From 838b033e0763f692ce1498fe45f735d8baf3bb95 Mon Sep 17 00:00:00 2001 From: hengsin Date: Thu, 30 Jan 2020 23:00:58 +0800 Subject: [PATCH] IDEMPIERE-4158 Move Swing Client out of core --- org.adempiere.report.jasper.swing/.classpath | 11 - org.adempiere.report.jasper.swing/.project | 39 - .../org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.jdt.core.prefs | 8 - .../.settings/org.eclipse.m2e.core.prefs | 4 - .../.settings/org.eclipse.pde.core.prefs | 4 - .../META-INF/MANIFEST.MF | 21 - .../OSGI-INF/jrviewerprovider.xml | 7 - .../build.properties | 6 - org.adempiere.report.jasper.swing/pom.xml | 12 - .../compiere/report/JasperReportViewer.java | 172 - .../report/JasperReportsClientActivator.java | 30 - .../src/org/compiere/report/JasperViewer.java | 144 - .../report/SwingJRViewerProvider.java | 17 - org.adempiere.ui.swing-feature/.project | 23 - .../org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.m2e.core.prefs | 4 - .../adempiere-client.bat | 20 - .../adempiere-client.sh | 20 - .../build.properties | 10 - org.adempiere.ui.swing-feature/feature.xml | 44 - org.adempiere.ui.swing-feature/pom.xml | 12 - .../swingclient.product | 47 - .../swingclient.product.launch | 421 --- org.adempiere.ui.swing.pluginlist/.classpath | 7 - org.adempiere.ui.swing.pluginlist/.project | 28 - .../.settings/org.eclipse.pde.core.prefs | 4 - .../META-INF/MANIFEST.MF | 13 - .../META-INF/PackOut.xml | 13 - .../build.properties | 5 - org.adempiere.ui.swing.pluginlist/plugin.xml | 11 - .../org/adempiere/plugin/list/Activator.java | 19 - .../org/adempiere/plugin/list/PluginList.java | 141 - org.adempiere.ui.swing/.classpath | 16 - org.adempiere.ui.swing/.project | 34 - .../org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.jdt.core.prefs | 102 - .../.settings/org.eclipse.m2e.core.prefs | 4 - org.adempiere.ui.swing/META-INF/MANIFEST.MF | 122 - .../OSGI-INF/defaultcreatefromfactory.xml | 7 - .../OSGI-INF/defaulteditorfactory.xml | 7 - .../OSGI-INF/defaultformfactory.xml | 7 - .../OSGI-INF/defaultinfofactory.xml | 7 - .../OSGI-INF/defaultpaymentformfactory.xml | 7 - .../OSGI-INF/defaultprintshippinglabel.xml | 7 - .../OSGI-INF/reportviewerprovider.xml | 7 - .../OSGI-INF/resourcefinder.xml | 7 - org.adempiere.ui.swing/RUN_build.bat | 19 - org.adempiere.ui.swing/RUN_build.sh | 18 - org.adempiere.ui.swing/Swingset.bat | 11 - org.adempiere.ui.swing/build.properties | 10 - org.adempiere.ui.swing/documentation.bat | 5 - org.adempiere.ui.swing/packages.txt | 11 - org.adempiere.ui.swing/plugin.xml | 26 - org.adempiere.ui.swing/pom.xml | 82 - .../schema/org.adempiere.apps.Form.exsd | 133 - .../compiere/tools/DocumentSearch.java | 62 - .../adempiere/apps/graph/FCHtmlEditorKit.java | 98 - .../src/org/adempiere/apps/graph/Graph.java | 313 -- .../org/adempiere/apps/graph/GraphUtil.java | 170 - .../adempiere/apps/graph/HtmlDashboard.java | 504 --- .../src/org/adempiere/apps/graph/PAPanel.java | 185 - .../apps/graph/PerformanceDetail.java | 83 - .../apps/graph/PerformanceIndicator.java | 363 -- .../src/org/adempiere/apps/graph/ViewPI.java | 148 - .../src/org/adempiere/client/Application.java | 23 - .../src/org/adempiere/client/Client.java | 52 - .../client/ClientCredentialDialog.java | 222 -- .../src/org/adempiere/client/InfoManager.java | 91 - .../pdf/viewer/22x22/document-print.png | Bin 972 -> 0 bytes .../pdf/viewer/22x22/document-save.png | Bin 1150 -> 0 bytes .../adempiere/pdf/viewer/22x22/go-first.png | Bin 1013 -> 0 bytes .../adempiere/pdf/viewer/22x22/go-last.png | Bin 1043 -> 0 bytes .../adempiere/pdf/viewer/22x22/go-next.png | Bin 688 -> 0 bytes .../pdf/viewer/22x22/go-previous.png | Bin 689 -> 0 bytes .../pdf/viewer/22x22/rotate-cclock.png | Bin 908 -> 0 bytes .../pdf/viewer/22x22/rotate-clock.png | Bin 901 -> 0 bytes .../org/adempiere/pdf/viewer/22x22/rotate.png | Bin 908 -> 0 bytes .../pdf/viewer/22x22/system-search.png | Bin 1267 -> 0 bytes .../adempiere/pdf/viewer/22x22/zoom-in.png | Bin 1142 -> 0 bytes .../adempiere/pdf/viewer/22x22/zoom-out.png | Bin 1137 -> 0 bytes .../pdf/viewer/48x48/document-print.png | Bin 2296 -> 0 bytes .../pdf/viewer/48x48/document-save.png | Bin 3339 -> 0 bytes .../adempiere/pdf/viewer/48x48/go-first.png | Bin 2164 -> 0 bytes .../adempiere/pdf/viewer/48x48/go-last.png | Bin 2161 -> 0 bytes .../adempiere/pdf/viewer/48x48/go-next.png | Bin 2028 -> 0 bytes .../pdf/viewer/48x48/go-previous.png | Bin 2021 -> 0 bytes .../pdf/viewer/48x48/system-search.png | Bin 3991 -> 0 bytes .../adempiere/pdf/viewer/PDFViewerBean.java | 614 ---- .../plaf/AdempiereButtonListener.java | 102 - .../adempiere/plaf/AdempiereComboBoxUI.java | 109 - .../adempiere/plaf/AdempiereComboPopup.java | 97 - .../org/adempiere/plaf/AdempiereLabelUI.java | 161 - .../adempiere/plaf/AdempiereLookAndFeel.java | 218 -- .../plaf/AdempiereLookAndFeelAddons.java | 24 - .../src/org/adempiere/plaf/AdempierePLAF.java | 736 ---- .../adempiere/plaf/AdempiereTabbedPaneUI.java | 3236 ----------------- .../adempiere/plaf/AdempiereTaskPaneUI.java | 109 - .../org/adempiere/plaf/AdempiereTheme.java | 425 --- .../adempiere/plaf/AdempiereThemeInnova.java | 111 - .../src/org/adempiere/plaf/PLAFEditor.java | 611 ---- .../org/adempiere/plaf/PLAFEditorPanel.java | 446 --- .../src/org/adempiere/plaf/icons/CL16.gif | Bin 929 -> 0 bytes .../src/org/adempiere/plaf/icons/CL32.gif | Bin 2213 -> 0 bytes .../src/org/adempiere/plaf/icons/Cancel24.gif | Bin 1268 -> 0 bytes .../src/org/adempiere/plaf/icons/Computer.gif | Bin 443 -> 0 bytes .../src/org/adempiere/plaf/icons/Error.gif | Bin 1564 -> 0 bytes .../src/org/adempiere/plaf/icons/File.gif | Bin 333 -> 0 bytes .../org/adempiere/plaf/icons/FloppyDrive.gif | Bin 561 -> 0 bytes .../org/adempiere/plaf/icons/HardDrive.gif | Bin 603 -> 0 bytes .../org/adempiere/plaf/icons/HomeFolder.gif | Bin 528 -> 0 bytes .../src/org/adempiere/plaf/icons/Inform.gif | Bin 1910 -> 0 bytes .../org/adempiere/plaf/icons/NewFolder.gif | Bin 635 -> 0 bytes .../src/org/adempiere/plaf/icons/Ok24.gif | Bin 936 -> 0 bytes .../src/org/adempiere/plaf/icons/Question.gif | Bin 1482 -> 0 bytes .../org/adempiere/plaf/icons/TreeClosed.gif | Bin 498 -> 0 bytes .../src/org/adempiere/plaf/icons/TreeLeaf.gif | Bin 433 -> 0 bytes .../src/org/adempiere/plaf/icons/TreeOpen.gif | Bin 523 -> 0 bytes .../src/org/adempiere/plaf/icons/UpFolder.gif | Bin 652 -> 0 bytes .../src/org/adempiere/plaf/icons/Warn.gif | Bin 1377 -> 0 bytes .../process/DefaultPrintShippingLabel.java | 164 - .../swing/factory/DefaultEditorFactory.java | 308 -- .../ui/swing/factory/DefaultFormFactory.java | 77 - .../ui/swing/factory/DefaultInfoFactory.java | 136 - .../ui/swing/factory/IEditorFactory.java | 36 - .../ui/swing/factory/IFormFactory.java | 30 - .../ui/swing/factory/IInfoFactory.java | 62 - .../src/org/compiere/AdempiereClient.java | 205 -- .../src/org/compiere/acct/AcctViewer.java | 819 ----- .../src/org/compiere/acct/AcctViewerData.java | 550 --- .../src/org/compiere/acct/package.html | 30 - .../src/org/compiere/apps/AArchive.java | 187 - .../src/org/compiere/apps/AChat.java | 169 - .../src/org/compiere/apps/ADialog.java | 485 --- .../src/org/compiere/apps/ADialogDialog.java | 359 -- .../src/org/compiere/apps/AEnv.java | 1091 ------ .../src/org/compiere/apps/AExport.java | 165 - .../compiere/apps/AFocusTraversalPolicy.java | 179 - .../src/org/compiere/apps/AGlassPane.java | 268 -- .../compiere/apps/AKeyboardFocusManager.java | 52 - .../src/org/compiere/apps/ALayout.java | 418 --- .../org/compiere/apps/ALayoutCollection.java | 135 - .../org/compiere/apps/ALayoutConstraint.java | 122 - .../src/org/compiere/apps/ALogin.java | 1235 ------- .../src/org/compiere/apps/ALoginTest.java | 441 --- .../src/org/compiere/apps/AMenu.java | 839 ----- .../src/org/compiere/apps/AMenuStartItem.java | 354 -- .../src/org/compiere/apps/APanel.java | 3191 ---------------- .../src/org/compiere/apps/ARequest.java | 271 -- .../src/org/compiere/apps/ATask.java | 132 - .../src/org/compiere/apps/AWindow.java | 215 -- .../org/compiere/apps/AWindowListener.java | 69 - .../src/org/compiere/apps/AZoomAcross.java | 137 - .../src/org/compiere/apps/AboutBox.java | 165 - .../src/org/compiere/apps/AppsAction.java | 316 -- .../src/org/compiere/apps/Attachment.java | 669 ---- .../org/compiere/apps/BeanShellEditor.java | 404 -- .../org/compiere/apps/ClientProcessCtrl.java | 96 - .../src/org/compiere/apps/ConfirmPanel.java | 741 ---- .../src/org/compiere/apps/EMailDialog.java | 474 --- .../org/compiere/apps/FieldRecordInfo.java | 362 -- .../src/org/compiere/apps/GroovyEditor.java | 295 -- .../src/org/compiere/apps/Help.java | 200 - .../src/org/compiere/apps/OnlineHelp.java | 358 -- .../src/org/compiere/apps/Preference.java | 701 ---- .../org/compiere/apps/PrintScreenPainter.java | 135 - .../src/org/compiere/apps/ProcessCtl.java | 339 -- .../src/org/compiere/apps/ProcessDialog.java | 688 ---- .../org/compiere/apps/ProcessModalDialog.java | 349 -- .../org/compiere/apps/ProcessParameter.java | 573 --- .../compiere/apps/ProcessParameterPanel.java | 723 ---- .../src/org/compiere/apps/RecordInfo.java | 406 --- .../src/org/compiere/apps/ScreenShot.java | 145 - .../src/org/compiere/apps/Script.html | 69 - .../src/org/compiere/apps/ScriptEditor.java | 71 - .../src/org/compiere/apps/StatusBar.java | 269 -- .../src/org/compiere/apps/SwingWorker.java | 221 -- .../src/org/compiere/apps/TabSwitcher.java | 125 - .../src/org/compiere/apps/Waiting.java | 215 -- .../src/org/compiere/apps/WindowManager.java | 182 - .../src/org/compiere/apps/WindowMenu.java | 424 --- .../org/compiere/apps/form/ArchiveViewer.java | 456 --- .../src/org/compiere/apps/form/FormFrame.java | 500 --- .../src/org/compiere/apps/form/FormPanel.java | 40 - .../org/compiere/apps/form/VAllocation.java | 499 --- .../compiere/apps/form/VAttributeGrid.java | 550 --- .../src/org/compiere/apps/form/VBOMDrop.java | 738 ---- .../src/org/compiere/apps/form/VCharge.java | 245 -- .../compiere/apps/form/VCreateFromForm.java | 237 -- .../compiere/apps/form/VFactReconcile.java | 481 --- .../org/compiere/apps/form/VFileImport.java | 473 --- .../src/org/compiere/apps/form/VGenPanel.java | 411 --- .../src/org/compiere/apps/form/VInOutGen.java | 239 -- .../org/compiere/apps/form/VInvoiceGen.java | 221 -- .../src/org/compiere/apps/form/VMatch.java | 506 --- .../src/org/compiere/apps/form/VMerge.java | 245 -- .../src/org/compiere/apps/form/VPayPrint.java | 567 --- .../org/compiere/apps/form/VPaySelect.java | 473 --- .../compiere/apps/form/VResetPassword.java | 344 -- .../org/compiere/apps/form/VSQLProcess.java | 255 -- .../src/org/compiere/apps/form/VSetup.java | 508 --- .../apps/form/VStatementCreateFromBatch.java | 324 -- .../src/org/compiere/apps/form/VTreeBOM.java | 726 ---- .../compiere/apps/form/VTreeMaintenance.java | 332 -- .../org/compiere/apps/form/VTrxMaterial.java | 290 -- .../src/org/compiere/apps/form/package.html | 30 - .../src/org/compiere/apps/package.html | 30 - .../src/org/compiere/apps/search/Find.java | 1750 --------- .../compiere/apps/search/FindCellEditor.java | 166 - .../compiere/apps/search/FindValueEditor.java | 174 - .../apps/search/FindValueRenderer.java | 247 -- .../src/org/compiere/apps/search/Info.java | 1292 ------- .../org/compiere/apps/search/InfoAsset.java | 332 -- .../compiere/apps/search/InfoAssignment.java | 330 -- .../compiere/apps/search/InfoBPartner.java | 506 --- .../compiere/apps/search/InfoCashLine.java | 398 -- .../org/compiere/apps/search/InfoFactory.java | 22 - .../org/compiere/apps/search/InfoGeneral.java | 477 --- .../org/compiere/apps/search/InfoInOut.java | 348 -- .../org/compiere/apps/search/InfoInvoice.java | 452 --- .../org/compiere/apps/search/InfoOrder.java | 394 -- .../compiere/apps/search/InfoPAttribute.java | 597 --- .../org/compiere/apps/search/InfoPayment.java | 385 -- .../org/compiere/apps/search/InfoProduct.java | 1412 ------- .../compiere/apps/search/InfoSchedule.java | 451 --- .../org/compiere/apps/search/Info_Column.java | 97 - .../compiere/apps/search/InvoiceHistory.java | 710 ---- .../apps/search/PAttributeInstance.java | 401 -- .../org/compiere/apps/search/VSchedule.java | 180 - .../compiere/apps/search/VSchedulePanel.java | 426 --- .../apps/search/VScheduleTimePanel.java | 310 -- .../src/org/compiere/apps/search/package.html | 30 - .../src/org/compiere/apps/wf/NodeMenu.java | 113 - .../org/compiere/apps/wf/SceneMainMenu.java | 44 - .../src/org/compiere/apps/wf/WFActivity.java | 804 ---- .../org/compiere/apps/wf/WFContentPanel.java | 221 -- .../compiere/apps/wf/WFNodeMoveStrategy.java | 15 - .../src/org/compiere/apps/wf/WFPanel.java | 577 --- .../src/org/compiere/apps/wf/WFPopupItem.java | 86 - .../src/org/compiere/apps/wf/package.html | 30 - .../org/compiere/db/CConnectionDialog.java | 429 --- .../org/compiere/db/CConnectionEditor.java | 298 -- .../org/compiere/dbPort/ConvertDialog.java | 360 -- .../src/org/compiere/grid/APanelTab.java | 53 - .../grid/DefaultCreateFromFactory.java | 51 - .../grid/DefaultPaymentFormFactory.java | 44 - .../src/org/compiere/grid/GridController.java | 1506 -------- .../org/compiere/grid/GridSynchronizer.java | 80 - .../org/compiere/grid/RecordAccessDialog.java | 351 -- .../grid/VCreateFromDepositBatchUI.java | 337 -- .../org/compiere/grid/VCreateFromDialog.java | 227 -- .../org/compiere/grid/VCreateFromFactory.java | 35 - .../compiere/grid/VCreateFromInvoiceUI.java | 396 -- .../grid/VCreateFromPackageShipmentUI.java | 111 - .../org/compiere/grid/VCreateFromRMAUI.java | 202 - .../compiere/grid/VCreateFromShipmentUI.java | 555 --- .../compiere/grid/VCreateFromStatementUI.java | 335 -- .../org/compiere/grid/VOnlyCurrentDays.java | 170 - .../src/org/compiere/grid/VPanel.java | 770 ---- .../org/compiere/grid/VPaymentFormCash.java | 250 -- .../org/compiere/grid/VPaymentFormCheck.java | 294 -- .../compiere/grid/VPaymentFormCreditCard.java | 304 -- .../org/compiere/grid/VPaymentFormDialog.java | 115 - .../org/compiere/grid/VPaymentFormDirect.java | 159 - .../grid/VPaymentFormDirectDebit.java | 30 - .../grid/VPaymentFormDirectDeposit.java | 29 - .../compiere/grid/VPaymentFormFactory.java | 39 - .../compiere/grid/VPaymentFormMixedPOS.java | 61 - .../compiere/grid/VPaymentFormOnCredit.java | 100 - .../src/org/compiere/grid/VSortTab.java | 921 ----- .../src/org/compiere/grid/VTabbedPane.java | 367 -- .../src/org/compiere/grid/VTable.java | 210 -- .../org/compiere/grid/VTableExcelAdapter.java | 213 -- .../src/org/compiere/grid/XLookup.java | 173 - .../ed/ADempiereAutoCompleteDecorator.java | 222 -- .../org/compiere/grid/ed/AutoCompleter.java | 288 -- .../org/compiere/grid/ed/AutoCompletion.java | 284 -- .../src/org/compiere/grid/ed/Calculator.java | 689 ---- .../src/org/compiere/grid/ed/Calendar.java | 906 ----- .../compiere/grid/ed/CityAutoCompleter.java | 243 -- .../grid/ed/ComboSelectionManager.java | 63 - .../src/org/compiere/grid/ed/Editor.java | 342 -- .../src/org/compiere/grid/ed/HTMLEditor.java | 531 --- .../src/org/compiere/grid/ed/MDocDate.java | 304 -- .../src/org/compiere/grid/ed/MDocNumber.java | 322 -- .../src/org/compiere/grid/ed/MDocString.java | 401 -- .../src/org/compiere/grid/ed/MDocTime.java | 163 - .../src/org/compiere/grid/ed/VAccount.java | 507 --- .../org/compiere/grid/ed/VAccountDialog.java | 1145 ------ .../src/org/compiere/grid/ed/VAssignment.java | 462 --- .../compiere/grid/ed/VAssignmentDialog.java | 387 -- .../src/org/compiere/grid/ed/VBPartner.java | 486 --- .../src/org/compiere/grid/ed/VBinary.java | 287 -- .../src/org/compiere/grid/ed/VButton.java | 403 -- .../src/org/compiere/grid/ed/VCellEditor.java | 266 -- .../org/compiere/grid/ed/VCellRenderer.java | 293 -- .../src/org/compiere/grid/ed/VChart.java | 192 - .../src/org/compiere/grid/ed/VCheckBox.java | 275 -- .../src/org/compiere/grid/ed/VColor.java | 371 -- .../src/org/compiere/grid/ed/VComboBox.java | 176 - .../src/org/compiere/grid/ed/VDate.java | 648 ---- .../src/org/compiere/grid/ed/VDocAction.java | 440 --- .../src/org/compiere/grid/ed/VEditor.java | 113 - .../org/compiere/grid/ed/VEditorFactory.java | 103 - .../src/org/compiere/grid/ed/VFile.java | 459 --- .../org/compiere/grid/ed/VHeaderRenderer.java | 130 - .../src/org/compiere/grid/ed/VImage.java | 269 -- .../org/compiere/grid/ed/VImageDialog.java | 255 -- .../src/org/compiere/grid/ed/VLine.java | 143 - .../src/org/compiere/grid/ed/VLocation.java | 433 --- .../org/compiere/grid/ed/VLocationDialog.java | 1010 ----- .../src/org/compiere/grid/ed/VLocator.java | 644 ---- .../org/compiere/grid/ed/VLocatorDialog.java | 508 --- .../src/org/compiere/grid/ed/VLookup.java | 1761 --------- .../org/compiere/grid/ed/VManagedEditor.java | 37 - .../src/org/compiere/grid/ed/VMemo.java | 336 -- .../src/org/compiere/grid/ed/VNumber.java | 857 ----- .../src/org/compiere/grid/ed/VOvrCaret.java | 111 - .../src/org/compiere/grid/ed/VPAttribute.java | 524 --- .../compiere/grid/ed/VPAttributeDialog.java | 842 ----- .../src/org/compiere/grid/ed/VPassword.java | 229 -- .../org/compiere/grid/ed/VPaymentEditor.java | 580 --- .../src/org/compiere/grid/ed/VPostIt.java | 325 -- .../org/compiere/grid/ed/VRowIDEditor.java | 124 - .../org/compiere/grid/ed/VRowIDRenderer.java | 78 - .../src/org/compiere/grid/ed/VString.java | 440 --- .../org/compiere/grid/ed/VStringBeanInfo.java | 96 - .../src/org/compiere/grid/ed/VText.java | 281 -- .../org/compiere/grid/ed/VTextBeanInfo.java | 108 - .../src/org/compiere/grid/ed/VTextLong.java | 287 -- .../src/org/compiere/grid/ed/VURL.java | 537 --- .../org/compiere/grid/ed/ValuePreference.java | 525 --- .../src/org/compiere/grid/ed/package.html | 34 - .../src/org/compiere/grid/package.html | 30 - .../grid/tree/AdempiereTreeModel.java | 108 - .../grid/tree/TransferableTreeNode.java | 65 - .../compiere/grid/tree/VTreeCellRenderer.java | 81 - .../org/compiere/grid/tree/VTreePanel.java | 1072 ------ .../grid/tree/VTreeTransferHandler.java | 124 - .../src/org/compiere/images/About16.gif | Bin 756 -> 0 bytes .../src/org/compiere/images/About24.gif | Bin 1087 -> 0 bytes .../src/org/compiere/images/Account10.gif | Bin 470 -> 0 bytes .../src/org/compiere/images/Account16.gif | Bin 815 -> 0 bytes .../src/org/compiere/images/Account24.gif | Bin 1276 -> 0 bytes .../src/org/compiere/images/Archive16.gif | Bin 378 -> 0 bytes .../src/org/compiere/images/Archive24.gif | Bin 507 -> 0 bytes .../src/org/compiere/images/Assignment10.gif | Bin 298 -> 0 bytes .../src/org/compiere/images/Assignment16.gif | Bin 471 -> 0 bytes .../src/org/compiere/images/Assignment24.gif | Bin 501 -> 0 bytes .../src/org/compiere/images/Attachment16.gif | Bin 519 -> 0 bytes .../src/org/compiere/images/Attachment24.gif | Bin 684 -> 0 bytes .../src/org/compiere/images/Attachment24D.gif | Bin 684 -> 0 bytes .../src/org/compiere/images/AttachmentX16.gif | Bin 624 -> 0 bytes .../compiere/images/AttachmentX16_grey.gif | Bin 777 -> 0 bytes .../src/org/compiere/images/AttachmentX24.gif | Bin 934 -> 0 bytes .../src/org/compiere/images/BPartner10.gif | Bin 474 -> 0 bytes .../src/org/compiere/images/BPartner16.gif | Bin 801 -> 0 bytes .../src/org/compiere/images/BPartner24.gif | Bin 1040 -> 0 bytes .../src/org/compiere/images/Bold16.gif | Bin 705 -> 0 bytes .../src/org/compiere/images/C10030HR.png | Bin 2878 -> 0 bytes .../src/org/compiere/images/Calculator10.gif | Bin 447 -> 0 bytes .../src/org/compiere/images/Calculator16.gif | Bin 686 -> 0 bytes .../src/org/compiere/images/Calculator24.gif | Bin 843 -> 0 bytes .../src/org/compiere/images/Calendar10.gif | Bin 382 -> 0 bytes .../src/org/compiere/images/Calendar16.gif | Bin 604 -> 0 bytes .../src/org/compiere/images/Calendar24.gif | Bin 1054 -> 0 bytes .../src/org/compiere/images/Cancel10.gif | Bin 471 -> 0 bytes .../src/org/compiere/images/Cancel16.gif | Bin 878 -> 0 bytes .../src/org/compiere/images/Cancel24.gif | Bin 1268 -> 0 bytes .../src/org/compiere/images/ChangeLog16.png | Bin 559 -> 0 bytes .../src/org/compiere/images/Chat16.gif | Bin 422 -> 0 bytes .../src/org/compiere/images/Chat24.gif | Bin 535 -> 0 bytes .../src/org/compiere/images/ChatX16.gif | Bin 422 -> 0 bytes .../src/org/compiere/images/ChatX24.gif | Bin 535 -> 0 bytes .../src/org/compiere/images/Copy16.gif | Bin 498 -> 0 bytes .../src/org/compiere/images/Copy24.gif | Bin 725 -> 0 bytes .../src/org/compiere/images/Customize16.gif | Bin 440 -> 0 bytes .../src/org/compiere/images/Customize24.gif | Bin 512 -> 0 bytes .../src/org/compiere/images/Delete16.gif | Bin 655 -> 0 bytes .../src/org/compiere/images/Delete24.gif | Bin 1155 -> 0 bytes .../org/compiere/images/DeleteSelection16.gif | Bin 352 -> 0 bytes .../org/compiere/images/DeleteSelection24.gif | Bin 1016 -> 0 bytes .../src/org/compiere/images/Detail16.gif | Bin 676 -> 0 bytes .../src/org/compiere/images/Detail24.gif | Bin 930 -> 0 bytes .../src/org/compiere/images/DragCursor32.gif | Bin 261 -> 0 bytes .../org/compiere/images/EMailSupport16.gif | Bin 619 -> 0 bytes .../org/compiere/images/EMailSupport24.gif | Bin 946 -> 0 bytes .../src/org/compiere/images/Edit16.gif | Bin 574 -> 0 bytes .../src/org/compiere/images/Edit24.gif | Bin 995 -> 0 bytes .../src/org/compiere/images/Editor16.gif | Bin 574 -> 0 bytes .../src/org/compiere/images/Editor24.gif | Bin 995 -> 0 bytes .../src/org/compiere/images/End16.gif | Bin 829 -> 0 bytes .../src/org/compiere/images/End24.gif | Bin 1320 -> 0 bytes .../src/org/compiere/images/Error32.gif | Bin 1645 -> 0 bytes .../src/org/compiere/images/Exit16.gif | Bin 594 -> 0 bytes .../src/org/compiere/images/Exit24.gif | Bin 907 -> 0 bytes .../src/org/compiere/images/Export16.gif | Bin 866 -> 0 bytes .../src/org/compiere/images/Export16X.gif | Bin 866 -> 0 bytes .../src/org/compiere/images/Export24.gif | Bin 1097 -> 0 bytes .../src/org/compiere/images/Export24X.gif | Bin 1097 -> 0 bytes .../src/org/compiere/images/ExportX16.gif | Bin 866 -> 0 bytes .../src/org/compiere/images/ExportX24.gif | Bin 1097 -> 0 bytes .../src/org/compiere/images/FastBack24.gif | Bin 1003 -> 0 bytes .../src/org/compiere/images/FastForward24.gif | Bin 1025 -> 0 bytes .../src/org/compiere/images/Find16.gif | Bin 935 -> 0 bytes .../src/org/compiere/images/Find24.gif | Bin 1267 -> 0 bytes .../src/org/compiere/images/FindX16.gif | Bin 903 -> 0 bytes .../src/org/compiere/images/FindX24.gif | Bin 1459 -> 0 bytes .../src/org/compiere/images/First16.gif | Bin 636 -> 0 bytes .../src/org/compiere/images/First24.gif | Bin 917 -> 0 bytes .../src/org/compiere/images/First24D.gif | Bin 917 -> 0 bytes .../src/org/compiere/images/Folder16.gif | Bin 498 -> 0 bytes .../src/org/compiere/images/Folder24.gif | Bin 800 -> 0 bytes .../src/org/compiere/images/GetMail16.gif | Bin 644 -> 0 bytes .../src/org/compiere/images/GetMail24.gif | Bin 765 -> 0 bytes .../src/org/compiere/images/Help16.gif | Bin 932 -> 0 bytes .../src/org/compiere/images/Help24.gif | Bin 1359 -> 0 bytes .../src/org/compiere/images/History16.gif | Bin 970 -> 0 bytes .../src/org/compiere/images/History24.gif | Bin 1484 -> 0 bytes .../src/org/compiere/images/History24D.gif | Bin 1484 -> 0 bytes .../src/org/compiere/images/HistoryX16.gif | Bin 970 -> 0 bytes .../src/org/compiere/images/HistoryX24.gif | Bin 1484 -> 0 bytes .../src/org/compiere/images/Home16.gif | Bin 606 -> 0 bytes .../src/org/compiere/images/Home24.gif | Bin 920 -> 0 bytes .../src/org/compiere/images/Ignore16.gif | Bin 650 -> 0 bytes .../src/org/compiere/images/Ignore24.gif | Bin 1011 -> 0 bytes .../src/org/compiere/images/Import16.gif | Bin 701 -> 0 bytes .../src/org/compiere/images/Import24.gif | Bin 1098 -> 0 bytes .../src/org/compiere/images/Info16.gif | Bin 863 -> 0 bytes .../src/org/compiere/images/Info24.gif | Bin 1204 -> 0 bytes .../src/org/compiere/images/InfoAccount16.gif | Bin 572 -> 0 bytes .../src/org/compiere/images/InfoAccount24.gif | Bin 960 -> 0 bytes .../org/compiere/images/InfoBPartner16.gif | Bin 628 -> 0 bytes .../org/compiere/images/InfoBPartner24.gif | Bin 866 -> 0 bytes .../src/org/compiere/images/InfoProduct16.gif | Bin 439 -> 0 bytes .../src/org/compiere/images/InfoProduct24.gif | Bin 693 -> 0 bytes .../org/compiere/images/InfoSchedule16.gif | Bin 897 -> 0 bytes .../org/compiere/images/InfoSchedule24.gif | Bin 1411 -> 0 bytes .../src/org/compiere/images/Inform32.gif | Bin 1910 -> 0 bytes .../src/org/compiere/images/Italic16.gif | Bin 619 -> 0 bytes .../src/org/compiere/images/Java_anim.gif | Bin 9817 -> 0 bytes .../src/org/compiere/images/Java_logo.gif | Bin 5076 -> 0 bytes .../src/org/compiere/images/Last16.gif | Bin 663 -> 0 bytes .../src/org/compiere/images/Last24.gif | Bin 907 -> 0 bytes .../src/org/compiere/images/Last24D.gif | Bin 907 -> 0 bytes .../src/org/compiere/images/Location10.gif | Bin 162 -> 0 bytes .../src/org/compiere/images/Locator10.gif | Bin 174 -> 0 bytes .../src/org/compiere/images/Lock16.gif | Bin 731 -> 0 bytes .../src/org/compiere/images/Lock24.gif | Bin 1041 -> 0 bytes .../src/org/compiere/images/LockX16.gif | Bin 798 -> 0 bytes .../src/org/compiere/images/LockX24.gif | Bin 1232 -> 0 bytes .../src/org/compiere/images/Logo.gif | Bin 10127 -> 0 bytes .../src/org/compiere/images/Logout16.png | Bin 507 -> 0 bytes .../src/org/compiere/images/Logout24.png | Bin 829 -> 0 bytes .../src/org/compiere/images/Minus16.gif | Bin 247 -> 0 bytes .../src/org/compiere/images/Minus24.gif | Bin 252 -> 0 bytes .../src/org/compiere/images/Multi16.gif | Bin 482 -> 0 bytes .../src/org/compiere/images/Multi24.gif | Bin 892 -> 0 bytes .../src/org/compiere/images/MultiX16.gif | Bin 650 -> 0 bytes .../src/org/compiere/images/MultiX24.gif | Bin 834 -> 0 bytes .../src/org/compiere/images/New16.gif | Bin 477 -> 0 bytes .../src/org/compiere/images/New24.gif | Bin 692 -> 0 bytes .../src/org/compiere/images/Next16.gif | Bin 683 -> 0 bytes .../src/org/compiere/images/Next24.gif | Bin 874 -> 0 bytes .../src/org/compiere/images/Next24D.gif | Bin 874 -> 0 bytes .../src/org/compiere/images/Normal16.gif | Bin 541 -> 0 bytes .../src/org/compiere/images/Ok16.gif | Bin 626 -> 0 bytes .../src/org/compiere/images/Ok24.gif | Bin 936 -> 0 bytes .../src/org/compiere/images/Online10.gif | Bin 496 -> 0 bytes .../src/org/compiere/images/Online16.gif | Bin 864 -> 0 bytes .../src/org/compiere/images/Online24.gif | Bin 1397 -> 0 bytes .../src/org/compiere/images/Open16.gif | Bin 523 -> 0 bytes .../src/org/compiere/images/Open24.gif | Bin 803 -> 0 bytes .../src/org/compiere/images/PAttribute10.gif | Bin 373 -> 0 bytes .../src/org/compiere/images/PAttribute16.gif | Bin 453 -> 0 bytes .../src/org/compiere/images/PAttribute24.gif | Bin 737 -> 0 bytes .../src/org/compiere/images/PageSetup16.gif | Bin 775 -> 0 bytes .../src/org/compiere/images/PageSetup24.gif | Bin 1241 -> 0 bytes .../src/org/compiere/images/Parent16.gif | Bin 655 -> 0 bytes .../src/org/compiere/images/Parent24.gif | Bin 955 -> 0 bytes .../src/org/compiere/images/Payment10.gif | Bin 311 -> 0 bytes .../src/org/compiere/images/Payment16.gif | Bin 804 -> 0 bytes .../src/org/compiere/images/Payment24.gif | Bin 1347 -> 0 bytes .../src/org/compiere/images/PickOpen10.gif | Bin 460 -> 0 bytes .../src/org/compiere/images/Plus16.gif | Bin 323 -> 0 bytes .../src/org/compiere/images/Plus24.gif | Bin 386 -> 0 bytes .../src/org/compiere/images/PostIt16.png | Bin 613 -> 0 bytes .../src/org/compiere/images/PostIt24.png | Bin 1426 -> 0 bytes .../src/org/compiere/images/PostItX16.png | Bin 853 -> 0 bytes .../src/org/compiere/images/PostItX24.png | Bin 2557 -> 0 bytes .../src/org/compiere/images/Preference16.gif | Bin 611 -> 0 bytes .../src/org/compiere/images/Preference24.gif | Bin 1151 -> 0 bytes .../src/org/compiere/images/Previous16.gif | Bin 652 -> 0 bytes .../src/org/compiere/images/Previous24.gif | Bin 877 -> 0 bytes .../src/org/compiere/images/Previous24D.gif | Bin 877 -> 0 bytes .../src/org/compiere/images/Print16.gif | Bin 544 -> 0 bytes .../src/org/compiere/images/Print24.gif | Bin 869 -> 0 bytes .../org/compiere/images/PrintPreview16.gif | Bin 779 -> 0 bytes .../org/compiere/images/PrintPreview24.gif | Bin 1131 -> 0 bytes .../src/org/compiere/images/PrintScreen16.gif | Bin 707 -> 0 bytes .../src/org/compiere/images/PrintScreen24.gif | Bin 968 -> 0 bytes .../src/org/compiere/images/Process16.gif | Bin 588 -> 0 bytes .../src/org/compiere/images/Process24.gif | Bin 1488 -> 0 bytes .../src/org/compiere/images/Product10.gif | Bin 347 -> 0 bytes .../src/org/compiere/images/Product16.gif | Bin 439 -> 0 bytes .../src/org/compiere/images/Product24.gif | Bin 592 -> 0 bytes .../src/org/compiere/images/Question32.gif | Bin 1482 -> 0 bytes .../src/org/compiere/images/Redo16.gif | Bin 591 -> 0 bytes .../src/org/compiere/images/Redo24.gif | Bin 810 -> 0 bytes .../src/org/compiere/images/Refresh16.gif | Bin 912 -> 0 bytes .../src/org/compiere/images/Refresh24.gif | Bin 1364 -> 0 bytes .../src/org/compiere/images/Register16.gif | Bin 506 -> 0 bytes .../src/org/compiere/images/Register24.gif | Bin 853 -> 0 bytes .../src/org/compiere/images/Report16.png | Bin 392 -> 0 bytes .../src/org/compiere/images/Report24.png | Bin 654 -> 0 bytes .../src/org/compiere/images/Request16.gif | Bin 868 -> 0 bytes .../src/org/compiere/images/Request24.gif | Bin 1320 -> 0 bytes .../src/org/compiere/images/Reset16.gif | Bin 723 -> 0 bytes .../src/org/compiere/images/Reset24.gif | Bin 1054 -> 0 bytes .../src/org/compiere/images/Save16.gif | Bin 561 -> 0 bytes .../src/org/compiere/images/Save24.gif | Bin 787 -> 0 bytes .../src/org/compiere/images/SaveCreate16.gif | Bin 612 -> 0 bytes .../src/org/compiere/images/SaveCreate24.gif | Bin 1120 -> 0 bytes .../src/org/compiere/images/ScreenShot16.gif | Bin 772 -> 0 bytes .../src/org/compiere/images/ScreenShot24.gif | Bin 1261 -> 0 bytes .../src/org/compiere/images/Script16.gif | Bin 516 -> 0 bytes .../src/org/compiere/images/Script24.gif | Bin 885 -> 0 bytes .../src/org/compiere/images/SelectAll16.png | Bin 441 -> 0 bytes .../src/org/compiere/images/SelectAll24.png | Bin 645 -> 0 bytes .../src/org/compiere/images/SendMail16.gif | Bin 626 -> 0 bytes .../src/org/compiere/images/SendMail24.gif | Bin 942 -> 0 bytes .../src/org/compiere/images/Server16.gif | Bin 642 -> 0 bytes .../src/org/compiere/images/Server24.gif | Bin 878 -> 0 bytes .../src/org/compiere/images/Setup16.gif | Bin 964 -> 0 bytes .../src/org/compiere/images/Setup24.gif | Bin 1464 -> 0 bytes .../src/org/compiere/images/StepBack24.gif | Bin 1048 -> 0 bytes .../src/org/compiere/images/StepForward24.gif | Bin 1124 -> 0 bytes .../src/org/compiere/images/Summary16.gif | Bin 561 -> 0 bytes .../src/org/compiere/images/Summary24.gif | Bin 773 -> 0 bytes .../src/org/compiere/images/Translate16.gif | Bin 567 -> 0 bytes .../src/org/compiere/images/Translate24.gif | Bin 1210 -> 0 bytes .../src/org/compiere/images/Underline16.gif | Bin 673 -> 0 bytes .../src/org/compiere/images/Undo16.gif | Bin 649 -> 0 bytes .../src/org/compiere/images/Undo24.gif | Bin 999 -> 0 bytes .../src/org/compiere/images/VPreference16.gif | Bin 757 -> 0 bytes .../src/org/compiere/images/VPreference24.gif | Bin 953 -> 0 bytes .../src/org/compiere/images/Warn32.gif | Bin 1377 -> 0 bytes .../src/org/compiere/images/WinSize16.gif | Bin 772 -> 0 bytes .../src/org/compiere/images/WinSize24.gif | Bin 902 -> 0 bytes .../src/org/compiere/images/WorkFlow16.gif | Bin 363 -> 0 bytes .../src/org/compiere/images/WorkFlow24.gif | Bin 714 -> 0 bytes .../src/org/compiere/images/WorkFlow_16.gif | Bin 363 -> 0 bytes .../src/org/compiere/images/WorkFlow_24.gif | Bin 714 -> 0 bytes .../src/org/compiere/images/Zoom16.gif | Bin 617 -> 0 bytes .../src/org/compiere/images/Zoom24.gif | Bin 1090 -> 0 bytes .../src/org/compiere/images/ZoomAcross16.gif | Bin 900 -> 0 bytes .../src/org/compiere/images/ZoomAcross24.gif | Bin 1420 -> 0 bytes .../src/org/compiere/images/downarrow.gif | Bin 51 -> 0 bytes .../src/org/compiere/images/iD10030.png | Bin 2878 -> 0 bytes .../src/org/compiere/images/iD16.gif | Bin 800 -> 0 bytes .../src/org/compiere/images/iD32.gif | Bin 1578 -> 0 bytes .../src/org/compiere/images/iDempiere.png | Bin 1144 -> 0 bytes .../src/org/compiere/images/iDempiereHR.png | Bin 8345 -> 0 bytes .../src/org/compiere/images/logo_ad.png | Bin 9287 -> 0 bytes .../src/org/compiere/images/mClosed.gif | Bin 498 -> 0 bytes .../src/org/compiere/images/mDocAction.png | Bin 606 -> 0 bytes .../src/org/compiere/images/mOpen.gif | Bin 523 -> 0 bytes .../src/org/compiere/images/mProcess.png | Bin 588 -> 0 bytes .../src/org/compiere/images/mReport.png | Bin 333 -> 0 bytes .../src/org/compiere/images/mSetVariable.png | Bin 625 -> 0 bytes .../src/org/compiere/images/mUserChoice.png | Bin 648 -> 0 bytes .../src/org/compiere/images/mWindow.png | Bin 462 -> 0 bytes .../src/org/compiere/images/mWorkFlow.png | Bin 363 -> 0 bytes .../src/org/compiere/images/mWorkbench.png | Bin 765 -> 0 bytes .../src/org/compiere/images/standard.css | 165 - .../src/org/compiere/images/uparrow.gif | Bin 52 -> 0 bytes .../src/org/compiere/images/wfBack24.gif | Bin 955 -> 0 bytes .../src/org/compiere/images/wfEnd24.gif | Bin 940 -> 0 bytes .../src/org/compiere/images/wfNext24.gif | Bin 930 -> 0 bytes .../src/org/compiere/images/wfStart24.gif | Bin 962 -> 0 bytes .../src/org/compiere/images/zip.gif | Bin 695 -> 0 bytes .../compiere/install/VTranslationDialog.java | 256 -- .../src/org/compiere/install/package.html | 30 - .../src/org/compiere/license.html | 81 - .../org/compiere/minigrid/CheckRenderer.java | 101 - .../org/compiere/minigrid/IDColumnEditor.java | 137 - .../compiere/minigrid/IDColumnRenderer.java | 113 - .../org/compiere/minigrid/MiniCellEditor.java | 110 - .../src/org/compiere/minigrid/MiniTable.java | 910 ----- .../org/compiere/minigrid/ROCellEditor.java | 54 - .../src/org/compiere/minigrid/package.html | 30 - .../org/compiere/plaf/Adempiere200x100.gif | Bin 3372 -> 0 bytes .../src/org/compiere/plaf/AquaTheme.java | 44 - .../src/org/compiere/plaf/CharcoalTheme.java | 59 - .../compiere/plaf/CompiereButtonListener.java | 105 - .../org/compiere/plaf/CompiereButtonUI.java | 137 - .../plaf/CompiereCheckBoxMenuItemUI.java | 51 - .../org/compiere/plaf/CompiereCheckBoxUI.java | 67 - .../src/org/compiere/plaf/CompiereColor.java | 1308 ------- .../org/compiere/plaf/CompiereComboBoxUI.java | 114 - .../org/compiere/plaf/CompiereComboPopup.java | 81 - .../org/compiere/plaf/CompiereLabelUI.java | 164 - .../compiere/plaf/CompiereLookAndFeel.java | 252 -- .../org/compiere/plaf/CompiereMenuBarUI.java | 75 - .../org/compiere/plaf/CompiereMenuItemUI.java | 92 - .../src/org/compiere/plaf/CompiereMenuUI.java | 52 - .../org/compiere/plaf/CompierePanelUI.java | 136 - .../compiere/plaf/CompiereRadioButtonUI.java | 56 - .../org/compiere/plaf/CompiereRootPaneUI.java | 33 - .../compiere/plaf/CompiereScrollPaneUI.java | 54 - .../plaf/CompiereSplitPaneDivider.java | 61 - .../compiere/plaf/CompiereSplitPaneUI.java | 69 - .../compiere/plaf/CompiereTabbedPaneUI.java | 1068 ------ .../compiere/plaf/CompiereTableHeaderUI.java | 95 - .../org/compiere/plaf/CompiereTextAreaUI.java | 119 - .../src/org/compiere/plaf/CompiereTheme.java | 343 -- .../compiere/plaf/CompiereThemeBlueMetal.java | 101 - .../compiere/plaf/CompiereThemeEditor.java | 431 --- .../org/compiere/plaf/CompiereThemeIce.java | 101 - .../compiere/plaf/CompiereToggleButtonUI.java | 113 - .../org/compiere/plaf/CompiereToolBarUI.java | 60 - .../org/compiere/plaf/CompiereToolTipUI.java | 96 - .../src/org/compiere/plaf/CompiereUtils.java | 482 --- .../org/compiere/plaf/CompiereViewportUI.java | 58 - .../src/org/compiere/plaf/ContrastTheme.java | 180 - .../src/org/compiere/plaf/EmeraldTheme.java | 58 - .../src/org/compiere/plaf/PlafRes.java | 133 - .../src/org/compiere/plaf/PlafRes_ar.java | 132 - .../src/org/compiere/plaf/PlafRes_bg.java | 131 - .../src/org/compiere/plaf/PlafRes_ca.java | 134 - .../src/org/compiere/plaf/PlafRes_da.java | 131 - .../src/org/compiere/plaf/PlafRes_de.java | 130 - .../src/org/compiere/plaf/PlafRes_el.java | 133 - .../src/org/compiere/plaf/PlafRes_es.java | 133 - .../src/org/compiere/plaf/PlafRes_fa.java | 131 - .../src/org/compiere/plaf/PlafRes_fr.java | 124 - .../src/org/compiere/plaf/PlafRes_hr.java | 132 - .../src/org/compiere/plaf/PlafRes_hu.java | 133 - .../src/org/compiere/plaf/PlafRes_in.java | 131 - .../src/org/compiere/plaf/PlafRes_it.java | 213 -- .../src/org/compiere/plaf/PlafRes_ja.java | 131 - .../src/org/compiere/plaf/PlafRes_ms.java | 131 - .../src/org/compiere/plaf/PlafRes_nl.java | 132 - .../src/org/compiere/plaf/PlafRes_no.java | 131 - .../src/org/compiere/plaf/PlafRes_pl.java | 130 - .../src/org/compiere/plaf/PlafRes_pt.java | 133 - .../src/org/compiere/plaf/PlafRes_ro.java | 131 - .../src/org/compiere/plaf/PlafRes_ru.java | 131 - .../src/org/compiere/plaf/PlafRes_sl.java | 132 - .../src/org/compiere/plaf/PlafRes_sr.java | 132 - .../src/org/compiere/plaf/PlafRes_sv.java | 131 - .../src/org/compiere/plaf/PlafRes_th.java | 131 - .../src/org/compiere/plaf/PlafRes_vi.java | 131 - .../src/org/compiere/plaf/PlafRes_zh.java | 131 - .../src/org/compiere/plaf/PlafRes_zh_CN.java | 131 - .../src/org/compiere/plaf/RubyTheme.java | 44 - .../src/org/compiere/plaf/icons/CL16.gif | Bin 929 -> 0 bytes .../src/org/compiere/plaf/icons/CL32.gif | Bin 2213 -> 0 bytes .../src/org/compiere/plaf/icons/Cancel24.gif | Bin 1268 -> 0 bytes .../src/org/compiere/plaf/icons/Error.gif | Bin 1564 -> 0 bytes .../src/org/compiere/plaf/icons/Inform.gif | Bin 1910 -> 0 bytes .../src/org/compiere/plaf/icons/Ok24.gif | Bin 936 -> 0 bytes .../src/org/compiere/plaf/icons/Question.gif | Bin 1482 -> 0 bytes .../src/org/compiere/plaf/icons/Warn.gif | Bin 1377 -> 0 bytes .../src/org/compiere/plaf/package.html | 24 - .../org/compiere/plaf/sounds/FrameClose.wav | Bin 2036 -> 0 bytes .../compiere/plaf/sounds/FrameMaximize.wav | Bin 10108 -> 0 bytes .../compiere/plaf/sounds/FrameMinimize.wav | Bin 4876 -> 0 bytes .../compiere/plaf/sounds/FrameRestoreDown.wav | Bin 4878 -> 0 bytes .../compiere/plaf/sounds/FrameRestoreUp.wav | Bin 7916 -> 0 bytes .../compiere/plaf/sounds/MenuItemCommand.wav | Bin 4092 -> 0 bytes .../compiere/plaf/sounds/OptionPaneError.wav | Bin 32914 -> 0 bytes .../plaf/sounds/OptionPaneInformation.wav | Bin 20804 -> 0 bytes .../plaf/sounds/OptionPaneQuestion.wav | Bin 11884 -> 0 bytes .../plaf/sounds/OptionPaneWarning.wav | Bin 22828 -> 0 bytes .../compiere/plaf/sounds/PopupMenuPopup.wav | Bin 2460 -> 0 bytes .../src/org/compiere/plaf/vincent.jpg | Bin 53604 -> 0 bytes .../compiere/pos/AdempierePOSException.java | 17 - .../org/compiere/pos/CashSubFunctions.java | 572 --- .../src/org/compiere/pos/POSKeyboard.java | 261 -- .../src/org/compiere/pos/PosApplication.java | 94 - .../src/org/compiere/pos/PosBasePanel.java | 396 -- .../src/org/compiere/pos/PosKeyListener.java | 30 - .../src/org/compiere/pos/PosKeyPanel.java | 249 -- .../compiere/pos/PosKeyboardFocusManager.java | 133 - .../src/org/compiere/pos/PosLogin.java | 80 - .../src/org/compiere/pos/PosOrderModel.java | 473 --- .../src/org/compiere/pos/PosPanel.java | 18 - .../src/org/compiere/pos/PosPayment.java | 529 --- .../src/org/compiere/pos/PosQuery.java | 141 - .../src/org/compiere/pos/PosSubPanel.java | 165 - .../src/org/compiere/pos/PosTable.java | 43 - .../src/org/compiere/pos/PosTextField.java | 93 - .../src/org/compiere/pos/QueryBPartner.java | 300 -- .../src/org/compiere/pos/QueryProduct.java | 316 -- .../src/org/compiere/pos/QueryTicket.java | 306 -- .../src/org/compiere/pos/SubCheckout.java | 235 -- .../src/org/compiere/pos/SubCurrentLine.java | 718 ---- .../src/org/compiere/pos/SubFunctionKeys.java | 97 - .../src/org/compiere/pos/SubOrder.java | 661 ---- .../src/org/compiere/pos/package.html | 30 - .../src/org/compiere/print/AReport.java | 241 -- .../src/org/compiere/print/CPrinter.java | 118 - .../compiere/print/SwingViewerProvider.java | 38 - .../src/org/compiere/print/View.java | 344 -- .../src/org/compiere/print/Viewer.java | 1393 ------- .../src/org/compiere/print/package.html | 36 - .../org/compiere/report/core/ResultTable.java | 264 -- .../report/core/ResultTableCellEditor.java | 98 - .../report/core/ResultTableCellRenderer.java | 162 - .../src/org/compiere/swing/CButton.java | 341 -- .../src/org/compiere/swing/CCheckBox.java | 347 -- .../org/compiere/swing/CCheckBoxMenuItem.java | 98 - .../compiere/swing/CColumnControlButton.java | 890 ----- .../src/org/compiere/swing/CComboBox.java | 1006 ----- .../org/compiere/swing/CComboBoxEditable.java | 348 -- .../src/org/compiere/swing/CDialog.java | 305 -- .../src/org/compiere/swing/CEditor.java | 81 - .../src/org/compiere/swing/CField.java | 334 -- .../src/org/compiere/swing/CFieldEditor.java | 84 - .../src/org/compiere/swing/CFieldPopup.java | 57 - .../src/org/compiere/swing/CFrame.java | 143 - .../src/org/compiere/swing/CLabel.java | 309 -- .../src/org/compiere/swing/CMenuItem.java | 93 - .../src/org/compiere/swing/CPanel.java | 206 -- .../src/org/compiere/swing/CPassword.java | 219 -- .../src/org/compiere/swing/CScrollPane.java | 94 - .../src/org/compiere/swing/CTabbedPane.java | 382 -- .../src/org/compiere/swing/CTable.java | 740 ---- .../src/org/compiere/swing/CTextArea.java | 528 --- .../src/org/compiere/swing/CTextField.java | 259 -- .../src/org/compiere/swing/CTextPane.java | 360 -- .../src/org/compiere/swing/CToggleButton.java | 266 -- .../org/compiere/swing/CollapsiblePanel.java | 219 -- .../src/org/compiere/swing/ColorBlind.java | 290 -- .../src/org/compiere/swing/ColorEditor.java | 682 ---- .../src/org/compiere/swing/ExtendedTheme.java | 34 - .../src/org/compiere/swing/FontChooser.java | 324 -- .../src/org/compiere/swing/ShadowBorder.java | 77 - .../src/org/compiere/swing/StackedBox.java | 216 -- .../src/org/compiere/swing/TableCellNone.java | 76 - .../src/org/compiere/swing/ThemeUtils.java | 221 -- .../src/org/compiere/swing/package.html | 32 - .../src/org/compiere/util/IniDialog.java | 196 - .../src/org/compiere/util/MiniBrowser.java | 118 - .../src/org/compiere/util/ResourceFinder.java | 18 - .../src/org/compiere/util/Splash.java | 327 -- .../org/eevolution/form/VInOutInvoiceGen.java | 933 ----- org.adempiere.ui.swing/swing.properties | 10 - org.idempiere.javadoc/build.properties | 1 - pom.xml | 7 +- 751 files changed, 2 insertions(+), 123938 deletions(-) delete mode 100644 org.adempiere.report.jasper.swing/.classpath delete mode 100644 org.adempiere.report.jasper.swing/.project delete mode 100644 org.adempiere.report.jasper.swing/.settings/org.eclipse.core.resources.prefs delete mode 100644 org.adempiere.report.jasper.swing/.settings/org.eclipse.jdt.core.prefs delete mode 100644 org.adempiere.report.jasper.swing/.settings/org.eclipse.m2e.core.prefs delete mode 100644 org.adempiere.report.jasper.swing/.settings/org.eclipse.pde.core.prefs delete mode 100644 org.adempiere.report.jasper.swing/META-INF/MANIFEST.MF delete mode 100644 org.adempiere.report.jasper.swing/OSGI-INF/jrviewerprovider.xml delete mode 100644 org.adempiere.report.jasper.swing/build.properties delete mode 100644 org.adempiere.report.jasper.swing/pom.xml delete mode 100644 org.adempiere.report.jasper.swing/src/org/compiere/report/JasperReportViewer.java delete mode 100644 org.adempiere.report.jasper.swing/src/org/compiere/report/JasperReportsClientActivator.java delete mode 100644 org.adempiere.report.jasper.swing/src/org/compiere/report/JasperViewer.java delete mode 100644 org.adempiere.report.jasper.swing/src/org/compiere/report/SwingJRViewerProvider.java delete mode 100644 org.adempiere.ui.swing-feature/.project delete mode 100644 org.adempiere.ui.swing-feature/.settings/org.eclipse.core.resources.prefs delete mode 100644 org.adempiere.ui.swing-feature/.settings/org.eclipse.m2e.core.prefs delete mode 100644 org.adempiere.ui.swing-feature/adempiere-client.bat delete mode 100644 org.adempiere.ui.swing-feature/adempiere-client.sh delete mode 100644 org.adempiere.ui.swing-feature/build.properties delete mode 100644 org.adempiere.ui.swing-feature/feature.xml delete mode 100644 org.adempiere.ui.swing-feature/pom.xml delete mode 100644 org.adempiere.ui.swing-feature/swingclient.product delete mode 100644 org.adempiere.ui.swing-feature/swingclient.product.launch delete mode 100644 org.adempiere.ui.swing.pluginlist/.classpath delete mode 100644 org.adempiere.ui.swing.pluginlist/.project delete mode 100644 org.adempiere.ui.swing.pluginlist/.settings/org.eclipse.pde.core.prefs delete mode 100644 org.adempiere.ui.swing.pluginlist/META-INF/MANIFEST.MF delete mode 100644 org.adempiere.ui.swing.pluginlist/META-INF/PackOut.xml delete mode 100644 org.adempiere.ui.swing.pluginlist/build.properties delete mode 100644 org.adempiere.ui.swing.pluginlist/plugin.xml delete mode 100644 org.adempiere.ui.swing.pluginlist/src/org/adempiere/plugin/list/Activator.java delete mode 100644 org.adempiere.ui.swing.pluginlist/src/org/adempiere/plugin/list/PluginList.java delete mode 100644 org.adempiere.ui.swing/.classpath delete mode 100644 org.adempiere.ui.swing/.project delete mode 100644 org.adempiere.ui.swing/.settings/org.eclipse.core.resources.prefs delete mode 100644 org.adempiere.ui.swing/.settings/org.eclipse.jdt.core.prefs delete mode 100644 org.adempiere.ui.swing/.settings/org.eclipse.m2e.core.prefs delete mode 100644 org.adempiere.ui.swing/META-INF/MANIFEST.MF delete mode 100644 org.adempiere.ui.swing/OSGI-INF/defaultcreatefromfactory.xml delete mode 100644 org.adempiere.ui.swing/OSGI-INF/defaulteditorfactory.xml delete mode 100644 org.adempiere.ui.swing/OSGI-INF/defaultformfactory.xml delete mode 100644 org.adempiere.ui.swing/OSGI-INF/defaultinfofactory.xml delete mode 100644 org.adempiere.ui.swing/OSGI-INF/defaultpaymentformfactory.xml delete mode 100644 org.adempiere.ui.swing/OSGI-INF/defaultprintshippinglabel.xml delete mode 100644 org.adempiere.ui.swing/OSGI-INF/reportviewerprovider.xml delete mode 100644 org.adempiere.ui.swing/OSGI-INF/resourcefinder.xml delete mode 100644 org.adempiere.ui.swing/RUN_build.bat delete mode 100644 org.adempiere.ui.swing/RUN_build.sh delete mode 100644 org.adempiere.ui.swing/Swingset.bat delete mode 100644 org.adempiere.ui.swing/build.properties delete mode 100644 org.adempiere.ui.swing/documentation.bat delete mode 100644 org.adempiere.ui.swing/packages.txt delete mode 100644 org.adempiere.ui.swing/plugin.xml delete mode 100644 org.adempiere.ui.swing/pom.xml delete mode 100644 org.adempiere.ui.swing/schema/org.adempiere.apps.Form.exsd delete mode 100644 org.adempiere.ui.swing/src/de/schaeffer/compiere/tools/DocumentSearch.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/apps/graph/FCHtmlEditorKit.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/apps/graph/Graph.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/apps/graph/GraphUtil.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/apps/graph/HtmlDashboard.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/apps/graph/PAPanel.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/apps/graph/PerformanceDetail.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/apps/graph/PerformanceIndicator.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/apps/graph/ViewPI.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/client/Application.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/client/Client.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/client/ClientCredentialDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/client/InfoManager.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/document-print.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/document-save.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/go-first.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/go-last.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/go-next.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/go-previous.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/rotate-cclock.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/rotate-clock.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/rotate.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/system-search.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/zoom-in.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/zoom-out.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/48x48/document-print.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/48x48/document-save.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/48x48/go-first.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/48x48/go-last.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/48x48/go-next.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/48x48/go-previous.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/48x48/system-search.png delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/PDFViewerBean.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereButtonListener.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereComboBoxUI.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereComboPopup.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereLabelUI.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereLookAndFeel.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereLookAndFeelAddons.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/AdempierePLAF.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereTabbedPaneUI.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereTaskPaneUI.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereTheme.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereThemeInnova.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/PLAFEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/PLAFEditorPanel.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/CL16.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/CL32.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/Cancel24.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/Computer.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/Error.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/File.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/FloppyDrive.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/HardDrive.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/HomeFolder.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/Inform.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/NewFolder.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/Ok24.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/Question.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/TreeClosed.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/TreeLeaf.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/TreeOpen.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/UpFolder.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/plaf/icons/Warn.gif delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/process/DefaultPrintShippingLabel.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/DefaultEditorFactory.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/DefaultFormFactory.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/DefaultInfoFactory.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/IEditorFactory.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/IFormFactory.java delete mode 100644 org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/IInfoFactory.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/AdempiereClient.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/acct/AcctViewer.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/acct/AcctViewerData.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/acct/package.html delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/AArchive.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/AChat.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ADialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ADialogDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/AEnv.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/AExport.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/AFocusTraversalPolicy.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/AGlassPane.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/AKeyboardFocusManager.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ALayout.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ALayoutCollection.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ALayoutConstraint.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ALoginTest.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/AMenu.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/AMenuStartItem.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/APanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ARequest.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ATask.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/AWindow.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/AWindowListener.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/AZoomAcross.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/AboutBox.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/AppsAction.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/Attachment.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/BeanShellEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ClientProcessCtrl.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ConfirmPanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/EMailDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/FieldRecordInfo.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/GroovyEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/Help.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/OnlineHelp.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/Preference.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/PrintScreenPainter.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ProcessCtl.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ProcessDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ProcessModalDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameter.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameterPanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/RecordInfo.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ScreenShot.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/Script.html delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/ScriptEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/StatusBar.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/SwingWorker.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/TabSwitcher.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/Waiting.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/WindowManager.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/WindowMenu.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/ArchiveViewer.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/FormFrame.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/FormPanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VAllocation.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VAttributeGrid.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VBOMDrop.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VCharge.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VCreateFromForm.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VFactReconcile.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VFileImport.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VGenPanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VInOutGen.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VInvoiceGen.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VMatch.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VMerge.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VPayPrint.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VPaySelect.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VResetPassword.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VSQLProcess.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VSetup.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VStatementCreateFromBatch.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VTreeBOM.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VTreeMaintenance.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VTrxMaterial.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/package.html delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/package.html delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/FindCellEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/FindValueEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/FindValueRenderer.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/Info.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/InfoAsset.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/InfoAssignment.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/InfoBPartner.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/InfoCashLine.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/InfoFactory.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/InfoGeneral.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/InfoInOut.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/InfoInvoice.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/InfoOrder.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/InfoPAttribute.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/InfoPayment.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/InfoSchedule.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/Info_Column.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/InvoiceHistory.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/PAttributeInstance.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/VSchedule.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/VSchedulePanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/VScheduleTimePanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/search/package.html delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/wf/NodeMenu.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/wf/SceneMainMenu.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/wf/WFActivity.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/wf/WFContentPanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/wf/WFNodeMoveStrategy.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/wf/WFPanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/wf/WFPopupItem.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/wf/package.html delete mode 100644 org.adempiere.ui.swing/src/org/compiere/db/CConnectionDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/db/CConnectionEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/dbPort/ConvertDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/APanelTab.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/DefaultCreateFromFactory.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/DefaultPaymentFormFactory.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/GridController.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/GridSynchronizer.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/RecordAccessDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromDepositBatchUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromFactory.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromInvoiceUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromPackageShipmentUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromRMAUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromShipmentUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromStatementUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VOnlyCurrentDays.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VPanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormCash.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormCheck.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormCreditCard.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormDirect.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormDirectDebit.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormDirectDeposit.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormFactory.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormMixedPOS.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormOnCredit.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VSortTab.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VTabbedPane.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VTable.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/VTableExcelAdapter.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/XLookup.java delete mode 100755 org.adempiere.ui.swing/src/org/compiere/grid/ed/ADempiereAutoCompleteDecorator.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/AutoCompleter.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/AutoCompletion.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/Calculator.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/Calendar.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/CityAutoCompleter.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/ComboSelectionManager.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/Editor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/HTMLEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocDate.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocNumber.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocString.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocTime.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VAccount.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VAccountDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VAssignment.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VAssignmentDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VBPartner.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VBinary.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VButton.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VCellEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VCellRenderer.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VChart.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VCheckBox.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VColor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VComboBox.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VDate.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VDocAction.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VEditorFactory.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VFile.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VHeaderRenderer.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VImage.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VImageDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VLine.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocation.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocator.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocatorDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VManagedEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VMemo.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VNumber.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VOvrCaret.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttribute.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttributeDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VPassword.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VPaymentEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VPostIt.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VRowIDEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VRowIDRenderer.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VString.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VStringBeanInfo.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VText.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VTextBeanInfo.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VTextLong.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/VURL.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/ValuePreference.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/ed/package.html delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/package.html delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/tree/AdempiereTreeModel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/tree/TransferableTreeNode.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreeCellRenderer.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreePanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreeTransferHandler.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/About16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/About24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Account10.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Account16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Account24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Archive16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Archive24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Assignment10.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Assignment16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Assignment24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Attachment16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Attachment24.gif delete mode 100755 org.adempiere.ui.swing/src/org/compiere/images/Attachment24D.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/AttachmentX16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/AttachmentX16_grey.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/AttachmentX24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/BPartner10.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/BPartner16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/BPartner24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Bold16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/C10030HR.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Calculator10.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Calculator16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Calculator24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Calendar10.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Calendar16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Calendar24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Cancel10.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Cancel16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Cancel24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/ChangeLog16.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Chat16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Chat24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/ChatX16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/ChatX24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Copy16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Copy24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Customize16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Customize24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Delete16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Delete24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/DeleteSelection16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/DeleteSelection24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Detail16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Detail24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/DragCursor32.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/EMailSupport16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/EMailSupport24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Edit16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Edit24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Editor16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Editor24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/End16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/End24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Error32.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Exit16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Exit24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Export16.gif delete mode 100755 org.adempiere.ui.swing/src/org/compiere/images/Export16X.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Export24.gif delete mode 100755 org.adempiere.ui.swing/src/org/compiere/images/Export24X.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/ExportX16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/ExportX24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/FastBack24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/FastForward24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Find16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Find24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/FindX16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/FindX24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/First16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/First24.gif delete mode 100755 org.adempiere.ui.swing/src/org/compiere/images/First24D.gif delete mode 100755 org.adempiere.ui.swing/src/org/compiere/images/Folder16.gif delete mode 100755 org.adempiere.ui.swing/src/org/compiere/images/Folder24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/GetMail16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/GetMail24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Help16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Help24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/History16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/History24.gif delete mode 100755 org.adempiere.ui.swing/src/org/compiere/images/History24D.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/HistoryX16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/HistoryX24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Home16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Home24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Ignore16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Ignore24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Import16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Import24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Info16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Info24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/InfoAccount16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/InfoAccount24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/InfoBPartner16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/InfoBPartner24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/InfoProduct16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/InfoProduct24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/InfoSchedule16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/InfoSchedule24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Inform32.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Italic16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Java_anim.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Java_logo.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Last16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Last24.gif delete mode 100755 org.adempiere.ui.swing/src/org/compiere/images/Last24D.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Location10.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Locator10.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Lock16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Lock24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/LockX16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/LockX24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Logo.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Logout16.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Logout24.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Minus16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Minus24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Multi16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Multi24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/MultiX16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/MultiX24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/New16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/New24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Next16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Next24.gif delete mode 100755 org.adempiere.ui.swing/src/org/compiere/images/Next24D.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Normal16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Ok16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Ok24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Online10.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Online16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Online24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Open16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Open24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/PAttribute10.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/PAttribute16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/PAttribute24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/PageSetup16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/PageSetup24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Parent16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Parent24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Payment10.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Payment16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Payment24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/PickOpen10.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Plus16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Plus24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/PostIt16.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/PostIt24.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/PostItX16.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/PostItX24.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Preference16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Preference24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Previous16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Previous24.gif delete mode 100755 org.adempiere.ui.swing/src/org/compiere/images/Previous24D.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Print16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Print24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/PrintPreview16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/PrintPreview24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/PrintScreen16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/PrintScreen24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Process16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Process24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Product10.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Product16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Product24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Question32.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Redo16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Redo24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Refresh16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Refresh24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Register16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Register24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Report16.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Report24.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Request16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Request24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Reset16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Reset24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Save16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Save24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/SaveCreate16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/SaveCreate24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/ScreenShot16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/ScreenShot24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Script16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Script24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/SelectAll16.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/SelectAll24.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/SendMail16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/SendMail24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Server16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Server24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Setup16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Setup24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/StepBack24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/StepForward24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Summary16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Summary24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Translate16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Translate24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Underline16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Undo16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Undo24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/VPreference16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/VPreference24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Warn32.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/WinSize16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/WinSize24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/WorkFlow16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/WorkFlow24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/WorkFlow_16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/WorkFlow_24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Zoom16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/Zoom24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/ZoomAcross16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/ZoomAcross24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/downarrow.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/iD10030.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/iD16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/iD32.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/iDempiere.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/iDempiereHR.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/logo_ad.png delete mode 100755 org.adempiere.ui.swing/src/org/compiere/images/mClosed.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/mDocAction.png delete mode 100755 org.adempiere.ui.swing/src/org/compiere/images/mOpen.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/mProcess.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/mReport.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/mSetVariable.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/mUserChoice.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/mWindow.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/mWorkFlow.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/mWorkbench.png delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/standard.css delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/uparrow.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/wfBack24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/wfEnd24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/wfNext24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/wfStart24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/images/zip.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/install/VTranslationDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/install/package.html delete mode 100644 org.adempiere.ui.swing/src/org/compiere/license.html delete mode 100644 org.adempiere.ui.swing/src/org/compiere/minigrid/CheckRenderer.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/minigrid/IDColumnEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/minigrid/IDColumnRenderer.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/minigrid/MiniCellEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/minigrid/MiniTable.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/minigrid/ROCellEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/minigrid/package.html delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/Adempiere200x100.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/AquaTheme.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CharcoalTheme.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereButtonListener.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereButtonUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereCheckBoxMenuItemUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereCheckBoxUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereColor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereComboBoxUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereComboPopup.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereLabelUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereLookAndFeel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereMenuBarUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereMenuItemUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereMenuUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompierePanelUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereRadioButtonUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereRootPaneUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereScrollPaneUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereSplitPaneDivider.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereSplitPaneUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTabbedPaneUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTableHeaderUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTextAreaUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTheme.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereThemeBlueMetal.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereThemeEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereThemeIce.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereToggleButtonUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereToolBarUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereToolTipUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereUtils.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/CompiereViewportUI.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/ContrastTheme.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/EmeraldTheme.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ar.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_bg.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ca.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_da.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_de.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_el.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_es.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_fa.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_fr.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_hr.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_hu.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_in.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_it.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ja.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ms.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_nl.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_no.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_pl.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_pt.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ro.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ru.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_sl.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_sr.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_sv.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_th.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_vi.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_zh.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_zh_CN.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/RubyTheme.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/icons/CL16.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/icons/CL32.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/icons/Cancel24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/icons/Error.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/icons/Inform.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/icons/Ok24.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/icons/Question.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/icons/Warn.gif delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/package.html delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/sounds/FrameClose.wav delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/sounds/FrameMaximize.wav delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/sounds/FrameMinimize.wav delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/sounds/FrameRestoreDown.wav delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/sounds/FrameRestoreUp.wav delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/sounds/MenuItemCommand.wav delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/sounds/OptionPaneError.wav delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/sounds/OptionPaneInformation.wav delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/sounds/OptionPaneQuestion.wav delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/sounds/OptionPaneWarning.wav delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/sounds/PopupMenuPopup.wav delete mode 100644 org.adempiere.ui.swing/src/org/compiere/plaf/vincent.jpg delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/AdempierePOSException.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/CashSubFunctions.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/POSKeyboard.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/PosApplication.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/PosBasePanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/PosKeyListener.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/PosKeyPanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/PosKeyboardFocusManager.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/PosLogin.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/PosOrderModel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/PosPanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/PosPayment.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/PosQuery.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/PosSubPanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/PosTable.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/PosTextField.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/QueryBPartner.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/QueryProduct.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/QueryTicket.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/SubCheckout.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/SubCurrentLine.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/SubFunctionKeys.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/SubOrder.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/pos/package.html delete mode 100644 org.adempiere.ui.swing/src/org/compiere/print/AReport.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/print/CPrinter.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/print/SwingViewerProvider.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/print/View.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/print/Viewer.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/print/package.html delete mode 100644 org.adempiere.ui.swing/src/org/compiere/report/core/ResultTable.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/report/core/ResultTableCellEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/report/core/ResultTableCellRenderer.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CButton.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CCheckBox.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CCheckBoxMenuItem.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CColumnControlButton.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CComboBox.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CComboBoxEditable.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CField.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CFieldEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CFieldPopup.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CFrame.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CLabel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CMenuItem.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CPanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CPassword.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CScrollPane.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CTabbedPane.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CTable.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CTextArea.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CTextField.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CTextPane.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CToggleButton.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/CollapsiblePanel.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/ColorBlind.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/ColorEditor.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/ExtendedTheme.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/FontChooser.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/ShadowBorder.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/StackedBox.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/TableCellNone.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/ThemeUtils.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/swing/package.html delete mode 100644 org.adempiere.ui.swing/src/org/compiere/util/IniDialog.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/util/MiniBrowser.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/util/ResourceFinder.java delete mode 100644 org.adempiere.ui.swing/src/org/compiere/util/Splash.java delete mode 100755 org.adempiere.ui.swing/src/org/eevolution/form/VInOutInvoiceGen.java delete mode 100644 org.adempiere.ui.swing/swing.properties diff --git a/org.adempiere.report.jasper.swing/.classpath b/org.adempiere.report.jasper.swing/.classpath deleted file mode 100644 index 423c974870..0000000000 --- a/org.adempiere.report.jasper.swing/.classpath +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/org.adempiere.report.jasper.swing/.project b/org.adempiere.report.jasper.swing/.project deleted file mode 100644 index 77b952c3a4..0000000000 --- a/org.adempiere.report.jasper.swing/.project +++ /dev/null @@ -1,39 +0,0 @@ - - - org.adempiere.report.jasper.swing - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.ds.core.builder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/org.adempiere.report.jasper.swing/.settings/org.eclipse.core.resources.prefs b/org.adempiere.report.jasper.swing/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.adempiere.report.jasper.swing/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.adempiere.report.jasper.swing/.settings/org.eclipse.jdt.core.prefs b/org.adempiere.report.jasper.swing/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b5eacefd65..0000000000 --- a/org.adempiere.report.jasper.swing/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.release=enabled diff --git a/org.adempiere.report.jasper.swing/.settings/org.eclipse.m2e.core.prefs b/org.adempiere.report.jasper.swing/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f1cb..0000000000 --- a/org.adempiere.report.jasper.swing/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/org.adempiere.report.jasper.swing/.settings/org.eclipse.pde.core.prefs b/org.adempiere.report.jasper.swing/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index 0f8fd9b2cd..0000000000 --- a/org.adempiere.report.jasper.swing/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Mon Aug 23 13:20:48 MYT 2010 -eclipse.preferences.version=1 -pluginProject.extensions=true -resolve.requirebundle=false diff --git a/org.adempiere.report.jasper.swing/META-INF/MANIFEST.MF b/org.adempiere.report.jasper.swing/META-INF/MANIFEST.MF deleted file mode 100644 index 90c0c4dbaf..0000000000 --- a/org.adempiere.report.jasper.swing/META-INF/MANIFEST.MF +++ /dev/null @@ -1,21 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: JasperReports Swing Client -Bundle-SymbolicName: org.adempiere.report.jasper.swing;singleton:=true -Bundle-Version: 7.1.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-11 -Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version>=11))" -Require-Bundle: org.adempiere.base;bundle-version="0.0.0", - org.adempiere.ui.swing;bundle-version="0.0.0", - org.adempiere.report.jasper;bundle-version="0.0.0" -Import-Package: net.sf.jasperreports.engine, - net.sf.jasperreports.engine.export, - net.sf.jasperreports.swing, - net.sf.jasperreports.view, - org.adempiere.report.jasper, - org.osgi.framework -Service-Component: OSGI-INF/*.xml -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Automatic-Module-Name: org.adempiere.report.jasper.swing -Bundle-Vendor: iDempiere Community diff --git a/org.adempiere.report.jasper.swing/OSGI-INF/jrviewerprovider.xml b/org.adempiere.report.jasper.swing/OSGI-INF/jrviewerprovider.xml deleted file mode 100644 index 1e7305e452..0000000000 --- a/org.adempiere.report.jasper.swing/OSGI-INF/jrviewerprovider.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.adempiere.report.jasper.swing/build.properties b/org.adempiere.report.jasper.swing/build.properties deleted file mode 100644 index 9741b55bc5..0000000000 --- a/org.adempiere.report.jasper.swing/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -bin.includes = META-INF/,\ - OSGI-INF/jrviewerprovider.xml,\ - OSGI-INF/,\ - . -output.. = target/classes/ -source.. = src/ diff --git a/org.adempiere.report.jasper.swing/pom.xml b/org.adempiere.report.jasper.swing/pom.xml deleted file mode 100644 index 2a8404c590..0000000000 --- a/org.adempiere.report.jasper.swing/pom.xml +++ /dev/null @@ -1,12 +0,0 @@ - - 4.0.0 - - org.idempiere - org.idempiere.parent - 7.1.0-SNAPSHOT - ../org.idempiere.parent/pom.xml - - org.adempiere.report.jasper.swing - eclipse-plugin - \ No newline at end of file diff --git a/org.adempiere.report.jasper.swing/src/org/compiere/report/JasperReportViewer.java b/org.adempiere.report.jasper.swing/src/org/compiere/report/JasperReportViewer.java deleted file mode 100644 index 56f4202bdd..0000000000 --- a/org.adempiere.report.jasper.swing/src/org/compiere/report/JasperReportViewer.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Class JRViewer. - */ -package org.compiere.report; - -import java.awt.Graphics2D; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; -import java.util.logging.Level; - -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JFileChooser; -import javax.swing.JFrame; -import javax.swing.JSeparator; -import javax.swing.SwingConstants; - -import net.sf.jasperreports.engine.JRException; -import net.sf.jasperreports.engine.JRExporterParameter; -import net.sf.jasperreports.engine.JasperExportManager; -import net.sf.jasperreports.engine.JasperPrint; -import net.sf.jasperreports.engine.JasperReport; -import net.sf.jasperreports.engine.export.JRXlsExporter; -import net.sf.jasperreports.swing.JRViewer; - -import org.compiere.apps.EMailDialog; -import org.compiere.model.MUser; -import org.compiere.tools.FileUtil; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -public class JasperReportViewer extends JRViewer { - - private static final long serialVersionUID = -7988455595896562947L; - - /** Logger */ - @SuppressWarnings("unused") - private static CLogger log = CLogger.getCLogger(JasperReportViewer.class); - - @SuppressWarnings("unused") - private JasperViewer jasperViewer; - private JasperPrint jasperPrint; - private JComboBox comboBox; - - public JasperReportViewer(final JasperViewer jasperViewer, final JasperPrint jasperPrint) throws JRException { - super( jasperPrint); - this.jasperViewer = jasperViewer; - this.jasperPrint = jasperPrint; - - tlbToolBar.add(new JSeparator(SwingConstants.VERTICAL)); - JButton btnSendByEmail = new JButton(); - btnSendByEmail.setToolTipText(Msg.getMsg(Env.getCtx(), "SendMail")); - btnSendByEmail.setText(Msg.getMsg(Env.getCtx(), "SendMail")); - btnSendByEmail.setPreferredSize(new java.awt.Dimension(85, 23)); - btnSendByEmail.setMaximumSize(new java.awt.Dimension(85, 23)); - btnSendByEmail.setMinimumSize(new java.awt.Dimension(85, 23)); - btnSendByEmail.addActionListener( new SendByEmailListener(jasperViewer, this)); - tlbToolBar.add(btnSendByEmail); - tlbToolBar.add(new JSeparator(SwingConstants.VERTICAL)); - - JButton btnExport = new JButton(); - btnExport.setToolTipText(Msg.getMsg(Env.getCtx(), "Export")); - btnExport.setText(Msg.getMsg(Env.getCtx(), "Export")); - btnExport.setPreferredSize(new java.awt.Dimension(85, 23)); - btnExport.setMaximumSize(new java.awt.Dimension(85, 23)); - btnExport.setMinimumSize(new java.awt.Dimension(85, 23)); - btnExport.addActionListener( new ExportListener( this)); - tlbToolBar.add(btnExport); - - comboBox = new JComboBox( new String[] {"PDF","HTML", "XLS"}); - comboBox.setPreferredSize(new java.awt.Dimension(80, 23)); - comboBox.setMaximumSize(new java.awt.Dimension(80, 23)); - comboBox.setMinimumSize(new java.awt.Dimension(80, 23)); - tlbToolBar.add(comboBox); - - // Set default viewer zoom level - //btnFitPage.setSelected(true); - //setZooms(); - } - - public JasperPrint getJasperPrint() { - return jasperPrint; - } - - public String getFormat() { - return (String) comboBox.getSelectedItem(); - } - - - //@Override - protected void paintPage(Graphics2D grx) { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - try { - Thread.currentThread().setContextClassLoader(JasperReport.class.getClassLoader()); - //super.paintPage(grx); - } finally { - Thread.currentThread().setContextClassLoader(cl); - } - } - - - -} - -class ExportListener implements ActionListener { - private JasperReportViewer viewer; - - public ExportListener(JasperReportViewer viewer) { - this.viewer = viewer; - } - - public void actionPerformed(ActionEvent event) { - JFileChooser fileChooser = new JFileChooser(); - fileChooser.setSelectedFile(new File(viewer.getJasperPrint().getName() + - "." + viewer.getFormat().toLowerCase())); - if (fileChooser.showSaveDialog( viewer)==JFileChooser.APPROVE_OPTION) { - File file = fileChooser.getSelectedFile(); - try { - if (viewer.getFormat().equals("PDF")) { - JasperExportManager.exportReportToPdfFile( viewer.getJasperPrint(), file.getAbsolutePath()); - } else if (viewer.getFormat().equals("HTML")) { - JasperExportManager.exportReportToHtmlFile( viewer.getJasperPrint(), file.getAbsolutePath()); - } else if (viewer.getFormat().equals("XLS")) { - JRXlsExporter exporter = new net.sf.jasperreports.engine.export.JRXlsExporter(); - exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, file.getAbsolutePath()); - exporter.setParameter(JRExporterParameter.JASPER_PRINT, viewer.getJasperPrint()); - exporter.exportReport(); - } - } catch (JRException e) { - e.printStackTrace(); - } - } - } -} - -class SendByEmailListener implements ActionListener { - /** Logger */ - private static CLogger log = CLogger.getCLogger(SendByEmailListener.class); - - private JasperViewer jasperViewer; - private JasperReportViewer viewer; - - public SendByEmailListener(JasperViewer jasperViewer, JasperReportViewer viewer) { - this.jasperViewer = jasperViewer; - this.viewer = viewer; - } - - public void actionPerformed(ActionEvent event) { - String to = ""; - MUser from = MUser.get(Env.getCtx(), Env.getAD_User_ID(Env.getCtx())); - String subject = viewer.getJasperPrint().getName(); - String message = ""; - File attachment = null; - - try - { - attachment = new File(FileUtil.getTempMailName(subject, ".pdf")); - JasperExportManager.exportReportToPdfFile(viewer.getJasperPrint(), attachment.getAbsolutePath()); - } - catch (Exception e) - { - log.log(Level.SEVERE, "", e); - } - - @SuppressWarnings("unused") - EMailDialog emd = new EMailDialog ((JFrame)jasperViewer, - Msg.getMsg(Env.getCtx(), "SendMail"), - from, to, subject, message, attachment); - } -} diff --git a/org.adempiere.report.jasper.swing/src/org/compiere/report/JasperReportsClientActivator.java b/org.adempiere.report.jasper.swing/src/org/compiere/report/JasperReportsClientActivator.java deleted file mode 100644 index 434a3cda50..0000000000 --- a/org.adempiere.report.jasper.swing/src/org/compiere/report/JasperReportsClientActivator.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * - */ -package org.compiere.report; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -/** - * @author hengsin - * - */ -public class JasperReportsClientActivator implements BundleActivator { - - /** - * default constructor - */ - public JasperReportsClientActivator() { - super(); - } - - @Override - public void start(BundleContext arg0) throws Exception { - } - - @Override - public void stop(BundleContext arg0) throws Exception { - } - -} diff --git a/org.adempiere.report.jasper.swing/src/org/compiere/report/JasperViewer.java b/org.adempiere.report.jasper.swing/src/org/compiere/report/JasperViewer.java deleted file mode 100644 index 9ff7892c35..0000000000 --- a/org.adempiere.report.jasper.swing/src/org/compiere/report/JasperViewer.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Class JasperViewer. - */ -package org.compiere.report; - -import java.awt.BorderLayout; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.util.HashMap; - -import net.sf.jasperreports.engine.JRException; -import net.sf.jasperreports.engine.JasperCompileManager; -import net.sf.jasperreports.engine.JasperFillManager; -import net.sf.jasperreports.engine.JasperPrint; -import net.sf.jasperreports.engine.JasperReport; - -import org.compiere.db.CConnection; -import org.compiere.model.PrintInfo; - -public class JasperViewer extends javax.swing.JFrame { - - private static final long serialVersionUID = 1192807883081180999L; - - private String m_title; - private PrintInfo m_printInfo; - - /** Creates new form JasperViewer */ - /** - * @param jasperPrint report to display - * @param frameTitle Title to be displayed - * @throws JRException - */ - protected JasperViewer(JasperPrint jasperPrint,String frameTitle, PrintInfo printInfo) throws JRException { - this.m_title = frameTitle; - initComponents(); - JasperReportViewer viewer = new JasperReportViewer(this, jasperPrint); - this.pnlMain.add(viewer, BorderLayout.CENTER); - m_printInfo = printInfo; - } - - - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. - */ - private void initComponents()//GEN-BEGIN:initComponents - { - pnlMain = new javax.swing.JPanel(); - - setTitle(m_title); - addWindowListener(new java.awt.event.WindowAdapter() { - public void windowClosing(java.awt.event.WindowEvent evt) { - exitForm(); - } - }); - addKeyListener( new KeyAdapter() { - public void keyPressed(KeyEvent event) { - if (event.getKeyCode() == KeyEvent.VK_ESCAPE) exitForm(); - } - - public void keyTyped(KeyEvent event) { - super.keyTyped(event); - } - }); - - pnlMain.setLayout(new java.awt.BorderLayout()); - - getContentPane().add(pnlMain, java.awt.BorderLayout.CENTER); - - pack(); - java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); - setSize(new java.awt.Dimension(750, 550)); - setLocation((screenSize.width - 750) / 2, (screenSize.height - 550) / 2); - }//GEN-END:initComponents - - /** Exit the Application */ - private void exitForm() {//GEN-FIRST:event_exitForm - setVisible(false); - dispose(); - }//GEN-LAST:event_exitForm - - - /** - * - */ - public static void viewReport(JasperPrint jasperPrint, PrintInfo printInfo) throws JRException { - JasperViewer jasperViewer = new JasperViewer(jasperPrint,"JasperReport", printInfo); - jasperViewer.setVisible(true); - } - public static void viewReport(JasperPrint jasperPrint,String frameTitle, PrintInfo printInfo) throws JRException { - JasperViewer jasperViewer = new JasperViewer(jasperPrint,frameTitle, printInfo); - jasperViewer.setVisible(true); - } - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JPanel pnlMain; - // End of variables declaration//GEN-END:variables - - /** - * @param args the command line arguments - */ - public static void main(String args[]) { - try { - JasperReport myjasperReport = (JasperReport) JasperCompileManager.compileReport(args[0] ); - JasperPrint myjasperPrint = JasperFillManager.fillReport( myjasperReport, new HashMap(), getConnection()); - JasperViewer.viewReport(myjasperPrint, null); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public static Connection getConnection(String args[]) - { - CConnection compiereConnection = CConnection.get(); - - try { - DriverManager.registerDriver(compiereConnection.getDatabase().getDriver()); - - //this is for test only - return DriverManager.getConnection(args[1], args[2], args[3]); - } catch (SQLException e) { - e.printStackTrace(); - return null; - } - } - - public static Connection getConnection() { - CConnection compiereConnection = CConnection.get(); - try { - DriverManager.registerDriver(compiereConnection.getDatabase().getDriver()); - //this is for test only prefer testingby calling org.compiere.report.JaserViewer JDBC_CONNECTION JDBC_USER JDBC_PASS - return DriverManager.getConnection("jdbc:oracle:thin:@abalone.lesmuids.com:1521:abalone", "adempiere", "adempiere"); - } catch (SQLException e) { - e.printStackTrace(); - return null; - } - } - -} diff --git a/org.adempiere.report.jasper.swing/src/org/compiere/report/SwingJRViewerProvider.java b/org.adempiere.report.jasper.swing/src/org/compiere/report/SwingJRViewerProvider.java deleted file mode 100644 index 2d0a4820d2..0000000000 --- a/org.adempiere.report.jasper.swing/src/org/compiere/report/SwingJRViewerProvider.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.compiere.report; - -import org.adempiere.report.jasper.JRViewerProvider; -import org.compiere.model.PrintInfo; - -import net.sf.jasperreports.engine.JRException; -import net.sf.jasperreports.engine.JasperPrint; - -public class SwingJRViewerProvider implements JRViewerProvider { - - public void openViewer(JasperPrint jasperPrint, String title, PrintInfo printInfo) throws JRException { - JasperViewer jasperViewer = new JasperViewer( jasperPrint, title, printInfo); - jasperViewer.setExtendedState(jasperViewer.getExtendedState() | javax.swing.JFrame.MAXIMIZED_BOTH); - jasperViewer.setVisible(true); - } - -} diff --git a/org.adempiere.ui.swing-feature/.project b/org.adempiere.ui.swing-feature/.project deleted file mode 100644 index 880abdd4ce..0000000000 --- a/org.adempiere.ui.swing-feature/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - org.adempiere.ui.swing-feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.pde.FeatureNature - - diff --git a/org.adempiere.ui.swing-feature/.settings/org.eclipse.core.resources.prefs b/org.adempiere.ui.swing-feature/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.adempiere.ui.swing-feature/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.adempiere.ui.swing-feature/.settings/org.eclipse.m2e.core.prefs b/org.adempiere.ui.swing-feature/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f1cb..0000000000 --- a/org.adempiere.ui.swing-feature/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/org.adempiere.ui.swing-feature/adempiere-client.bat b/org.adempiere.ui.swing-feature/adempiere-client.bat deleted file mode 100644 index 7dcda7188f..0000000000 --- a/org.adempiere.ui.swing-feature/adempiere-client.bat +++ /dev/null @@ -1,20 +0,0 @@ -@Echo off - - -@if not "%JAVA_HOME%" == "" goto JAVA_HOME_OK -@Set JAVA=java -@Echo JAVA_HOME is not set. -@Echo You may not be able to start the server -@Echo Set JAVA_HOME to the directory of your local 1.6 JDK. -goto START - -:JAVA_HOME_OK -@Set JAVA=%JAVA_HOME%\bin\java - - -:START -@Echo ======================================= -@Echo Starting Adempiere Client ... -@Echo ======================================= - -@"%JAVA%" -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -Dosgi.compatibility.bootdelegation=true -XX:MaxPermSize=192m -jar plugins/org.eclipse.equinox.launcher_1.*.jar -application org.adempiere.ui.swing.client diff --git a/org.adempiere.ui.swing-feature/adempiere-client.sh b/org.adempiere.ui.swing-feature/adempiere-client.sh deleted file mode 100644 index 7d67eb2586..0000000000 --- a/org.adempiere.ui.swing-feature/adempiere-client.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -# -# script parameters are used as VM args. e.g.: -# ./adempiere-client.sh -DPropertyFile=/home/tbayen/idempiere-conf2.properties -# -- tbayen - -if [ $JAVA_HOME ]; then - JAVA=$JAVA_HOME/bin/java -else - JAVA=java - echo JAVA_HOME is not set. - echo You may not be able to start the server - echo Set JAVA_HOME to the directory of your local JDK. -fi - -echo =================================== -echo Starting Adempiere Client -echo =================================== - -$JAVA -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -Dosgi.compatibility.bootdelegation=true $@ -XX:MaxPermSize=192m -jar plugins/org.eclipse.equinox.launcher_1.*.jar -application org.adempiere.ui.swing.client diff --git a/org.adempiere.ui.swing-feature/build.properties b/org.adempiere.ui.swing-feature/build.properties deleted file mode 100644 index 88c0d7fb8d..0000000000 --- a/org.adempiere.ui.swing-feature/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -bin.includes = feature.xml -root.linux.gtk.x86=file:adempiere-client.sh -root.linux.gtk.x86.permissions.755=*.sh,**/*.sh -root.linux.gtk.x86_64=file:adempiere-client.sh -root.linux.gtk.x86_64.permissions.755=*.sh,**/*.sh -root.macosx.cocoa.x86=file:adempiere-client.sh -root.macosx.cocoa.x86.permissions.755=*.sh,**/*.sh -root.win32.win32.x86=file:adempiere-client.bat -root.solaris.gtk.x86=file:adempiere-client.sh -root.solaris.gtk.x86.permissions.755=*.sh,**/*.sh \ No newline at end of file diff --git a/org.adempiere.ui.swing-feature/feature.xml b/org.adempiere.ui.swing-feature/feature.xml deleted file mode 100644 index d06a8d0983..0000000000 --- a/org.adempiere.ui.swing-feature/feature.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - [Enter Feature Description here.] - - - - [Enter Copyright Description here.] - - - - [Enter License Description here.] - - - - - - - - - - - - - diff --git a/org.adempiere.ui.swing-feature/pom.xml b/org.adempiere.ui.swing-feature/pom.xml deleted file mode 100644 index 2608546450..0000000000 --- a/org.adempiere.ui.swing-feature/pom.xml +++ /dev/null @@ -1,12 +0,0 @@ - - 4.0.0 - - org.idempiere - org.idempiere.parent - 7.1.0-SNAPSHOT - ../org.idempiere.parent/pom.xml - - org.adempiere.ui.swing.feature - eclipse-feature - \ No newline at end of file diff --git a/org.adempiere.ui.swing-feature/swingclient.product b/org.adempiere.ui.swing-feature/swingclient.product deleted file mode 100644 index 1acf5c3489..0000000000 --- a/org.adempiere.ui.swing-feature/swingclient.product +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - --launcher.XXMaxPermSize 192m - - -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -Dosgi.compatibility.bootdelegation=true - - -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.adempiere.ui.swing-feature/swingclient.product.launch b/org.adempiere.ui.swing-feature/swingclient.product.launch deleted file mode 100644 index cb6b9cfd31..0000000000 --- a/org.adempiere.ui.swing-feature/swingclient.product.launch +++ /dev/null @@ -1,421 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.adempiere.ui.swing.pluginlist/.classpath b/org.adempiere.ui.swing.pluginlist/.classpath deleted file mode 100644 index 1fa3e6803d..0000000000 --- a/org.adempiere.ui.swing.pluginlist/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.adempiere.ui.swing.pluginlist/.project b/org.adempiere.ui.swing.pluginlist/.project deleted file mode 100644 index 4daab55d00..0000000000 --- a/org.adempiere.ui.swing.pluginlist/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.adempiere.ui.swing.pluginlist - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/org.adempiere.ui.swing.pluginlist/.settings/org.eclipse.pde.core.prefs b/org.adempiere.ui.swing.pluginlist/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index b83250f900..0000000000 --- a/org.adempiere.ui.swing.pluginlist/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Wed Mar 17 17:21:50 CET 2010 -eclipse.preferences.version=1 -pluginProject.extensions=true -resolve.requirebundle=false diff --git a/org.adempiere.ui.swing.pluginlist/META-INF/MANIFEST.MF b/org.adempiere.ui.swing.pluginlist/META-INF/MANIFEST.MF deleted file mode 100644 index b6fc150e76..0000000000 --- a/org.adempiere.ui.swing.pluginlist/META-INF/MANIFEST.MF +++ /dev/null @@ -1,13 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: PluginList -Bundle-SymbolicName: org.adempiere.ui.swing.pluginlist;singleton:=true -Bundle-Version: 1.0.0.qualifier -Bundle-Activator: org.adempiere.plugin.list.Activator -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Eclipse-LazyStart: true -Import-Package: org.osgi.framework;version="1.3.0" -Require-Bundle: org.adempiere.base;bundle-version="0.0.0", - org.adempiere.ui.swing;bundle-version="0.0.0", - org.adempiere.plugin.utils;bundle-version="0.0.0" diff --git a/org.adempiere.ui.swing.pluginlist/META-INF/PackOut.xml b/org.adempiere.ui.swing.pluginlist/META-INF/PackOut.xml deleted file mode 100644 index 333bcac9c3..0000000000 --- a/org.adempiere.ui.swing.pluginlist/META-INF/PackOut.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - -
-
-
diff --git a/org.adempiere.ui.swing.pluginlist/build.properties b/org.adempiere.ui.swing.pluginlist/build.properties deleted file mode 100644 index e9863e281e..0000000000 --- a/org.adempiere.ui.swing.pluginlist/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml diff --git a/org.adempiere.ui.swing.pluginlist/plugin.xml b/org.adempiere.ui.swing.pluginlist/plugin.xml deleted file mode 100644 index 1393adbd45..0000000000 --- a/org.adempiere.ui.swing.pluginlist/plugin.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/org.adempiere.ui.swing.pluginlist/src/org/adempiere/plugin/list/Activator.java b/org.adempiere.ui.swing.pluginlist/src/org/adempiere/plugin/list/Activator.java deleted file mode 100644 index 0ccbe00ba0..0000000000 --- a/org.adempiere.ui.swing.pluginlist/src/org/adempiere/plugin/list/Activator.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.adempiere.plugin.list; - -import org.adempiere.plugin.utils.AdempiereActivator; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator extends AdempiereActivator implements BundleActivator { - - static private BundleContext ctx; - - @Override - public void start() { - ctx = getContext(); - } - - public static BundleContext getPluginContext() { - return ctx; - } -} diff --git a/org.adempiere.ui.swing.pluginlist/src/org/adempiere/plugin/list/PluginList.java b/org.adempiere.ui.swing.pluginlist/src/org/adempiere/plugin/list/PluginList.java deleted file mode 100644 index 65edec6c9f..0000000000 --- a/org.adempiere.ui.swing.pluginlist/src/org/adempiere/plugin/list/PluginList.java +++ /dev/null @@ -1,141 +0,0 @@ -package org.adempiere.plugin.list; - -import java.awt.BorderLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.JButton; -import javax.swing.JScrollPane; -import javax.swing.table.DefaultTableModel; - -import org.compiere.apps.form.FormFrame; -import org.compiere.apps.form.FormPanel; -import org.compiere.minigrid.MiniTable; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.BundleException; - -public class PluginList implements FormPanel, ActionListener { - - private static CLogger log = CLogger.getCLogger(PluginList.class); - @SuppressWarnings("unused") - private int m_WindowNo; - private FormFrame m_frame; - private CPanel northPanel = new CPanel(); - private CPanel centerPanel = new CPanel(); - private CPanel confirmPanel = new CPanel(); - private MiniTable pluginTable = new MiniTable(); - private JScrollPane centerScrollPane = new JScrollPane(); - private JButton refreshButton = new JButton(); - - @Override - public void dispose() { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } - - @Override - public void init(int WindowNo, FormFrame frame) { - log.info(""); - m_WindowNo = WindowNo; - m_frame = frame; - try - { - jbInit(); - frame.getContentPane().add(northPanel, BorderLayout.NORTH); - frame.getContentPane().add(centerPanel, BorderLayout.CENTER); - frame.getContentPane().add(confirmPanel, BorderLayout.SOUTH); - } - catch(Exception e) - { - log.log(Level.SEVERE, "init", e); - } - } - - private void jbInit() { - centerPanel.add(centerScrollPane, BorderLayout.CENTER); - centerScrollPane.getViewport().add(pluginTable, null); - updatePlugins(); - - refreshButton.setText("Refresh"); - refreshButton.addActionListener(this); - confirmPanel.add(refreshButton); - } - - private void updatePlugins() { - DefaultTableModel dataModel = new DefaultTableModel(getData(), getColumnNames()); - pluginTable.setModel(dataModel); - pluginTable.autoSize(); - } - - private Vector> getData() { - BundleContext ctx = getContext(); - Vector> result = new Vector>(); - for (Bundle bundle : ctx.getBundles()) { - Vector col = new Vector(); - col.add(bundle.getBundleId()); - col.add(state(bundle.getState())); - col.add(bundle.getSymbolicName()); - col.add(bundle.getVersion()); - result.add(col); - } - return result; - } - - private BundleContext getContext() { - return Activator.getPluginContext(); - } - - private String state(int state) { - switch (state) { - case Bundle.ACTIVE: - return "ACTIVE"; - case Bundle.INSTALLED: - return "INSTALLED"; - case Bundle.RESOLVED: - return "RESOLVED"; - case Bundle.STARTING: - return "STARTING"; - case Bundle.STOPPING: - return "STOPPING"; - case Bundle.UNINSTALLED: - return "UNINSTALLED"; - default: - return "UNKNOWN"; - } - } - - private Vector getColumnNames() { - Vector result = new Vector(); - result.add("Id"); - result.add("State"); - result.add("Name"); - result.add("Version"); - return result; - } - - @Override - public void actionPerformed(ActionEvent e) { - if (e.getSource().equals(refreshButton)) - refreshClicked(e); - } - - private void refreshClicked(ActionEvent e) { - int row = pluginTable.getSelectedRow(); - if (row==-1) - return; - long id = (Long) pluginTable.getValueAt(row, 0); - Bundle bundle = getContext().getBundle(id); - try { - bundle.update(); - } catch (BundleException ex) { - log.log(Level.SEVERE, "refresh", ex); - } - } - -} diff --git a/org.adempiere.ui.swing/.classpath b/org.adempiere.ui.swing/.classpath deleted file mode 100644 index 83e1df1e99..0000000000 --- a/org.adempiere.ui.swing/.classpath +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/org.adempiere.ui.swing/.project b/org.adempiere.ui.swing/.project deleted file mode 100644 index 75bed072bd..0000000000 --- a/org.adempiere.ui.swing/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.adempiere.ui.swing - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/org.adempiere.ui.swing/.settings/org.eclipse.core.resources.prefs b/org.adempiere.ui.swing/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.adempiere.ui.swing/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.adempiere.ui.swing/.settings/org.eclipse.jdt.core.prefs b/org.adempiere.ui.swing/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 05b5a63067..0000000000 --- a/org.adempiere.ui.swing/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,102 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled -org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore -org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull -org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= -org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable -org.eclipse.jdt.core.compiler.annotation.nullable.secondary= -org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.problem.APILeak=warning -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning -org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning -org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning -org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled -org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.release=enabled diff --git a/org.adempiere.ui.swing/.settings/org.eclipse.m2e.core.prefs b/org.adempiere.ui.swing/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f1cb..0000000000 --- a/org.adempiere.ui.swing/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/org.adempiere.ui.swing/META-INF/MANIFEST.MF b/org.adempiere.ui.swing/META-INF/MANIFEST.MF deleted file mode 100644 index be74ae4112..0000000000 --- a/org.adempiere.ui.swing/META-INF/MANIFEST.MF +++ /dev/null @@ -1,122 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: iDempiere Swing Client -Bundle-SymbolicName: org.adempiere.ui.swing;singleton:=true -Bundle-Version: 7.1.0.qualifier -Bundle-ClassPath: ., - lib/jpedal.jar, - lib/looks.jar, - lib/miglayout.jar, - lib/swingx.jar -Export-Package: com.jgoodies.looks, - com.jgoodies.looks.common, - com.jgoodies.looks.plastic, - com.jgoodies.looks.plastic.theme, - com.jgoodies.looks.windows, - de.schaeffer.compiere.tools, - net.miginfocom.layout, - net.miginfocom.swing, - org.adempiere.apps.graph, - org.adempiere.pdf.viewer, - org.adempiere.plaf, - org.adempiere.ui.swing.factory, - org.compiere, - org.compiere.acct, - org.compiere.apps, - org.compiere.apps.form, - org.compiere.apps.search, - org.compiere.apps.wf, - org.compiere.grid, - org.compiere.grid.ed, - org.compiere.grid.tree, - org.compiere.images, - org.compiere.install, - org.compiere.minigrid, - org.compiere.plaf, - org.compiere.pos, - org.compiere.print, - org.compiere.swing, - org.eevolution.form, - org.jdesktop.beans, - org.jdesktop.swingx, - org.jdesktop.swingx.action, - org.jdesktop.swingx.auth, - org.jdesktop.swingx.autocomplete, - org.jdesktop.swingx.border, - org.jdesktop.swingx.calendar, - org.jdesktop.swingx.color, - org.jdesktop.swingx.combobox, - org.jdesktop.swingx.decorator, - org.jdesktop.swingx.error, - org.jdesktop.swingx.event, - org.jdesktop.swingx.geom, - org.jdesktop.swingx.graphics, - org.jdesktop.swingx.hyperlink, - org.jdesktop.swingx.icon, - org.jdesktop.swingx.image, - org.jdesktop.swingx.multislider, - org.jdesktop.swingx.multisplitpane, - org.jdesktop.swingx.painter, - org.jdesktop.swingx.painter.effects, - org.jdesktop.swingx.plaf, - org.jdesktop.swingx.renderer, - org.jdesktop.swingx.rollover, - org.jdesktop.swingx.search, - org.jdesktop.swingx.sort, - org.jdesktop.swingx.table, - org.jdesktop.swingx.tips, - org.jdesktop.swingx.tree, - org.jdesktop.swingx.treetable, - org.jdesktop.swingx.util -Require-Bundle: org.adempiere.base;bundle-version="0.0.0", - org.adempiere.ui;bundle-version="0.0.0", - org.jfree.chart;bundle-version="1.0.19", - org.jfree.jcommon;bundle-version="1.0.23" -Eclipse-ExtensibleAPI: true -Eclipse-RegisterBuddy: org.adempiere.base -Bundle-RequiredExecutionEnvironment: JavaSE-11 -Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version>=11))" -Import-Package: groovy.beans;version="2.5.3", - groovy.cli;version="2.5.3", - groovy.grape;version="2.5.3", - groovy.inspect;version="2.5.3", - groovy.inspect.swingui;version="2.5.3", - groovy.io;version="2.5.3", - groovy.json;version="2.5.3", - groovy.lang;version="2.5.3", - groovy.model;version="2.5.3", - groovy.security;version="2.5.3", - groovy.sql;version="2.5.3", - groovy.swing;version="2.5.3", - groovy.swing.binding;version="2.5.3", - groovy.swing.factory;version="2.5.3", - groovy.swing.impl;version="2.5.3", - groovy.time;version="2.5.3", - groovy.transform;version="2.5.3", - groovy.transform.builder;version="2.5.3", - groovy.transform.options;version="2.5.3", - groovy.transform.stc;version="2.5.3", - groovy.ui;version="2.5.3", - groovy.ui.icons;version="2.5.3", - groovy.ui.text;version="2.5.3", - groovy.ui.view;version="2.5.3", - groovy.util;version="2.5.3", - groovy.util.logging;version="2.5.3", - groovy.util.slurpersupport;version="2.5.3", - groovy.xml;version="2.5.3", - groovy.xml.dom;version="2.5.3", - groovy.xml.jaxb;version="2.5.3", - groovy.xml.streamingmarkupsupport;version="2.5.3", - javax.net.ssl, - net.sf.jasperreports.engine, - org.apache.ecs, - org.apache.ecs.xhtml, - org.apache.poi.hssf.usermodel, - org.compiere.css, - org.eclipse.core.runtime;version="3.4.0", - org.eclipse.equinox.app, - org.osgi.framework;version="1.5.0" -Service-Component: OSGI-INF/*.xml -Bundle-ActivationPolicy: lazy -Automatic-Module-Name: org.adempiere.ui.swing -Bundle-Vendor: iDempiere Community diff --git a/org.adempiere.ui.swing/OSGI-INF/defaultcreatefromfactory.xml b/org.adempiere.ui.swing/OSGI-INF/defaultcreatefromfactory.xml deleted file mode 100644 index a8e8a3eab7..0000000000 --- a/org.adempiere.ui.swing/OSGI-INF/defaultcreatefromfactory.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.adempiere.ui.swing/OSGI-INF/defaulteditorfactory.xml b/org.adempiere.ui.swing/OSGI-INF/defaulteditorfactory.xml deleted file mode 100644 index b5b667baba..0000000000 --- a/org.adempiere.ui.swing/OSGI-INF/defaulteditorfactory.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.adempiere.ui.swing/OSGI-INF/defaultformfactory.xml b/org.adempiere.ui.swing/OSGI-INF/defaultformfactory.xml deleted file mode 100644 index ecfac158fa..0000000000 --- a/org.adempiere.ui.swing/OSGI-INF/defaultformfactory.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.adempiere.ui.swing/OSGI-INF/defaultinfofactory.xml b/org.adempiere.ui.swing/OSGI-INF/defaultinfofactory.xml deleted file mode 100644 index 4b7475506b..0000000000 --- a/org.adempiere.ui.swing/OSGI-INF/defaultinfofactory.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.adempiere.ui.swing/OSGI-INF/defaultpaymentformfactory.xml b/org.adempiere.ui.swing/OSGI-INF/defaultpaymentformfactory.xml deleted file mode 100644 index e987a82e55..0000000000 --- a/org.adempiere.ui.swing/OSGI-INF/defaultpaymentformfactory.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.adempiere.ui.swing/OSGI-INF/defaultprintshippinglabel.xml b/org.adempiere.ui.swing/OSGI-INF/defaultprintshippinglabel.xml deleted file mode 100644 index 2b14a97e99..0000000000 --- a/org.adempiere.ui.swing/OSGI-INF/defaultprintshippinglabel.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.adempiere.ui.swing/OSGI-INF/reportviewerprovider.xml b/org.adempiere.ui.swing/OSGI-INF/reportviewerprovider.xml deleted file mode 100644 index ff537236c1..0000000000 --- a/org.adempiere.ui.swing/OSGI-INF/reportviewerprovider.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.adempiere.ui.swing/OSGI-INF/resourcefinder.xml b/org.adempiere.ui.swing/OSGI-INF/resourcefinder.xml deleted file mode 100644 index 52e76f4703..0000000000 --- a/org.adempiere.ui.swing/OSGI-INF/resourcefinder.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.adempiere.ui.swing/RUN_build.bat b/org.adempiere.ui.swing/RUN_build.bat deleted file mode 100644 index 2fc71c0800..0000000000 --- a/org.adempiere.ui.swing/RUN_build.bat +++ /dev/null @@ -1,19 +0,0 @@ -@Title Build Client -@Rem $Header: /cvsroot/adempiere/client/RUN_build.bat,v 1.13 2005/09/16 00:48:35 jjanke Exp $ - -@CALL ..\utils_dev\myDevEnv.bat -@IF NOT %ADEMPIERE_ENV%==Y GOTO NOBUILD - -@echo Cleanup ... -@"%JAVA_HOME%\bin\java" -Dant.home="." %ANT_PROPERTIES% org.apache.tools.ant.Main clean - -@echo Building ... -@"%JAVA_HOME%\bin\java" -Dant.home="." %ANT_PROPERTIES% org.apache.tools.ant.Main clientDistribute - -@Echo Done ... -@sleep 60 -@exit - -:NOBUILD -@Echo Check myDevEnv.bat (copy from myDevEnvTemplate.bat) -@Pause \ No newline at end of file diff --git a/org.adempiere.ui.swing/RUN_build.sh b/org.adempiere.ui.swing/RUN_build.sh deleted file mode 100644 index 5f80633c60..0000000000 --- a/org.adempiere.ui.swing/RUN_build.sh +++ /dev/null @@ -1,18 +0,0 @@ -# Module compiling script -# Ported from Windows script Marek Mosiewicz - - -SAVED_DIR=`pwd` #save current dir -cd `dirname $0`/../utils_dev #change dir to place where script resides - doesn not work with sym links -UTILS_DEV=`pwd` #this is adempiere source -cd $SAVED_DIR #back to the saved directory - -. $UTILS_DEV/myDevEnv.sh #call environment -echo done -if [ ! $ADEMPIERE_ENV==Y ] ; then - echo "Can't set developemeent environemnt - check myDevEnv.sh" - exit 1 -fi - -echo running Ant -$JAVA_HOME/bin/java -Dant.home="." $ANT_PROPERTIES org.apache.tools.ant.Main diff --git a/org.adempiere.ui.swing/Swingset.bat b/org.adempiere.ui.swing/Swingset.bat deleted file mode 100644 index 1bc80a928c..0000000000 --- a/org.adempiere.ui.swing/Swingset.bat +++ /dev/null @@ -1,11 +0,0 @@ -@Title Swingset - -@Rem $Id: Swingset.bat,v 1.1 2002/03/17 02:29:49 jjanke Exp $ -@Rem Put the swing.properties file in the \rje\lib directory -@set JAVA_HOME=D:\j2sdk1.4.0 - -@Rem -%JAVA_HOME%\jre\bin\java -jar %JAVA_HOME%\demo\jfc\SwingSet2\SwingSet2.jar - -@Echo done ... -@Sleep 10 \ No newline at end of file diff --git a/org.adempiere.ui.swing/build.properties b/org.adempiere.ui.swing/build.properties deleted file mode 100644 index 1fa0422790..0000000000 --- a/org.adempiere.ui.swing/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -bin.includes = META-INF/,\ - plugin.xml,\ - OSGI-INF/,\ - .,\ - lib/jpedal.jar,\ - lib/looks.jar,\ - lib/miglayout.jar,\ - lib/swingx.jar -source.. = src/ -output.. = target/classes/ diff --git a/org.adempiere.ui.swing/documentation.bat b/org.adempiere.ui.swing/documentation.bat deleted file mode 100644 index 659c934f80..0000000000 --- a/org.adempiere.ui.swing/documentation.bat +++ /dev/null @@ -1,5 +0,0 @@ -@Rem API Documentation for Base - -call ..\doc\documentation.bat src doc -private - -@pause \ No newline at end of file diff --git a/org.adempiere.ui.swing/packages.txt b/org.adempiere.ui.swing/packages.txt deleted file mode 100644 index e66e569bf2..0000000000 --- a/org.adempiere.ui.swing/packages.txt +++ /dev/null @@ -1,11 +0,0 @@ -org.compiere.acct -org.compiere.apps -org.compiere.apps.form -org.compiere.apps.search -org.compiere.grid -org.compiere.grid.ed -org.compiere.grid.tree -org.compiere.images -org.compiere.install -org.compiere.minigrid -org.compiere.print \ No newline at end of file diff --git a/org.adempiere.ui.swing/plugin.xml b/org.adempiere.ui.swing/plugin.xml deleted file mode 100644 index 84669800d9..0000000000 --- a/org.adempiere.ui.swing/plugin.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/org.adempiere.ui.swing/pom.xml b/org.adempiere.ui.swing/pom.xml deleted file mode 100644 index f38e5e95d5..0000000000 --- a/org.adempiere.ui.swing/pom.xml +++ /dev/null @@ -1,82 +0,0 @@ - - 4.0.0 - - org.idempiere - org.idempiere.parent - 7.1.0-SNAPSHOT - ../org.idempiere.parent/pom.xml - - org.adempiere.ui.swing - eclipse-plugin - - - - - org.eclipse.tycho - tycho-compiler-plugin - - - - -warn:+forbidden - --add-exports - java.desktop/sun.awt=ALL-UNNAMED - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - validate - - copy - - - - - org.swinglabs - swingx - 1.6 - - - com.jgoodies - looks - 2.0.4 - - - com.miglayout - miglayout - 3.7.1 - - - lib - true - true - true - - - - - - com.googlecode.maven-download-plugin - download-maven-plugin - - - validate - - wget - - - ${url.file.srv}/extra.jar/jpedal.jar - false - lib - 5 - - - - - - - \ No newline at end of file diff --git a/org.adempiere.ui.swing/schema/org.adempiere.apps.Form.exsd b/org.adempiere.ui.swing/schema/org.adempiere.apps.Form.exsd deleted file mode 100644 index 0811f445d6..0000000000 --- a/org.adempiere.ui.swing/schema/org.adempiere.apps.Form.exsd +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - Extension point to provide FormPanel instance. Use the {extension id} syntax in AD_Form.ClassName to reference the extension that will provide the FormPanel instance ( replace {extension id} with your actual extension id ). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Implementation class name for the org.compiere.apps.form.FormPanel interface - - - - - - - - - - numeric priority value, higher value is of higher priority - - - - - - - - - - - - 1.0.0 - - - - - - - - - <pre> -<extension - id="org.adempiere.extend.myForm" - name="My Form" - point="org.adempiere.apps.Form"> - <process - class="org.adempiere.ui.swing.extend.MyForm"> - </process> -</extension> - -AD_Form.ClassName="org.adempiere.extend.myForm" -</pre> - - - - - - - - - The class attribute must represent an implementor of org.compiere.apps.form.FormPanel - - - - - - - - - - This file is part of Adempiere ERP Bazaar http://www.adempiere.org. - - Copyright (C) Heng Sin Low. - Copyright (C) Contributors. - - This program is free software; you can redistribute it and/or modify it - under the terms version 2 of the GNU General Public License as published - by the Free Software Foundation. This program is distributed in the hope - that it will be useful, but WITHOUT ANY WARRANTY; without even the implied - warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - - - - diff --git a/org.adempiere.ui.swing/src/de/schaeffer/compiere/tools/DocumentSearch.java b/org.adempiere.ui.swing/src/de/schaeffer/compiere/tools/DocumentSearch.java deleted file mode 100644 index 5d84e6645f..0000000000 --- a/org.adempiere.ui.swing/src/de/schaeffer/compiere/tools/DocumentSearch.java +++ /dev/null @@ -1,62 +0,0 @@ -/********************************************************************** -* This file is part of Adempiere ERP Bazaar * -* http://www.adempiere.org * -* * -* Copyright (C) Jan Roessler - Schaeffer * -* Copyright (C) Contributors * -* * -* This program is free software; you can redistribute it and/or * -* modify it under the terms of the GNU General Public License * -* as published by the Free Software Foundation; either version 2 * -* of the License, or (at your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License for more details. * -* * -* You should have received a copy of the GNU General Public License * -* along with this program; if not, write to the Free Software * -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * -* MA 02110-1301, USA. * -* * -* Contributors: * -* - Jan Roessler * -* - Heng Sin Low * -* * -* Sponsors: * -* - Schaeffer * -**********************************************************************/ - -package de.schaeffer.compiere.tools; - -import org.adempiere.util.AbstractDocumentSearch; -import org.compiere.apps.AEnv; -import org.compiere.apps.AWindow; -import org.compiere.model.MQuery; -import org.compiere.util.CLogger; - -/** - * Executes search and opens windows for defined transaction codes - * - * @author Jan Roessler, jr@schaeffer-ag.de - * - */ -public class DocumentSearch extends AbstractDocumentSearch { - - /** the logger */ - @SuppressWarnings("unused") - private static CLogger log = CLogger.getCLogger(DocumentSearch.class); - - @Override - protected boolean openWindow(int windowId, MQuery query) { - final AWindow frame = new AWindow(null); - AEnv.addToWindowManager(frame); - if (frame.initWindow(windowId, query)) { - frame.pack(); - AEnv.showCenterScreen(frame); - } - return true; - } - -} diff --git a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/FCHtmlEditorKit.java b/org.adempiere.ui.swing/src/org/adempiere/apps/graph/FCHtmlEditorKit.java deleted file mode 100644 index 643f506906..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/FCHtmlEditorKit.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.adempiere.apps.graph; - -import java.awt.Image; -import java.awt.Toolkit; -import java.net.URL; - -import javax.swing.ImageIcon; -import javax.swing.text.Element; -import javax.swing.text.View; -import javax.swing.text.ViewFactory; -import javax.swing.text.html.HTML; -import javax.swing.text.html.HTMLEditorKit; -import javax.swing.text.html.ImageView; - -public class FCHtmlEditorKit extends HTMLEditorKit { - /** - * - */ - private static final long serialVersionUID = -3371176452691681668L; - - public ViewFactory getViewFactory() { - if (defaultFactory == null) { - defaultFactory = new FCHtmlFactory(super.getViewFactory()); - } - return defaultFactory; - } - - private static class FCHtmlFactory implements ViewFactory { - public FCHtmlFactory(ViewFactory factory) { - oldFactory = factory; - } - public View create(Element elem) { - View result; - result = oldFactory.create(elem); - if (result instanceof ImageView) { - String src = (String)elem.getAttributes(). - getAttribute(HTML.Attribute.SRC); - if ("res:".equals(src.substring(0, 4))) { - result = new NewImageView(elem); - } - } - return result; - } - private static class NewImageView extends ImageView { - Element elem; - public NewImageView(Element elem) { - super(elem); - this.elem=elem; - } - public Image getImage() { - //return smile image - //java.awt.Toolkit.getDefaultToolkit().getImage(getImageURL()).flush(); - //if (smileImage == null) { - String src = (String)elem.getAttributes(). - getAttribute(HTML.Attribute.SRC); - //System.out.println("img load: " + src.substring(4)); - URL url = getClass().getClassLoader(). - getResource(src.substring(4)); - //getResource("at/freecom/apps/images/freecom.gif"); - //getResource("javax/swing/text/html/icons/image-delayed.gif"); - if (url == null) return null; - smileImage = Toolkit.getDefaultToolkit().getImage(url); - if (smileImage==null) return null; - //forcing image to load synchronously - ImageIcon ii = new ImageIcon(); - ii.setImage(smileImage); - //} - return smileImage; - } - public URL getImageURL() { - // here we return url to some image. It might be any - // existing image. we need to move ImageView to the - // state where it thinks that image was loaded. - // ImageView is calling getImage to get image for - // measurement and painting when image was loaded - /*if (false) { - return getClass().getClassLoader(). - getResource("javax/swing/text/html/icons/image-delayed.gif"); - } else {*/ - String src = (String)elem.getAttributes(). - getAttribute(HTML.Attribute.SRC); - //System.out.println("img load: " + src.substring(4)); - URL url = getClass().getClassLoader(). - getResource(src.substring(4)); - if (url != null) { - // System.out.println("load image: " + url); - return url; - } - //} - return null; - } - private static Image smileImage = null; - } - - private ViewFactory oldFactory; - } - private static ViewFactory defaultFactory = null; -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/Graph.java b/org.adempiere.ui.swing/src/org/adempiere/apps/graph/Graph.java deleted file mode 100644 index db561fbcdd..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/Graph.java +++ /dev/null @@ -1,313 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.adempiere.apps.graph; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Point; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.beans.VetoableChangeListener; -import java.util.ArrayList; - -import org.compiere.apps.AEnv; -import org.compiere.grid.ed.VLookup; -import org.compiere.model.MGoal; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MLookupInfo; -import org.compiere.model.MQuery; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.jfree.chart.ChartMouseEvent; -import org.jfree.chart.ChartMouseListener; -import org.jfree.chart.ChartPanel; -import org.jfree.chart.JFreeChart; -import org.jfree.chart.entity.CategoryItemEntity; -import org.jfree.chart.entity.ChartEntity; -import org.jfree.chart.entity.PieSectionEntity; - -/** - * Graph - * - * @author Jorg Janke - * @version $Id: BarGraph.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - * - * @author Teo Sarca, www.arhipac.ro - *
  • BF [ 2507325 ] BarGraph zoom not working - * @author hengsin - *
  • Add support for other type of graph - */ -public class Graph extends CPanel implements ChartMouseListener -{ - /** - * - */ - private static final long serialVersionUID = -4150122585550132822L; - - /** - * Constructor - */ - public Graph() - { - super(); - this.setLayout(new BorderLayout()); - builder = new GraphBuilder(); - } // BarGraph - - /** - * Constructor - * @param goal goal - */ - public Graph(MGoal goal) - { - this(goal, false); - } - - /** - * Constructor - * @param goal goal - */ - public Graph(MGoal goal, boolean userSelection) - { - this(); - builder = new GraphBuilder(); - builder.setMGoal(goal); - builder.setYAxisLabel(goal.getName()); - builder.setXAxisLabel(goal.getXAxisText()); - m_userSelection = userSelection; - loadData(); - //addComponentListener(this); - } // BarGraph - - - /** Graph Size */ - //private Dimension m_size = null; - /** Zero/Zero Coordinate point */ - private Point m_point0_0 = null; -// /** Layout */ -// private BarGraphLayout m_layout = new BarGraphLayout(this); - - /** Logger */ - private static CLogger log = CLogger.getCLogger (Graph.class); - - - /** Y Axis Target Line */ - @SuppressWarnings("unused") - private double m_Y_Target = 0; - /** Y Axis Target Line Label */ - private String m_Y_TargetLabel = null; - private static Dimension paneldimension = new Dimension(180, 150); - - private GraphBuilder builder; - - /** - * Load Performance Data - */ - ArrayList list = new ArrayList(); - private boolean m_userSelection; - - - private void loadData() - { - - list = builder.loadData(); - JFreeChart chart = builder.createChart(builder.getMGoal().getChartType()); - if (chartPanel != null) - remove(chartPanel); - - chartPanel = new ChartPanel(chart); - chartPanel.setSize(getSize()); - chartPanel.addChartMouseListener(this); - add(chartPanel,BorderLayout.CENTER); - - if (m_userSelection) - { - int AD_Reference_Value_ID = DB.getSQLValue(null, "SELECT AD_Reference_ID FROM AD_Reference WHERE Name = ?", "PA_Goal ChartType"); - MLookupInfo info = MLookupFactory.getLookup_List(Env.getLanguage(Env.getCtx()), AD_Reference_Value_ID); - MLookup mLookup = new MLookup(info, 0); - VLookup lookup = new VLookup("ChartType", false, false, true, - mLookup); - lookup.addVetoableChangeListener(new VetoableChangeListener() { - - public void vetoableChange(PropertyChangeEvent evt) - throws PropertyVetoException { - Object value = evt.getNewValue(); - if (value == null) return; - JFreeChart chart = null; - chart = builder.createChart(value.toString()); - - if (chart != null) - { - if (chartPanel != null) - remove(chartPanel); - - chartPanel = new ChartPanel(chart); - chartPanel.setSize(getSize()); - chartPanel.addChartMouseListener(Graph.this); - add(chartPanel,BorderLayout.CENTER); - getParent().validate(); - - } - } - - }); - add(lookup, BorderLayout.NORTH); - } - this.setMinimumSize(paneldimension); - } // loadData - - private ChartPanel chartPanel; - /** - * Get Point 0_0 - * @return point - */ - public Point getPoint0_0() - { - return m_point0_0; - } // getPoint0_0 - - - /** - * @return Returns the x_AxisLabel. - */ - public String getX_AxisLabel () - { - return builder.getXAxisLabel(); - } // getX_AxisLabel - - /** - * @param axisLabel The x_AxisLabel to set. - */ - public void setX_AxisLabel (String axisLabel) - { - builder.setXAxisLabel(axisLabel); - } // setX_AxisLabel - - /** - * @return Returns the y_AxisLabel. - */ - public String getY_AxisLabel () - { - return builder.getYAxisLabel(); - } // getY_AxisLabel - - /** - * @param axisLabel The y_AxisLabel to set. - */ - public void setY_AxisLabel (String axisLabel) - { - builder.setYAxisLabel(axisLabel); - } // setY_AxisLabel - - /** - * @return Returns the y_TargetLabel. - */ - public String getY_TargetLabel () - { - return m_Y_TargetLabel; - } // getY_TargetLabel - - /** - * @param targetLabel The y_TargetLabel to set. - */ - public void setY_TargetLabel (String targetLabel, double target) - { - m_Y_TargetLabel = targetLabel; - m_Y_Target = target; - } // setY_TargetLabel - - - /** - * Get BarGraphColumn for ChartEntity - * @param event - * @return BarGraphColumn or null if not found - */ - private GraphColumn getGraphColumn(ChartMouseEvent event) - { - ChartEntity entity = event.getEntity(); - String key = null; - if (entity instanceof CategoryItemEntity) - { - Comparable colKey = ((CategoryItemEntity)entity).getColumnKey(); - if (colKey != null) - { - key = colKey.toString(); - } - } - else if (entity instanceof PieSectionEntity) - { - Comparable sectionKey = ((PieSectionEntity)entity).getSectionKey(); - if (sectionKey != null) - { - key = sectionKey.toString(); - } - } - if (key == null) - { - return null; - } - for (int i = 0; i < list.size(); i++) - { - final String label = list.get(i).getLabel(); - if (key.equals(label)) - { - return list.get(i); - } - } - // - return null; - } - - public void chartMouseClicked(ChartMouseEvent event) - { - if ((event.getEntity()!=null) && (event.getTrigger().getClickCount() > 1)) - { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - try - { - GraphColumn bgc = getGraphColumn(event); - if (bgc == null) - { - return; - } - - MQuery query = bgc.getMQuery(builder.getMGoal()); - if (query != null) - AEnv.zoom(query); - else - log.warning("Nothing to zoom to - " + bgc); - } - finally - { - setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - } - } - } - - public void chartMouseMoved(ChartMouseEvent event) - { - } - - public GraphColumn[] getGraphColumnList() - { - return list.toArray(new GraphColumn[list.size()]); - } -} // BarGraph diff --git a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/GraphUtil.java b/org.adempiere.ui.swing/src/org/adempiere/apps/graph/GraphUtil.java deleted file mode 100644 index c9830b23b6..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/GraphUtil.java +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.adempiere.apps.graph; - -import java.awt.Color; -import java.util.ArrayList; - -import org.compiere.util.CLogger; - -/** - * Graphic Utilities - * - * @author Jorg Janke - * @version $Id: GraphUtil.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $ - */ -public class GraphUtil -{ - /** Logger */ - @SuppressWarnings("unused") - private static CLogger log = CLogger.getCLogger (GraphUtil.class); - - /** - * Get Foreground for back - * @param background back - * @return while or black - */ - public static Color getForeground (Color background) - { - if (background != null && isDark(background)) - return Color.white; - return Color.black; - } // getForeground - - /** - * Get Column Background - * @param index index - * @return random color - */ - public static Color getBackground (int index) - { - while (s_colors.size() <= index) - { - int rr = (index+1) * 47; - int gg = 100; - while (rr > 255) - { - rr -= 255; - gg += 50; - } - while (gg > 255) - gg -= 255; - s_colors.add(new Color(255-rr, gg, rr)); - } - return s_colors.get(index); - } // getBackGround - - /** List of Colors */ - private static ArrayList s_colors = new ArrayList(); - - - /** - * Is the Color dark? - * @param color color - * @return true if dark - */ - public static boolean isDark (Color color) - { - float r = color.getRed() / 255.0f; - float g = color.getGreen() / 255.0f; - float b = color.getBlue() / 255.0f; - double whiteDistance = colorDistance (r, g, b, 1.0, 1.0, 1.0); - double blackDistance = colorDistance (r, g, b, 0.0, 0.0, 0.0); - boolean dark = blackDistance < whiteDistance; - if (r+g+b == 1.0) - dark = false; - // log.info("r=" + r + ",g=" + g + ",b=" + b + " - black=" + blackDistance - // + (dark ? " ") + "white=" + whiteDistance - // + " - Alpha=" + color.getAlpha() + ", Trans=" + color.getTransparency()); - return dark; - } // isDark - - /** - * Is Color more white or black? - * @param r red - * @param g green - * @param b blue - * @return true if dark - */ - public static boolean isDark (double r, double g, double b) - { - double whiteDistance = colorDistance (r, g, b, 1.0, 1.0, 1.0); - double blackDistance = colorDistance (r, g, b, 0.0, 0.0, 0.0); - boolean dark = blackDistance < whiteDistance; - // log.finest("r=" + r + ",g=" + g + ",b=" + b + " - white=" + whiteDistance + ",black=" + blackDistance); - return dark; - } // isDark - - /** - * Simple Color Distance. - * (3d point distance) - * @param r1 first red - * @param g1 first green - * @param b1 first blue - * @param r2 second red - * @param g2 second green - * @param b2 second blue - * @return 3d distance for relative comparison - */ - public static double colorDistance (double r1, double g1, double b1, - double r2, double g2, double b2) - { - double a = (r2 - r1) + 0.1; - double b = (g2 - g1) + 0.1; - double c = (b2 - b1) + 0.1; - return Math.sqrt (a*a + b*b + c*c); - } // colorDistance - - - /** - * Get darker color - * @param color color - * @param factor factor 0..1 (AWT 0.7) the smaller, the darker - * @return darker color - */ - public static Color darker(Color color, double factor) - { - if (factor < 0.0) - factor = 0.7; - else if (factor > 1.0) - factor = 0.7; - return new Color( - Math.max((int)(color.getRed() * factor), 0), - Math.max((int)(color.getGreen() * factor), 0), - Math.max((int)(color.getBlue() * factor), 0)); - } // darker - - /** - * Get brighter color - * @param color color - * @param factor factor 0..1 (AWT 0.7) the smaller, the lighter - * @return brighter color - */ - public static Color brighter (Color color, double factor) - { - if (factor < 0.0) - factor = 0.7; - else if (factor > 1.0) - factor = 0.7; - - return new Color( - Math.min((int)(color.getRed() / factor), 255), - Math.min((int)(color.getGreen() / factor), 255), - Math.min((int)(color.getBlue() / factor), 255)); - } // brighter - -} // GraphUtil diff --git a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/HtmlDashboard.java b/org.adempiere.ui.swing/src/org/adempiere/apps/graph/HtmlDashboard.java deleted file mode 100644 index 7126843026..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/HtmlDashboard.java +++ /dev/null @@ -1,504 +0,0 @@ -/** - * - */ -package org.adempiere.apps.graph; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Container; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.JEditorPane; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.SwingUtilities; -import javax.swing.event.HyperlinkEvent; -import javax.swing.event.HyperlinkListener; -import javax.swing.text.Document; - -import org.compiere.apps.AEnv; -import org.compiere.apps.AWindow; -import org.compiere.model.MAchievement; -import org.compiere.model.MDashboardContent; -import org.compiere.model.MDashboardPreference; -import org.compiere.model.MGoal; -import org.compiere.model.MMeasureCalc; -import org.compiere.model.MProjectType; -import org.compiere.model.MQuery; -import org.compiere.model.MRequestType; -import org.compiere.model.MRole; -import org.compiere.swing.CMenuItem; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Ini; -import org.compiere.util.Msg; -import org.compiere.util.Util; - -/** - * @author fcsku - * - */ -public class HtmlDashboard extends JPanel implements MouseListener, - ActionListener, HyperlinkListener { - - /** - * - */ - private static final long serialVersionUID = 8125801717324723271L; - private static Dimension paneldimensionMin = new Dimension(80, 80); - private JEditorPane html; - private enum PAGE_TYPE {PAGE_HOME, PAGE_PERFORMANCE, PAGE_LOGO}; - private static CLogger log = CLogger.getCLogger (HtmlDashboard.class); - MGoal[] m_goals = null; - JPopupMenu popupMenu = new JPopupMenu(); - private CMenuItem mRefresh = new CMenuItem(Msg.getMsg(Env.getCtx(), "Refresh"), Env.getImageIcon("Refresh16.gif")); - URL lastUrl = null; - - - /** - * Constructor - */ - public HtmlDashboard(String url, MGoal[] m_goals, boolean scrolling) - { - super(); - //+param VTreePanel treePanel, - //this.treePanel = treePanel; - setName("test title"); - this.setLayout( new BorderLayout() ); - this.m_goals = m_goals; - // Create an HTML viewer - JEditorPane.registerEditorKitForContentType("text/html", "org.adempiere.apps.graph.FCHtmlEditorKit"); - html = new JEditorPane(); - html.setContentType("text/html"); - html.setEditable( false ); - htmlUpdate(url); - JScrollPane scrollPane = null; - if (scrolling) - scrollPane = new JScrollPane(); - else - scrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_NEVER, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); - scrollPane.getViewport().add( html, BorderLayout.CENTER ); - this.add( scrollPane, BorderLayout.CENTER ); - this.setMinimumSize(paneldimensionMin); - addMouseListener(this); - html.addHyperlinkListener( this ); - mRefresh.addActionListener(this); - popupMenu.add(mRefresh); - html.addMouseListener(this); - html.setBackground(getBackground()); - } - - public HtmlDashboard(String url) - { - new HtmlDashboard(url, null, true); - } - - private String createHTML(PAGE_TYPE requestPage){ - - StringBuilder result = new StringBuilder(""); - - // READ CSS - URL url = getClass().getClassLoader(). - getResource("org/compiere/css/PAPanel.css"); - InputStreamReader ins; - BufferedReader bufferedReader = null; - try { - ins = new InputStreamReader(url.openStream()); - bufferedReader = new BufferedReader( ins ); - String cssLine; - result.append(""); - } catch (IOException e1) { - log.log(Level.SEVERE, e1.getLocalizedMessage(), e1); - } - finally{ - if (bufferedReader != null) { - try { - bufferedReader.close(); - } catch (Exception e) {} - bufferedReader = null; - } - } - //System.out.println(result); - switch (requestPage) { - case PAGE_LOGO: - - result.append("") - .append("
    ") - .append("") - .append("") - .append("
    ") - .append(""); - break; - - case PAGE_HOME: //************************************************************** - - result.append("
    \n");// "" - queryZoom = null; - queryZoom = new ArrayList(); - String appendToHome = null; - try - { - int AD_User_ID = Env.getAD_User_ID(Env.getCtx()); - int AD_Role_ID = Env.getAD_Role_ID(Env.getCtx()); - - MDashboardPreference[] dps = MDashboardPreference.getForSession(AD_User_ID, AD_Role_ID); - if (dps.length == 0) - createDashboardPreference(); - - dps = MDashboardPreference.getForSession(true, AD_User_ID, AD_Role_ID); // based on user and role - - for (final MDashboardPreference dp : dps) - { - MDashboardContent dc = new MDashboardContent(dp.getCtx(), dp.getPA_DashboardContent_ID(), dp.get_TrxName()); - - if (!Util.isEmpty(dc.getZulFilePath(), true)) - continue; - // - appendToHome = dc.get_Translation(MDashboardContent.COLUMNNAME_HTML); - String descriptionTrl = dp.get_Translation(MDashboardContent.COLUMNNAME_Description); - if (appendToHome != null) { - if (descriptionTrl != null) - result.append("

    ").append(descriptionTrl).append("

    \n"); - result.append(stripHtml(appendToHome, false)).append("
    \n"); - } - - if (dc.getAD_Menu_ID() > 0) { - result.append(""); - result.append(descriptionTrl.toString()); - result.append("
    \n"); - - } - result.append("
    \n"); - //result += "table id: " + rs.getInt("AD_TABLE_ID"); - if (dc.getPA_Goal_ID() > 0) - result.append(goalsDetail(dc.getPA_Goal_ID())); - } - } - catch (Exception e) - { - log.log(Level.SEVERE, e.getLocalizedMessage(), e); - } - finally - { - } - result.append("


    \n") - .append("
    \n\n\n"); - break; - default: //************************************************************** - log.warning("Unknown option - "+requestPage); - } - return result.toString(); - } - - private void createDashboardPreference() - { - if (Env.getAD_User_ID(Env.getCtx()) == 0 && Env.getAD_Role_ID(Env.getCtx()) == 0) - return; - - MDashboardContent[] dcs = MDashboardContent.getForSession(0, 0); - for (MDashboardContent dc : dcs) - { - MDashboardPreference preference = new MDashboardPreference(Env.getCtx(), 0, null); - preference.setAD_Org_ID(Env.getAD_Org_ID(Env.getCtx())); - preference.setAD_Role_ID(Env.getAD_Role_ID(Env.getCtx())); - preference.setAD_User_ID(Env.getAD_User_ID(Env.getCtx())); - preference.setColumnNo(dc.getColumnNo()); - preference.setIsCollapsedByDefault(dc.isCollapsedByDefault()); - preference.setIsShowInDashboard(dc.isShowInDashboard()); - preference.setLine(dc.getLine()); - preference.setPA_DashboardContent_ID(dc.getPA_DashboardContent_ID()); - - if (!preference.save()){ - StringBuilder msglog = new StringBuilder("Failed to create dashboard preference ").append(preference.toString()); - log.log(Level.SEVERE, msglog.toString()); - } - } - } - - ArrayList queryZoom = null; //new ArrayList(); - - private String goalsDetail(int AD_Table_ID) { //TODO link to goals - StringBuilder output = new StringBuilder(); - if (m_goals==null) return output.toString(); - for (int i = 0; i < m_goals.length; i++) { - MMeasureCalc mc = MMeasureCalc.get(Env.getCtx(), m_goals[i].getMeasure().getPA_MeasureCalc_ID()); - if (AD_Table_ID == m_goals[i].getPA_Goal_ID()){// mc.getAD_Table_ID()) { - output.append("\n\n"); - output.append("\n"); - output.append("\n"); - - //if (mc.getTableName()!=null) output += "table: " + mc.getAD_Table_ID() + "
    \n"; - Graph barPanel = new Graph(m_goals[i]); - GraphColumn[] bList = barPanel.getGraphColumnList(); - MQuery query = null; - output.append("\n"); - for (int k=0; k0) output.append(""); - if (bgc.getAchievement() != null) // Single Achievement - { - MAchievement a = bgc.getAchievement(); - query = MQuery.getEqualQuery("PA_Measure_ID", a.getPA_Measure_ID()); - } - else if (bgc.getGoal() != null) // Multiple Achievements - { - MGoal goal = bgc.getGoal(); - query = MQuery.getEqualQuery("PA_Measure_ID", goal.getPA_Measure_ID()); - } - else if (bgc.getMeasureCalc() != null) // Document - { - mc = bgc.getMeasureCalc(); - query = mc.getQuery(m_goals[i].getRestrictions(false), - bgc.getMeasureDisplay(), bgc.getDate(), - MRole.getDefault()); // logged in role - } - else if (bgc.getProjectType() != null) // Document - { - MProjectType pt = bgc.getProjectType(); - query = pt.getQuery(m_goals[i].getRestrictions(false), - bgc.getMeasureDisplay(), bgc.getDate(), bgc.getID(), - MRole.getDefault()); // logged in role - } - else if (bgc.getRequestType() != null) // Document - { - MRequestType rt = bgc.getRequestType(); - query = rt.getQuery(m_goals[i].getRestrictions(false), - bgc.getMeasureDisplay(), bgc.getDate(), bgc.getID(), - MRole.getDefault()); // logged in role - } - output.append(""); - } - output.append("") - .append("") - .append("
    ").append(m_goals[i].getName()).append("
    Target").append(m_goals[i].getMeasureTarget()).append("
    Actual").append(m_goals[i].getMeasureActual()).append("
    ").append(m_goals[i].getXAxisText()).append("
    ").append(bgc.getLabel()).append(""); - if (query != null) { - output.append("") - .append(bgc.getValue()) - .append("
    \n"); - queryZoom.add(query); - } - else { - if (log.isLoggable(Level.INFO)) log.info("Nothing to zoom to - " + bgc); - output.append(bgc.getValue()); - } - output.append("
    ") - .append(m_goals[i].getDescription()) - .append("
    ") - .append(stripHtml(m_goals[i].getColorSchema().getDescription(), true)) - .append("
    \n"); - bList = null; - barPanel = null; - } - } - return output.toString(); - } - - private String stripHtml(String htmlString, boolean all) { - htmlString = htmlString - .replace("", "") - .replace("", "") - .replace("", "") - .replace("", "") - .replace("", "") - .replace("", ""); - - if (all) - htmlString = htmlString - .replace(">", ">") - .replace("<", "<"); - return htmlString; - } - private void htmlUpdate(String url) { - try { - htmlUpdate( new URL( url ) ); - } catch( MalformedURLException e ) { - log.warning("Malformed URL: " + e ); - } - } - - private void htmlUpdate(URL url) { - if ((url==null) || (url.getPath().equals("/local/home"))){ - html.setText(createHTML(PAGE_TYPE.PAGE_HOME)); - html.setCaretPosition(0); - lastUrl = url; - } - else if (url.getPath().equals("/local/logo")){ - html.setText(createHTML(PAGE_TYPE.PAGE_LOGO)); - html.setCaretPosition(0); - lastUrl = url; - } - else if (url.getPath().equals("/local/performance")){ - html.setText(createHTML(PAGE_TYPE.PAGE_PERFORMANCE)); - } - else if (url.getPath().equals("/window/node")){ - /* fcsku 3.7.07 - CButton button = new CButton(""); // Create the button - button.setActionCommand(String.valueOf(url.getRef())); //getNode_ID() - button.addActionListener(treePanel); //VTreePanel - //AEnv.zoom(130, 0); - html.setCursor(Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR )); - button.doClick(); - html.setCursor(Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR )); - */ - int AD_Window_ID=Integer.parseInt(url.getRef()); - AWindow frame = new AWindow(getGraphicsConfiguration()); - if (!frame.initWindow(AD_Window_ID, null))//MQuery.getEqualQuery(TableName + "_ID", Record_ID))) - return; - AEnv.addToWindowManager(frame); - if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED)) - { - AEnv.showMaximized(frame); - } - else - { - AEnv.showCenterScreen(frame); - } - frame = null; - html.setCursor(Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR )); - } - else if (url.getPath().equals("/window/zoom")){ - int index = Integer.parseInt(String.valueOf(url.getRef())); - if ((index >= 0) && (index < queryZoom.size())) { - html.setCursor(Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR )); - AEnv.zoom(queryZoom.get(index)); - html.setCursor(Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR )); - } - } - else if (url != null){ - // Load some cursors - Cursor cursor = html.getCursor(); - html.setCursor( Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ) ); - SwingUtilities.invokeLater( new PageLoader( html, url, cursor ) ); - lastUrl = url; - } - } - - - public void hyperlinkUpdate( HyperlinkEvent event ) - { - if( event.getEventType() == HyperlinkEvent.EventType.ACTIVATED ) - { - //System.out.println("parsed url: " + event.getURL());// +" from: " +event.getDescription()); - htmlUpdate(event.getURL()); - } - } - - /* (non-Javadoc) - * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent) - */ - public void mouseClicked(MouseEvent e) { - if (SwingUtilities.isRightMouseButton(e)) - popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - } - - /* (non-Javadoc) - * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent) - */ - public void mouseEntered(MouseEvent e) { - } - - /* (non-Javadoc) - * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent) - */ - public void mouseExited(MouseEvent e) { - } - - /* (non-Javadoc) - * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent) - */ - public void mousePressed(MouseEvent e) { - } - - /* (non-Javadoc) - * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent) - */ - public void mouseReleased(MouseEvent e) { - } - - /* (non-Javadoc) - * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) - */ - public void actionPerformed(ActionEvent e) { - if (e.getSource() == mRefresh) - { - if (m_goals != null) - for (int i=0; i < m_goals.length; i++) - m_goals[i].updateGoal(true); - htmlUpdate(lastUrl); - Container parent = getParent(); - if (parent != null) - parent.invalidate(); - invalidate(); - if (parent != null) - parent.repaint(); - else - repaint(); - } - } - - static class PageLoader implements Runnable - { - private JEditorPane html; - private URL url; - private Cursor cursor; - - PageLoader( JEditorPane html, URL url, Cursor cursor ) - { - this.html = html; - this.url = url; - this.cursor = cursor; - } - - public void run() - { - if( url == null ) - { - // restore the original cursor - html.setCursor( cursor ); - - // PENDING(prinz) remove this hack when - // automatic validation is activated. - Container parent = html.getParent(); - parent.repaint(); - } - else - { - Document doc = html.getDocument(); - try { - html.setPage( url ); - } - catch( IOException ioe ) - { - html.setDocument( doc ); - } - finally - { - // schedule the cursor to revert after - // the paint has happended. - url = null; - SwingUtilities.invokeLater( this ); - } - } - } - } -} diff --git a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/PAPanel.java b/org.adempiere.ui.swing/src/org/adempiere/apps/graph/PAPanel.java deleted file mode 100644 index 00505157b2..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/PAPanel.java +++ /dev/null @@ -1,185 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.adempiere.apps.graph; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.logging.Level; - -import javax.swing.Box; -import javax.swing.JScrollPane; -import javax.swing.ScrollPaneConstants; - -import org.compiere.model.MGoal; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.Env; - -/** - * Performance Analysis Panel. - * Key Performace Indicators - * - * @author Jorg Janke - * @version $Id: PAPanel.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class PAPanel extends CPanel implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 4937417260772233929L; - - /** - * Get Panel if User has Perfpormance Goals - * @return panel pr null - */ - public static PAPanel get() - { - int AD_User_ID = Env.getAD_User_ID(Env.getCtx()); - MGoal[] goals = MGoal.getUserGoals(Env.getCtx(), AD_User_ID); - if (goals.length == 0) - return null; - return new PAPanel(goals); - } // get - - - /************************************************************************** - * Constructor - * @param goals - */ - private PAPanel (MGoal[] goals) - { - super (); - m_goals = goals; - init(); - } // PAPanel - - /** Goals */ - private MGoal[] m_goals = null; - - /** Logger */ - private static CLogger log = CLogger.getCLogger (PAPanel.class); - - /** - * Static/Dynamic Init - */ - private void init() - { - /* BOXES: - * - * boxV Header - * ******** - * boxH - * - * boxH * * * - * * boxV1 * boxV2 * - * * * * - * - * boxV1 dial1 - * ******** - * dial2 - * - * boxV2 HTML - * ******** - * boxH1 - * - * boxH1 * * * - * * bar1 * bar2 * - * * * * - * - * - * V1 + HTML in scrollpane - */ - - this.setLayout(new BorderLayout()); - - // HEADER - Box boxV = Box.createVerticalBox(); - // DIALS/HTML+Bars - Box boxH = Box.createHorizontalBox(); - // DIALS - Box boxV1 = Box.createVerticalBox(); - // HTML/Bars - Box boxV2 = Box.createVerticalBox(); - // barChart - Box boxH1 = Box.createHorizontalBox(); - //boxH_V.setPreferredSize(new Dimension(180, 1500)); - //boxH1.setPreferredSize(new Dimension(400, 180)); - boxV2.setPreferredSize(new Dimension(120, 120)); - - // DIALS below HEADER, LEFT - for (int i = 0; i < m_goals.length; i++) - { - PerformanceIndicator pi = new PerformanceIndicator(m_goals[i]); - pi.addActionListener(this); - boxV1.add (pi, BorderLayout.NORTH); - } - boxV1.add(Box.createVerticalGlue(), BorderLayout.CENTER); - JScrollPane scrollPane = new JScrollPane(); - scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - scrollPane.getViewport().add(boxV1, BorderLayout.CENTER ); - scrollPane.setMinimumSize(new Dimension(190, 180)); - - // RIGHT, HTML + Bars - HtmlDashboard contentHtml = new HtmlDashboard("http:///local/home", m_goals, true); - boxV2.add(contentHtml, BorderLayout.CENTER); - - for (int i = 0; i < java.lang.Math.min(2, m_goals.length); i++) - { - if (m_goals[i].getMeasure() != null) //MGoal goal = pi.getGoal(); - boxH1.add ( new Graph(m_goals[i]), BorderLayout.SOUTH); - } - boxV2.add(boxH1, BorderLayout.SOUTH); - - // below HEADER - boxH.add(scrollPane, BorderLayout.WEST ); - boxH.add(Box.createHorizontalStrut(5)); //space - boxH.add(boxV2, BorderLayout.CENTER); - - // HEADER + below - HtmlDashboard t = new HtmlDashboard("http:///local/logo", null, false); - t.setMaximumSize(new Dimension(2000,80)); - //t.setPreferredSize(new Dimension(200,10)); - //t.setMaximumSize(new Dimension(2000,10)); - boxV.add(t, BorderLayout.NORTH); - boxV.add(Box.createVerticalStrut(5)); //space - boxV.add(boxH, BorderLayout.CENTER); - boxV.add(Box.createVerticalGlue()); - - // WINDOW - add(boxV, BorderLayout.CENTER); - } // init - - /** - * Action Listener for Drill Down - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (e.getSource() instanceof PerformanceIndicator) - { - PerformanceIndicator pi = (PerformanceIndicator)e.getSource(); - if (log.isLoggable(Level.INFO)) log.info(pi.getName()); - MGoal goal = pi.getGoal(); - if (goal.getMeasure() != null) - new PerformanceDetail(goal); - } - } // actionPerformed - -} // PAPanel diff --git a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/PerformanceDetail.java b/org.adempiere.ui.swing/src/org/adempiere/apps/graph/PerformanceDetail.java deleted file mode 100644 index 44bde9b2dc..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/PerformanceDetail.java +++ /dev/null @@ -1,83 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.adempiere.apps.graph; - -import java.awt.BorderLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import org.compiere.Adempiere; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.model.MGoal; -import org.compiere.swing.CFrame; - - -/** - * Performance Detail Frame. - * BarPanel for Drill-Down - * - * @author Jorg Janke - * @version $Id: PerformanceDetail.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class PerformanceDetail extends CFrame - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -5994488373513922522L; - - /** - * Constructor. - * Called from PAPanel, ViewPI (Performance Indicator) - * @param goal goal - */ - public PerformanceDetail (MGoal goal) - { - super (goal.getName()); - setIconImage(Adempiere.getImage16()); - barPanel = new Graph(goal, true); - init(); - AEnv.addToWindowManager(this); - AEnv.showCenterScreen(this); - } // PerformanceDetail - - Graph barPanel = null; - ConfirmPanel confirmPanel = new ConfirmPanel(); - - /** - * Static init - */ - private void init() - { - getContentPane().add(barPanel, BorderLayout.CENTER); - getContentPane().add(confirmPanel, BorderLayout.SOUTH); - confirmPanel.addActionListener(this); - } // init - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - dispose(); - } // actionPerformed - -} // PerformanceDetail diff --git a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/PerformanceIndicator.java b/org.adempiere.ui.swing/src/org/adempiere/apps/graph/PerformanceIndicator.java deleted file mode 100644 index eb7d8b2161..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/PerformanceIndicator.java +++ /dev/null @@ -1,363 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.adempiere.apps.graph; - -import java.awt.BasicStroke; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.text.DecimalFormat; - -import javax.swing.BorderFactory; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.SwingUtilities; -import javax.swing.border.BevelBorder; -import javax.swing.event.EventListenerList; - -import org.compiere.model.MColorSchema; -import org.compiere.model.MGoal; -import org.compiere.swing.CMenuItem; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.jfree.chart.ChartPanel; -import org.jfree.chart.JFreeChart; -import org.jfree.chart.plot.DialShape; -import org.jfree.chart.plot.MeterInterval; -import org.jfree.chart.plot.MeterPlot; -import org.jfree.data.Range; -import org.jfree.data.general.DefaultValueDataset; -import org.jfree.ui.RectangleInsets; - -/** - * Performance Indicator - * - * @author Jorg Janke - * @version $Id: PerformanceIndicator.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -//vpj-cd e-evolution public class PerformanceIndicator extends JComponent -public class PerformanceIndicator extends JPanel - implements MouseListener, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 2267850468607341211L; - - /** - * Constructor - * @param goal goal model - */ - public PerformanceIndicator(MGoal goal) - { - super(); - m_goal = goal; - setName(m_goal.getName()); - //vpj-cd e-evolution getPreferredSize(); // calculate size - init(); - // - setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED)); - setOpaque(true); - //vpj-cd e-evolution updateDisplay(); - - // - mRefresh.addActionListener(this); - popupMenu.add(mRefresh); - // - addMouseListener(this); - } // PerformanceIndicator - - private MGoal m_goal = null; - /** The Performance Name */ - private String m_text = null; - /** Performance Line */ - @SuppressWarnings("unused") - private double m_line = 0; - - /** Height */ - //private static double s_height = 45; - /** 100% width */ - private static double s_width100 = 150; - /** Max width */ - //private static double s_widthMax = 250; - /** Integer Number Format */ - private static DecimalFormat s_format = DisplayType.getNumberFormat(DisplayType.Integer); - - JPopupMenu popupMenu = new JPopupMenu(); - private CMenuItem mRefresh = new CMenuItem(Msg.getMsg(Env.getCtx(), "Refresh"), Env.getImageIcon("Refresh16.gif")); - - //Insert Pie Graph Kinamo (pelgrim) - //private static Color colorOK = Color.magenta; - //private static Color colorNotOK = Color.lightGray; - private static Dimension indicatordimension = new Dimension(170,120); - private static Dimension paneldimension = new Dimension(180, 150); - ChartPanel chartPanel; - //private static Dimension - - /** - * Get Goal - * @return goal - */ - public MGoal getGoal() - { - return m_goal; - } // getGoal - - - private JFreeChart createChart(){ - JFreeChart chart = null; - - // Set Text - StringBuilder text = new StringBuilder(m_goal.getName()); - if (m_goal.isTarget()) - text.append(": ").append(m_goal.getPercent()).append("%"); - else - text.append(": ").append(s_format.format(m_goal.getMeasureActual())); - - m_text = text.toString(); - - // ToolTip - text = new StringBuilder(); - if (m_goal.getDescription() != null) - text.append(m_goal.getDescription()).append(": "); - text.append(s_format.format(m_goal.getMeasureActual())); - if (m_goal.isTarget()) - text.append(" ").append(Msg.getMsg(Env.getCtx(), "of")).append(" ") - .append(s_format.format(m_goal.getMeasureTarget())); - setToolTipText(text.toString()); - // - //setBackground(m_goal.getColor()); - setForeground(GraphUtil.getForeground(getBackground())); - // Performance Line - int percent = m_goal.getPercent(); - if (percent > 100) // draw 100% line - m_line = s_width100; - else // draw Performance Line - m_line = s_width100 * m_goal.getGoalPerformanceDouble(); - - DefaultValueDataset data = new DefaultValueDataset((float)m_goal.getPercent()); - MeterPlot plot = new MeterPlot(data); - - MColorSchema colorSchema = m_goal.getColorSchema(); - int rangeLo = 0; int rangeHi=0; - for (int i=1; i<=4; i++){ - switch (i) { - case 1: rangeHi = colorSchema.getMark1Percent(); break; - case 2: rangeHi = colorSchema.getMark2Percent(); break; - case 3: rangeHi = colorSchema.getMark3Percent(); break; - case 4: rangeHi = colorSchema.getMark4Percent(); break; - } - if (rangeHi==9999) - rangeHi = (int) Math.floor(rangeLo*1.5); - if (rangeLo < rangeHi) { - plot.addInterval(new MeterInterval("Normal", //label - new Range(rangeLo, rangeHi), //range - colorSchema.getColor(rangeHi), - new BasicStroke(7.0f), - //Color.lightGray - new Color(-13091716) - //Color.gray - )); - rangeLo = rangeHi; - } - } - plot.setRange(new Range(0,rangeLo)); - - plot.setDialBackgroundPaint(new Color(-13091716));//Color.GRAY); - plot.setUnits(m_goal.getName()); - plot.setDialShape(DialShape.CHORD);//CIRCLE); - //plot.setDialBackgroundPaint(new GradientPaint(0, 0, m_goal.getColor(), 0, 1000, Color.black)); - plot.setNeedlePaint(Color.white); - plot.setTickSize(2000); - plot.setTickLabelFont(new Font("SansSerif", Font.BOLD, 12)); - plot.setTickLabelPaint(Color.white); - plot.setInsets(new RectangleInsets(1.0, 2.0, 3.0, 4.0)); - - chart = new JFreeChart( m_text, new Font("SansSerif", Font.BOLD, 15), plot,false); - - return chart; - } - /** - * Init Graph Display - * Kinamo (pelgrim) - */ - private void init() { - chartPanel = new ChartPanel(createChart(), //chart - false, //boolean properties - false, // boolean save - false, //boolean print - false, //boolean zoom - true //boolean tooltips - ); - chartPanel.setPreferredSize(indicatordimension); - - chartPanel.addChartMouseListener( new org.jfree.chart.ChartMouseListener() - { - public void chartMouseClicked(org.jfree.chart.ChartMouseEvent e) - { - //plot p = (MeterPlot) e.getSource(); - MouseEvent me = e.getTrigger(); - if (SwingUtilities.isLeftMouseButton(me) && me.getClickCount() > 1) - fireActionPerformed(me); - if (SwingUtilities.isRightMouseButton(me)) - popupMenu.show((Component)me.getSource(), me.getX(), me.getY()); - } - public void chartMouseMoved(org.jfree.chart.ChartMouseEvent e) - { - - } - }); - - this.add(chartPanel, BorderLayout.NORTH); - this.setMinimumSize(paneldimension); - this.setMaximumSize(paneldimension); - //--------------------------------------------- - - invalidate(); - } - - - /** - * Update Display Data - */ - protected void updateDisplay() - { - chartPanel.setChart(createChart()); - invalidate(); - - } // updateData - - /************************************************************************** - * Adds an ActionListener to the indicator. - * @param l the ActionListener to be added - */ - public void addActionListener(ActionListener l) - { - if (l != null) - listenerList.add(ActionListener.class, l); - } // addActionListener - - /** - * Removes an ActionListener from the indicator. - * @param l the listener to be removed - */ - public void removeActionListener(ActionListener l) - { - if (l != null) - listenerList.remove(ActionListener.class, l); - } // removeActionListener - - /** - * Returns an array of all the ActionListeners added - * to this indicator with addActionListener(). - * - * @return all of the ActionListeners added or an empty - * array if no listeners have been added - */ - public ActionListener[] getActionListeners() - { - return (ActionListener[])(listenerList.getListeners(ActionListener.class)); - } // getActionListeners - - /** - * Notifies all listeners that have registered interest for - * notification on this event type. The event instance - * is lazily created using the event - * parameter. - * - * @param event the ActionEvent object - * @see EventListenerList - */ - protected void fireActionPerformed(MouseEvent event) - { - // Guaranteed to return a non-null array - ActionListener[] listeners = getActionListeners(); - ActionEvent e = null; - // Process the listeners first to last - for (int i = 0; i < listeners.length; i++) - { - // Lazily create the event: - if (e == null) - e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, - "pi", event.getWhen(), event.getModifiersEx()); - listeners[i].actionPerformed(e); - } - } // fireActionPerformed - - - /************************************************************************** - * Mouse Clicked - * @param e mouse event - */ - public void mouseClicked (MouseEvent e) - { - if (SwingUtilities.isLeftMouseButton(e) && e.getClickCount() > 1) - fireActionPerformed(e); - if (SwingUtilities.isRightMouseButton(e)) - popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - } // mouseClicked - - public void mousePressed (MouseEvent e) - { - } - - public void mouseReleased (MouseEvent e) - { - } - - public void mouseEntered (MouseEvent e) - { - } - - public void mouseExited (MouseEvent e) - { - } - - /** - * Action Listener. - * Update Display - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (e.getSource() == mRefresh) - { - m_goal.updateGoal(true); - updateDisplay(); - // - Container parent = getParent(); - if (parent != null) - parent.invalidate(); - invalidate(); - if (parent != null) - parent.repaint(); - else - repaint(); - } - } // actionPerformed - - - -} // PerformanceIndicator diff --git a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/ViewPI.java b/org.adempiere.ui.swing/src/org/adempiere/apps/graph/ViewPI.java deleted file mode 100644 index 958fe5b9d1..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/ViewPI.java +++ /dev/null @@ -1,148 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.adempiere.apps.graph; - -import java.awt.BorderLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.logging.Level; - -import javax.swing.BoxLayout; - -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.form.FormFrame; -import org.compiere.apps.form.FormPanel; -import org.compiere.model.MGoal; -import org.compiere.swing.CPanel; -import org.compiere.swing.CScrollPane; -import org.compiere.util.CLogger; -import org.compiere.util.Env; - -/** - * View Performance Indicators - * - * @author Jorg Janke - * @version $Id: ViewPI.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class ViewPI extends CPanel -implements FormPanel, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 8022906851004145960L; - - - /** - * Init - * @param WindowNo - * @param frame - */ - public void init (int WindowNo, FormFrame frame) - { - log.fine(""); - m_WindowNo = WindowNo; - m_frame = frame; - try - { - // Top Selection Panel - // m_frame.getContentPane().add(selectionPanel, BorderLayout.NORTH); - // Center - initPanel(); - CScrollPane scroll = new CScrollPane (this); - m_frame.getContentPane().add(scroll, BorderLayout.CENTER); - // South - confirmPanel.addActionListener(this); - m_frame.getContentPane().add(confirmPanel, BorderLayout.SOUTH); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - } - sizeIt(); - } // init - - /** - * Size Window - */ - private void sizeIt() - { - // Frame - m_frame.pack(); - // Dimension size = m_frame.getPreferredSize(); - // size.width = WINDOW_WIDTH; - // m_frame.setSize(size); - } // size - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - removeAll(); - } // dispose - - /** Window No */ - @SuppressWarnings("unused") - private int m_WindowNo = 0; - /** FormFrame */ - private FormFrame m_frame; - /** Logger */ - private static CLogger log = CLogger.getCLogger (ViewPI.class); - /** Confirmation Panel */ - private ConfirmPanel confirmPanel = new ConfirmPanel(); - - - /** - * Init Panel - */ - private void initPanel() - { - @SuppressWarnings("unused") - BoxLayout layout = new BoxLayout(this, BoxLayout.PAGE_AXIS); - MGoal[] goals = MGoal.getGoals(Env.getCtx()); - for (int i = 0; i < goals.length; i++) - { - PerformanceIndicator pi = new PerformanceIndicator(goals[i]); - pi.addActionListener(this); - add (pi); - } - } // initPanel - - - /** - * Action Listener for Drill Down - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - dispose(); - else if (e.getSource() instanceof PerformanceIndicator) - { - PerformanceIndicator pi = (PerformanceIndicator)e.getSource(); - if (log.isLoggable(Level.INFO)) log.info(pi.getName()); - MGoal goal = pi.getGoal(); - if (goal.getMeasure() != null) - new PerformanceDetail(goal); - } - } // actionPerformed - -} // ViewPI diff --git a/org.adempiere.ui.swing/src/org/adempiere/client/Application.java b/org.adempiere.ui.swing/src/org/adempiere/client/Application.java deleted file mode 100644 index 951e3c24fc..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/client/Application.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.adempiere.client; - -import org.compiere.Adempiere; -import org.compiere.util.CLogger; -import org.eclipse.equinox.app.IApplication; -import org.eclipse.equinox.app.IApplicationContext; - -public class Application implements IApplication { - private static CLogger log = CLogger.getCLogger(Application.class); - - public Object start(IApplicationContext ctx) throws Exception { - log.info("Starting client"); - - // - Adempiere.startup(true); - org.compiere.AdempiereClient.main(new String[]{}); - return IApplication.EXIT_OK; - } - - public void stop() { - } - -} diff --git a/org.adempiere.ui.swing/src/org/adempiere/client/Client.java b/org.adempiere.ui.swing/src/org/adempiere/client/Client.java deleted file mode 100644 index 28ccc0ec37..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/client/Client.java +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** - * This file is part of Adempiere ERP Bazaar * - * http://www.adempiere.org * - * * - * Copyright (C) Jorg Viola * - * Copyright (C) Contributors * - * * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * * - * Contributors: * - * - Heng Sin Low * - *****************************************************************************/ -package org.adempiere.client; - -import java.util.List; - -import org.adempiere.base.Service; -import org.adempiere.ui.swing.factory.IFormFactory; -import org.compiere.apps.form.FormPanel; - -/** - * - * @author viola - * @author hengsin - */ -public class Client { - - /** - * @param formId - * @return new form instance - */ - public static FormPanel getFormPanel(String formId) { - List factories = Service.locator().list(IFormFactory.class).getServices(); - if (factories != null) { - for(IFormFactory factory : factories) { - FormPanel form = factory.newFormInstance(formId); - if (form != null) - return form; - } - } - return null; - } - -} diff --git a/org.adempiere.ui.swing/src/org/adempiere/client/ClientCredentialDialog.java b/org.adempiere.ui.swing/src/org/adempiere/client/ClientCredentialDialog.java deleted file mode 100644 index f1dd0ec164..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/client/ClientCredentialDialog.java +++ /dev/null @@ -1,222 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2010 Low Heng Sin All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.adempiere.client; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.Dialog; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.WindowEvent; -import java.util.ResourceBundle; - -import javax.swing.JPasswordField; -import javax.swing.SwingConstants; - -import org.compiere.Adempiere; -import org.compiere.apps.ConfirmPanel; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.Ini; - -/** - * - * @author hengsin - * - */ -public final class ClientCredentialDialog extends CDialog - implements ActionListener -{ - - /** - * generated serial version Id - */ - private static final long serialVersionUID = 2728290476926236505L; - - - /** - * Construct the dialog. - * Need to call initLogin for dynamic start - * @param parent parent - */ - public ClientCredentialDialog (Dialog parent) - { - super (parent, "Login", true); // Modal - log.finer(""); - setDefaultCloseOperation(DISPOSE_ON_CLOSE); - res = ResourceBundle.getBundle(RESOURCE); - // - try - { - jbInit(); - initLogin(); - } - catch(Exception e) - { - log.severe(e.toString()); - } - // Focus to OK - this.getRootPane().setDefaultButton(confirmPanel.getOKButton()); - parent.setIconImage(Adempiere.getImage16()); - } // ALogin - - - protected static final String RESOURCE = "org.compiere.apps.ALoginRes"; - private static ResourceBundle res = ResourceBundle.getBundle(RESOURCE); - /** Logger */ - private static CLogger log = CLogger.getCLogger(ClientCredentialDialog.class); - - private CPanel mainPanel = new CPanel(new BorderLayout()); - private CLabel userLabel = new CLabel(); - private CTextField userTextField = new CTextField(); - private CLabel passwordLabel = new CLabel(); - private JPasswordField passwordField = new JPasswordField(); - private GridBagLayout loginLayout = new GridBagLayout(); - private CPanel loginPanel = new CPanel(loginLayout); - private CPanel southPanel = new CPanel(); - private BorderLayout southLayout = new BorderLayout(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true, false, false, false, false, false, false); - /** Combo Active */ - private boolean m_okPressed = false; - - - /************************************************************************** - * Component initialization - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setName("Login"); - userLabel.setRequestFocusEnabled(false); - userLabel.setLabelFor(userTextField); - passwordLabel.setRequestFocusEnabled(false); - passwordLabel.setLabelFor(passwordField); - southPanel.setLayout(southLayout); - - userLabel.setHorizontalAlignment(SwingConstants.RIGHT); - userLabel.setText(res.getString("User")); - userLabel.setLabelFor(userTextField); - loginPanel.add(userLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); - userTextField.setText("System"); // default - loginPanel.add(userTextField, new GridBagConstraints(1, 3, 3, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 12), 0, 0)); - passwordLabel.setHorizontalAlignment(SwingConstants.RIGHT); - passwordLabel.setText(res.getString("Password")); - passwordLabel.setLabelFor(passwordField); - loginPanel.add(passwordLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - passwordField.setText("System"); // default - loginPanel.add(passwordField, new GridBagConstraints(1, 4, 3, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0)); - - // - this.getContentPane().add(mainPanel); - mainPanel.add(loginPanel, BorderLayout.CENTER); - mainPanel.setName("loginMainPanel"); - mainPanel.add(southPanel, BorderLayout.SOUTH); - // - southPanel.add(confirmPanel, BorderLayout.NORTH); - confirmPanel.addActionListener(this); - } // jbInit - - /** - * Set Initial & Ini Parameters - * Optional Automatic login - * @return true, if connected & parameters set - */ - public boolean initLogin() - { - // Application/PWD - userTextField.setText(Ini.getProperty(Ini.P_UID)); - if (Ini.isPropertyBool(Ini.P_STORE_PWD)) - passwordField.setText(Ini.getProperty(Ini.P_PWD)); - else - passwordField.setText(""); - - return false; - } // initLogin - - /** - * Window Events - requestFocus - * @param e event - */ - protected void processWindowEvent(WindowEvent e) - { - super.processWindowEvent(e); - if (e.getID() == WindowEvent.WINDOW_OPENED) - { - this.toFront(); - confirmPanel.getOKButton().requestFocusInWindow(); - } - } // processWindowEvent - - /************************************************************************* - * Exit action performed - */ - private void appExit() - { - dispose(); - } // appExit_actionPerformed - - - /** - * Did the user press OK - * @return true if user pressed final OK button - */ - public boolean isOKpressed() - { - return m_okPressed; - } // isOKpressed - - /************************************************************************** - * Action Event handler - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - m_okPressed = true; - appExit(); - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - m_okPressed = false; - appExit(); - } - } // actionPerformed - - /** - * @return user id - */ - public String getUserId() - { - return userTextField.getText(); - } - - /** - * @return password - */ - public char[] getPassword() - { - return passwordField.getPassword(); - } -} diff --git a/org.adempiere.ui.swing/src/org/adempiere/client/InfoManager.java b/org.adempiere.ui.swing/src/org/adempiere/client/InfoManager.java deleted file mode 100644 index eaa1eeac34..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/client/InfoManager.java +++ /dev/null @@ -1,91 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2010 Heng Sin Low * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.adempiere.client; - -import java.awt.Frame; -import java.util.List; - -import org.adempiere.base.Service; -import org.adempiere.ui.swing.factory.IInfoFactory; -import org.compiere.apps.search.Info; -import org.compiere.model.GridField; -import org.compiere.model.Lookup; - -/** - * - * @author hengsin - * - */ -public class InfoManager -{ - /** - * Factory Constructor - * @param frame parent frame - * @param modal new window is modal - * @param lookup Lookup - * @param field Grid field - * @param tableName table name of the search - * @param keyColumn key column of the search - * @param value query value - * @param multiSelection allow to select more than one row - * @param whereClause fully qualified where clause for the search - * @return special or general Info Window - */ - public static Info create(Frame frame, boolean modal, Lookup lookup, - GridField field, String tableName, String keyColumn, String queryValue, - boolean multiSelection, String whereClause) - { - Info info = null; - List factoryList = Service.locator().list(IInfoFactory.class).getServices(); - for(IInfoFactory factory : factoryList) - { - info = factory.create(frame, true, lookup, field, tableName, keyColumn, - queryValue, multiSelection, whereClause); - if (info != null) - break; - } - return info; - } - - /** - * Factory Constructor - * @param frame parent frame - * @param modal new window is modal - * @param WindowNo window no - * @param tableName table name of the search - * @param keyColumn key column of the search - * @param value query value - * @param multiSelection allow to select more than one row - * @param whereClause fully qualified where clause for the search - * @param lookup - * @return special or general Info Window - */ - public static Info create(Frame frame, boolean modal, int WindowNo, - String tableName, String keyColumn, String value, - boolean multiSelection, String whereClause, boolean lookup) - { - Info info = null; - - List factoryList = Service.locator().list(IInfoFactory.class).getServices(); - for(IInfoFactory factory : factoryList) - { - info = factory.create(frame, modal, WindowNo, tableName, keyColumn, value, - multiSelection, whereClause, lookup); - if (info != null) - break; - } - // - return info; - } -} diff --git a/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/document-print.png b/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/document-print.png deleted file mode 100644 index fdfe1c1c488aebff64e32b9dfa67236809aaa206..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 972 zcmV;-12g=IP)#@6#LbX#=3^@*OU|=_mBO zk$3;*-81i<-A{syPmGC($o<7NY3Ue|*@x@Wef^$vU%w}_57(uoV?^#Ru8D}q_{5kL zVi?8X4<4;^VQ7-!o;F5jm)!Ny*(HX1+PE+@$%9AhMJq1~K0g?7%Rl?ZQFlE*AMR=6 z{9vRgr{rlz(slU`O2KE{r|>9207U4z5-F6Ry|0Y#UTtTr?<5VOgZN8?x+*`l6+V0= zaI`u=Wau<^ueRsi&1W7(Uw?12yJ;A-HUzM@{-QRJ;nkOel>3D6vecVg8Zu(NS<;G>TLNF)*f96wfx&#Ri70O3A;qXf!I(XjB#!7NoDgS9Zy5BOYV=$De3zeT~Y> zD(2?qXliOgMBMYVZQHFvw4jXbzPNGYYnq!|_UibL$IC1)FB1#~nVFfPzP^rNFaRhF z!$3q(DhIMH%LRyNvRRW@EJikK?FB2P5D_j73}9MWY+G-`1f2FjL_5S>)}{VZY+F-S zR)%F20LSBT8XLnLezBVPMjQhWM?E5fX_@?;NRUjXFgyyS6iOMc-hHLs!YyrC7J?8A z2JrcPq|<2-uyrm&ZQGQWS0EyYw$YNSNJP+DBcjM;GOmpC;4i+P`mXczsdtD>-sZp9 zEAoelefl9_ssc|{8Bh*X0U_Wy;DGaK$43JRAPOu2t3cAZI(5-E u&*^s$;B`j7GtYx<=c-IOqs|F%+x`J%>$6PgXPm+S00003|zoo&0*WtZL7Wm!I!A_dx#R*N546CW@_G)8>T7t{CvHAq!b z1NtCF0vL;FY#&4)G>VeQiw|fFF*e4CG(l9XCA76R#n#=n({{gSXLo#PcWkLpO#CM| z=jNVs{`Y^+Ju_Ee0iJuK{rx`@m5;`zw2Fo6lFdl^T=Bk@@^5XOuYUF&w*jFz>H46p z_Uw=0i>o6Wv!RtfF`g5hRb@``&$z}^I?MFc^Fyg*#t~Nf+q+*o{qb_dmLlo-{=nH) zTOM!^5A@pyhlgz=zYmHd6O-6VD^Q$voZfZHbh=P>J?7lG>k-eTi{Jb@a4TXF;D>9@ z<9DpE4kre_y4vWy@N`edKJmU#@6O!J_1V$ED@JrSPCS`F@dc25LB}t#t)IU1`Yw4{ zVl^eLv*Z&q_pcv)=;({@eFAXo;74CJ1V@h~R8>gMPN8K|0QiFIMX#)lOlaZmWo!J@ zp%*?6J90nIs)fS~oeoLh+o=$%H`Omna;N*4_-mZX!t{-N?VWFTodB=`1k2)Iq$cg% z$Bw?aWakIlx|XbEJa;iV)We4-7wO>TLkEuoC(Kf$#_iV>x0h6E?zqWh(i|pP`k%SQ zW?vLHGCD#snZ)b$vj0G9t*IDT>-Pr$NF)=uWY@ncEy5@i0C?=kX>?8F%;7x%D2hTX z7K;Fv#rfFXbzAF6r_%@srqb$$9aJ~$pj`0+kj-Z1Y&y=m+Phg((*Qt;R06;~P4@z9 zHcJ6KTv=JQNY%T~H#6|l_W+EI4uN5i*K=gjN#Zjq07F-Ld1v2tGbb1f0lWer?my64 zD@i5T?RGpKj~Nv3hUjS7Mt^S)72Zk;hB03UgEF^=fy)=@XxT=nG6H}s%k$;%u>U}7 ztq4R``uqT>s){Vj$g+$miiE2+(7CtCBo_q%S9t{kmoLz{w~27o1~Xn&=T1>xRt^vm zfz5Yr+(a&yGptq%Gcz-&s){5@$g)gLq@Gi4&Gh&7;9e16xbG6D+M20})SHB=s*=y^ zBoYZ@?V7a!O=32i-QxHAak*TAuIDMt-*_=WRaGiV19UvwK!0x!Z#`2_MQOnF0p#;K z2%sp65Dcy&lgXA^9S+CtNF-vm%gvxDjeLEwaoOKxb#*mPr=!IR5R1i_oSeLQ-xe?K zHhf<1Tx%9T5HwB0GC5-yhuRaNo%d_<$sCALT` zF5FGmbu1POhG8HI7P8qanxb zl}&6^RTRg6=iT?(+9DstSfoY`im4JXMvW~67A|Z|XqAXTQDI?-F?M0n5koX#*QhK^ zGzv<k>HXb1}>wzY+7X<=sG+;{JBF>g9k+KL-)ayB>T{O1`;FK}qYG`#R+H-QL7 zB3?VtwRBGCi_t3!uU))j;?j84l`;+hR2_$Z+Xo1<^}IC`MQgT4hn6)q?RaVPo3&vO zUWvS%1-`zU31R;P|kM{|xz69M;Q&acOmX6N4`STX=%g9%tf?zoI$0wkYaut`x z-hWHSY_0Gl-lBmA2p891zx(O+&)4P|=hWEO7zq&!Xn^;EIsqlkw3w~)$xN_UkEej* zxbv>t{6qI_tsTn!%4qfsVG!Ze0S1745|hneB(aV_43ViOGSxV5XMz)NDQFgzgavhr zguoN~3*`BS#9I<;i3>S$`5d<3u(8L+ernD}Lhf#yu9u>uMe$-ue9ZA<1VjXi&dKP|xt#}k_vWr~4cxcn5vr=H zr+~&7Okgm^5J=fBKV^ZG6Oa>cyMrqp%MKp==!5q<*0Fi!jJUD$%f zC5m_D^(+lfL_}3}E^Ss1eC&U?vDt3w^L_hUnp^5yRz4A)80-UJPw%UFXNhKs8wMhv zkgi)%eHEfJK=kMLI(*@5@|3g3-xwV|zr1bj!&Ru_EMb37^1$RUe*4e=^TR3oy6ZH4EeN7uKo?3X5 zJY%zrr{&w!Vj!#O2S-+Sg<&c4cv9u}Bc8F-YSO!~1WhX_RpBchwm__^)1)VJ{Y*uq j1T+=!N~i}CodfVM;8DZ>6AAgs00000NkvXXu0mjf4yffW diff --git a/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/go-last.png b/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/go-last.png deleted file mode 100644 index 67884eacd6dea1736363f7cb76efef1141b244c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1043 zcmV+u1nm2XP)b zm0gHcRTze!Z>_!0pMS^3X~rppFtZ?UEQ~q@c2^gfph6IMQD_lC1m_t2Ty!A>IY}|m zMM`O2qz0x^X*L#!BW9>Y5|TE9BIc-PYI2UV=j^@K*Twmn-yX1k*Jqtr2N6oCzS?VpJ8cp6=hbHJ|;j zjAvx>yu5N_Zt3Dj)`;Oqp%~7YvT@8t2mlJjFhIDB(mKgzDjg+0&h!ra%$nsdWm@uW z4}SOKm%kK>;p07>aUX!9HPv_&9R&k{6?@y;>$YITV#Fe1Fk%47BtE8Gxy+5IOkv3r zVN1Ss!LCDFPZf&clRcgB@tRnV_nyY~ZRRB+IG@mSVGn^xVZ>s^fJn_Hj+mSL+JBgZ zcRV2LSC{hJ_jPp_isAFtSk!o&CaC(!89SdalH4SUhlt`KhT|ckxWY(Mp{m0q3^T$F ze!G5{Fb6L_^V*D-eCsDQVIE9^S2tcUfYXF(GECyDBtFKg!-yr9nMu}UYbr#+IL-|o zrG3UCo?HD&?%?Si-itF{s;Kz!U{&RxsLc6mCvloI7ZZUXZAhgp*<6lnI!ijt5QHg4 zXh#gpoi$H9RU*AX;zuS&5xZy{6hMq%tRNN~5fOt7ag~nQiD3^aE|qpY@)$t1j zLJ$bw^u13moWsK%tGIBfR}Xx9pi(~P)}7t!k3CijHY30&w+W6tzW?Jd-o3r{dUT{R zL3RC_VzwoFC(AlkaN^X__@|R6uJ?WKUikC0_5qoRuAAUv?Y02%8i|Z8^>{!AD+BEB-ZgUNV)@|d zZLUil)jF`zTL)`>RtKx9iiiUokN_4i2$6G1u=}fR(bc|6=b4>;e_cSMFRmA&hNl;o zaLEM4sv3*P*nEBTw+{G3k6k`r`RMFEe`-wrz7BUl?7S;~@ae{U^Gl&$Cf<1>Vt`aV zzp$>p=AZ^{*l)m-{9WSP?ib&3k7*o&coKNb0#b*K1)B*_2RNMq@-LP~vU$=UmN)@@%Y diff --git a/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/go-next.png b/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/go-next.png deleted file mode 100644 index cf93647658d6298e78aa95ebb6f49a0aa5380e86..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 688 zcmV;h0#E&kP)8|#$y=2{GaSvX!lFCe`tAADVukM0>&19IMjm`1UdEeg3hT3C> zt>DSy7tOWR_1}{G74XvH?TMMm<<_w9p}|G*6CaA|{LFP723{GYWv@A3U|S7r>(tE7 zEVH({4x2k+kmi-%56_;y1Oy`qVhkb%L1<=2I9H%SvGsi>YfG2H`@mn1-XnmRqzxAV z1Q7@!pg{?$9M|_5Pv-{0`!x36Qu+etETzkFzQAjN)Am!<;hJFh(#*8!iGq6nIylt$-@152Wb=%S-op z^LB^rt*mkpxO%RS2u6qr1QRQVb^{Rs0=3#Si__=O*~ln>Q0bZ(3Bby=JBVnMLXe~l zZ{~-bWrwH=B7xf20&^4hI?$C^q>Fv?eNyc0y}s~*Jb3t=+9M;V=*^zc z&@Dv({PtEh1&nri6{v1(j=yXFeF9;m8+r>UW2GI}UX5ElV^m{c36PG?K^Wo6)T0jc zMqF=2&jCB=RM@V})wrGjJ0icLNvzyC-w_? WL?~}8zZg&e0000FFIBbRtg(`_&p!< z-pk*hrDB=hpo54*MJW`@6j!z}46}fRKrjy&uU@~n0M1+mbq-F>KB1C9R8dg|QHTDZ z0~lsTFpmX~U1voKO~$8;q6nuB(+P^hL_h?LDKvx`e1cr^;h9C~&+ZYyJWex!191=( zQ3W&Nq(?FuOy_Qne71y$UO&8Oc#5cy&Ezp0$vDRQ7$0KBlObjh0$4D7fZ&aMwsiHn zwVF}p;IK{Q)+3Aw-ToKOdY>5#zcZSg;Vnj;piXcOR0UNKg^5qD1PhRBHKWag!#0(j z$E>Yypvnve&dD@&3KazvP`Ti5ZqW*z8cL?sjBe9tf2&pNoVxeKqZ34?-4$2&D6Q-f zf?*zfFoHMCl+N*2W()x=1>3@+->1<&s#WWp4?i%PoPc=Ni@Usg`|?JAUH~SubilaP zj2_Tvf2>vO{OG=!`X#>$KLkdzOy<(3P0sI03=C(27#Oyi(Y=GiHaqK2z_JwbTd8&c zM05INuF$2IPy%#;9?%E+t!A{F!iUi?)%E7!=`*>>Mekp=l_jg XNLd;Hp6zbW00000NkvXXu0mjfMnXET diff --git a/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/rotate-cclock.png b/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/rotate-cclock.png deleted file mode 100644 index 6ec64656560ee6e3ec1f9a927d3d3922655996af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 908 zcmV;719SX|P)qHh2I010qNS#tmY3ljhU3ljkVnw%H_000McNliru)e966C@Ca|DP#Zu03CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00QtyL_t(I%iWbvZyQw< z#ee5{?6E@;NKJ|=YO1KL5MqOnD}hj#^@^{MW%7xVrPq9cc9|6-f(n5^s)T4n(=@7@ zgeKJWpYhzoV#ZEMQ@TKGxSM(JN%wcpJG$=<{70el2iG58@q8Vl_;~Ne;V=Ih{K4)@ zu3TdP&-_Hvd!YM-R|#+c21@Tb*p?YQ{OIY<8^Lq6lV6Kb^ID^kI;rIo?q3FlQ5>hSgC@_Kp288tiB8I3*#{`GX!gA9w$0VddH&>C3u3EF!G;1rXwP7N_uJtH4Ne13&22AQ{)eoaRc)eLHBPn;-w-kxvgN6%#c8taIk%W z6$}wqY3h4&qXIkwf(@Cic^_9d@H(MQ8b)oQtePPNgA0dH_s8XB2T%PRJgH_uOaZf_ zVBkvqnoN((C{HLE>L-2BKi+ulJic~s`40AN59_8cz*FOCZ9~JTAxMJEq?WL`d(c1b z|I>8i(Wi%fLR;h_EeW+j?RvcgYNu-70p-G#(*7I&AoFqHh2I010qNS#tmY3ljhU3ljkVnw%H_000McNliru)e966DFk>!L{I<#03CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00QYrL_t(I%iWaCYg}a% zho9e>x$}`!6XOJ#+9;_X6a-y}1Oy?=WaYmw%k(cwmiaG|WkH1o1)++&5|UP=F|9}& zCU<7;`MJ0m^VJp+-1u(pdoK4r?>P_WJ@6kb{o5ax9`-(oZu~rr4{jdmAA#TdWpTw~ zpkS4TmJuj`07CoVJGP&wsdoTex^uYvd-+=M(u3Y6p$!a-O;#X`Bq%^Fp*fMm9E~4W zRr{l&do}CkHRz9vJGR$2F`gLGFsdJtp#{+mG$*1Pt>{#lWlo|Uex-_A-}g2NHat9o zmc|o-*pt{sK!X7tzKD6LG2f6AvdpZWR%Pq`!Us2xW-o!?z5n)#r28%tkHACY1cmMr zY$1>!D;L0spek-R!lgwUC^QM{xx>9jw~zB&MKZv~r{GiL2@qN**#)Bz1{4~*vN7Yy zlWe(isv<0!t&fX&!Qs-w-dAw}yqc%RV{i#1cS-L$4HiyA0vL>_X#2UJQ8ILisKCRN zLURP&iy1Gw1WJS1Gi)hqS;nYw22Bxf(ghkG`BS7jaYNtI;Vs504sIQNceyJPT!F`c z*(Rt<2bA@m5DMcHol2m#egYnNDJ#_*pXPvkzpc8*FLLSlUnt3qk!lL%>vTyrS@R7SRQDggSv{AZBzH*L&K6)Yet#YX^OQXJJKR;9wPLS>frBN76pwdj#9Re))8d b|Hb+X;oN>_N(v}000000NkvXXu0mjf&bfzO diff --git a/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/rotate.png b/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/rotate.png deleted file mode 100644 index 138b44d4280c0a60cd12972e8a0caa591c506414..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 908 zcmV;719SX|P)qHh2I010qNS#tmY3ljhU3ljkVnw%H_000McNliru)e966Cp%E4MB@Me03CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00QtyL_t(I%iWbvZyQw< z#ee5{?6E@;NKJ|=YO1KL5MqOnD}hj#^@^{MW%7xVrPq9cc9|6-f(n5^s)T4n(=@7@ zgeKJWpYhzoV#ZEMQ@TKGxSM(JN%wcpJG$=<{70el2iG58@q8Vl_;~Ne;V=Ih{K4)@ zu3TdP&-_Hvd!YM-R|#+c21@Tb*p?YQ{OIY<8^Lq6lV6Kb^ID^kI;rIo?q3FlQ5>hSgC@_Kp288tiB8I3*#{`GX!gA9w$0VddH&>C3u3EF!G;1rXwP7N_uJtH4Ne13&22AQ{)eoaRc)eLHBPn;-w-kxvgN6%#c8taIk%W z6$}wqY3h4&qXIkwf(@Cic^_9d@H(MQ8b)oQtePPNgA0dH_s8XB2T%PRJgH_uOaZf_ zVBkvqnoN((C{HLE>L-2BKi+ulJic~s`40AN59_8cz*FOCZ9~JTAxMJEq?WL`d(c1b z|I>8i(Wi%fLR;h_EeW+j?RvcgYNu-70p-G#(*7I&AoFDTAjLaB+%Yd6 zk9Re0dWW32a4X-d2sw)^O9q9&f$6DKD(jyH%hK8k)4@XrXqmgLZpZeWq5CS1#gvXM zZ*L{-=OWs$Y8TfnsYsPim2XqV^o(lgSHcPH_ukQml79^4H#crI9X#}DCji^Mz&rr# z_~8A3e{S8f8;W4uNXz0IOJ|JuoD#8^IFV9N%AngMQO~IQT3)C5T;51g#?k;w6R@5^5L(>1YOvB}oR)3$97Q zgb-dg4Df=$$1{4`EOH!(pc;(jIYM${>HNs4OOf-0!xTmVUJ!Ty;5foh3Z|6mW>FAD zj0eK z)tk}Mo6*b}#vwuoH^MVSC_{n=+#t-Vj7FZWdZ?5rN=)^7eP{0l<_aEv8SFSYwA%0C zC9AZ^VAKXiI4~wKM$L>+J0&pXa=9|6+x_gyr`%l2;ja_%_*ih#b~||@7@AdG6|kBG zb@pSG@{MS|ZggnSElJXK@B~^e?}~&6wm4m`S60_JAgD3wn(9tmxzf9&a>m1lFZcAO zCIkb(OKV>I?a!V|n^&%cj-)T{!aj$8`Df=ehp= zew*E1qTNo!8y=Za`R(2CJBCp6zCCjW25$c1cDZv7N2$p_*YB7PKRqbSM~N85fJnsmA~@7wb_fVG2zgNq3v5@Re| zQBiRkz|p3__HP;+8}|~9y|-cgMs#&`fl_K*xY(VE#bQ;*emH*Xp5UU7xIo`gTvv-0^o|D zC>9EgtG+{hku3}W1z?Qlf`#*^RXtvHM3!Z*5*u6A*4B23OfdM#1VFyX=W+0O>V*Py d-2eYI{sF*Z|Ipo-va0|9002ovPDHLkV1mNbUMBzm diff --git a/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/zoom-in.png b/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/22x22/zoom-in.png deleted file mode 100644 index 3518ce5815470e3047828f4683b14719f74436e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1142 zcmV-+1d02JP)3dVFqTP^SU$lagHB_W(u?rUCBxA z&BJSoVi5p(KK`iF zS5v!hDk_;%Nkx9QVP~i`-%d7*ATtKWI1GnfHc}bmjz7x0R+iE|`8KModM0socw}@V zV&T5p#SUMMPyS_EH}>o*`bQE;*9@kmH8a6DPXati;K^uQpCh6x<6+Qqb$e{#aH#9C zR!EZM5=0p`CC9q0z@}$(#sQd;C>R`EXAJ3JG#!Y zq(ckA**0cqMT}UXp4Pm<>8UQO&Dz^k<$@MpWLv({+qakRzxMOh(Osd?T>ERSWk24Q zs%D~krN)SI6)PWXKTH5{Axls;yde*NPwY4E^Bi7v%=;;os`CJDgN|aGVL`o^m+3lsnXV3J%wG}X5JbAyT z`^juB_e0k+U1C{TIcmDeOa@fokRX69m0W!znM}P@T53Of_DuivEh#?zaqoddA~A9N z?f3A??{~FXh0j}MSu!c`1elRdr*r z0{*7vWAh4c&Szxd)uX#3KBt6MkqDFmr3?(aBp6xMm|0M0jfG})kJF0v4UeUN8XKQj z4@~}18|(Hr`Gp&Ibfa~z>o(7!t{GIzYi61YIW+9?xVr9BwWXMZC2XD_@Fb zuQLKsL=xc`L@9$L2jB)|Hf1IHMD4C}RFt^t_4;mX1SSQKzZ@OAy4>OSaFR_rWHM?8 zh6EVn8KV}4w3H%<`Fy^@>2^QW{#{S1`a{bYp!T`@r2Xmda3g@!op(6OMSqjuQC(ea zUszbU|H`A!mpP|hTY~;|X<_~D)<4kqG5~aiLZQQmC^5!z-<|qa{?Fi|hb4tuVNJxN z#y?DL%L-B`KW;4>8ym&J!NGkVkH-f9d@L4=4-XID8X6i(0RZjn>^xXm<-7d)Yj0vI zl>(>J37__Ta`)0V!Aeq8&msT_h0!9*vJ?me_WOLk7N5`etjpzUx7lnBb#--n3SF&a zWMpJ&^0%o&=f3z1yk0NZ?RIcD9610WSfpGi9I&SPU+Rl&VE{k@z+B7LgDpF2AF2IX zmSwLJUp*EK25;gz*5EoouE@4E@LC#$188CG|Bb%^h%UbB_%Ss}00000NkvXXu0mjf Dl;H?> diff --git a/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/48x48/document-print.png b/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/48x48/document-print.png deleted file mode 100644 index 30b6348d9a01138527a3a01cf2d8942cb85113d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2296 zcmVW=UzJw_TnTE5*i33ghBZ#>F7|Wt}r2O)flu? z+84hHYSKsug&(Yc*w{Kvi$wWDm4&F&G&K}7wEX~7(T%p-mpOC@~pDH;i@yweXDu?(uH#v6Da=q@txGU%L8Y>J9p?sk4Mp_vzKLA-nVaG zJYP(C6F6|-z+1Ym|Bw)(=hERE_{U(C*tB>NUAL+MAKxB@C{VO43gR#CU4kAP(pqZ9 z)al0IoD)jvZ+GwB{fm5XO*@;G?BBn?T9Tx#+qZ8Qr_<{^@(E_^Nj$xJAKzj97j&+!rbNSgcqJ!H0^i?4<39Kz@sCes;bZH_3E0YVPs?^tInxUhH?3B z1Y0+*#HIc*BvR=}iNzJ%9-hFK^~>vq-PF%n%8>>-UVJv8UeSNVoiqAsz z_4TN)uZJd8;!o$suxb4=Jcy+bnM~!h85&JM)(AE}y#zfUJVbd#&6ffX6hMFw0zwEF zV-N%ZLqkKjdb1y|9l3&y>zbkH6ycaWqn}VXj)32XmSywt%fpv&w?70y5I`vfrG?LD z!4`rbfH8(Swe>jk{wP*2n-8zgi{VHjFMAH)UO0}&>MBt?w+e^PPJj>!#uykYJfe#t zKnTUJ-ue`?s{^R531TRc058CYu5*MQ#_{#WI*cWBym{)jy$XaBRvZ*WzzU%^PJ9N1 zda!KqJUkqiAy5J)5D0YU!9{^WVic4Rj83NT)Dw$v{>~WQ=^HBT3Rp99)=)Zz}>rd?fd_}Hi~yIN8uF#aCaCvvrCys;PW#4`lWAU<)W%7dV~;gUdV1L z;vf?Q0RYh0*l6FoJu1R~D~`sRa%lSW0GL4V5i>Td<;y9$p0m`-?k`_O=Q&`BHCvQY zctnbM!LphC0AQ5Z>DVcp^U@KpoKH+lxKf=g%MdA0HOoDtHgJaxqkyWaNTpIab@G+G z3Fx{GRaFsl#@VfYwPAUYu0RN zXjn*{peUtKRTYDSgIPh8LIgpuCng?`J#$-|z13K56Mqp}%X_uA7~m zolT6foF}5L>vpc@oZHPQg`TFF!Z~-PSf9^_L?VH`d-vY&>gt*YqcTsgKu1SMSt^xk zkR%D5^PEfWe&|SpEe3ZkvSnrNLs60>Fvcp{+uLipy1Iq|2Z71SNhuHr=!&8s9DV@K z0YU&Kh<3pRZqE9Y!MP3I24m@PZrd9D7GZAsvaQXJ(Pz2UG!2PF9J+4!X>MKuuh+|? z(WqVax;C+Z~)D24-W)`8#cvrQg0z_a_qxjE;uE zIftUSUlvRu;H*W4haaHK>%&NR1S?mr!i^g@;PH4}4zf!oxMIYxymI9#R8@r_2vAkk z6>>QVghGP|1}h;5BKrFJzyu*{^;l}TapNWyESPT+P{1=7xI)MxKql32;ozEry3DrToXbRfc#aK<^7p>^C@z?00IEY9nEL9GP8LBc+4ikm>2=+B*6h_ zW>Wy90LTE601{@4JK7|GF#u6hH>VU*r7;t%-vQnUT*?41IQ(+}dKMB+B1r%-0OKZ! zybh#d%S>Vdl}r*=6CL1b1_6tNYJ!$w%zV-$q@sw&hf>tZB;(r>SB(E(0Q?6@#^~dc SQ9#WA0000<~D$+3`ZV@nP;!b)slZIEK5 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 diff --git a/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/48x48/go-last.png b/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/48x48/go-last.png deleted file mode 100644 index e9f976bc544343d0af9b72fab34158a963e8a7d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2161 zcmV-%2#)uOP)&f=gxz%%d;$RXMh584YHNmK#NhhZso}tncCGYR+(=(PSg;xbfrvnaq1nUA-!BXA-x2~9 ziAp>-`=zQsZC~?}EZuT%_PTy*-*4dcr7t2v)6w-{(a`K;#<&Fq_ti~7Tx?)PnDg*= ztL98y_>Ib1ch}^_7~GeBBot9`HQjUqk2j!(0MFAo9KZAd9{Ak!iiKZUKC!BDz&|H1 zsTkL{UIPggBXQFSv^sEu;TUPJ14mo-VC3!f&U5pAGP3Try5^}%+!^KdXu$&liB1WC zTO=WY2n$2A51%tQaj_Xl`1JhTAKx~5=-9WWHYA=eqb~>qEF2_q?EbAGAOaB$Ej~2+ zVDWLf^)N1{PGjM$It}27-cS&qR&E!f0v#7@fImnES=2s)y_!{;eGc-yV1W3;xV~Kgad%!AEAm{FOxj z0DidO*U;<(00;yk0!sjj%u+~^HBqw|*IDGy+OrG$is=;-`C%w6I z{oyG~>CxRQvL}m;O$cVddR#*#5m4k{_kT7*L4k;%NC7Y{Q2}^sHsLJzsE#{xZ8&(g z33rcr$o=-0zhB?j^zy#Ri}kEMzw~!>=|==C8UjNij;#~|A`E6f(6nf14)pD_2VLO4 zadRF%qv5j;W^HmpBkQMe=-hjt3ZI_-`U|zg2Hn1OT0`RLVu7%;&0qjrJ^==Y;Fv9_ zJQ<(;fRuU0o`;|%{~nvf4ienM@k`BUNqvMTXD+U;AMu&hQySdW^XDT>F1v+b(O}kL zNwrpT70}{?pul3JBS9|YDF8a3OMOXVF*Q8^tiTqyX)Otp8ul%7ED!;hI80<_n-e;`cBSJinzL_X z>ckmUgKLLPdw2h)L+~Zcf#AKaGf(zTGusA54v18j ztwebeGHU=#s}uoH0TF{<0DvT1D{?xGl%GU8*N&{83gp8AWjEHv6o>!;!Pi;%l7*+!$Z-Z)or-J& zf*esWvqJ(g^Tm(?5+eqV#e;Xu#LiTzOLUJ)|B}=F?*M`nq8-M_a<0v?e1LY_{ zF`xuW1s_1nB!L{0;AST*0tf-j0TG5knfojO$xjcvALE8k#yfjnPoKMRt~yR2ZsmU> zqu|2|6d+1Nh=V*(6cA7m0wy6usDJ>-vL}}ga*!utW&zQP1ORLbh)s0!ztXM6q|x(m;qn=5+x1S$%j#$M{z|`E zYCyXqK;~Wn0Sa;!W)EkM^JJ7V5st_RVk;BC0w@UBEPaD3N8*7|vvKJ7Uf#R!gO2o7 z%sa47@98D5y%LCm4++#%)P?eJ96-4NXvfXVLpi3rIst){Hrsp&N+y`V2uO_j#N8M_ zWCphF{fl?v#IcsEN7bBTo4r%kpKLv%ubJ^|rR?@gt)2+j-HeJjUjE}xOX;h? zmVNIocKgyBM1pgKtxcfsxV>D*U*v7pz*B@nPf|D&AxSdZ3L`s8TlZVO(065 zxAOv`p$i-!*tR$>K?JB)b@=?C**JCPglyUJw@m9vfBDfjcw33%l}#Z24N`aKaStL# z&;Z1i+CdeganHc7qWRzset&0k^4#Bf(dixhFBEFMr}4@nPz;oc9NXz-0NNbu=(|Ml zZD*qfd=_`rJd7>dH|0J&bmGECfAyZd{2^K*eOZ^-u{|%FfCbzW*eGZV+&-_#LDt^5 zvvLv|H*UzB{rKX6Bd>Z5?U&FI=}!ajBgeW3v9bxE7qG=ZThbZ;k%LMAXzRF&Km2)J zy7fYGQ}bH=Gvq>m(Y7b=GXX)@2*+g=ohgk-`Be^b%#v8UVNK?Gi?`yydfga#uVA)% zAreY){(Z~KA^;R>u_po+yd^-KK|26kIhA|n$ZL9MEC@Z3h?4Qld9Q0wDdj47zqo!Z0qZfe3pz|#G=5vBVgNT)XS>*#q4JN nN?B|*1#V!0>bHLTAK8Ba8h-Gb@`J}#00000NkvXXu0mjfQ)v$p diff --git a/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/48x48/go-next.png b/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/48x48/go-next.png deleted file mode 100644 index 5fae27b3d2f91c550bc00aa91607140c3d0f9a43..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2028 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 Dr61H~ diff --git a/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/48x48/system-search.png b/org.adempiere.ui.swing/src/org/adempiere/pdf/viewer/48x48/system-search.png deleted file mode 100644 index dbd8d4e019fb0092b7cb73248f96a9b7c54d36a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3991 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 rotationSelect = new JComboBox(new String[] { - "0", "90", "180", "270"}); - private final JComboBox zoomSelect; - private final float[] zoomFactors = new float[] { - 0.25f, 0.33f, 0.50f, 0.75f, 1.00f, 1.50f, 2.00f, 4.00f, 8.00f}; - - private final Action printAction = new AbstractAction() { - /** - * - */ - private static final long serialVersionUID = -4038401603459821668L; - - public void actionPerformed(ActionEvent e) { - print(); - } - }; - - private final Action saveAction = new AbstractAction() { - /** - * - */ - private static final long serialVersionUID = 2556454917786013951L; - - public void actionPerformed(ActionEvent e) { - save(); - } - }; - - private final Action goFirstAction = new AbstractAction() { - /** - * - */ - private static final long serialVersionUID = 3012006964079877706L; - - public void actionPerformed(ActionEvent e) { - goFirst(); - } - }; - - private final Action goPreviousAction = new AbstractAction() { - /** - * - */ - private static final long serialVersionUID = 7146121058674779580L; - - public void actionPerformed(ActionEvent e) { - goPrevious(); - } - }; - - private final Action goNextAction = new AbstractAction() { - /** - * - */ - private static final long serialVersionUID = -535856649012053593L; - - public void actionPerformed(ActionEvent e) { - goNext(); - } - }; - - private final Action goLastAction = new AbstractAction() { - /** - * - */ - private static final long serialVersionUID = -9129162509234933692L; - - public void actionPerformed(ActionEvent e) { - goLast(); - } - }; - - private final Action zoomInAction = new AbstractAction() { - /** - * - */ - private static final long serialVersionUID = 8712227061870874820L; - - public void actionPerformed(ActionEvent e) { - zoomIn(); - } - }; - - private final Action zoomOutAction = new AbstractAction() { - /** - * - */ - private static final long serialVersionUID = -796771923722993041L; - - public void actionPerformed(ActionEvent e) { - zoomOut(); - } - }; - - private final Action rotateCClockAction = new AbstractAction() { - /** - * - */ - private static final long serialVersionUID = -5323310183497748731L; - - public void actionPerformed(ActionEvent e) { - rotateCClock(); - } - }; - - private final Action rotateClockAction = new AbstractAction() { - /** - * - */ - private static final long serialVersionUID = 7048804716310413300L; - - public void actionPerformed(ActionEvent e) { - rotateClock(); - } - }; - - private String filename; - private int currentPage = 1; - private int scaleStep = 3; - private int rotation = 0; - - private File tmpFile = null; - - public PDFViewerBean() { - final String[] zoomLabels = new String[zoomFactors.length]; - for (int i = 0; i < zoomFactors.length; i++) { - zoomLabels[i] = Integer.toString((int) (zoomFactors[i] * 100)); - } - zoomSelect = new JComboBox(zoomLabels); - - zoomSelect.addActionListener(new ActionListener() { - private boolean isAdjusting = false; - public void actionPerformed(ActionEvent e) { - if (isAdjusting) { - return; - } - isAdjusting = true; - try { - setScaleStep(zoomSelect.getSelectedIndex()); - } finally { - isAdjusting = false; - } - } - }); - - rotationSelect.addActionListener(new ActionListener() { - private boolean isAdjusting = false; - public void actionPerformed(ActionEvent e) { - if (isAdjusting) { - return; - } - isAdjusting = true; - try { - setRotation(rotationSelect.getSelectedIndex() * 90); - } finally { - isAdjusting = false; - } - } - }); - - setLayout(new BorderLayout()); - createToolBar(); - add(BorderLayout.CENTER, center); - pageField.addFocusListener(new FocusAdapter() { - public void focusGained(FocusEvent e) { - pageField.selectAll(); - } - }); - pageField.setHorizontalAlignment(SwingConstants.TRAILING); - pageField.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - setCurrentPage(Integer.parseInt(pageField.getText())); - } - }); - - setPreferredSize(new Dimension(480, 0)); - } - - public void setRotation(int rotation) { - this.rotation = rotation; - rotationSelect.setSelectedIndex(rotation / 90); - updateZoomRotate(); - } - - public void goFirst() { - setCurrentPage(1); - } - - public void goPrevious() { - setCurrentPage(currentPage - 1); - } - - public void goNext() { - setCurrentPage(currentPage + 1); - } - - public void goLast() { - setCurrentPage(decoder.getPageCount()); - } - - public void setCurrentPage(int page) { - if (page < 1 || page > decoder.getPageCount()) { - return; - } - - final Cursor oldCursor = getCursor(); - try { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - decoder.setPageParameters(zoomFactors[scaleStep], page); - decoder.decodePage(page); - setRotation(decoder.getPdfPageData().getRotation(page)); - currentPage = page; - } catch (Exception e) { - e.printStackTrace(); - return; - } finally { - setCursor(oldCursor); - } - - goFirstAction.setEnabled(currentPage > 1); - goPreviousAction.setEnabled(currentPage > 1); - goNextAction.setEnabled(currentPage < decoder.getPageCount()); - goLastAction.setEnabled(currentPage < decoder.getPageCount()); - - pageField.setText(Integer.toString(currentPage)); - } - - public void zoomIn() { - setScaleStep(scaleStep + 1); - } - - public void zoomOut() { - setScaleStep(scaleStep - 1); - } - - public void rotateCClock() { - rotationSelect.setSelectedIndex( - (rotationSelect.getSelectedIndex() + 3) % 4); - } - - public void rotateClock() { - rotationSelect.setSelectedIndex( - (rotationSelect.getSelectedIndex() + 1) % 4); - } - - public void save() { - final JFileChooser fc = new JFileChooser(); - fc.setFileFilter(new FileFilter() { - - public String getDescription() { - return "PDF File"; - } - - public boolean accept(File f) { - return f.isDirectory() - || f.getName().toLowerCase().endsWith(".pdf"); - } - - }); - - if (fc.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) { - return; - } - - File targetFile = fc.getSelectedFile(); - if (!targetFile.getName().toLowerCase().endsWith(".pdf")) { - targetFile = - new File(targetFile.getParentFile(), targetFile.getName() + ".pdf"); - } - if (targetFile.exists()) { - if (JOptionPane.showConfirmDialog(this, - "Do you want to overwrite the file?") - != JOptionPane.YES_OPTION) { - return; - } - } - - try { - final InputStream is = new FileInputStream(filename); - try { - final OutputStream os = new FileOutputStream(targetFile); - try { - final byte[] buffer = new byte[32768]; - for (int read; (read = is.read(buffer)) != -1; ) { - os.write(buffer, 0, read); - } - } finally { - os.close(); - } - } finally { - is.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - - public void print() { - PrinterJob printJob = PrinterJob.getPrinterJob(); - //decoder.enableScaledPrinting(false); - printJob.setPageable(decoder); - final PageFormat pf = printJob.defaultPage(); - decoder.setPageFormat(pf); - decoder.setTextPrint(PdfDecoder.TEXTGLYPHPRINT); - printJob.setPrintable(decoder, pf); - if (printJob.printDialog()) { - final Cursor oldCursor = getCursor(); - try { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - printJob.print(); - } catch (PrinterException e) { - e.printStackTrace(); - } finally { - setCursor(oldCursor); - } - } - } - - protected void createToolBar() { - final JToolBar bar = new JToolBar(); - - bar.add(createActionButton(printAction, - null, - "22x22/document-print.png", - "Print document")); - bar.add(createActionButton(saveAction, - null, - "22x22/document-save.png", - "Save document")); - - //bar.addSeparator(new Dimension(10,0)); - - bar.add(createActionButton(goFirstAction, - null, - "22x22/go-first.png", - "First page")); - bar.add(createActionButton(goPreviousAction, - null, - "22x22/go-previous.png", - "Previos page")); - final JPanel pagePanel = createToolbarItemPanel(pageField); - - bar.add(pagePanel); - //bar.add(new JLabel("/")); - //bar.add(pageCountLabel); - bar.add(createActionButton(goNextAction, - null, - "22x22/go-next.png", - "Next page")); - bar.add(createActionButton(goLastAction, - null, - "22x22/go-last.png", - "Last page")); - - //bar.addSeparator(new Dimension(10,0)); - - bar.add(createActionButton(zoomOutAction, - null, - "22x22/zoom-out.png", - "Next page")); - bar.add(createToolbarItemPanel(zoomSelect)); - bar.add(createActionButton(zoomInAction, - null, - "22x22/zoom-in.png", - "Next page")); - - //bar.addSeparator(new Dimension(10,0)); - - bar.add(createActionButton(rotateCClockAction, - null, - "22x22/rotate-cclock.png", - "Next page")); - bar.add(createToolbarItemPanel(rotationSelect)); - bar.add(createActionButton(rotateClockAction, - null, - "22x22/rotate-clock.png", - "Next page")); - - bar.setFloatable(false); - add(BorderLayout.NORTH, bar); - } - - protected JPanel createToolbarItemPanel(JComponent component) { - final JPanel pagePanel = new JPanel(new GridBagLayout()); - pagePanel.add(component); - pagePanel.setMaximumSize(pagePanel.getPreferredSize()); - return pagePanel; - } - - public void loadPDF(String filename) { - this.filename = filename; - try { - decoder.closePdfFile(); - decoder.openPdfFile(filename); - pageCountLabel.setText(decoder.getPageCount() + " "); - setCurrentPage(1); - } catch (Exception e) { - e.printStackTrace(); - } - } - - protected JButton createActionButton(Action action, - String text, - String image, - String tooltip) { - final ImageIcon icon = - new ImageIcon(getClass().getResource(image)); - final double colorFactor = 0.9; - - final RGBImageFilter filter = new RGBImageFilter() { - public int filterRGB(int x, int y, int rgb) { - final int alpha = (rgb >> 24) & 0xff; - final int red = (rgb >> 16) & 0xff; - final int green = (rgb >> 8) & 0xff; - final int blue = (rgb ) & 0xff; - return ((int) (alpha * colorFactor) << 24) - | ((int) (red * colorFactor) << 16) - | ((int) (green * colorFactor) << 8) - | ((int) (blue * colorFactor)); - } - }; - - final ImageIcon darkerIcon = new ImageIcon( - Toolkit.getDefaultToolkit().createImage( - new FilteredImageSource(icon.getImage().getSource(), - filter))); - final JButton result = new JButton(); - result.setAction(action); - result.setText(text); - result.setIcon(darkerIcon); - result.setBorderPainted(false); - result.setHorizontalTextPosition(SwingConstants.CENTER); - result.setVerticalTextPosition(SwingConstants.BOTTOM); - result.setMnemonic(0); - result.setToolTipText(tooltip); - - final Dimension dim = result.getPreferredSize(); - result.setMaximumSize(new Dimension(32, dim.height)); - - result.addMouseListener(new MouseAdapter() { - public void mouseEntered(MouseEvent me) { - result.setBorderPainted(true); - result.setIcon(icon); - } - public void mouseExited(MouseEvent me) { - result.setBorderPainted(false); - result.setIcon(darkerIcon); - } - }); - - result.setBorderPainted(false); - result.setFocusPainted(false); - - return result; - } - - public int getCurrentPage() { - return currentPage; - } - - public void clearDocument() { - decoder.closePdfFile(); - if (tmpFile != null) { - tmpFile.delete(); - tmpFile = null; - } - } - - public void setScaleStep(int scaleStep) { - if (scaleStep < 0 || zoomFactors.length <= scaleStep) { - return; - } - - this.scaleStep = scaleStep; - zoomSelect.setSelectedIndex(scaleStep); - updateZoomRotate(); - } - - protected void updateZoomRotate() { - final Cursor oldCursor = getCursor(); - try { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - decoder.setPageParameters(zoomFactors[scaleStep], - currentPage, - rotation); - decoder.invalidate(); - decoder.repaint(); - zoomInAction.setEnabled(scaleStep < zoomFactors.length - 1); - zoomOutAction.setEnabled(scaleStep > 0); - } finally { - setCursor(oldCursor); - } - } - - public void setScale(int percent) { - int step; - for (step = 0; step < zoomFactors.length - 1; step++) { - if (zoomFactors[step] * 100 >= percent) { - break; - } - } - setScaleStep(step); - } - - public void loadPDF(InputStream is) { - if (tmpFile != null) { - tmpFile.delete(); - } - - try { - tmpFile = File.createTempFile("adempiere", ".pdf"); - tmpFile.deleteOnExit(); - } catch (IOException e) { - e.printStackTrace(); - return; - } - - try { - final OutputStream os = new FileOutputStream(tmpFile); - try { - final byte[] buffer = new byte[32768]; - for (int read; (read = is.read(buffer)) != -1; ) { - os.write(buffer, 0, read); - } - } catch (IOException e) { - e.printStackTrace(); - } finally { - os.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - - loadPDF(tmpFile.getAbsolutePath()); - } - - protected void finalize() throws Throwable { - if (tmpFile != null) { - tmpFile.delete(); - } - decoder.closePdfFile(); - } -} diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereButtonListener.java b/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereButtonListener.java deleted file mode 100644 index edee8a5f21..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereButtonListener.java +++ /dev/null @@ -1,102 +0,0 @@ -/****************************************************************************** - * The contents of this file are subject to the Compiere License Version 1.1 - * ("License"); You may not use this file except in compliance with the License - * You may obtain a copy of the License at http://www.compiere.org/license.html - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for - * the specific language governing rights and limitations under the License. - * The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial - * Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke - * are Copyright (C) 1999-2005 Jorg Janke. - * All parts are Copyright (C) 1999-2005 ComPiere, Inc. All Rights Reserved. - * Contributor(s): ______________________________________. - *****************************************************************************/ -package org.adempiere.plaf; - -import java.awt.event.ActionEvent; -import java.beans.PropertyChangeEvent; - -import javax.swing.AbstractButton; -import javax.swing.InputMap; -import javax.swing.JCheckBox; -import javax.swing.JComponent; -import javax.swing.KeyStroke; -import javax.swing.SwingUtilities; -import javax.swing.plaf.ComponentInputMapUIResource; -import javax.swing.plaf.basic.BasicButtonListener; - -/** - * Button Listener - * - * @author Jorg Janke - * @version $Id: CompiereButtonListener.java,v 1.1 2005/12/05 02:38:28 jjanke Exp $ - */ -public class AdempiereButtonListener extends BasicButtonListener -{ - /** - * Adempiere Button Listener - * @param b button - */ - public AdempiereButtonListener (AbstractButton b) - { - super (b); - } // AdempiereButtonListener - - /** - * Install Keyboard Actions - * @param c component - */ - public void installKeyboardActions (JComponent c) - { - super.installKeyboardActions (c); - updateMnemonicBindingX ((AbstractButton)c); - } // installKeyboardActions - - /** - * Property Change - * @param e event - */ - public void propertyChange (PropertyChangeEvent e) - { - String prop = e.getPropertyName(); - if (prop.equals(AbstractButton.MNEMONIC_CHANGED_PROPERTY)) - updateMnemonicBindingX ((AbstractButton)e.getSource()); - else - super.propertyChange (e); - } // propertyChange - - /** - * Update Mnemonic Binding - * @param b button - */ - void updateMnemonicBindingX (AbstractButton b) - { - int m = b.getMnemonic(); - if (m != 0) - { - InputMap map = SwingUtilities.getUIInputMap(b, JComponent.WHEN_IN_FOCUSED_WINDOW); - - if (map == null) - { - map = new ComponentInputMapUIResource(b); - SwingUtilities.replaceUIInputMap(b, JComponent.WHEN_IN_FOCUSED_WINDOW, map); - } - map.clear(); - String className = b.getClass().getName(); - int mask = ActionEvent.ALT_MASK; // Default Buttons - if (b instanceof JCheckBox // In Tab - || className.indexOf("VButton") != -1) - mask = ActionEvent.SHIFT_MASK + ActionEvent.CTRL_MASK; - map.put(KeyStroke.getKeyStroke(m, mask, false), "pressed"); - map.put(KeyStroke.getKeyStroke(m, mask, true), "released"); - map.put(KeyStroke.getKeyStroke(m, 0, true), "released"); - } - else - { - InputMap map = SwingUtilities.getUIInputMap(b, JComponent.WHEN_IN_FOCUSED_WINDOW); - if (map != null) - map.clear(); - } - } // updateMnemonicBindingX - -} // AdempiereButtonListener diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereComboBoxUI.java b/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereComboBoxUI.java deleted file mode 100644 index 0ebb0ee66b..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereComboBoxUI.java +++ /dev/null @@ -1,109 +0,0 @@ -/****************************************************************************** - * The contents of this file are subject to the Compiere License Version 1.1 - * ("License"); You may not use this file except in compliance with the License - * You may obtain a copy of the License at http://www.compiere.org/license.html - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for - * the specific language governing rights and limitations under the License. - * The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial - * Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke - * are Copyright (C) 1999-2005 Jorg Janke. - * All parts are Copyright (C) 1999-2005 ComPiere, Inc. All Rights Reserved. - * Contributor(s): ______________________________________. - *****************************************************************************/ -package org.adempiere.plaf; - -import java.awt.event.MouseListener; - -import javax.swing.Icon; -import javax.swing.JButton; -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.ComboPopup; -import javax.swing.plaf.metal.MetalComboBoxButton; - -import com.jgoodies.looks.plastic.PlasticComboBoxUI; - -/** - * Compiere ComboBox UI. - * The ComboBox is opaque - with opaque arrow button and textfield background - * - * @author Jorg Janke - * @version $Id: CompiereComboBoxUI.java,v 1.10 2005/10/09 19:01:37 jjanke Exp $ - */ -public class AdempiereComboBoxUI extends PlasticComboBoxUI -{ - /** - * Create UI - * @param c - * @return new instance of CompiereComboBoxUI - */ - public static ComponentUI createUI(JComponent c) - { - return new AdempiereComboBoxUI(); - } // CreateUI - - /*************************************************************************/ - - static int s_no = 0; - /** - * Install UI - Set ComboBox opaque. - * Bug in Metal: arrowButton gets Mouse Events, so add the JComboBox - * MouseListeners to the arrowButton - * @see org.compiere.swing.CComboBox#addMouseListener(MouseListener) - * @param c componrnt - */ - public void installUI (JComponent c) - { - MouseListener[] ml = c.getMouseListeners(); - super.installUI(c); - //c.setOpaque(false); - // - for (int i = 0; i < ml.length; i++) - { - // System.out.println("adding " + c.getClass().getName()); - arrowButton.addMouseListener(ml[i]); - } - - } // installUI - - /*************************************************************************/ - - /** - * Create opaque button - * @return opaque button - */ - protected JButton createArrowButton() - { - JButton button = super.createArrowButton(); - return button; - } // createArrowButton - - public JButton getArrowButton() - { - return arrowButton; - } - - /** - * Set Icon of arrow button - * @param defaultIcon - */ - public void setIcon(Icon defaultIcon) - { - ((MetalComboBoxButton)arrowButton).setComboIcon(defaultIcon); - } // setIcon - - /*************************************************************************/ - - /** - * Create Popup - * @return AdempiereComboPopup - */ - protected ComboPopup createPopup() - { - AdempiereComboPopup newPopup = new AdempiereComboPopup( comboBox ); - newPopup.getAccessibleContext().setAccessibleParent(comboBox); - return newPopup; - } // createPopup - -} // AdempiereComboBoxUI diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereComboPopup.java b/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereComboPopup.java deleted file mode 100644 index c9f6e18802..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereComboPopup.java +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.adempiere.plaf; - -import javax.swing.JComboBox; -import javax.swing.plaf.basic.BasicComboPopup; - -import org.compiere.swing.CComboBox; -import org.compiere.swing.CField; - -/** - * Adempiere Combo Popup - allows to prevent the display of the popup - * - * @author Jorg Janke - * @version $Id: AdempiereComboPopup.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class AdempiereComboPopup extends BasicComboPopup -{ - /** - * - */ - private static final long serialVersionUID = 274215317393292721L; - - - /** - * Constructor - * @param combo - */ - public AdempiereComboPopup(JComboBox combo) - { - super(combo); - } // AdempiereComboPopup - - /** - * Conditionally show the Popup. - * If the combo is a CComboBox/CField, the return value of the - * method displayPopup determines if the popup is actually displayed - * @see CComboBox#displayPopup() - * @see CField#displayPopup() - */ - public void show() - { - // Check ComboBox if popup should be displayed - if (comboBox instanceof CComboBox && !((CComboBox)comboBox).displayPopup()) - return; - // Check Field if popup should be displayed - if (comboBox instanceof CField && !((CField)comboBox).displayPopup()) - return; - super.show(); - } // show - - - /** - * Inform CComboBox and CField that Popup was hidden - * @see CComboBox.hidingPopup - * @see CField.hidingPopup - * - public void hide() - { - super.hide(); - // Inform ComboBox that popup was hidden - if (comboBox instanceof CComboBox) - (CComboBox)comboBox).hidingPopup(); - else if (comboBox instanceof CComboBox) - (CComboBox)comboBox).hidingPopup(); - } // hided - /**/ - - /** - * @see javax.swing.plaf.basic.BasicComboPopup#getPopupHeightForRowCount(int) - **/ - @Override - protected int getPopupHeightForRowCount(int maxRowCount) - { - // ensure the combo box sized for the amount of data to be displayed - int rows = comboBox.getItemCount() < comboBox.getMaximumRowCount() - ? comboBox.getItemCount() - : comboBox.getMaximumRowCount() ; - - if (rows <= 0 ) rows = 1; - return super.getPopupHeightForRowCount(1) * rows; - } -} // AdempiereComboPopup diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereLabelUI.java b/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereLabelUI.java deleted file mode 100644 index ac8de8ebb4..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereLabelUI.java +++ /dev/null @@ -1,161 +0,0 @@ -/****************************************************************************** - * The contents of this file are subject to the Compiere License Version 1.1 - * ("License"); You may not use this file except in compliance with the License - * You may obtain a copy of the License at http://www.compiere.org/license.html - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for - * the specific language governing rights and limitations under the License. - * The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial - * Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke - * are Copyright (C) 1999-2005 Jorg Janke. - * All parts are Copyright (C) 1999-2005 ComPiere, Inc. All Rights Reserved. - * Contributor(s): ______________________________________. - *****************************************************************************/ -package org.adempiere.plaf; - -import java.awt.Component; -import java.awt.Container; -import java.awt.FocusTraversalPolicy; -import java.awt.event.ActionEvent; - -import javax.swing.ActionMap; -import javax.swing.InputMap; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.KeyStroke; -import javax.swing.SwingUtilities; -import javax.swing.plaf.ComponentInputMapUIResource; -import javax.swing.plaf.metal.MetalLabelUI; - -import org.jdesktop.swingx.UIAction; - -/** - * Adempiere Label UI - * - * @author Jorg Janke - * @version $Id: CompiereLabelUI.java,v 1.2 2005/12/05 02:38:28 jjanke Exp $ - */ -public class AdempiereLabelUI extends MetalLabelUI -{ - /** Singleton */ - protected static AdempiereLabelUI adempiereLabelUI = new AdempiereLabelUI(); - - /** - * Create UI - * @param c component - * @return singleton - */ - public static AdempiereLabelUI createUI(JComponent c) - { - return adempiereLabelUI; - } // createUI - - /** - * Install Keyboard Actions - * @param l label - */ - protected void installKeyboardActions (JLabel l) - { - // super.installKeyboardActions(l); - int dka = l.getDisplayedMnemonic(); - if (dka != 0) - { - Component lf = l.getLabelFor(); - if (lf != null) - { - ActionMap actionMap = l.getActionMap(); - actionMap.put(PRESS, ACTION_PRESS); - InputMap inputMap = SwingUtilities.getUIInputMap (l, JComponent.WHEN_IN_FOCUSED_WINDOW); - if (inputMap == null) - { - inputMap = new ComponentInputMapUIResource (l); - SwingUtilities.replaceUIInputMap (l, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); - } - inputMap.clear (); - inputMap.put (KeyStroke.getKeyStroke (dka, - ActionEvent.SHIFT_MASK+ActionEvent.CTRL_MASK, false), PRESS); - } - } - } // installKeyboardActions - - - /** Action Name */ - private static final String PRESS = "press"; - /** Press Action */ - private static PressAction ACTION_PRESS = new PressAction(); - - /** - * Compiere Label UI Actions - */ - private static class PressAction extends UIAction - { - - PressAction () - { - super (PRESS); - } - - public void actionPerformed (ActionEvent e) - { - JLabel label = (JLabel)e.getSource (); - String key = getName (); - if (key.equals(PRESS)) - { - doPress (label); - } - } // actionPerformed - - /** - * Do Press - Focus the Field - * @param label label - */ - private void doPress (JLabel label) - { - Component labelFor = label.getLabelFor (); - if (labelFor != null && labelFor.isEnabled ()) - { - Component owner = label.getLabelFor (); - if (owner instanceof Container - && ((Container)owner).isFocusCycleRoot ()) - { - owner.requestFocus (); - } - else - { - if (owner instanceof Container) - { - Container container = (Container)owner; - if (container.isFocusCycleRoot()) - { - FocusTraversalPolicy policy = container.getFocusTraversalPolicy(); - Component comp = policy.getDefaultComponent(container); - if (comp != null) - { - comp.requestFocus(); - return; - } - } - Container rootAncestor = container.getFocusCycleRootAncestor(); - if (rootAncestor != null) - { - FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy(); - Component comp = policy.getComponentAfter(rootAncestor, container); - if (comp != null && SwingUtilities.isDescendingFrom(comp, container)) - { - comp.requestFocus(); - return; - } - } - } - if (owner.isFocusable()) - { - owner.requestFocus(); - return; - } - // No Forcus - } - } - } // doPress - } // PressAction - -} // AdempiereLabelUI diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereLookAndFeel.java b/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereLookAndFeel.java deleted file mode 100644 index 6808d8145b..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereLookAndFeel.java +++ /dev/null @@ -1,218 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.adempiere.plaf; - -import java.awt.Color; -import java.awt.Component; - -import javax.swing.UIDefaults; - -import com.jgoodies.looks.plastic.PlasticLookAndFeel; -import com.jgoodies.looks.plastic.PlasticTheme; - -/** - * Adempiere Look & Feel, based on JGoodies look and feel - * @author vpj-cd, Low Heng Sin - */ -public class AdempiereLookAndFeel extends com.jgoodies.looks.plastic.Plastic3DLookAndFeel -{ - /** - * - */ - private static final long serialVersionUID = 5681571518701552477L; - - /** - * Constructor - */ - public AdempiereLookAndFeel() - { - super(); - // System.setProperty("awt.visualbell", "true"); - } // CompiereLookAndFeel - - /** The name */ - public static final String NAME = "Adempiere"; - - /** The Theme */ - private static PlasticTheme s_adempiereTheme = new org.adempiere.plaf.AdempiereTheme(); - private static PlasticTheme s_theme = s_adempiereTheme; - - /** Paint Round Corners */ - protected static boolean ROUND = false; - - public static final String TABLEVEL = "TabLevel"; - - public static final String HIDE_IF_ONE_TAB = "adempiere.hideIfOneTab"; - - /** - * The Name - * @return Name - */ - public String getName() - { - return NAME; - } // getName - - /** - * The ID - * @return Name - */ - public String getID() - { - return NAME; - } // getID - - /** - * The Description - * @return description - */ - public String getDescription() - { - return "Adempiere Look & Feel - (c) 2001-2005 Victor Perez"; - } // getDescription - - - /************************************************************************** - * Get/Create Defaults - * @return UI Defaults - */ - public UIDefaults getDefaults() - { - //com.jgoodies.looks.plastic.PlasticLookAndFeel.setCurrentTheme(s_theme); - UIDefaults defaults = super.getDefaults(); // calls init..Defaults - return defaults; - } // getDefaults - - /** - * Creates the mapping from UI class IDs to ComponentUI classes, - * putting the ID-ComponentUI pairs in the passed-in defaults table. - * Each JComponent class specifies its own UI class ID string. - * - * @param table UI Defaults - */ - protected void initClassDefaults(UIDefaults table) - { - //System.out.println("AdempiereLookAndFeel.initClassDefaults"); - super.initClassDefaults( table); - // Overwrite - putDefault (table, "ComboBoxUI"); - putDefault (table, "LabelUI"); - putDefault (table, "TabbedPaneUI"); - - } // initClassDefaults - - /** - * Put "uiKey - ClassName" pair in UIDefaults - * @param table - * @param uiKey - */ - private void putDefault (UIDefaults table, String uiKey) - { - try - { - String className = "org.adempiere.plaf.Adempiere" + uiKey; - table.put(uiKey, className); - } - catch (Exception ex) - { - ex.printStackTrace(); - } - } // putDefault - - /** - * For overwriting Component defaults - * @param table - */ - protected void initSystemColorDefaults (UIDefaults table) - { - super.initSystemColorDefaults( table); - } // initSystemColorDefaults - - /** - * For overwriting Component defaults - * @param table - */ - protected void initComponentDefaults (UIDefaults table) - { - super.initComponentDefaults( table); - - // ComboBox defaults - Color c = table.getColor("TextField.background"); - table.put("ComboBox.background", c); - table.put("ComboBox.listBackground", c); - - // globalqss - Class lf = com.jgoodies.looks.plastic.PlasticLookAndFeel.class; - table.put("Tree.openIcon", makeIcon(lf, "icons/TreeOpen.gif")); - table.put("Tree.closedIcon", makeIcon(lf, "icons/TreeClosed.gif")); - table.put("Tree.leafIcon", makeIcon(lf, "icons/TreeLeaf.gif")); - - } // initComponentDefaults - - - /** - * Set Current Theme - * @param theme metal theme - */ - public static void setCurrentTheme (PlasticTheme theme) - { - if (theme != null) { - s_theme = theme; - PlasticLookAndFeel.setCurrentTheme(s_theme); - } - } // setCurrentTheme - - /** - * Get Current Theme - * @return Metal Theme - */ - public static PlasticTheme getCurrentTheme() - { - return s_theme; - } // getCurrentTheme - - /** - * Get default adempiere theme - * @return Metal Theme - */ - public static PlasticTheme getDefaultTheme() - { - return s_adempiereTheme; - } // getCurrentTheme - - /** - * Error Feedback. - *

    - * Invoked when the user attempts an invalid operation, - * such as pasting into an uneditable JTextField - * that has focus. - *

    - *

    - * If the user has enabled visual error indication on - * the desktop, this method will flash the caption bar - * of the active window. The user can also set the - * property awt.visualbell=true to achieve the same - * results. - *

    - * @param component Component the error occured in, may be - * null indicating the error condition is - * not directly associated with a - * Component. - */ - public void provideErrorFeedback (Component component) - { - super.provideErrorFeedback (component); - } // provideErrorFeedback - -} // AdempiereLookAndFeel diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereLookAndFeelAddons.java b/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereLookAndFeelAddons.java deleted file mode 100644 index fd27e2dc6b..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereLookAndFeelAddons.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.adempiere.plaf; - -import org.jdesktop.swingx.plaf.basic.BasicLookAndFeelAddons; - -public class AdempiereLookAndFeelAddons extends BasicLookAndFeelAddons { - public void initialize() { - super.initialize(); - loadDefaults(getDefaults()); - } - - public void uninitialize() { - super.uninitialize(); - unloadDefaults(getDefaults()); - } - - private Object[] getDefaults() { - Object[] defaults = - new Object[] { -// "DirectoryChooserUI", -// "org.jdesktop.jdnc.swing.plaf.windows.WindowsDirectoryChooserUI", - }; - return defaults; - } -} diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempierePLAF.java b/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempierePLAF.java deleted file mode 100644 index 43b03a89a3..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempierePLAF.java +++ /dev/null @@ -1,736 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.adempiere.plaf; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.Insets; -import java.awt.Toolkit; -import java.awt.Window; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.ResourceBundle; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.swing.ImageIcon; -import javax.swing.JOptionPane; -import javax.swing.LookAndFeel; -import javax.swing.SwingUtilities; -import javax.swing.UIManager; -import javax.swing.plaf.metal.MetalLookAndFeel; -import javax.swing.plaf.metal.MetalTheme; - -import org.compiere.plaf.CompiereLookAndFeel; -import org.compiere.plaf.CompiereThemeBlueMetal; -import org.compiere.plaf.CompiereThemeIce; -import org.compiere.swing.CButton; -import org.compiere.swing.ColorBlind; -import org.compiere.swing.ExtendedTheme; -import org.compiere.util.Ini; -import org.compiere.util.ValueNamePair; - -import com.jgoodies.looks.plastic.PlasticTheme; - -/** - * Variable Pluggable Look And Feel. - * Provides an easy access to the required currently active PLAF information - * - * @author Jorg Janke - * @version $Id: AdempierePLAF.java,v 1.3 2006/07/30 00:52:23 jjanke Exp $ - * - * @author Low Heng Sin - * @version 2006-11-27 - */ -public final class AdempierePLAF -{ - /** Logger */ - private static Logger log = Logger.getLogger(AdempierePLAF.class.getName()); - - /****** Background *******************************************************/ - - /** - * Return Normal field background color "text". - * Windows = white - * @return Color - */ - public static Color getFieldBackground_Normal() - { - // window => white - return ColorBlind.getDichromatColor(UIManager.getColor("text")); - } // getFieldBackground_Normal - - /** - * Return Error field background - * @return Color - */ - public static Color getFieldBackground_Error() - { - Color c = UIManager.getColor(ExtendedTheme.ERROR_BG_KEY); - if (c == null) - c = ExtendedTheme.DEFAULT_ERROR_BG; - return ColorBlind.getDichromatColor(c); - } // getFieldBackground_Error - - /** - * Return Mandatory field background color - * @return Color - */ - public static Color getFieldBackground_Mandatory() - { - Color c = UIManager.getColor(ExtendedTheme.MANDATORY_BG_KEY); - if (c == null) - c = ExtendedTheme.DEFAULT_MANDATORY_BG; - return ColorBlind.getDichromatColor(c); - } // getFieldBackground_Mandatory - - /** - * Return Inactive field background color - * @return Color - */ - public static Color getFieldBackground_Inactive() - { - Color c = UIManager.getColor(ExtendedTheme.INACTIVE_BG_KEY); - if ( c != null ) - return ColorBlind.getDichromatColor(c); - else - return getFieldBackground_Normal(); - } // getFieldBackground_Inactive - - /** - * Return Selected field background color - * @return Color - */ - public static Color getFieldBackground_Selected() - { - Color c = UIManager.getColor(ExtendedTheme.SELECTED_BG_KEY); - if (c == null) - c = ExtendedTheme.DEFAULT_SELECTED_BG; - return ColorBlind.getDichromatColor(c); - } // getFieldBackground_Selected - - /** - * Return ReadOnly field background color - * @return Color - */ - public static Color getFieldBackground_ReadOnly() - { - Color c = UIManager.getColor(ExtendedTheme.READONLY_BG_KEY); - if (c == null) - c = ExtendedTheme.DEFAULT_READONLY_BG; - return ColorBlind.getDichromatColor(c); - } // getFieldBackground_ReadOnly - - /** - * Return form background color "control". - * Windows = lightGray - * @return Color - */ - public static Color getFormBackground() - { - return ColorBlind.getDichromatColor(UIManager.getColor("control")); - } // getFormBackground - - /** - * Info Background Color "info" - * Windows = info (light yellow) - * @return Color - */ - public static Color getInfoBackground() - { - Color c = UIManager.getColor(ExtendedTheme.INFO_BG_KEY); - if (c == null) - c = UIManager.getColor("info"); - return ColorBlind.getDichromatColor(c); - } // getInfoBackground - - - /****** Text *************************************************************/ - - /** - * Normal field text foreground color "textText" - * Windows = black - * @return Color - */ - public static Color getTextColor_Normal() - { - return ColorBlind.getDichromatColor(UIManager.getColor("textText")); - } // getText_Normal - - /** - * OK Text Foreground Color (Theme) - * @return Color - */ - public static Color getTextColor_OK() - { - return getTextColor_Normal(); - } // getText_OK - - /** - * Issue Text Foreground Color (Theme) - * @return Color - */ - public static Color getTextColor_Issue() - { - Color c = UIManager.getColor(ExtendedTheme.ERROR_FG_KEY); - if (c == null) - c = ExtendedTheme.DEFAULT_ERROR_FG; - return ColorBlind.getDichromatColor(c); - } // getText_Issue - - /** - * Label Text foreground Color "controlText" - * Windows = black - * @return Color - */ - public static Color getTextColor_Label() - { - return ColorBlind.getDichromatColor(UIManager.getColor("controlText")); - } // getTextColor_Label - - /** - * Get Primary1 - * @return primary 1 - */ - public static Color getPrimary1() - { - return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getPrimaryControlDarkShadow()); - } - /** - * Get Primary2 - * @return primary 2 - */ - public static Color getPrimary2() - { - return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getPrimaryControlShadow()); - } - /** - * Get Primary3 - * @return primary 3 - */ - public static Color getPrimary3() - { - return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getPrimaryControl()); - } - /** - * Get Secondary 1 - * @return secondary 1 - */ - public static Color getSecondary1() - { - return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getControlDarkShadow()); - } - /** - * Get Secondary 2 - * @return secondary 2 - */ - public static Color getSecondary2() - { - return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getControlShadow()); - } - /** - * Get Secondary 3 - * @return secondary 3 - */ - public static Color getSecondary3() - { - return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getControl()); - } - - - /****** Fonts ************************************************************/ - - /** - * Get Header Font (window title font) - * @return font - */ - public static Font getFont_Header() - { - return MetalLookAndFeel.getWindowTitleFont(); - } // getFont_Header - - /** - * Get Field Font - * @return font - */ - public static Font getFont_Field() - { - return UIManager.getFont("TextField.font"); - } // getFont_Field - - /** - * Get Label Font - * @return font - */ - public static Font getFont_Label() - { - return UIManager.getFont("Label.font"); - } // setFont_Label - - /** - * Get Small (report) Font - * @return font - */ - public static Font getFont_Small() - { - return MetalLookAndFeel.getSubTextFont(); - } // setFont_Small - - /****** Available L&F ****************************************************/ - - /** Available Looks */ - private static ValueNamePair[] s_looks = null; - /** Default PLAF */ - private static ValueNamePair s_defaultPLAF = null; - /** Available Themes */ - private static ValueNamePair[] s_metalThemes = null; - private static ValueNamePair[] s_plasticThemes = null; - - //default theme - private static ValueNamePair s_vp_compiereTheme = null; - private static ValueNamePair s_vp_metalTheme = null; - //e-evolution vpj-cd 19102006 - private static ValueNamePair s_vp_adempiereTheme = null; - //e-evolution vpj-cd 1910200sky - - /** - * Static Initializer. - * - Fill available PLAFs and Themes - */ - static - { - ArrayList plafList = new ArrayList(); - //e-evolution vpj-cd 19102006 - ValueNamePair vp = null; - ArrayList metalThemes = new ArrayList(); - ArrayList plasticThemes = new ArrayList(); - - try - { - Class.forName("com.jgoodies.looks.plastic.Plastic3DLookAndFeel"); - vp = new ValueNamePair("org.adempiere.plaf.AdempiereLookAndFeel", org.adempiere.plaf.AdempiereLookAndFeel.NAME); - plafList.add(vp); - s_vp_adempiereTheme = new ValueNamePair("org.adempiere.plaf.AdempiereTheme", AdempiereThemeInnova.NAME); - plasticThemes.add (s_vp_adempiereTheme); - - List installedThemes = AdempiereLookAndFeel.getInstalledThemes(); - for(Object t : installedThemes) { - MetalTheme theme = (MetalTheme)t; - vp = new ValueNamePair(theme.getClass().getName(), theme.getName()); - plasticThemes.add(vp); - } - } - catch (Exception e) - { - log.severe("Plastic look and feel not found"); - } - //e-evolution vpj-cd 19102006 - vp = new ValueNamePair("org.compiere.plaf.CompiereLookAndFeel", CompiereLookAndFeel.NAME); - plafList.add (vp); - - //Metal - s_vp_compiereTheme = new ValueNamePair("org.compiere.plaf.CompiereThemeBlueMetal", CompiereThemeBlueMetal.NAME); - metalThemes.add (s_vp_compiereTheme); - metalThemes.add (new ValueNamePair("org.compiere.plaf.CompiereThemeIce", CompiereThemeIce.NAME)); - s_vp_metalTheme = new ValueNamePair("javax.swing.plaf.metal.OceanTheme", "Ocean"); - metalThemes.add (s_vp_metalTheme); - metalThemes.add (new ValueNamePair("javax.swing.plaf.metal.DefaultMetalTheme", "Steel")); - metalThemes.add (new ValueNamePair("org.compiere.plaf.AquaTheme", "Aqua")); - metalThemes.add (new ValueNamePair("org.compiere.plaf.CharcoalTheme", "Charcoal")); - metalThemes.add (new ValueNamePair("org.compiere.plaf.ContrastTheme", "Contrast")); - metalThemes.add (new ValueNamePair("org.compiere.plaf.EmeraldTheme", "Emerald")); - metalThemes.add (new ValueNamePair("org.compiere.plaf.RubyTheme", "Ruby")); - - // Install discovered PLAFs - for (int i = 0; i < plafList.size(); i++) - { - vp = plafList.get(i); - UIManager.installLookAndFeel(vp.getName(), vp.getValue()); - } - - // Fill Available PLAFs - plafList = new ArrayList(); - UIManager.LookAndFeelInfo[] lfInfo = UIManager.getInstalledLookAndFeels(); - for (int i = 0; i < lfInfo.length; i++) - { - vp = new ValueNamePair (lfInfo[i].getClassName(), lfInfo[i].getName()); - plafList.add(vp); - if (lfInfo[i].getName().equals(org.adempiere.plaf.AdempiereLookAndFeel.NAME)) - { - s_defaultPLAF = vp; - if (log.isLoggable(Level.FINEST)) log.finest(vp.getName() + " (default)"); - } - else - if (log.isLoggable(Level.FINEST)) log.finest(vp.getName()); - } - s_looks = new ValueNamePair[plafList.size()]; - plafList.toArray(s_looks); - - // Fill Available Themes - s_metalThemes = new ValueNamePair[metalThemes.size()]; - metalThemes.toArray(s_metalThemes); - - s_plasticThemes = new ValueNamePair[plasticThemes.size()]; - plasticThemes.toArray(s_plasticThemes); - // - // printPLAFDefaults(); - } // static Initializer - - - /** - * Get available Look And Feels - * @return Array of ValueNamePair with name and class of Look and Feel - */ - public static ValueNamePair[] getPLAFs() - { - return s_looks; - } // getPLAFs - - /** - * Get the list of available Metal or Plastic Themes. - * @return Array of Strings with Names of Metal Themes - */ - public static ValueNamePair[] getThemes () - { - LookAndFeel l = UIManager.getLookAndFeel(); - if ( l instanceof AdempiereLookAndFeel) - return s_plasticThemes; - else if ( l instanceof MetalLookAndFeel) - return s_metalThemes; - return new ValueNamePair[0]; - } // getThemes - - - /************************************************************************** - * Set PLAF based on Ini Properties - */ - public static void setPLAF () - { - String look = Ini.getProperty(Ini.P_UI_LOOK); - String lookTheme = Ini.getProperty(Ini.P_UI_THEME); - // Search for PLAF - ValueNamePair plaf = null; - for (int i = 0; i < s_looks.length; i++) - { - if (s_looks[i].getName().equals(look)) - { - plaf = s_looks[i]; - break; - } - } - // Search for Theme - ValueNamePair theme = null; - for (int i = 0; i < s_metalThemes.length; i++) - { - if (s_metalThemes[i].getName().equals(lookTheme)) - { - theme = s_metalThemes[i]; - break; - } - } - - if (theme == null) - { - for (int i = 0; i < s_plasticThemes.length; i++) - { - if (s_plasticThemes[i].getName().equals(lookTheme)) - { - theme = s_plasticThemes[i]; - break; - } - } - } - // Set PLAF - setPLAF (plaf == null ? s_defaultPLAF : plaf, theme, true); - } // setPLAF - - /** - * Set PLAF and update Ini - * - * @param plaf ValueNamePair of the PLAF to be set - * @param theme Optional Theme name - * @param upateIni Update setting to INI - */ - public static void setPLAF (ValueNamePair plaf, ValueNamePair theme, boolean updateIni) - { - if (plaf == null) - return; - if (log.isLoggable(Level.CONFIG)) log.config(plaf + (theme == null ? "" : (" - " + theme))); - - // Look & Feel - Class lafClass = null; - try { - lafClass = Class.forName(plaf.getValue()); - } - catch (Exception e) - { - log.severe(e.getMessage()); - return; - } - - if ( updateIni ) { - Ini.setProperty(Ini.P_UI_LOOK, plaf.getName()); - // Optional Theme - Ini.setProperty(Ini.P_UI_THEME, ""); - } - - // Default Theme - boolean metal = MetalLookAndFeel.class.isAssignableFrom(lafClass); - boolean adempiere = AdempiereLookAndFeel.class.isAssignableFrom(lafClass); - boolean compiere = CompiereLookAndFeel.class.isAssignableFrom(lafClass); - if (theme == null && metal) - { - if (compiere) - theme = s_vp_compiereTheme; - else if (adempiere) - theme = s_vp_adempiereTheme; - else - theme = s_vp_metalTheme; - } - if (theme != null && metal && theme.getValue().length() > 0) - { - try - { - Class c = Class.forName(theme.getValue()); - MetalTheme t = (MetalTheme)c.newInstance(); - if (compiere) - CompiereLookAndFeel.setCurrentTheme(t); - else if (adempiere && t instanceof PlasticTheme) - AdempiereLookAndFeel.setCurrentTheme((PlasticTheme)t); - else - MetalLookAndFeel.setCurrentTheme(t); - // - if (updateIni) - Ini.setProperty(Ini.P_UI_THEME, theme.getName()); - } - catch (Exception e) - { - log.severe("Theme - " + e.getMessage()); - } - } - try - { - UIManager.setLookAndFeel((LookAndFeel)lafClass.newInstance()); - } - catch (Exception e) - { - log.severe(e.getMessage()); - } - if (log.isLoggable(Level.CONFIG)) log.config(plaf + " - " + theme); - // printPLAFDefaults(); - } // setPLAF - - /** - * Update UI of this and parent Windows - * @param win window - */ - public static void updateUI (Window win) - { - if (win == null) - return; - Window c = win; - do - { - SwingUtilities.updateComponentTreeUI(c); - c.invalidate(); - c.pack(); - c.validate(); - c.repaint(); - c = c.getOwner(); - } - while (c != null); - } // updateUI - - /** - * Reset PLAF Settings - */ - public static void reset () - { - // Clean Theme Properties - AdempierePLAF.setPLAF (); - } // reset - - /** - * Print current UIDefaults - */ - public static void printPLAFDefaults () - { - System.out.println(UIManager.getLookAndFeel()); - Object[] keys = UIManager.getLookAndFeelDefaults().keySet().toArray(); - Arrays.sort(keys); - char lastStart = ' '; - for (int i = 0; i < keys.length; i++) - { - StringBuffer sb = new StringBuffer(); - sb.append(keys[i]).append(" = ").append(UIManager.get(keys[i])); - if (keys[i].toString().charAt(0) != lastStart) - { - System.out.println(); - lastStart = keys[i].toString().charAt(0); - } - System.out.println(sb); - } - } // printPLAFDefaults - - /** - * Is AdempiereL&F the active L&F - * @return true if L&F is Adempiere - */ - public static boolean isActive() - { - return UIManager.getLookAndFeel() instanceof AdempiereLookAndFeel; - } // isActive - - /*************************************************************************/ - - static ResourceBundle s_res = ResourceBundle.getBundle("org.compiere.plaf.PlafRes"); - - /** - * Create OK Button - * @return OK button - */ - public static CButton getOKButton() - { - CButton b = new CButton(); - b.setIcon(new ImageIcon(AdempierePLAF.class.getResource("icons/Ok24.gif"))); - b.setMargin(new Insets(0,10,0,10)); - b.setToolTipText (s_res.getString("OK")); - return b; - } // getOKButton - - /** - * Create Cancel Button - * @return Cancel button - */ - public static CButton getCancelButton() - { - CButton b = new CButton(); - b.setIcon(new ImageIcon(AdempierePLAF.class.getResource("icons/Cancel24.gif"))); - b.setMargin(new Insets(0,10,0,10)); - b.setToolTipText (s_res.getString("Cancel")); - return b; - } // getCancelButton - - /** - * Center Window on Screen and show it - * @param window window - */ - public static void showCenterScreen (Window window) - { - window.pack(); - Dimension sSize = Toolkit.getDefaultToolkit().getScreenSize(); - Dimension wSize = window.getSize(); - window.setLocation(((sSize.width-wSize.width)/2), ((sSize.height-wSize.height)/2)); - window.toFront(); - window.setVisible(true); - } // showCenterScreen - - /** - * Invoke the correct method to set current metal based theme. - * Supported look and feel are Metal, Plastic and Compiere. - * @param laf Metal based look and feel - * @param theme Metal based theme - */ - public static void setCurrentMetalTheme(MetalLookAndFeel laf, MetalTheme theme) - { - if (laf instanceof CompiereLookAndFeel) - CompiereLookAndFeel.setCurrentTheme(theme); - else if (laf instanceof AdempiereLookAndFeel && theme instanceof PlasticTheme) - AdempiereLookAndFeel.setCurrentTheme((PlasticTheme)theme); - else - MetalLookAndFeel.setCurrentTheme(theme); - } - - /************************************************************************** - * Start Class With Adempiere Look - * @param args first parameter is class to start, if none start PLAF Editor - */ - public static void main (String[] args) - { - String jVersion = System.getProperty("java.version"); - if (!(jVersion.startsWith("1.5"))) - { - JOptionPane.showMessageDialog (null, - "Require Java Version 1.5 or up - Not " + jVersion, - "AdempierePLAF - Version Conflict", - JOptionPane.ERROR_MESSAGE); - System.exit(1); - } - - // set the defined PLAF - Ini.loadProperties (true); - setPLAF (); - // - if (args.length == 0) - { - return; - } - - String className = args[0]; - // find class - Class startClass = null; - try - { - startClass = Class.forName(className); - } - catch (Exception e) - { - log.severe("Did not find: " + className); - e.printStackTrace(); - System.exit(1); - } - - // try static main method - try - { - Method[] methods = startClass.getMethods(); - if (methods.length > 0) - { - if (Modifier.isStatic(methods[0].getModifiers()) && methods[0].getName().equals("main")) - { - String[] startArgs = new String[args.length-1]; - for (int ii = 1; ii < args.length; ii++) - startArgs[ii] = args[ii]; - methods[0].invoke(null, new Object[] {startArgs}); - } - return; - } - } - catch (Exception ee) - { - log.severe("Problems invoking main"); - ee.printStackTrace(); - } - - // start the class - try - { - startClass.newInstance(); - } - catch (Exception e) - { - log.severe("Cannot start: " + className); - e.printStackTrace(); - System.exit(1); - } - } // main - -} // AdempierePLAF diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereTabbedPaneUI.java b/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereTabbedPaneUI.java deleted file mode 100644 index 895d17a4a6..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereTabbedPaneUI.java +++ /dev/null @@ -1,3236 +0,0 @@ -/* - * Copyright (c) 2001-2006 JGoodies Karsten Lentzsch. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * o Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * o Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * o Neither the name of JGoodies Karsten Lentzsch nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package org.adempiere.plaf; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Insets; -import java.awt.LayoutManager; -import java.awt.Point; -import java.awt.Polygon; -import java.awt.Rectangle; -import java.awt.Shape; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; - -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.ActionMap; -import javax.swing.Icon; -import javax.swing.JButton; -import javax.swing.JComponent; -import javax.swing.JPanel; -import javax.swing.JTabbedPane; -import javax.swing.JViewport; -import javax.swing.SwingConstants; -import javax.swing.SwingUtilities; -import javax.swing.UIManager; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.UIResource; -import javax.swing.plaf.basic.BasicTabbedPaneUI; -import javax.swing.plaf.metal.MetalTabbedPaneUI; -import javax.swing.text.View; - -import com.jgoodies.looks.LookUtils; -import com.jgoodies.looks.Options; -import com.jgoodies.looks.plastic.PlasticLookAndFeel; - -/** - * The JGoodies Plastic Look&Feel implementation of - * TabbedPaneUI. It differs from its superclass - * MetalTabbedPaneUI in that it paints new tab shapes, - * provides two options, and supports ClearLook. - *

    - * You can enable or disable icons in tabs globally via - * com.jgoodies.looks.Options.setTabIconsEnabled(boolean). - *

    - * To disable the content border set - *

    - * JTabbedPane tabbedPane = new JTabbedPane();
    - * tabbedPane.putClientProperty(Option.NO_CONTENT_BORDER_KEY, Boolean.TRUE);
    - * 
    - * To paint embedded tabs use - *
    - * JTabbedPane tabbedPane = new JTabbedPane();
    - * tabbedPane.putClientProperty(Option.EMBEDDED_TABS_KEY, Boolean.TRUE);
    - * 
    - *

    - * There's a special mode that helps you detect content borders in - * heavily wrapped component hierarchies - such as the NetBeans IDE. - * In this marked mode the content border is painted as a Magenta line. - * You can enable this mode by setting the System property - * markContentBorders to true; in a command line: - *

    - * java -DmarkContentBorders=true
    - * 
    - * - * @author Karsten Lentzsch - * @author Torge Husfeldt - * @author Andrej Golovnin - * @version $Revision: 1.4 $ - * - * @see Options - */ -public final class AdempiereTabbedPaneUI extends MetalTabbedPaneUI { - - - // State ****************************************************************** - - /** - * Describes if tabs are painted with or without icons. - */ - private static boolean isTabIconsEnabled = Options.isTabIconsEnabled(); - - /** - * Describes if we paint no content border or not; is false by default. - * You can disable the content border by setting the client property - * Options.NO_CONTENT_BORDER_KEY to Boolean.TRUE; - */ - private Boolean noContentBorder; - - /** - * Describes if we paint tabs in an embedded style that is with - * less decoration; this is false by default. - * You can enable the embedded tabs style by setting the client property - * Options.EMBEDDED_TABS_KEY to Boolean.TRUE. - */ - private Boolean embeddedTabs; - - /** - * Holds the renderer that is used to render the tabs. - */ - private AbstractRenderer renderer; - - - /** For use when tabLayoutPolicy == SCROLL_TAB_LAYOUT. */ - private ScrollableTabSupport tabScroller; - - private Boolean hideIfOneTab; - - /** - * Creates the PlasticTabbedPaneUI. - * - * @see javax.swing.plaf.ComponentUI#createUI(JComponent) - */ - public static ComponentUI createUI(JComponent tabPane) { - return new AdempiereTabbedPaneUI(); - } - - /** - * Installs the UI. - * - * @see javax.swing.plaf.ComponentUI#installUI(JComponent) - */ - public void installUI(JComponent c) { - super.installUI(c); - embeddedTabs = (Boolean) c.getClientProperty(Options.EMBEDDED_TABS_KEY); - noContentBorder = (Boolean) c.getClientProperty(Options.NO_CONTENT_BORDER_KEY); - hideIfOneTab = (Boolean) c.getClientProperty(AdempiereLookAndFeel.HIDE_IF_ONE_TAB); - renderer = createRenderer(tabPane); - } - - /** - * Uninstalls the UI. - * @see javax.swing.plaf.ComponentUI#uninstallUI(JComponent) - */ - public void uninstallUI(JComponent c) { - renderer = null; - super.uninstallUI(c); - } - - /** - * Creates and installs any required subcomponents for the JTabbedPane. - * Invoked by installUI. - * @see javax.swing.plaf.basic.BasicTabbedPaneUI#installComponents() - */ - protected void installComponents() { - if (scrollableTabLayoutEnabled()) { - if (tabScroller == null) { - tabScroller = new ScrollableTabSupport(tabPane.getTabPlacement()); - tabPane.add(tabScroller.viewport); - } - } - } - - /** - * Removes any installed subcomponents from the JTabbedPane. - * Invoked by uninstallUI. - * @see javax.swing.plaf.basic.BasicTabbedPaneUI#uninstallComponents() - */ - protected void uninstallComponents() { - if (scrollableTabLayoutEnabled()) { - tabPane.remove(tabScroller.viewport); - tabPane.remove(tabScroller.scrollForwardButton); - tabPane.remove(tabScroller.scrollBackwardButton); - tabScroller = null; - } - } - - protected void installListeners() { - super.installListeners(); - // if the layout policy is the SCROLL_TAB_LAYOUT, the super class - // will install the mouse listener on tabPane instead of - // tabScroller#tabPanel and there is no way to prevent this. - // That's why the mouse listener must be removed from tabPane and - // added to tabScroller#tabPanel when the scroll tab layout is enabled. - // This applies only to JDK 1.4!!! - if ((mouseListener != null) && (LookUtils.IS_JAVA_1_4)) { - if (scrollableTabLayoutEnabled()) { - tabPane.removeMouseListener(mouseListener); - tabScroller.tabPanel.addMouseListener(mouseListener); - } - } - } - - protected void uninstallListeners() { - if ((mouseListener != null) && (LookUtils.IS_JAVA_1_4)) { - if (scrollableTabLayoutEnabled()) { // SCROLL_TAB_LAYOUT - tabScroller.tabPanel.removeMouseListener(mouseListener); - } else { // WRAP_TAB_LAYOUT - tabPane.removeMouseListener(mouseListener); - } - mouseListener = null; - } - super.uninstallListeners(); - } - - protected void installKeyboardActions() { - super.installKeyboardActions(); - // if the layout policy is the SCROLL_TAB_LAYOUT, then replace - // the forward and backward actions, installed in the action map - // in the supper class, by our own. - if (scrollableTabLayoutEnabled()) { - Action forwardAction = new ScrollTabsForwardAction(); - Action backwardAction = new ScrollTabsBackwardAction(); - ActionMap am = SwingUtilities.getUIActionMap(tabPane); - am.put("scrollTabsForwardAction", forwardAction); - am.put("scrollTabsBackwardAction", backwardAction); - tabScroller.scrollForwardButton.setAction(forwardAction); - tabScroller.scrollBackwardButton.setAction(backwardAction); - } - } - - /** - * Checks and answers if content border will be painted. - * This is controlled by the component's client property - * Options.NO_CONTENT_BORDER or Options.EMBEDDED. - */ - private boolean hasNoContentBorder() { - return Boolean.TRUE.equals(noContentBorder); - } - - /** - * Checks and answers if tabs are painted with minimal decoration. - */ - private boolean hasEmbeddedTabs() { - return Boolean.TRUE.equals(embeddedTabs); - } - - private boolean isHideIfOneTab() { - return Boolean.TRUE.equals(hideIfOneTab); - } - - /** - * Creates the renderer used to lay out and paint the tabs. - * @param tabbedPane the UIs component - * @return AbstractRenderer the renderer that will be used to paint - */ - private AbstractRenderer createRenderer(JTabbedPane tabbedPane) { - return hasEmbeddedTabs() - ? AbstractRenderer.createEmbeddedRenderer(tabbedPane) - : AbstractRenderer.createRenderer(tabPane); - } - - /** - * Creates and answer a handler that listens to property changes. - * Unlike the superclass BasicTabbedPane, the PlasticTabbedPaneUI - * uses an extended Handler. - */ - protected PropertyChangeListener createPropertyChangeListener() { - return new MyPropertyChangeHandler(); - } - - protected ChangeListener createChangeListener() { - return new TabSelectionHandler(); - } - - /* - * Private helper method for the next three methods. - */ - private void doLayout() { - tabPane.revalidate(); - tabPane.repaint(); - } - - /** - * Updates the renderer and layout. This message is sent by - * my PropertyChangeHandler whenever the tab placement changes. - */ - private void tabPlacementChanged() { - renderer = createRenderer(tabPane); - if (scrollableTabLayoutEnabled()) { - tabScroller.createButtons(); - } - doLayout(); - } - - /** - * Updates the embedded tabs property. This message is sent by - * my PropertyChangeHandler whenever the embedded tabs property changes. - */ - private void embeddedTabsPropertyChanged(Boolean newValue) { - embeddedTabs = newValue; - renderer = createRenderer(tabPane); - doLayout(); - } - - /** - * Updates the no content border property. This message is sent - * by my PropertyChangeHandler whenever the noContentBorder - * property changes. - */ - private void noContentBorderPropertyChanged(Boolean newValue) { - noContentBorder = newValue; - tabPane.repaint(); - } - - public void paint(Graphics g, JComponent c) { - int selectedIndex = tabPane.getSelectedIndex(); - int tabPlacement = tabPane.getTabPlacement(); - - ensureCurrentLayout(); - - // Paint tab area - // If scrollable tabs are enabled, the tab area will be - // painted by the scrollable tab panel instead. - // - if (!scrollableTabLayoutEnabled()) { // WRAP_TAB_LAYOUT - paintTabArea(g, tabPlacement, selectedIndex); - } - - // Paint content border - paintContentBorder(g, tabPlacement, selectedIndex); - } - - protected void paintTab(Graphics g, int tabPlacement, Rectangle[] rects, - int tabIndex, Rectangle iconRect, Rectangle textRect) { - Rectangle tabRect = rects[tabIndex]; - int selectedIndex = tabPane.getSelectedIndex(); - boolean isSelected = selectedIndex == tabIndex; - Graphics2D g2 = null; - Polygon cropShape = null; - Shape save = null; - int cropx = 0; - int cropy = 0; - - if (scrollableTabLayoutEnabled()) { - if (g instanceof Graphics2D) { - g2 = (Graphics2D) g; - - // Render visual for cropped tab edge... - Rectangle viewRect = tabScroller.viewport.getViewRect(); - int cropline; - switch (tabPlacement) { - case LEFT: - case RIGHT: - cropline = viewRect.y + viewRect.height; - if ((tabRect.y < cropline) - && (tabRect.y + tabRect.height > cropline)) { - cropShape = createCroppedTabClip(tabPlacement, tabRect, - cropline); - cropx = tabRect.x; - cropy = cropline - 1; - } - break; - case TOP: - case BOTTOM: - default: - cropline = viewRect.x + viewRect.width; - if ((tabRect.x < cropline) - && (tabRect.x + tabRect.width > cropline)) { - cropShape = createCroppedTabClip(tabPlacement, tabRect, - cropline); - cropx = cropline - 1; - cropy = tabRect.y; - } - } - if (cropShape != null) { - save = g.getClip(); - g2.clip(cropShape); - } - } - } - - paintTabBackground(g, tabPlacement, tabIndex, tabRect.x, tabRect.y, - tabRect.width, tabRect.height, isSelected); - - paintTabBorder(g, tabPlacement, tabIndex, tabRect.x, tabRect.y, - tabRect.width, tabRect.height, isSelected); - - String title = tabPane.getTitleAt(tabIndex); - Font font = tabPane.getFont(); - FontMetrics metrics = g.getFontMetrics(font); - Icon icon = getIconForTab(tabIndex); - - layoutLabel(tabPlacement, metrics, tabIndex, title, icon, tabRect, - iconRect, textRect, isSelected); - - paintText(g, tabPlacement, font, metrics, tabIndex, title, textRect, - isSelected); - - paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected); - - paintFocusIndicator(g, tabPlacement, rects, tabIndex, iconRect, - textRect, isSelected); - - if (cropShape != null) { - paintCroppedTabEdge(g, tabPlacement, tabIndex, isSelected, cropx, - cropy); - g.setClip(save); - } - } - - /* - * This method will create and return a polygon shape for the given tab - * rectangle which has been cropped at the specified cropline with a torn - * edge visual. e.g. A "File" tab which has cropped been cropped just after - * the "i": - * ------------- - * | ..... | - * | . | - * | ... . | - * | . . | - * | . . | - * | . . | - * -------------- - * - * The x, y arrays below define the pattern used to create a "torn" edge - * segment which is repeated to fill the edge of the tab. For tabs placed on - * TOP and BOTTOM, this righthand torn edge is created by line segments - * which are defined by coordinates obtained by subtracting xCropLen[i] from - * (tab.x + tab.width) and adding yCroplen[i] to (tab.y). For tabs placed on - * LEFT or RIGHT, the bottom torn edge is created by subtracting xCropLen[i] - * from (tab.y + tab.height) and adding yCropLen[i] to (tab.x). - */ - private int[] xCropLen = { 1, 1, 0, 0, 1, 1, 2, 2 }; - - private int[] yCropLen = { 0, 3, 3, 6, 6, 9, 9, 12 }; - - private static final int CROP_SEGMENT = 12; - - private Polygon createCroppedTabClip(int tabPlacement, Rectangle tabRect, - int cropline) { - int rlen = 0; - int start = 0; - int end = 0; - int ostart = 0; - - switch (tabPlacement) { - case LEFT: - case RIGHT: - rlen = tabRect.width; - start = tabRect.x; - end = tabRect.x + tabRect.width; - ostart = tabRect.y; - break; - case TOP: - case BOTTOM: - default: - rlen = tabRect.height; - start = tabRect.y; - end = tabRect.y + tabRect.height; - ostart = tabRect.x; - } - int rcnt = rlen / CROP_SEGMENT; - if (rlen % CROP_SEGMENT > 0) { - rcnt++; - } - int npts = 2 + (rcnt * 8); - int[] xp = new int[npts]; - int[] yp = new int[npts]; - int pcnt = 0; - - xp[pcnt] = ostart; - yp[pcnt++] = end; - xp[pcnt] = ostart; - yp[pcnt++] = start; - for (int i = 0; i < rcnt; i++) { - for (int j = 0; j < xCropLen.length; j++) { - xp[pcnt] = cropline - xCropLen[j]; - yp[pcnt] = start + (i * CROP_SEGMENT) + yCropLen[j]; - if (yp[pcnt] >= end) { - yp[pcnt] = end; - pcnt++; - break; - } - pcnt++; - } - } - if (tabPlacement == SwingConstants.TOP - || tabPlacement == SwingConstants.BOTTOM) { - return new Polygon(xp, yp, pcnt); - - } - //LEFT or RIGHT - return new Polygon(yp, xp, pcnt); - } - - /* If tabLayoutPolicy == SCROLL_TAB_LAYOUT, this method will paint an edge - * indicating the tab is cropped in the viewport display - */ - private void paintCroppedTabEdge(Graphics g, int tabPlacement, - int tabIndex, boolean isSelected, int x, int y) { - switch (tabPlacement) { - case LEFT: - case RIGHT: - int xx = x; - g.setColor(shadow); - while (xx <= x + rects[tabIndex].width) { - for (int i = 0; i < xCropLen.length; i += 2) { - g.drawLine(xx + yCropLen[i], y - xCropLen[i], xx - + yCropLen[i + 1] - 1, y - xCropLen[i + 1]); - } - xx += CROP_SEGMENT; - } - break; - case TOP: - case BOTTOM: - default: - int yy = y; - g.setColor(shadow); - while (yy <= y + rects[tabIndex].height) { - for (int i = 0; i < xCropLen.length; i += 2) { - g.drawLine(x - xCropLen[i], yy + yCropLen[i], x - - xCropLen[i + 1], yy + yCropLen[i + 1] - 1); - } - yy += CROP_SEGMENT; - } - } - } - - private void ensureCurrentLayout() { - if (!tabPane.isValid()) { - tabPane.validate(); - } - /* If tabPane doesn't have a peer yet, the validate() call will - * silently fail. We handle that by forcing a layout if tabPane - * is still invalid. See bug 4237677. - */ - if (!tabPane.isValid()) { - TabbedPaneLayout layout = (TabbedPaneLayout) tabPane.getLayout(); - layout.calculateLayoutInfo(); - } - } - - /** - * Returns the tab index which intersects the specified point - * in the JTabbedPane's coordinate space. - */ - public int tabForCoordinate(JTabbedPane pane, int x, int y) { - ensureCurrentLayout(); - Point p = new Point(x, y); - - if (scrollableTabLayoutEnabled()) { - translatePointToTabPanel(x, y, p); - Rectangle viewRect = tabScroller.viewport.getViewRect(); - if (!viewRect.contains(p)) { - return -1; - } - } - int tabCount = tabPane.getTabCount(); - for (int i = 0; i < tabCount; i++) { - if (rects[i].contains(p.x, p.y)) { - return i; - } - } - return -1; - } - - protected Rectangle getTabBounds(int tabIndex, Rectangle dest) { - dest.width = rects[tabIndex].width; - dest.height = rects[tabIndex].height; - if (scrollableTabLayoutEnabled()) { // SCROLL_TAB_LAYOUT - // Need to translate coordinates based on viewport location & - // view position - Point vpp = tabScroller.viewport.getLocation(); - Point viewp = tabScroller.viewport.getViewPosition(); - dest.x = rects[tabIndex].x + vpp.x - viewp.x; - dest.y = rects[tabIndex].y + vpp.y - viewp.y; - } else { // WRAP_TAB_LAYOUT - dest.x = rects[tabIndex].x; - dest.y = rects[tabIndex].y; - } - return dest; - } - - /** - * Returns the index of the tab closest to the passed in location, note - * that the returned tab may not contain the location x,y. - */ - private int getClosestTab(int x, int y) { - int min = 0; - int tabCount = Math.min(rects.length, tabPane.getTabCount()); - int max = tabCount; - int tabPlacement = tabPane.getTabPlacement(); - boolean useX = (tabPlacement == TOP || tabPlacement == BOTTOM); - int want = (useX) ? x : y; - - while (min != max) { - int current = (max + min) / 2; - int minLoc; - int maxLoc; - - if (useX) { - minLoc = rects[current].x; - maxLoc = minLoc + rects[current].width; - } else { - minLoc = rects[current].y; - maxLoc = minLoc + rects[current].height; - } - if (want < minLoc) { - max = current; - if (min == max) { - return Math.max(0, current - 1); - } - } else if (want >= maxLoc) { - min = current; - if (max - min <= 1) { - return Math.max(current + 1, tabCount - 1); - } - } else { - return current; - } - } - return min; - } - - /** - * Returns a point which is translated from the specified point in the - * JTabbedPane's coordinate space to the coordinate space of the - * ScrollableTabPanel. This is used for SCROLL_TAB_LAYOUT ONLY. - */ - private Point translatePointToTabPanel(int srcx, int srcy, Point dest) { - Point vpp = tabScroller.viewport.getLocation(); - Point viewp = tabScroller.viewport.getViewPosition(); - dest.x = srcx - vpp.x + viewp.x; - dest.y = srcy - vpp.y + viewp.y; - return dest; - } - - protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) { - int tabCount = tabPane.getTabCount(); - - Rectangle iconRect = new Rectangle(), - textRect = new Rectangle(); - Rectangle clipRect = g.getClipBounds(); - - // Paint tabRuns of tabs from back to front - for (int i = runCount - 1; i >= 0; i--) { - int start = tabRuns[i]; - int next = tabRuns[(i == runCount - 1) ? 0 : i + 1]; - int end = (next != 0 ? next - 1 : tabCount - 1); - for (int j = end; j >= start; j--) { - if (j != selectedIndex && rects[j].intersects(clipRect)) { - paintTab(g, tabPlacement, rects, j, iconRect, textRect); - } - } - } - - // Paint selected tab if its in the front run - // since it may overlap other tabs - if (selectedIndex >= 0 && rects[selectedIndex].intersects(clipRect)) { - paintTab(g, tabPlacement, rects, selectedIndex, iconRect, textRect); - } - } - - /* - * Copied here from super(super)class to avoid labels being centered on - * vertical tab runs if they consist of icon and text - */ - protected void layoutLabel( - int tabPlacement, - FontMetrics metrics, - int tabIndex, - String title, - Icon icon, - Rectangle tabRect, - Rectangle iconRect, - Rectangle textRect, - boolean isSelected) { - textRect.x = textRect.y = iconRect.x = iconRect.y = 0; - //fix of issue #4 - View v = getTextViewForTab(tabIndex); - if (v != null) { - tabPane.putClientProperty("html", v); - } - - Rectangle calcRectangle = new Rectangle(tabRect); - if (isSelected) { - Insets calcInsets = getSelectedTabPadInsets(tabPlacement); - calcRectangle.x += calcInsets.left; - calcRectangle.y += calcInsets.top; - calcRectangle.width -= calcInsets.left + calcInsets.right; - calcRectangle.height -= calcInsets.bottom + calcInsets.top; - } - int xNudge = getTabLabelShiftX(tabPlacement, tabIndex, isSelected); - int yNudge = getTabLabelShiftY(tabPlacement, tabIndex, isSelected); - if ((tabPlacement == RIGHT || tabPlacement == LEFT) && icon != null && title != null && !title.equals("")) { - SwingUtilities.layoutCompoundLabel( - tabPane, - metrics, - title, - icon, - SwingConstants.CENTER, - SwingConstants.LEFT, - SwingConstants.CENTER, - SwingConstants.TRAILING, - calcRectangle, - iconRect, - textRect, - textIconGap); - xNudge += 4; - } else { - SwingUtilities.layoutCompoundLabel( - tabPane, - metrics, - title, - icon, - SwingConstants.CENTER, - SwingConstants.CENTER, - SwingConstants.CENTER, - SwingConstants.TRAILING, - calcRectangle, - iconRect, - textRect, - textIconGap); - iconRect.y += calcRectangle.height % 2; - } - - //fix of issue #4 - tabPane.putClientProperty("html", null); - - iconRect.x += xNudge; - iconRect.y += yNudge; - textRect.x += xNudge; - textRect.y += yNudge; - } - - /** - * Answers the icon for the tab with the specified index. - * In case, we have globally switched of the use tab icons, - * we answer null if and only if we have a title. - */ - protected Icon getIconForTab(int tabIndex) { - String title = tabPane.getTitleAt(tabIndex); - boolean hasTitle = (title != null) && (title.length() > 0); - return !isTabIconsEnabled && hasTitle - ? null - : super.getIconForTab(tabIndex); - } - - /** - * Creates the layout manager used to set the tab's bounds. - */ - protected LayoutManager createLayoutManager() { - if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { - return new TabbedPaneScrollLayout(); - } - /* WRAP_TAB_LAYOUT */ - return new TabbedPaneLayout(); - } - - /* In an attempt to preserve backward compatibility for programs - * which have extended BasicTabbedPaneUI to do their own layout, the - * UI uses the installed layoutManager (and not tabLayoutPolicy) to - * determine if scrollTabLayout is enabled. - */ - private boolean scrollableTabLayoutEnabled() { - return tabPane.getLayout() instanceof TabbedPaneScrollLayout; - } - - protected boolean isTabInFirstRun(int tabIndex) { - return getRunForTab(tabPane.getTabCount(), tabIndex) == 0; - } - - protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) { - int width = tabPane.getWidth(); - int height = tabPane.getHeight(); - Insets insets = tabPane.getInsets(); - - int x = insets.left; - int y = insets.top; - int w = width - insets.right - insets.left; - int h = height - insets.top - insets.bottom; - - switch (tabPlacement) { - case LEFT : - x += calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); - w -= (x - insets.left); - break; - case RIGHT : - w -= calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); - break; - case BOTTOM : - h -= calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); - break; - case TOP : - default : - y += calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); - h -= (y - insets.top); - } - // Fill region behind content area - g.setColor(selectColor == null - ? tabPane.getBackground() - : selectColor); - g.fillRect(x, y, w, h); - - Rectangle selRect; - selRect = (selectedIndex < 0) ? null : getTabBounds(selectedIndex, calcRect); - boolean drawBroken = selectedIndex >= 0 && isTabInFirstRun(selectedIndex); - boolean isContentBorderPainted = !hasNoContentBorder(); - // It sounds a bit odd to call paintContentBorder with - // a parameter isContentBorderPainted set to false. - // But in this case the part of the border touching the tab - // area will still be painted so best let the renderer decide. - renderer.paintContentBorderTopEdge (g, x, y, w, h, drawBroken, selRect, isContentBorderPainted); - renderer.paintContentBorderLeftEdge (g, x, y, w, h, drawBroken, selRect, isContentBorderPainted); - renderer.paintContentBorderBottomEdge(g, x, y, w, h, drawBroken, selRect, isContentBorderPainted); - renderer.paintContentBorderRightEdge (g, x, y, w, h, drawBroken, selRect, isContentBorderPainted); - } - - // - // Here comes a number of methods that are just delegated to the - // appropriate renderer - // - /** - * Returns the insets (i.e. the width) of the content Border. - */ - protected Insets getContentBorderInsets(int tabPlacement) { - return renderer.getContentBorderInsets(super.getContentBorderInsets(tabPlacement)); - } - - /** - * Returns the amount by which the Tab Area is inset. - */ - protected Insets getTabAreaInsets(int tabPlacement) { - return renderer.getTabAreaInsets(super.getTabAreaInsets(tabPlacement)); - } - - /** - * Returns the amount by which the label should be shifted horizontally. - */ - protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected) { - return renderer.getTabLabelShiftX(tabIndex, isSelected); - } - - /** - * Returns the amount by which the label should be shifted vertically. - */ - protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected) { - return renderer.getTabLabelShiftY(tabIndex, isSelected); - } - - /** - * Returns the amount (in pixels) by which two runs should overlap. - */ - protected int getTabRunOverlay(int tabPlacement) { - return renderer.getTabRunOverlay(tabRunOverlay); - } - - /** - * This boolean controls wheather the given run should be padded to - * use up as much space as the others (with more tabs in them). - */ - protected boolean shouldPadTabRun(int tabPlacement, int run) { - return renderer.shouldPadTabRun(run, super.shouldPadTabRun(tabPlacement, run)); - } - - /** - * Returns the amount by which the run number run - * should be indented. Add six pixels for every run to make - * diagonal lines align. - */ - protected int getTabRunIndent(int tabPlacement, int run) { - return renderer.getTabRunIndent(run); - } - - /** - * Returns the insets for this tab. - */ - protected Insets getTabInsets(int tabPlacement, int tabIndex) { - Insets insets = renderer.getTabInsets(tabIndex, tabInsets); - //adempiere hierarchical tab - int level = 0; - Component comp = tabPane.getComponentAt(tabIndex); - if (comp instanceof JComponent) - { - JComponent jc = (JComponent)comp; - try - { - Integer ll = (Integer)jc.getClientProperty(AdempiereLookAndFeel.TABLEVEL); - if (ll != null) - level = ll.intValue(); - } - catch (Exception e) - { - System.err.println("AdempiereTabbedPaneUI - ClientProperty: " + e.getMessage()); - } - } - if (level != 0) - { - if (tabPlacement == LEFT) - insets.left += level * 10; - } - return insets; - } - - /** - * Returns the insets for selected tab. - */ - protected Insets getSelectedTabPadInsets(int tabPlacement) { - return renderer.getSelectedTabPadInsets(); - } - - /** - * Draws the rectancle around the Tab label which indicates keyboard focus. - */ - protected void paintFocusIndicator( - Graphics g, - int tabPlacement, - Rectangle[] rectangles, - int tabIndex, - Rectangle iconRect, - Rectangle textRect, - boolean isSelected) { - renderer.paintFocusIndicator(g, rectangles, tabIndex, iconRect, textRect, isSelected); - } - - /** - * Fills the background of the given tab to make sure overlap of - * tabs is handled correctly. - * Note: that tab backgrounds seem to be painted somewhere else, too. - */ - protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - renderer.paintTabBackground(g, tabIndex, x, y, w, h, isSelected); - } - - /** - * Paints the border for one tab. Gets the bounds of the tab as parameters. - * Note that the result is not clipped so you can paint outside that - * rectangle. Tabs painted later on have a chance to overwrite though. - */ - protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - renderer.paintTabBorder(g, tabIndex, x, y, w, h, isSelected); - } - - /** - * Answers wheather tab runs should be rotated. If true, the layout mechanism - * will move the run containing the selected tab so that it touches - * the content pane. - */ - protected boolean shouldRotateTabRuns(int tabPlacement) { - return false; - } - - private class TabSelectionHandler implements ChangeListener { - - private Rectangle rect = new Rectangle(); - - public void stateChanged(ChangeEvent e) { - JTabbedPane tabPane = (JTabbedPane) e.getSource(); - tabPane.revalidate(); - tabPane.repaint(); - - if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { - int index = tabPane.getSelectedIndex(); - if (index < rects.length && index != -1) { - rect.setBounds(rects[index]); - Point viewPosition = tabScroller.viewport.getViewPosition(); - if (rect.x < viewPosition.x) { - rect.x -= renderer.getTabsOverlay(); - } else { - rect.x += renderer.getTabsOverlay(); - } - tabScroller.tabPanel.scrollRectToVisible(rect); - } - } - } - } - - /** - * Catches and handles property change events. In addition to the super - * class behavior we listen to changes of the ancestor, tab placement, - * and JGoodies options for content border, and embedded tabs. - */ - private class MyPropertyChangeHandler - extends BasicTabbedPaneUI.PropertyChangeHandler { - public void propertyChange(PropertyChangeEvent e) { - String pName = e.getPropertyName(); - - if (null == pName) { - return; - } - - super.propertyChange(e); - - if (pName.equals("tabPlacement")) { - tabPlacementChanged(); - return; - } - if (pName.equals(Options.EMBEDDED_TABS_KEY)) { - embeddedTabsPropertyChanged((Boolean) e.getNewValue()); - return; - } - if (pName.equals(Options.NO_CONTENT_BORDER_KEY)) { - noContentBorderPropertyChanged((Boolean) e.getNewValue()); - return; - } - - if (pName.equals(AdempiereLookAndFeel.HIDE_IF_ONE_TAB)) { - hideIfOneTab = (Boolean)e.getNewValue(); - } - } - } - - /** - * Does all the layout work. The result is stored in the container - * class's instance variables. Mainly the rects[] vector. - */ - private class TabbedPaneLayout extends BasicTabbedPaneUI.TabbedPaneLayout implements LayoutManager { - - protected void calculateTabRects(int tabPlacement, int tabCount) { - FontMetrics metrics = getFontMetrics(); - Dimension size = tabPane.getSize(); - Insets insets = tabPane.getInsets(); - Insets theTabAreaInsets = getTabAreaInsets(tabPlacement); - int fontHeight = metrics.getHeight(); - int selectedIndex = tabPane.getSelectedIndex(); - int theTabRunOverlay; - int i, j; - int x, y; - int returnAt; - boolean verticalTabRuns = (tabPlacement == LEFT || tabPlacement == RIGHT); - boolean leftToRight = tabPane.getComponentOrientation().isLeftToRight(); - - // - // Calculate bounds within which a tab run must fit - // - switch (tabPlacement) { - case LEFT : - maxTabWidth = calculateMaxTabWidth(tabPlacement); - x = insets.left + theTabAreaInsets.left; - y = insets.top + theTabAreaInsets.top; - returnAt = size.height - (insets.bottom + theTabAreaInsets.bottom); - break; - case RIGHT : - maxTabWidth = calculateMaxTabWidth(tabPlacement); - x = size.width - insets.right - theTabAreaInsets.right - maxTabWidth; - y = insets.top + theTabAreaInsets.top; - returnAt = size.height - (insets.bottom + theTabAreaInsets.bottom); - break; - case BOTTOM : - maxTabHeight = calculateMaxTabHeight(tabPlacement); - x = insets.left + theTabAreaInsets.left; - y = size.height - insets.bottom - theTabAreaInsets.bottom - maxTabHeight; - returnAt = size.width - (insets.right + theTabAreaInsets.right); - break; - case TOP : - default : - maxTabHeight = calculateMaxTabHeight(tabPlacement); - x = insets.left + theTabAreaInsets.left; - y = insets.top + theTabAreaInsets.top; - returnAt = size.width - (insets.right + theTabAreaInsets.right); - break; - } - - theTabRunOverlay = getTabRunOverlay(tabPlacement); - - runCount = 0; - selectedRun = -1; - //keeps track of where we are in the current run. - //this helps not to rely on fragile positioning - //informaion to find out wheter the active Tab - //is the first in run - int tabInRun = -1; - // make a copy of returnAt for the current run and modify - // that so returnAt may still be used later on - int runReturnAt = returnAt; - - if (tabCount == 0) { - return; - } - - if (tabCount == 1 && isHideIfOneTab()) { - rects[0].height = 0; - rects[0].width = 0; - rects[0].x = 0; - rects[0].y = 0; - return; - } - - // Run through tabs and partition them into runs - Rectangle rect; - for (i = 0; i < tabCount; i++) { - rect = rects[i]; - tabInRun++; - - if (!verticalTabRuns) { - // Tabs on TOP or BOTTOM.... - if (i > 0) { - rect.x = rects[i - 1].x + rects[i - 1].width; - } else { - tabRuns[0] = 0; - runCount = 1; - maxTabWidth = 0; - rect.x = x; - // tabInRun = 0; - } - rect.width = calculateTabWidth(tabPlacement, i, metrics); - maxTabWidth = Math.max(maxTabWidth, rect.width); - - // Never move a TAB down a run if it is the first in run. - // Even if there isn't enough room, moving it to a fresh - // line won't help. - // if (rect.x != 2 + insets.left && rect.x + rect.width > returnAt) { - // Never rely on phisical position information to determine - // logical position (if you can avoid it) - if (tabInRun != 0 && rect.x + rect.width > runReturnAt) { - if (runCount > tabRuns.length - 1) { - expandTabRunsArray(); - } - // just created a new run, adjust some counters - tabInRun = 0; - tabRuns[runCount] = i; - runCount++; - rect.x = x; - runReturnAt = runReturnAt - 2 * getTabRunIndent(tabPlacement, runCount); - } - // Initialize y position in case there's just one run - rect.y = y; - rect.height = maxTabHeight /* - 2*/; - - } else { - // Tabs on LEFT or RIGHT... - if (i > 0) { - rect.y = rects[i - 1].y + rects[i - 1].height; - } else { - tabRuns[0] = 0; - runCount = 1; - maxTabHeight = 0; - rect.y = y; - // tabInRun = 0; - } - rect.height = calculateTabHeight(tabPlacement, i, fontHeight); - maxTabHeight = Math.max(maxTabHeight, rect.height); - - // Never move a TAB over a run if it is the first in run. - // Even if there isn't enough room, moving it to a fresh - // run won't help. - // if (rect.y != 2 + insets.top && rect.y + rect.height > returnAt) { - if (tabInRun != 0 && rect.y + rect.height > runReturnAt) { - if (runCount > tabRuns.length - 1) { - expandTabRunsArray(); - } - tabRuns[runCount] = i; - runCount++; - rect.y = y; - tabInRun = 0; - runReturnAt -= 2 * getTabRunIndent(tabPlacement, runCount); - } - // Initialize x position in case there's just one column - rect.x = x; - rect.width = maxTabWidth /* - 2*/; - - } - - //adempiere hierarchical tab - int level = 0; - Component comp = tabPane.getComponentAt(i); - if (comp instanceof JComponent) - { - JComponent jc = (JComponent)comp; - try - { - Integer ll = (Integer)jc.getClientProperty(AdempiereLookAndFeel.TABLEVEL); - if (ll != null) - level = ll.intValue(); - } - catch (Exception e) - { - System.err.println("AdempiereTabbedPaneUI - ClientProperty: " + e.getMessage()); - } - } - if (level != 0) - { - if (tabPlacement == LEFT) - rect.x += level * 10; - rect.width -= level * 10; - } - - if (i == selectedIndex) { - selectedRun = runCount - 1; - } - } - - if (runCount > 1) { - // Re-distribute tabs in case last run has leftover space - //last line flush left is OK - // normalizeTabRuns(tabPlacement, tabCount, verticalTabRuns? y : x, returnAt); - //don't need to recalculate selectedRun if not changed - // selectedRun = getRunForTab(tabCount, selectedIndex); - - // Rotate run array so that selected run is first - if (shouldRotateTabRuns(tabPlacement)) { - rotateTabRuns(tabPlacement, selectedRun); - } - } - - // Step through runs from back to front to calculate - // tab y locations and to pad runs appropriately - for (i = runCount - 1; i >= 0; i--) { - int start = tabRuns[i]; - int next = tabRuns[i == (runCount - 1) ? 0 : i + 1]; - int end = (next != 0 ? next - 1 : tabCount - 1); - int indent = getTabRunIndent(tabPlacement, i); - if (!verticalTabRuns) { - for (j = start; j <= end; j++) { - rect = rects[j]; - rect.y = y; - rect.x += indent; - // try to make tabRunIndent symmetric - // rect.width -= 2* indent + 20; - } - if (shouldPadTabRun(tabPlacement, i)) { - padTabRun(tabPlacement, start, end, returnAt - 2 * indent); - } - if (tabPlacement == BOTTOM) { - y -= (maxTabHeight - theTabRunOverlay); - } else { - y += (maxTabHeight - theTabRunOverlay); - } - } else { - for (j = start; j <= end; j++) { - rect = rects[j]; - rect.x = x; - rect.y += indent; - } - if (shouldPadTabRun(tabPlacement, i)) { - padTabRun(tabPlacement, start, end, returnAt - 2 * indent); - } - if (tabPlacement == RIGHT) { - x -= (maxTabWidth - theTabRunOverlay); - } else { - x += (maxTabWidth - theTabRunOverlay); - } - } - } - - // Pad the selected tab so that it appears raised in front - padSelectedTab(tabPlacement, selectedIndex); - - // if right to left and tab placement on the top or - // the bottom, flip x positions and adjust by widths - if (!leftToRight && !verticalTabRuns) { - int rightMargin = size.width - (insets.right + theTabAreaInsets.right); - for (i = 0; i < tabCount; i++) { - rects[i].x = rightMargin - rects[i].x - rects[i].width - + renderer.getTabsOverlay(); - } - } - } - - /** - * Overridden to insure the same behavior in JDK 6.0 as in JDK 5.0. - */ - protected void padSelectedTab(int tabPlacement, int selectedIndex) { - if (selectedIndex >= 0) { - Rectangle selRect = rects[selectedIndex]; - Insets padInsets = getSelectedTabPadInsets(tabPlacement); - selRect.x -= padInsets.left; - selRect.width += (padInsets.left + padInsets.right); - selRect.y -= padInsets.top; - selRect.height += (padInsets.top + padInsets.bottom); - } - } - - } - - - private boolean requestFocusForVisibleComponentX() { - Component visibleComponent = getVisibleComponent(); - if (visibleComponent.isFocusable()) { - visibleComponent.requestFocus(); - return true; - } - if (visibleComponent instanceof JComponent) { - if (((JComponent) visibleComponent).requestDefaultFocus()) { - return true; - } - } - return false; - } - - private static class ScrollTabsForwardAction extends AbstractAction { - - /** - * - */ - private static final long serialVersionUID = -270810699887568982L; - - public void actionPerformed(ActionEvent e) { - JTabbedPane pane = null; - Object src = e.getSource(); - if (src instanceof JTabbedPane) { - pane = (JTabbedPane) src; - } else if (src != null - && src.getClass().getName().equals("com.jgoodies.looks.plastic.com.jgoodies.looks.plastic")) { - pane = (JTabbedPane) ((Component) src).getParent(); - } else { - return; // shouldn't happen - } - AdempiereTabbedPaneUI ui = (AdempiereTabbedPaneUI) pane.getUI(); - - if (ui.scrollableTabLayoutEnabled()) { - ui.tabScroller.scrollForward(pane.getTabPlacement()); - } - } - } - - private static class ScrollTabsBackwardAction extends AbstractAction { - - /** - * - */ - private static final long serialVersionUID = -3249390793846061809L; - - public void actionPerformed(ActionEvent e) { - JTabbedPane pane = null; - Object src = e.getSource(); - if (src instanceof JTabbedPane) { - pane = (JTabbedPane) src; - } else if (src != null - && src.getClass().getName().equals("com.jgoodies.looks.plastic.com.jgoodies.looks.plastic")) { - pane = (JTabbedPane) ((Component) src).getParent(); - } else { - return; // shouldn't happen - } - AdempiereTabbedPaneUI ui = (AdempiereTabbedPaneUI) pane.getUI(); - - if (ui.scrollableTabLayoutEnabled()) { - ui.tabScroller.scrollBackward(pane.getTabPlacement()); - } - } - } - - private class TabbedPaneScrollLayout extends TabbedPaneLayout { - - protected int preferredTabAreaHeight(int tabPlacement, int width) { - return calculateMaxTabHeight(tabPlacement); - } - - protected int preferredTabAreaWidth(int tabPlacement, int height) { - return calculateMaxTabWidth(tabPlacement); - } - - public void layoutContainer(Container parent) { - int tabPlacement = tabPane.getTabPlacement(); - int tabCount = tabPane.getTabCount(); - Insets insets = tabPane.getInsets(); - int selectedIndex = tabPane.getSelectedIndex(); - Component visibleComponent = getVisibleComponent(); - - calculateLayoutInfo(); - - if (selectedIndex < 0) { - if (visibleComponent != null) { - // The last tab was removed, so remove the component - setVisibleComponent(null); - } - } else { - Component selectedComponent = tabPane.getComponentAt(selectedIndex); - boolean shouldChangeFocus = false; - - // In order to allow programs to use a single component - // as the display for multiple tabs, we will not change - // the visible compnent if the currently selected tab - // has a null component. This is a bit dicey, as we don't - // explicitly state we support this in the spec, but since - // programs are now depending on this, we're making it work. - // - if (selectedComponent != null) { - if (selectedComponent != visibleComponent && - visibleComponent != null) { - if (SwingUtilities.findFocusOwner(visibleComponent) != null) { - shouldChangeFocus = true; - } - } - setVisibleComponent(selectedComponent); - } - int tx, ty, tw, th; // tab area bounds - int cx, cy, cw, ch; // content area bounds - Insets contentInsets = getContentBorderInsets(tabPlacement); - Rectangle bounds = tabPane.getBounds(); - int numChildren = tabPane.getComponentCount(); - - if (numChildren > 0) { - switch (tabPlacement) { - case LEFT: - // calculate tab area bounds - tw = calculateTabAreaWidth(tabPlacement, runCount, - maxTabWidth); - th = bounds.height - insets.top - insets.bottom; - tx = insets.left; - ty = insets.top; - - // calculate content area bounds - cx = tx + tw + contentInsets.left; - cy = ty + contentInsets.top; - cw = bounds.width - insets.left - insets.right - tw - - contentInsets.left - contentInsets.right; - ch = bounds.height - insets.top - insets.bottom - - contentInsets.top - contentInsets.bottom; - break; - case RIGHT: - // calculate tab area bounds - tw = calculateTabAreaWidth(tabPlacement, runCount, - maxTabWidth); - th = bounds.height - insets.top - insets.bottom; - tx = bounds.width - insets.right - tw; - ty = insets.top; - - // calculate content area bounds - cx = insets.left + contentInsets.left; - cy = insets.top + contentInsets.top; - cw = bounds.width - insets.left - insets.right - tw - - contentInsets.left - contentInsets.right; - ch = bounds.height - insets.top - insets.bottom - - contentInsets.top - contentInsets.bottom; - break; - case BOTTOM: - // calculate tab area bounds - tw = bounds.width - insets.left - insets.right; - th = calculateTabAreaHeight(tabPlacement, runCount, - maxTabHeight); - tx = insets.left; - ty = bounds.height - insets.bottom - th; - - // calculate content area bounds - cx = insets.left + contentInsets.left; - cy = insets.top + contentInsets.top; - cw = bounds.width - insets.left - insets.right - - contentInsets.left - contentInsets.right; - ch = bounds.height - insets.top - insets.bottom - th - - contentInsets.top - contentInsets.bottom; - break; - case TOP: - default: - // calculate tab area bounds - tw = bounds.width - insets.left - insets.right; - th = calculateTabAreaHeight(tabPlacement, runCount, - maxTabHeight); - tx = insets.left; - ty = insets.top; - - // calculate content area bounds - cx = tx + contentInsets.left; - cy = ty + th + contentInsets.top; - cw = bounds.width - insets.left - insets.right - - contentInsets.left - contentInsets.right; - ch = bounds.height - insets.top - insets.bottom - th - - contentInsets.top - contentInsets.bottom; - } - - for (int i = 0; i < numChildren; i++) { - Component child = tabPane.getComponent(i); - - if (tabScroller != null && child == tabScroller.viewport) { - JViewport viewport = (JViewport) child; - Rectangle viewRect = viewport.getViewRect(); - int vw = tw; - int vh = th; - Dimension butSize = tabScroller.scrollForwardButton.getPreferredSize(); - switch (tabPlacement) { - case LEFT: - case RIGHT: - int totalTabHeight = rects[tabCount - 1].y - + rects[tabCount - 1].height; - if (totalTabHeight > th) { - // Allow space for scrollbuttons - vh = (th > 2 * butSize.height) ? th - 2 - * butSize.height : 0; - if (totalTabHeight - viewRect.y <= vh) { - // Scrolled to the end, so ensure the - // viewport size is - // such that the scroll offset aligns - // with a tab - vh = totalTabHeight - viewRect.y; - } - } - break; - case BOTTOM: - case TOP: - default: - int totalTabWidth = rects[tabCount - 1].x - + rects[tabCount - 1].width + renderer.getTabsOverlay(); - if (totalTabWidth > tw) { - // Need to allow space for scrollbuttons - vw = (tw > 2 * butSize.width) ? tw - 2 - * butSize.width : 0; - if (totalTabWidth - viewRect.x <= vw) { - // Scrolled to the end, so ensure the - // viewport size is - // such that the scroll offset aligns - // with a tab - vw = totalTabWidth - viewRect.x; - } - } - } - child.setBounds(tx, ty, vw, vh); - - } else if (tabScroller != null && - (child == tabScroller.scrollForwardButton || - child == tabScroller.scrollBackwardButton)) { - Component scrollbutton = child; - Dimension bsize = scrollbutton.getPreferredSize(); - int bx = 0; - int by = 0; - int bw = bsize.width; - int bh = bsize.height; - boolean visible = false; - - switch (tabPlacement) { - case LEFT: - case RIGHT: - int totalTabHeight = rects[tabCount - 1].y - + rects[tabCount - 1].height; - if (totalTabHeight > th) { - visible = true; - bx = (tabPlacement == LEFT ? tx + tw - - bsize.width : tx); - by = (child == tabScroller.scrollForwardButton) ? bounds.height - - insets.bottom - bsize.height - : bounds.height - insets.bottom - 2 - * bsize.height; - } - break; - - case BOTTOM: - case TOP: - default: - int totalTabWidth = rects[tabCount - 1].x - + rects[tabCount - 1].width; - - if (totalTabWidth > tw) { - visible = true; - bx = (child == tabScroller.scrollForwardButton) ? bounds.width - - insets.left - bsize.width - : bounds.width - insets.left - 2 - * bsize.width; - by = (tabPlacement == TOP ? ty + th - - bsize.height : ty); - } - } - child.setVisible(visible); - if (visible) { - child.setBounds(bx, by, bw, bh); - } - - } else { - // All content children... - child.setBounds(cx, cy, cw, ch); - } - } - if (shouldChangeFocus) { - if (!requestFocusForVisibleComponentX()) { - tabPane.requestFocus(); - } - } - } - } - } - - protected void calculateTabRects(int tabPlacement, int tabCount) { - FontMetrics metrics = getFontMetrics(); - Dimension size = tabPane.getSize(); - Insets insets = tabPane.getInsets(); - Insets tabAreaInsets = getTabAreaInsets(tabPlacement); - int fontHeight = metrics.getHeight(); - int selectedIndex = tabPane.getSelectedIndex(); - boolean verticalTabRuns = (tabPlacement == LEFT || tabPlacement == RIGHT); - boolean leftToRight = tabPane.getComponentOrientation().isLeftToRight(); - int x = tabAreaInsets.left; - int y = tabAreaInsets.top; - int totalWidth = 0; - int totalHeight = 0; - - // - // Calculate bounds within which a tab run must fit - // - switch(tabPlacement) { - case LEFT: - case RIGHT: - maxTabWidth = calculateMaxTabWidth(tabPlacement); - break; - case BOTTOM: - case TOP: - default: - maxTabHeight = calculateMaxTabHeight(tabPlacement); - } - - runCount = 0; - selectedRun = -1; - - if (tabCount == 0) { - return; - } - - if (tabCount == 1 && isHideIfOneTab()) { - rects[0].height = 0; - rects[0].width = 0; - rects[0].x = 0; - rects[0].y = 0; - return; - } - - selectedRun = 0; - runCount = 1; - - // Run through tabs and lay them out in a single run - Rectangle rect; - for (int i = 0; i < tabCount; i++) { - rect = rects[i]; - - if (!verticalTabRuns) { - // Tabs on TOP or BOTTOM.... - if (i > 0) { - rect.x = rects[i-1].x + rects[i-1].width; - } else { - tabRuns[0] = 0; - maxTabWidth = 0; - totalHeight += maxTabHeight; - rect.x = x; - } - rect.width = calculateTabWidth(tabPlacement, i, metrics); - totalWidth = rect.x + rect.width + renderer.getTabsOverlay(); - maxTabWidth = Math.max(maxTabWidth, rect.width); - - rect.y = y; - rect.height = maxTabHeight/* - 2*/; - - } else { - // Tabs on LEFT or RIGHT... - if (i > 0) { - rect.y = rects[i-1].y + rects[i-1].height; - } else { - tabRuns[0] = 0; - maxTabHeight = 0; - totalWidth = maxTabWidth; - rect.y = y; - } - rect.height = calculateTabHeight(tabPlacement, i, fontHeight); - totalHeight = rect.y + rect.height; - maxTabHeight = Math.max(maxTabHeight, rect.height); - - rect.x = x; - rect.width = maxTabWidth/* - 2*/; - - } - - //adempiere hierarchical tab - int level = 0; - Component comp = tabPane.getComponentAt(i); - if (comp instanceof JComponent) - { - JComponent jc = (JComponent)comp; - try - { - Integer ll = (Integer)jc.getClientProperty(AdempiereLookAndFeel.TABLEVEL); - if (ll != null) - level = ll.intValue(); - } - catch (Exception e) - { - System.err.println("AdempiereTabbedPaneUI - ClientProperty: " + e.getMessage()); - } - } - if (level != 0) - { - if (tabPlacement == LEFT) - rect.x += level * 10; - rect.width -= level * 10; - } - } - - // Pad the selected tab so that it appears raised in front - padSelectedTab(tabPlacement, selectedIndex); - - // if right to left and tab placement on the top or - // the bottom, flip x positions and adjust by widths - if (!leftToRight && !verticalTabRuns) { - int rightMargin = size.width - - (insets.right + tabAreaInsets.right); - for (int i = 0; i < tabCount; i++) { - rects[i].x = rightMargin - rects[i].x - rects[i].width; - } - } - tabScroller.tabPanel.setPreferredSize(new Dimension(totalWidth, totalHeight)); - } - } - - private class ScrollableTabSupport implements ActionListener, - ChangeListener { - - public ScrollableTabViewport viewport; - public ScrollableTabPanel tabPanel; - public JButton scrollForwardButton; - public JButton scrollBackwardButton; - public int leadingTabIndex; - private Point tabViewPosition = new Point(0, 0); - - ScrollableTabSupport(int tabPlacement) { - viewport = new ScrollableTabViewport(); - tabPanel = new ScrollableTabPanel(); - viewport.setView(tabPanel); - viewport.addChangeListener(this); - createButtons(); - } - - /** - * Recreates the scroll buttons and adds them to the TabbedPane. - */ - void createButtons() { - if (scrollForwardButton != null) { - tabPane.remove(scrollForwardButton); - scrollForwardButton.removeActionListener(this); - tabPane.remove(scrollBackwardButton); - scrollBackwardButton.removeActionListener(this); - } - int tabPlacement = tabPane.getTabPlacement(); - int width = UIManager.getInt("ScrollBar.width"); - if (tabPlacement == TOP || tabPlacement == BOTTOM) { - scrollForwardButton = new ArrowButton(EAST, width); - scrollBackwardButton = new ArrowButton(WEST, width); - } else { // tabPlacement = LEFT || RIGHT - scrollForwardButton = new ArrowButton(SOUTH, width); - scrollBackwardButton = new ArrowButton(NORTH, width); - } - scrollForwardButton.addActionListener(this); - scrollBackwardButton.addActionListener(this); - tabPane.add(scrollForwardButton); - tabPane.add(scrollBackwardButton); - } - - public void scrollForward(int tabPlacement) { - Dimension viewSize = viewport.getViewSize(); - Rectangle viewRect = viewport.getViewRect(); - - if (tabPlacement == TOP || tabPlacement == BOTTOM) { - if (viewRect.width >= viewSize.width - viewRect.x) { - return; // no room left to scroll - } - } else { // tabPlacement == LEFT || tabPlacement == RIGHT - if (viewRect.height >= viewSize.height - viewRect.y) { - return; - } - } - setLeadingTabIndex(tabPlacement, leadingTabIndex + 1); - } - - public void scrollBackward(int tabPlacement) { - if (leadingTabIndex == 0) { - return; // no room left to scroll - } - setLeadingTabIndex(tabPlacement, leadingTabIndex - 1); - } - - public void setLeadingTabIndex(int tabPlacement, int index) { - leadingTabIndex = index; - Dimension viewSize = viewport.getViewSize(); - Rectangle viewRect = viewport.getViewRect(); - - switch (tabPlacement) { - case TOP: - case BOTTOM: - tabViewPosition.x = leadingTabIndex == 0 ? 0 - : rects[leadingTabIndex].x - renderer.getTabsOverlay(); - - if ((viewSize.width - tabViewPosition.x) < viewRect.width) { - // We've scrolled to the end, so adjust the viewport size - // to ensure the view position remains aligned on a tab - // boundary - Dimension extentSize = new Dimension(viewSize.width - - tabViewPosition.x, viewRect.height); - viewport.setExtentSize(extentSize); - } - break; - case LEFT: - case RIGHT: - tabViewPosition.y = leadingTabIndex == 0 ? 0 - : rects[leadingTabIndex].y; - - if ((viewSize.height - tabViewPosition.y) < viewRect.height) { - // We've scrolled to the end, so adjust the viewport size - // to ensure the view position remains aligned on a tab - // boundary - Dimension extentSize = new Dimension(viewRect.width, - viewSize.height - tabViewPosition.y); - viewport.setExtentSize(extentSize); - } - } - viewport.setViewPosition(tabViewPosition); - } - - public void stateChanged(ChangeEvent e) { - JViewport viewport = (JViewport) e.getSource(); - int tabPlacement = tabPane.getTabPlacement(); - int tabCount = tabPane.getTabCount(); - Rectangle vpRect = viewport.getBounds(); - Dimension viewSize = viewport.getViewSize(); - Rectangle viewRect = viewport.getViewRect(); - - leadingTabIndex = getClosestTab(viewRect.x, viewRect.y); - - // If the tab isn't right aligned, adjust it. - if (leadingTabIndex + 1 < tabCount) { - switch (tabPlacement) { - case TOP: - case BOTTOM: - if (rects[leadingTabIndex].x < viewRect.x) { - leadingTabIndex++; - } - break; - case LEFT: - case RIGHT: - if (rects[leadingTabIndex].y < viewRect.y) { - leadingTabIndex++; - } - break; - } - } - Insets contentInsets = getContentBorderInsets(tabPlacement); - switch (tabPlacement) { - case LEFT: - tabPane.repaint(vpRect.x + vpRect.width, vpRect.y, - contentInsets.left, vpRect.height); - scrollBackwardButton.setEnabled(viewRect.y > 0 - && leadingTabIndex > 0); - scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 - && viewSize.height - viewRect.y > viewRect.height); - break; - case RIGHT: - tabPane.repaint(vpRect.x - contentInsets.right, vpRect.y, - contentInsets.right, vpRect.height); - scrollBackwardButton.setEnabled(viewRect.y > 0 - && leadingTabIndex > 0); - scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 - && viewSize.height - viewRect.y > viewRect.height); - break; - case BOTTOM: - tabPane.repaint(vpRect.x, vpRect.y - contentInsets.bottom, - vpRect.width, contentInsets.bottom); - scrollBackwardButton.setEnabled(viewRect.x > 0 - && leadingTabIndex > 0); - scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 - && viewSize.width - viewRect.x > viewRect.width); - break; - case TOP: - default: - tabPane.repaint(vpRect.x, vpRect.y + vpRect.height, - vpRect.width, contentInsets.top); - scrollBackwardButton.setEnabled(viewRect.x > 0 - && leadingTabIndex > 0); - scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 - && viewSize.width - viewRect.x > viewRect.width); - } - } - - /** - * ActionListener for the scroll buttons. - */ - public void actionPerformed(ActionEvent e) { - ActionMap map = tabPane.getActionMap(); - - if (map != null) { - String actionKey; - - if (e.getSource() == scrollForwardButton) { - actionKey = "scrollTabsForwardAction"; - } else { - actionKey = "scrollTabsBackwardAction"; - } - Action action = map.get(actionKey); - - if (action != null && action.isEnabled()) { - action.actionPerformed(new ActionEvent(tabPane, - ActionEvent.ACTION_PERFORMED, null, e.getWhen(), e - .getModifiers())); - } - } - } - - } - - private class ScrollableTabViewport extends JViewport implements UIResource { - - /** - * - */ - private static final long serialVersionUID = 327251688467352279L; - - public ScrollableTabViewport() { - super(); - setName("TabbedPane.scrollableViewport"); - setScrollMode(SIMPLE_SCROLL_MODE); - setOpaque(tabPane.isOpaque()); - Color bgColor = UIManager.getColor("TabbedPane.tabAreaBackground"); - if (bgColor == null) { - bgColor = tabPane.getBackground(); - } - setBackground(bgColor); - } - } - - private class ScrollableTabPanel extends JPanel implements UIResource { - - /** - * - */ - private static final long serialVersionUID = -7751954262914422261L; - - public ScrollableTabPanel() { - super(null); - setOpaque(tabPane.isOpaque()); - Color bgColor = UIManager.getColor("TabbedPane.tabAreaBackground"); - if (bgColor == null) { - bgColor = tabPane.getBackground(); - } - setBackground(bgColor); - } - - public void paintComponent(Graphics g) { - super.paintComponent(g); - AdempiereTabbedPaneUI.this.paintTabArea(g, tabPane.getTabPlacement(), - tabPane.getSelectedIndex()); - - } - } - - private static class ArrowButton extends JButton implements UIResource { - - /** - * - */ - private static final long serialVersionUID = 2076478876425671827L; - private final int buttonWidth; - private final int direction; - private boolean mouseIsOver; - - ArrowButton(int direction, int buttonWidth) { - this.direction = direction; - this.buttonWidth = buttonWidth; - setRequestFocusEnabled(false); - } - - protected void processMouseEvent(MouseEvent e) { - super.processMouseEvent(e); - switch (e.getID()) { - case MouseEvent.MOUSE_ENTERED: - mouseIsOver = true; - revalidate(); - repaint(); - break; - case MouseEvent.MOUSE_EXITED: - mouseIsOver = false; - revalidate(); - repaint(); - break; - } - } - - protected void paintBorder(Graphics g) { - if (mouseIsOver && isEnabled()) { - super.paintBorder(g); - } - } - - protected void paintComponent(Graphics g) { - if (mouseIsOver) { - super.paintComponent(g); - } else { - g.setColor(getBackground()); - g.fillRect(0, 0, getWidth(), getHeight()); - } - paintArrow(g); - } - - private void paintArrow(Graphics g) { - Color oldColor = g.getColor(); - - boolean isEnabled = isEnabled(); - g.setColor(isEnabled ? PlasticLookAndFeel.getControlInfo() - : PlasticLookAndFeel.getControlDisabled()); - - int arrowWidth, arrowHeight; - switch (direction) { - case NORTH: - case SOUTH: - arrowWidth = 9; - arrowHeight = 5; - break; - case WEST: - case EAST: - default: - arrowWidth = 5; - arrowHeight = 9; - break; - } - int x = (getWidth() - arrowWidth ) / 2; - int y = (getHeight() - arrowHeight) / 2; - g.translate(x, y); - - boolean paintShadow = !mouseIsOver || !isEnabled; - Color shadow = isEnabled ? PlasticLookAndFeel.getControlShadow() - : UIManager.getColor("ScrollBar.highlight"); - - switch (direction) { - case NORTH: - g.fillRect(0, 4, 9, 1); - g.fillRect(1, 3, 7, 1); - g.fillRect(2, 2, 5, 1); - g.fillRect(3, 1, 3, 1); - g.fillRect(4, 0, 1, 1); - if (paintShadow) { - g.setColor(shadow); - g.fillRect(1, 5, 9, 1); - } - break; - case SOUTH: - g.fillRect(0, 0, 9, 1); - g.fillRect(1, 1, 7, 1); - g.fillRect(2, 2, 5, 1); - g.fillRect(3, 3, 3, 1); - g.fillRect(4, 4, 1, 1); - if (paintShadow) { - g.setColor(shadow); - g.drawLine(5, 4, 8, 1); - g.drawLine(5, 5, 9, 1); - } - break; - case WEST: - g.fillRect(0, 4, 1, 1); - g.fillRect(1, 3, 1, 3); - g.fillRect(2, 2, 1, 5); - g.fillRect(3, 1, 1, 7); - g.fillRect(4, 0, 1, 9); - if (paintShadow) { - g.setColor(shadow); - g.fillRect(5, 1, 1, 9); - } - break; - case EAST: - g.fillRect(0, 0, 1, 9); - g.fillRect(1, 1, 1, 7); - g.fillRect(2, 2, 1, 5); - g.fillRect(3, 3, 1, 3); - g.fillRect(4, 4, 1, 1); - if (paintShadow) { - g.setColor(shadow); - g.drawLine(1, 8, 4, 5); - g.drawLine(1, 9, 5, 5); - } - break; - } - - g.translate(-x, -y); - g.setColor(oldColor); - } - - public Dimension getPreferredSize() { - return new Dimension(buttonWidth, buttonWidth); - } - - public Dimension getMinimumSize() { - return getPreferredSize(); - } - - public Dimension getMaximumSize() { - return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE); - } - } - - /** - * This is the abstract superclass for all TabbedPane renderers. - * Those will be defined in the rest of this file - */ - private abstract static class AbstractRenderer { - - protected static final Insets EMPTY_INSETS = new Insets(0, 0, 0, 0); - protected static final Insets NORTH_INSETS = new Insets(1, 0, 0, 0); - protected static final Insets WEST_INSETS = new Insets(0, 1, 0, 0); - protected static final Insets SOUTH_INSETS = new Insets(0, 0, 1, 0); - protected static final Insets EAST_INSETS = new Insets(0, 0, 0, 1); - - protected final JTabbedPane tabPane; - @SuppressWarnings("unused") - protected final int tabPlacement; - protected Color shadowColor; - protected Color darkShadow; - protected Color selectColor; - protected Color selectLight; - protected Color selectHighlight; - @SuppressWarnings("unused") - protected Color lightHighlight; - protected Color focus; - - private AbstractRenderer(JTabbedPane tabPane) { - initColors(); - this.tabPane = tabPane; - this.tabPlacement = tabPane.getTabPlacement(); - } - - private static AbstractRenderer createRenderer(JTabbedPane tabPane) { - switch (tabPane.getTabPlacement()) { - case SwingConstants.TOP : - return new TopRenderer(tabPane); - case SwingConstants.BOTTOM : - return new BottomRenderer(tabPane); - case SwingConstants.LEFT : - return new LeftRenderer(tabPane); - case SwingConstants.RIGHT : - return new RightRenderer(tabPane); - default : - return new TopRenderer(tabPane); - } - } - - private static AbstractRenderer createEmbeddedRenderer(JTabbedPane tabPane) { - switch (tabPane.getTabPlacement()) { - case SwingConstants.TOP : - return new TopEmbeddedRenderer(tabPane); - case SwingConstants.BOTTOM : - return new BottomEmbeddedRenderer(tabPane); - case SwingConstants.LEFT : - return new LeftEmbeddedRenderer(tabPane); - case SwingConstants.RIGHT : - return new RightEmbeddedRenderer(tabPane); - default : - return new TopEmbeddedRenderer(tabPane); - } - } - - private void initColors() { - shadowColor = UIManager.getColor("TabbedPane.shadow"); - darkShadow = UIManager.getColor("TabbedPane.darkShadow"); - selectColor = UIManager.getColor("TabbedPane.selected"); - focus = UIManager.getColor("TabbedPane.focus"); - selectHighlight = UIManager.getColor("TabbedPane.selectHighlight"); - lightHighlight = UIManager.getColor("TabbedPane.highlight"); - selectLight = - new Color( - (2 * selectColor.getRed() + selectHighlight.getRed()) / 3, - (2 * selectColor.getGreen() + selectHighlight.getGreen()) / 3, - (2 * selectColor.getBlue() + selectHighlight.getBlue()) / 3); - } - - protected boolean isFirstDisplayedTab(int tabIndex, int position, int paneBorder) { - return tabIndex == 0; -// return (position - paneBorder) < 8; - } - - protected Insets getTabAreaInsets(Insets defaultInsets) { - return defaultInsets; - } - - protected Insets getContentBorderInsets(Insets defaultInsets) { - return defaultInsets; - } - - /** - * Returns the amount by which the label should be shifted horizontally. - */ - protected int getTabLabelShiftX(int tabIndex, boolean isSelected) { - return 0; - } - - /** - * Returns the amount by which the label should be shifted vertically. - */ - protected int getTabLabelShiftY(int tabIndex, boolean isSelected) { - return 0; - } - - /** - * Returns the amount of overlap for two Runs. - */ - protected int getTabRunOverlay(int tabRunOverlay) { - return tabRunOverlay; - } - - /** - * Returns if a run should be padded with empty space - * to take up as much room as the others. - */ - protected boolean shouldPadTabRun(int run, boolean aPriori) { - return aPriori; - } - - /** - * Returns the amount by which the run number run - * should be indented. Add a few pixels for every run to make - * diagonal lines align. - */ - protected int getTabRunIndent(int run) { - return 0; - } - - /** - * Returns the insets for the given tab. - */ - protected abstract Insets getTabInsets(int tabIndex, Insets tabInsets); - - /** - * Draws the rectancle around the Tab label which indicates keyboard focus. - */ - protected abstract void paintFocusIndicator( - Graphics g, - Rectangle[] rects, - int tabIndex, - Rectangle iconRect, - Rectangle textRect, - boolean isSelected); - - /** - * Fills the background of the given tab to make sure overlap of - * tabs is handled correctly. - */ - protected abstract void paintTabBackground(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected); - - /** - * Paints the border around the given tab. - */ - protected abstract void paintTabBorder(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected); - - /** - * Returns additional the insets for the selected tab. This allows to "raise" - * The selected tab over the others - */ - protected Insets getSelectedTabPadInsets() { - return EMPTY_INSETS; - } - - /** - * Draws the top edge of the border around the content area. - * Draw unbroken line for tabs are not on TOP - * override where appropriate. - */ - protected void paintContentBorderTopEdge( - Graphics g, - int x, - int y, - int w, - int h, - boolean drawBroken, - Rectangle selRect, - boolean isContentBorderPainted) { - if (isContentBorderPainted) { - g.setColor(selectHighlight); - g.fillRect(x, y, w - 1, 1); - } - } - - /** - * Draws the bottom edge of the Border around the content area. - * Draw broken line if selected tab is visible and adjacent to content - * and TabPlacement is same as painted edge. - */ - protected void paintContentBorderBottomEdge( - Graphics g, - int x, - int y, - int w, - int h, - boolean drawBroken, - Rectangle selRect, - boolean isContentBorderPainted) { - if (isContentBorderPainted) { - g.setColor(darkShadow); - g.fillRect(x, y + h - 1, w - 1, 1); - } - } - - /** - * Draws the left edge of the Border around the content area. - * Draw broken line if selected tab is visible and adjacent to content - * and TabPlacement is same as painted edge - */ - protected void paintContentBorderLeftEdge( - Graphics g, - int x, - int y, - int w, - int h, - boolean drawBroken, - Rectangle selRect, - boolean isContentBorderPainted) { - if (isContentBorderPainted) { - g.setColor(selectHighlight); - g.fillRect(x, y, 1, h - 1); - } - } - - /** - * Draws the right edge of the Border around the content area. - * Draw broken line if selected tab is visible and adjacent to content - * and TabPlacement is same as painted edge - */ - protected void paintContentBorderRightEdge( - Graphics g, - int x, - int y, - int w, - int h, - boolean drawBroken, - Rectangle selRect, - boolean isContentBorderPainted) { - if (isContentBorderPainted) { - g.setColor(darkShadow); - g.fillRect(x + w - 1, y, 1, h); - } - } - - /** - * Returns the amount of overlap for two tabs. - */ - protected int getTabsOverlay() { - return 0; - } - } - - /** - * The renderer for the case where tabs are displayed below the contents - * and with minimal decoration. - */ - private static final class BottomEmbeddedRenderer extends AbstractRenderer { - - private BottomEmbeddedRenderer(JTabbedPane tabPane) { - super(tabPane); - } - - protected Insets getTabAreaInsets(Insets insets) { - return EMPTY_INSETS; - } - - protected Insets getContentBorderInsets(Insets defaultInsets) { - return SOUTH_INSETS; - } - - protected Insets getSelectedTabPadInsets() { - return EMPTY_INSETS; - } - - protected Insets getTabInsets(int tabIndex, Insets tabInsets) { - return new Insets(tabInsets.top, tabInsets.left, tabInsets.bottom, tabInsets.right); - } - - /** - * Paints no focus: minimal decoration is really minimal. - */ - protected void paintFocusIndicator( - Graphics g, - Rectangle[] rects, - int tabIndex, - Rectangle iconRect, - Rectangle textRect, - boolean isSelected) { - // Embedded tabs paint no focus. - } - - protected void paintTabBackground(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - - g.setColor(selectColor); - g.fillRect(x, y, w + 1, h); - } - - protected void paintTabBorder(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - - int bottom = h; - int right = w + 1; - - g.translate(x, y); - if (isFirstDisplayedTab(tabIndex, x, tabPane.getBounds().x)) { - if (isSelected) { - // selected and first in line - g.setColor(shadowColor); - g.fillRect(right, 0, 1, bottom - 1); - g.fillRect(right - 1, bottom - 1, 1, 1); - // it is open to discussion if the outer border of the tab - // should be painted because in the primary case it won't - // be visible anyway. uncomment the following two lines if wanted - // g.fillRect(0,bottom, right, 1); - // g.fillRect(-1,0,1,bottom; - g.setColor(selectHighlight); - g.fillRect(0, 0, 1, bottom); - g.fillRect(right - 1, 0, 1, bottom - 1); - g.fillRect(1, bottom - 1, right - 2, 1); - } else { - //not selected and first in line - } - } else { - if (isSelected) { - //selected and not first in line - g.setColor(shadowColor); - g.fillRect(0, 0, 1, bottom - 1); - g.fillRect(1, bottom - 1, 1, 1); - g.fillRect(right, 0, 1, bottom - 1); - g.fillRect(right - 1, bottom - 1, 1, 1); - // outside line: - // g.fillRect(2,bottom, right-3, 1); - g.setColor(selectHighlight); - g.fillRect(1, 0, 1, bottom - 1); - g.fillRect(right - 1, 0, 1, bottom - 1); - g.fillRect(2, bottom - 1, right - 3, 1); - } else { - g.setColor(shadowColor); - g.fillRect(1, h / 2, 1, h - (h / 2)); - } - } - g.translate(-x, -y); - } - - protected void paintContentBorderBottomEdge( - Graphics g, - int x, - int y, - int w, - int h, - boolean drawBroken, - Rectangle selRect, - boolean isContentBorderPainted) { - - g.setColor(shadowColor); - g.fillRect(x, y + h - 1, w, 1); - } - - } - - /** - * The renderer for the case where Tabs are below the content and - * decoration is standard. - */ - private static final class BottomRenderer extends AbstractRenderer { - - private BottomRenderer(JTabbedPane tabPane) { - super(tabPane); - } - - protected Insets getTabAreaInsets(Insets defaultInsets) { - return new Insets(defaultInsets.top, defaultInsets.left + 5, defaultInsets.bottom, defaultInsets.right); - } - - protected int getTabLabelShiftY(int tabIndex, boolean isSelected) { - return isSelected ? 0 : -1; - } - - protected int getTabRunOverlay(int tabRunOverlay) { - return tabRunOverlay - 2; - } - - protected int getTabRunIndent(int run) { - return 6 * run; - } - - protected Insets getSelectedTabPadInsets() { - return SOUTH_INSETS; - } - - protected Insets getTabInsets(int tabIndex, Insets tabInsets) { - return new Insets(tabInsets.top, tabInsets.left - 2, tabInsets.bottom, tabInsets.right - 2); - } - - protected void paintFocusIndicator( - Graphics g, - Rectangle[] rects, - int tabIndex, - Rectangle iconRect, - Rectangle textRect, - boolean isSelected) { - - if (!tabPane.hasFocus() || !isSelected) - return; - Rectangle tabRect = rects[tabIndex]; - int top = tabRect.y; - int left = tabRect.x + 6; - int height = tabRect.height - 3; - int width = tabRect.width - 12; - g.setColor(focus); - g.drawRect(left, top, width, height); - } - - protected void paintTabBackground(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - - g.setColor(selectColor); - g.fillRect(x, y, w, h); - } - - protected void paintTabBorder(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - - int bottom = h - 1; - int right = w + 4; - - g.translate(x - 3, y); - - // Paint Border - g.setColor(selectHighlight); - - // Paint left - g.fillRect(0, 0, 1, 2); - g.drawLine(0, 2, 4, bottom - 4); - g.fillRect(5, bottom - 3, 1, 2); - g.fillRect(6, bottom - 1, 1, 1); - - // Paint bootom - g.fillRect(7, bottom, 1, 1); - g.setColor(darkShadow); - g.fillRect(8, bottom, right - 13, 1); - - // Paint right - g.drawLine(right + 1, 0, right - 3, bottom - 4); - g.fillRect(right - 4, bottom - 3, 1, 2); - g.fillRect(right - 5, bottom - 1, 1, 1); - - g.translate(-x + 3, -y); - } - - protected void paintContentBorderBottomEdge( - Graphics g, - int x, - int y, - int w, - int h, - boolean drawBroken, - Rectangle selRect, - boolean isContentBorderPainted) { - int bottom = y + h - 1; - int right = x + w - 1; - g.translate(x, bottom); - if (drawBroken && selRect.x >= x && selRect.x <= x + w) { - // Break line to show visual connection to selected tab - g.setColor(darkShadow); - g.fillRect(0, 0, selRect.x - x - 2, 1); - if (selRect.x + selRect.width < x + w - 2) { - g.setColor(darkShadow); - g.fillRect(selRect.x + selRect.width + 2 - x, 0, right - selRect.x - selRect.width - 2, 1); - } - } else { - g.setColor(darkShadow); - g.fillRect(0, 0, w - 1, 1); - } - g.translate(-x, -bottom); - } - - protected int getTabsOverlay() { - return 4; - } - - } - - /** - * The renderer for tabs on the left with minimal decoration. - */ - private static final class LeftEmbeddedRenderer extends AbstractRenderer { - - private LeftEmbeddedRenderer(JTabbedPane tabPane) { - super(tabPane); - } - - protected Insets getTabAreaInsets(Insets insets) { - return EMPTY_INSETS; - } - - protected Insets getContentBorderInsets(Insets defaultInsets) { - return WEST_INSETS; - } - - protected int getTabRunOverlay(int tabRunOverlay) { - return 0; - } - - protected boolean shouldPadTabRun(int run, boolean aPriori) { - return false; - } - - protected Insets getTabInsets(int tabIndex, Insets tabInsets) { - return new Insets(tabInsets.top, tabInsets.left, tabInsets.bottom, tabInsets.right); - } - - protected Insets getSelectedTabPadInsets() { - return EMPTY_INSETS; - } - - /** - * minimal decoration is really minimal: no focus. - */ - protected void paintFocusIndicator( - Graphics g, - Rectangle[] rects, - int tabIndex, - Rectangle iconRect, - Rectangle textRect, - boolean isSelected) { - // Embedded tabs paint no focus. - } - - protected void paintTabBackground(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - g.setColor(selectColor); - g.fillRect(x, y, w, h); - } - - protected void paintTabBorder(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - - int bottom = h; - int right = w; - - g.translate(x, y); - - if (isFirstDisplayedTab(tabIndex, y, tabPane.getBounds().y)) { - if (isSelected) { - //selected and first in line - g.setColor(selectHighlight); - g.fillRect(0, 0, right, 1); - g.fillRect(0, 0, 1, bottom - 1); - g.fillRect(1, bottom - 1, right - 1, 1); - g.setColor(shadowColor); - g.fillRect(0, bottom - 1, 1, 1); - g.fillRect(1, bottom, right - 1, 1); - // outside line: - // g.fillRect(-1,0,1,bottom-1) - } else { - //not selected but first in line - } - } else { - if (isSelected) { - //selected but not first in line - g.setColor(selectHighlight); - g.fillRect(1, 1, right - 1, 1); - g.fillRect(0, 2, 1, bottom - 2); - g.fillRect(1, bottom - 1, right - 1, 1); - g.setColor(shadowColor); - g.fillRect(1, 0, right - 1, 1); - g.fillRect(0, 1, 1, 1); - g.fillRect(0, bottom - 1, 1, 1); - g.fillRect(1, bottom, right - 1, 1); - // outside line: - // g.fillRect(-1,2,1,bottom-3) - } else { - g.setColor(shadowColor); - g.fillRect(0, 0, right / 3, 1); - } - } - - g.translate(-x, -y); - } - - protected void paintContentBorderLeftEdge( - Graphics g, - int x, - int y, - int w, - int h, - boolean drawBroken, - Rectangle selRect, - boolean isContentBorderPainted) { - g.setColor(shadowColor); - g.fillRect(x, y, 1, h); - } - } - - /** - * Renderer for tabs on the left with normal decoration. - */ - private static final class LeftRenderer extends AbstractRenderer { - - private LeftRenderer(JTabbedPane tabPane) { - super(tabPane); - } - - protected Insets getTabAreaInsets(Insets defaultInsets) { - return new Insets(defaultInsets.top + 4, defaultInsets.left, defaultInsets.bottom, defaultInsets.right); - } - - protected int getTabLabelShiftX(int tabIndex, boolean isSelected) { - return 1; - } - - protected int getTabRunOverlay(int tabRunOverlay) { - return 1; - } - - protected boolean shouldPadTabRun(int run, boolean aPriori) { - return false; - } - - protected Insets getTabInsets(int tabIndex, Insets tabInsets) { - return new Insets(tabInsets.top, tabInsets.left - 5, tabInsets.bottom + 1, tabInsets.right - 5); - } - - protected Insets getSelectedTabPadInsets() { - return WEST_INSETS; - } - - protected void paintFocusIndicator( - Graphics g, - Rectangle[] rects, - int tabIndex, - Rectangle iconRect, - Rectangle textRect, - boolean isSelected) { - - if (!tabPane.hasFocus() || !isSelected) - return; - Rectangle tabRect = rects[tabIndex]; - int top = tabRect.y + 2; - int left = tabRect.x + 3; - int height = tabRect.height - 5; - int width = tabRect.width - 6; - g.setColor(focus); - g.drawRect(left, top, width, height); - } - - protected void paintTabBackground(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - if (!isSelected) { - g.setColor(selectLight); - g.fillRect(x + 1, y + 1, w - 1, h - 2); - } else { - g.setColor(selectColor); - g.fillRect(x + 1, y + 1, w - 3, h - 2); - } - } - - protected void paintTabBorder(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - - int bottom = h - 1; - int left = 0; - g.translate(x, y); - - // Paint Border - g.setColor(selectHighlight); - // Paint top - g.fillRect(left + 2, 0, w - 2 - left, 1); - - // Paint left - g.fillRect(left + 1, 1, 1, 1); - g.fillRect(left, 2, 1, bottom - 3); - g.setColor(darkShadow); - g.fillRect(left + 1, bottom - 1, 1, 1); - - // Paint bottom - g.fillRect(left + 2, bottom, w - 2 - left, 1); - - g.translate(-x, -y); - } - - protected void paintContentBorderLeftEdge( - Graphics g, - int x, - int y, - int w, - int h, - boolean drawBroken, - Rectangle selRect, - boolean isContentBorderPainted) { - g.setColor(selectHighlight); - if (drawBroken && selRect.y >= y && selRect.y <= y + h) { - // Break line to show visual connection to selected tab - g.fillRect(x, y, 1, selRect.y + 1 - y); - if (selRect.y + selRect.height < y + h - 2) { - g.fillRect(x, selRect.y + selRect.height - 1, 1, y + h - selRect.y - selRect.height); - } - } else { - g.fillRect(x, y, 1, h - 1); - } - } - - } - - /** - * The renderer for tabs on the right with minimal decoration. - */ - private static final class RightEmbeddedRenderer extends AbstractRenderer { - - private RightEmbeddedRenderer(JTabbedPane tabPane) { - super(tabPane); - } - - protected Insets getTabAreaInsets(Insets insets) { - return EMPTY_INSETS; - } - - protected Insets getContentBorderInsets(Insets defaultInsets) { - return EAST_INSETS; - } - - protected int getTabRunIndent(int run) { - return 4 * run; - } - - protected int getTabRunOverlay(int tabRunOverlay) { - return 0; - } - - protected boolean shouldPadTabRun(int run, boolean aPriori) { - return false; - } - - protected Insets getTabInsets(int tabIndex, Insets tabInsets) { - return new Insets(tabInsets.top, tabInsets.left, tabInsets.bottom, tabInsets.right); - } - - protected Insets getSelectedTabPadInsets() { - return EMPTY_INSETS; - } - - /** - * Minimal decoration: no focus. - */ - protected void paintFocusIndicator( - Graphics g, - Rectangle[] rects, - int tabIndex, - Rectangle iconRect, - Rectangle textRect, - boolean isSelected) { - // Embedded tabs paint no focus. - } - - protected void paintTabBackground(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - - g.setColor(selectColor); - g.fillRect(x, y, w, h); - } - - protected void paintTabBorder(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - - int bottom = h; - int right = w - 1; - - g.translate(x + 1, y); - - if (isFirstDisplayedTab(tabIndex, y, tabPane.getBounds().y)) { - if (isSelected) { - //selected and first in line - g.setColor(shadowColor); - //outside lines: - // g.fillRect(0,-1,right,1); - // g.fillRect(right,-1,1,bottom); - g.fillRect(right - 1, bottom - 1, 1, 1); - g.fillRect(0, bottom, right - 1, 1); - g.setColor(selectHighlight); - g.fillRect(0, 0, right - 1, 1); - g.fillRect(right - 1, 0, 1, bottom - 1); - g.fillRect(0, bottom - 1, right - 1, 1); - } - } else { - if (isSelected) { - //selected but not first in line - g.setColor(shadowColor); - g.fillRect(0, -1, right - 1, 1); - g.fillRect(right - 1, 0, 1, 1); - //outside line: - // g.fillRect(right,0,1,bottom); - g.fillRect(right - 1, bottom - 1, 1, 1); - g.fillRect(0, bottom, right - 1, 1); - g.setColor(selectHighlight); - g.fillRect(0, 0, right - 1, 1); - g.fillRect(right - 1, 1, 1, bottom - 2); - g.fillRect(0, bottom - 1, right - 1, 1); - } else { - //not selected and not first in line - g.setColor(shadowColor); - g.fillRect(2 * right / 3, 0, right / 3, 1); - } - } - g.translate(-x - 1, -y); - } - - protected void paintContentBorderRightEdge( - Graphics g, - int x, - int y, - int w, - int h, - boolean drawBroken, - Rectangle selRect, - boolean isContentBorderPainted) { - g.setColor(shadowColor); - g.fillRect(x + w - 1, y, 1, h); - } - - } - - /** - * Renderer for tabs on the right with normal decoration. - */ - private static final class RightRenderer extends AbstractRenderer { - - private RightRenderer(JTabbedPane tabPane) { - super(tabPane); - } - - protected int getTabLabelShiftX(int tabIndex, boolean isSelected) { - return 1; - } - - protected int getTabRunOverlay(int tabRunOverlay) { - return 1; - } - - protected boolean shouldPadTabRun(int run, boolean aPriori) { - return false; - } - - protected Insets getTabInsets(int tabIndex, Insets tabInsets) { - return new Insets(tabInsets.top, tabInsets.left - 5, tabInsets.bottom + 1, tabInsets.right - 5); - } - - protected Insets getSelectedTabPadInsets() { - return EAST_INSETS; - } - - protected void paintFocusIndicator( - Graphics g, - Rectangle[] rects, - int tabIndex, - Rectangle iconRect, - Rectangle textRect, - boolean isSelected) { - - if (!tabPane.hasFocus() || !isSelected) - return; - Rectangle tabRect = rects[tabIndex]; - int top = tabRect.y + 2; - int left = tabRect.x + 3; - int height = tabRect.height - 5; - int width = tabRect.width - 6; - g.setColor(focus); - g.drawRect(left, top, width, height); - } - - protected void paintTabBackground(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - if (!isSelected) { - g.setColor(selectLight); - g.fillRect(x, y, w, h); - } else { - g.setColor(selectColor); - g.fillRect(x + 2, y, w - 2, h); - } - } - - protected void paintTabBorder(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - - int bottom = h - 1; - int right = w; - - g.translate(x, y); - - // Paint Border - - g.setColor(selectHighlight); - g.fillRect(0, 0, right - 1, 1); - // Paint right - g.setColor(darkShadow); - g.fillRect(right - 1, 1, 1, 1); - g.fillRect(right, 2, 1, bottom - 3); - // Paint bottom - g.fillRect(right - 1, bottom - 1, 1, 1); - g.fillRect(0, bottom, right - 1, 1); - - g.translate(-x, -y); - } - - protected void paintContentBorderRightEdge( - Graphics g, - int x, - int y, - int w, - int h, - boolean drawBroken, - Rectangle selRect, - boolean isContentBorderPainted) { - g.setColor(darkShadow); - if (drawBroken && selRect.y >= y && selRect.y <= y + h) { - // Break line to show visual connection to selected tab - g.fillRect(x + w - 1, y, 1, selRect.y - y); - if (selRect.y + selRect.height < y + h - 2) { - g.fillRect(x + w - 1, selRect.y + selRect.height, 1, y + h - selRect.y - selRect.height); - } - } else { - g.fillRect(x + w - 1, y, 1, h - 1); - } - } - } - - /** - * Renderer for tabs on top with minimal decoration. - */ - private static final class TopEmbeddedRenderer extends AbstractRenderer { - - private TopEmbeddedRenderer(JTabbedPane tabPane) { - super(tabPane); - } - - protected Insets getTabAreaInsets(Insets insets) { - return EMPTY_INSETS; - } - - protected Insets getContentBorderInsets(Insets defaultInsets) { - return NORTH_INSETS; - } - - protected Insets getTabInsets(int tabIndex, Insets tabInsets) { - return new Insets(tabInsets.top, tabInsets.left + 1, tabInsets.bottom, tabInsets.right); - } - - protected Insets getSelectedTabPadInsets() { - return EMPTY_INSETS; - } - - /** - * Minimal decoration: no focus. - */ - protected void paintFocusIndicator( - Graphics g, - Rectangle[] rects, - int tabIndex, - Rectangle iconRect, - Rectangle textRect, - boolean isSelected) { - // Embedded tabs paint no focus. - } - - protected void paintTabBackground(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - - g.setColor(selectColor); - g.fillRect(x, y, w, h); - } - - protected void paintTabBorder(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - - g.translate(x, y); - - int right = w; - int bottom = h; - - if (isFirstDisplayedTab(tabIndex, x, tabPane.getBounds().x)) { - if (isSelected) { - g.setColor(selectHighlight); - //left - g.fillRect(0, 0, 1, bottom); - //top - g.fillRect(0, 0, right - 1, 1); - //right - g.fillRect(right - 1, 0, 1, bottom); - g.setColor(shadowColor); - //topright corner - g.fillRect(right - 1, 0, 1, 1); - //right - g.fillRect(right, 1, 1, bottom); - } - } else { - if (isSelected) { - g.setColor(selectHighlight); - //left - g.fillRect(1, 1, 1, bottom - 1); - //top - g.fillRect(2, 0, right - 3, 1); - //right - g.fillRect(right - 1, 1, 1, bottom - 1); - g.setColor(shadowColor); - //left - g.fillRect(0, 1, 1, bottom - 1); - //topleft corner - g.fillRect(1, 0, 1, 1); - //topright corner - g.fillRect(right - 1, 0, 1, 1); - //right - g.fillRect(right, 1, 1, bottom); - } else { - g.setColor(shadowColor); - g.fillRect(0, 0, 1, bottom +2 - bottom / 2); - } - } - g.translate(-x, -y); - } - - protected void paintContentBorderTopEdge( - Graphics g, - int x, - int y, - int w, - int h, - boolean drawBroken, - Rectangle selRect, - boolean isContentBorderPainted) { - g.setColor(shadowColor); - g.fillRect(x, y, w, 1); - } - - } - - /** - * Renderer for tabs on top with normal decoration. - */ - private static final class TopRenderer extends AbstractRenderer { - - private TopRenderer(JTabbedPane tabPane) { - super(tabPane); - } - - protected Insets getTabAreaInsets(Insets defaultInsets) { - return new Insets(defaultInsets.top, defaultInsets.left + 4, defaultInsets.bottom, defaultInsets.right); - } - - protected int getTabLabelShiftY(int tabIndex, boolean isSelected) { - return isSelected ? -1 : 0; - } - - protected int getTabRunOverlay(int tabRunOverlay) { - return tabRunOverlay - 2; - } - - protected int getTabRunIndent(int run) { - return 6 * run; - } - - protected Insets getSelectedTabPadInsets() { - return NORTH_INSETS; - } - - protected Insets getTabInsets(int tabIndex, Insets tabInsets) { - return new Insets(tabInsets.top-1, tabInsets.left - 4, tabInsets.bottom, tabInsets.right - 4); - } - - protected void paintFocusIndicator( - Graphics g, - Rectangle[] rects, - int tabIndex, - Rectangle iconRect, - Rectangle textRect, - boolean isSelected) { - - if (!tabPane.hasFocus() || !isSelected) - return; - Rectangle tabRect = rects[tabIndex]; - int top = tabRect.y +1 ; - int left = tabRect.x + 4; - int height = tabRect.height - 3; - int width = tabRect.width - 9; - g.setColor(focus); - g.drawRect(left, top, width, height); - } - - protected void paintTabBackground(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - - int sel = (isSelected) ? 0 : 1; - g.setColor(selectColor); - g.fillRect(x, y + sel, w, h / 2); - g.fillRect(x - 1, y + sel + h / 2, w + 2, h - h / 2); - } - - protected void paintTabBorder(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) { - - g.translate(x - 4, y); - - int top = 0; - int right = w + 6; - - // Paint Border - g.setColor(selectHighlight); - - // Paint left - g.drawLine(1, h - 1, 4, top + 4); - g.fillRect(5, top + 2, 1, 2); - g.fillRect(6, top + 1, 1, 1); - - // Paint top - g.fillRect(7, top, right - 12, 1); - - // Paint right - g.setColor(darkShadow); - g.drawLine(right, h - 1, right - 3, top + 4); - g.fillRect(right - 4, top + 2, 1, 2); - g.fillRect(right - 5, top + 1, 1, 1); - - g.translate(-x + 4, -y); - } - - protected void paintContentBorderTopEdge( - Graphics g, - int x, - int y, - int w, - int h, - boolean drawBroken, - Rectangle selRect, - boolean isContentBorderPainted) { - int right = x + w - 1; - int top = y; - g.setColor(selectHighlight); - - if (drawBroken && selRect.x >= x && selRect.x <= x + w) { - // Break line to show visual connection to selected tab - g.fillRect(x, top, selRect.x - 2 - x, 1); - if (selRect.x + selRect.width < x + w - 2) { - g.fillRect(selRect.x + selRect.width + 2, top, right - 2 - selRect.x - selRect.width, 1); - } else { - g.fillRect(x + w - 2, top, 1, 1); - } - } else { - g.fillRect(x, top, w - 1, 1); - } - } - - protected int getTabsOverlay() { - return 6; - } - } - -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereTaskPaneUI.java b/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereTaskPaneUI.java deleted file mode 100644 index 55250dba9d..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereTaskPaneUI.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.adempiere.plaf; - -import java.awt.GradientPaint; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Paint; -import java.awt.Rectangle; -import java.awt.RenderingHints; - -import javax.swing.JComponent; -import javax.swing.border.Border; -import javax.swing.plaf.ColorUIResource; -import javax.swing.plaf.ComponentUI; - -import org.jdesktop.swingx.JXTaskPane; -import org.jdesktop.swingx.plaf.basic.BasicTaskPaneUI; - -public class AdempiereTaskPaneUI extends BasicTaskPaneUI { - public static ComponentUI createUI(JComponent c) { - return new AdempiereTaskPaneUI(); - } - - protected Border createPaneBorder() { - return new AdempierePaneBorder(); - } - - /** - * Overriden to paint the background of the component but keeping the - * rounded corners. - */ - public void update(Graphics g, JComponent c) { - if (c.isOpaque()) { - g.setColor(new ColorUIResource(251, 248, 241)); - g.fillRect(0, 0, c.getWidth(), c.getHeight()); - g.setColor(new ColorUIResource(251, 248, 241)); - g.fillRect(0, getRoundHeight(), c.getWidth(), c.getHeight() - - getRoundHeight()); - } - paint(g, c); - } - - /** - * The border of the taskpane group paints the "text", the "icon", the - * "expanded" status and the "special" type. - * - */ - class AdempierePaneBorder extends PaneBorder { - - protected void paintTitleBackground(JXTaskPane group, Graphics g) { - if (group.isSpecial()) { - g.setColor(new ColorUIResource(251, 248, 241)); - g.fillRoundRect(0, 0, group.getWidth(), getRoundHeight() * 2, - getRoundHeight(), getRoundHeight()); - g.fillRect(0, getRoundHeight(), group.getWidth(), getTitleHeight(group) - - getRoundHeight()); - } else { - Paint oldPaint = ((Graphics2D) g).getPaint(); - GradientPaint gradient = new GradientPaint(0f, 0f, // group.getWidth() - // / 2, - new ColorUIResource(241, 239, 222), 0f, // group.getWidth(), - getTitleHeight(group), new ColorUIResource(251, 248, 241)); - - ((Graphics2D) g).setRenderingHint( - RenderingHints.KEY_COLOR_RENDERING, - RenderingHints.VALUE_COLOR_RENDER_QUALITY); - ((Graphics2D) g).setRenderingHint( - RenderingHints.KEY_INTERPOLATION, - RenderingHints.VALUE_INTERPOLATION_BILINEAR); - ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING, - RenderingHints.VALUE_RENDER_QUALITY); - ((Graphics2D) g).setPaint(gradient); - - g.fillRoundRect(0, 0, group.getWidth(), getRoundHeight() * 2, - getRoundHeight(), getRoundHeight()); - g.fillRect(0, getRoundHeight(), group.getWidth(), getTitleHeight(group) - - getRoundHeight()); - ((Graphics2D) g).setPaint(oldPaint); - } - - Rectangle oldRect = g.getClipBounds(); - g.setClip(0, 0, group.getWidth(), getTitleHeight(group)); - g.setColor(borderColor); - g.drawRoundRect(0, 0, group.getWidth() - 1, getTitleHeight(group) - + getRoundHeight(), getRoundHeight(), getRoundHeight()); - g.drawLine(0, getTitleHeight(group) - 1, group.getWidth(), getTitleHeight(group) - 1); - g.setClip(oldRect); - } - - protected void paintExpandedControls(JXTaskPane group, Graphics g, - int x, int y, int width, int height) { - ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, - RenderingHints.VALUE_ANTIALIAS_ON); - - paintOvalAroundControls(group, g, x, y, width, height); - g.setColor(getPaintColor(group)); - paintChevronControls(group, g, x, y, width, height); - - ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, - RenderingHints.VALUE_ANTIALIAS_OFF); - } - - @Override - protected boolean isMouseOverBorder() { - return true; - } - - } - -} diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereTheme.java b/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereTheme.java deleted file mode 100644 index d6135f0e71..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereTheme.java +++ /dev/null @@ -1,425 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.adempiere.plaf; - - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.Toolkit; -import java.util.logging.Logger; - -import javax.swing.UIDefaults; -import javax.swing.plaf.ColorUIResource; -import javax.swing.plaf.FontUIResource; - -import org.compiere.swing.ColorBlind; -import org.compiere.swing.ExtendedTheme; - -import com.jgoodies.looks.plastic.PlasticScrollBarUI; - - -/** - * A theme based on GTK2-Gilouche and tango project iconset. - * It has been optimized to work with Suse SLED 10 default desktop settings. - * - * - * @author vpj-cd - * @version $Revision: 1.0 $ - * @author Low Heng Sin - * - Fixed invisible disactive component issue - * - Use red instead of green as background for error field - */ -public class AdempiereTheme extends com.jgoodies.looks.plastic.PlasticTheme { - - - /** - * Return Theme Name - * @return Theme Name - */ - public String getName() - { - return s_name; - } // getName - - - /** - * String Representation - * @return info - */ - public String toString () - { - return getName(); - } // toString - - - - /** Static Initializer */ - static - { - s_theme = new org.adempiere.plaf.AdempiereTheme(); - } - - //------------------------------------------------- - /** Theme Name */ - protected static String s_name = "Adempiere Theme"; - - public static final String NAME = s_name; - /** Logger */ - protected static Logger log = Logger.getLogger(org.adempiere.plaf.AdempiereTheme.class.getName()); - /** Active Theme */ - protected static AdempiereTheme s_theme = null; - - /** Blue 51,51,102 */ - public static ColorUIResource primary0 = new ColorUIResource(103, 152, 203); - /** Blue 102, 102, 153 */ - //protected static ColorUIResource primary1; - public static ColorUIResource primary1 = new ColorUIResource( 101, 138, 187); - /** Blue 153, 153, 204 */ - public static ColorUIResource primary2 = new ColorUIResource(103, 152, 203); - /** Blue 204, 204, 255 */ - public static ColorUIResource primary3= new ColorUIResource(233, 238, 245); // - - /** Black */ - public final ColorUIResource secondary0 = new ColorUIResource(0, 0, 0); - /** Gray 102, 102, 102 */ - public static ColorUIResource secondary1= new ColorUIResource(190, 179, 153); - /** Gray 153, 153, 153 */ - public static ColorUIResource secondary2= new ColorUIResource(196, 189, 174); - /** BlueGray 214, 224, 234 - background */ - public static ColorUIResource secondary3= new ColorUIResource(251, 248, 241); - /** White */ - public final ColorUIResource secondary4 = new ColorUIResource(255, 255, 255); - - /** Black */ - public static ColorUIResource black = BLACK; - /** White */ - public static ColorUIResource white = WHITE; - - /** Background for mandatory fields */ - //public static ColorUIResource mandatory = new ColorUIResource(233, 238, 245); // blueish - public static ColorUIResource mandatory = new ColorUIResource(205, 225, 245); // BF[ 1640919 ] Adempiere Theme aspect problem - - /** Background for fields in error */ - //Gree for error is confusing new ColorUIResource(220, 241, 203); // green ; - public static ColorUIResource error = new ColorUIResource(255, 204, 204); // red-isch - /** Background for inactive fields */ - public static ColorUIResource inactive = new ColorUIResource(241,239,222); //234, 234, 234); - /** Background for info fields */ - public static ColorUIResource info = new ColorUIResource(251, 248, 251); // somewhat white - - /** Foreground Text OK */ - public static ColorUIResource txt_ok =new ColorUIResource(0, 153, 255); // blue ; - /** Foreground Text Error */ - public static ColorUIResource txt_error = new ColorUIResource(255, 0, 51); // red ; - - /** Control font */ - public static FontUIResource controlFont; - /** System font */ - public static FontUIResource systemFont; - /** User font */ - public static FontUIResource userFont; - /** Small font */ - public static FontUIResource smallFont; - /** Window Title font */ - public static FontUIResource windowFont; - /** Menu font */ - public static FontUIResource menuFont; - - /** Default Font */ - public static final String FONT_DEFAULT = "Dialog"; - /** Default Font Size */ - public static int FONT_SIZE = 12; - - static { - //set font size base on screen resolution - try { - Dimension size = Toolkit.getDefaultToolkit().getScreenSize(); - if (size.width <= 800) - FONT_SIZE = 9; - else if (size.width <= 1024) - FONT_SIZE = 10; - else if (size.width <= 1280) - FONT_SIZE = 11; - else if (size.width <= 1400) - FONT_SIZE = 12; - else if (size.width <= 1600) - FONT_SIZE = 13; - else - FONT_SIZE = 14; - } catch (Throwable t) {} - } - - /************************************************************************** - * Get Primary 1 (blue in default Metal Theme) - * @return color - */ - public ColorUIResource getPrimary1() - { - return ColorBlind.getDichromatColorUIResource(primary1); - } - public ColorUIResource getPrimary2() - { - return ColorBlind.getDichromatColorUIResource(primary2); - } - public ColorUIResource getPrimary3() - { - return ColorBlind.getDichromatColorUIResource(primary3); - } - - /** - * Get Secondary 1 (gray in default Metal Theme) - * @return color - */ - public ColorUIResource getSecondary0() - { - return ColorBlind.getDichromatColorUIResource(secondary0); - } - public ColorUIResource getSecondary1() - { - return ColorBlind.getDichromatColorUIResource(secondary1); - } - public ColorUIResource getSecondary2() - { - return ColorBlind.getDichromatColorUIResource(secondary2); - } - public ColorUIResource getSecondary3() - { - return ColorBlind.getDichromatColorUIResource(secondary3); - } - public ColorUIResource getSecondary4() - { - return ColorBlind.getDichromatColorUIResource(secondary4); - } - - public ColorUIResource getBlack() - { - return ColorBlind.getDichromatColorUIResource(black); - } - public ColorUIResource getWhite() - { - return ColorBlind.getDichromatColorUIResource(white); - } - - /** - * Control Font (plain) - * @return font - */ - protected static FontUIResource _getControlTextFont() - { - if (controlFont == null) - { - try - { - controlFont = new FontUIResource(Font.getFont("swing.plaf.metal.controlFont", - new Font(FONT_DEFAULT, Font.PLAIN, FONT_SIZE))); - } - catch (Exception e) - { - controlFont = new FontUIResource(FONT_DEFAULT, Font.PLAIN, FONT_SIZE); - } - } - return controlFont; - } - public FontUIResource getControlTextFont() {return _getControlTextFont();} - - /** - * System Font - * @return font - */ - protected static FontUIResource _getSystemTextFont() - { - if (systemFont == null) - { - try - { - systemFont = new FontUIResource(Font.getFont("swing.plaf.metal.systemFont", - new Font(FONT_DEFAULT, Font.PLAIN, FONT_SIZE))); - } - catch (Exception e) - { - systemFont = new FontUIResource(FONT_DEFAULT, Font.PLAIN, FONT_SIZE); - } - } - return systemFont; - } - public FontUIResource getSystemTextFont() {return _getSystemTextFont();} - - /** - * User Font - * @return font - */ - protected static FontUIResource _getUserTextFont() - { - if (userFont == null) - { - try - { - userFont = new FontUIResource(Font.getFont("swing.plaf.metal.userFont", - new Font(FONT_DEFAULT, Font.PLAIN, FONT_SIZE))); - } - catch (Exception e) - { - userFont = new FontUIResource(FONT_DEFAULT, Font.PLAIN, FONT_SIZE); - } - } - return userFont; - } - public FontUIResource getUserTextFont() {return _getUserTextFont();} - - /** - * Menu - * @return font - */ - protected static FontUIResource _getMenuTextFont() - { - if (menuFont == null) - { - try - { - menuFont = new FontUIResource(Font.getFont("swing.plaf.metal.menuFont", - new Font(FONT_DEFAULT, Font.PLAIN, FONT_SIZE))); - } - catch (Exception e) - { - menuFont = new FontUIResource(FONT_DEFAULT, Font.PLAIN, FONT_SIZE); - } - } - return menuFont; - } - public FontUIResource getMenuTextFont() {return _getMenuTextFont();} - - /** - * Window Title - * @return font - */ - protected static FontUIResource _getWindowTitleFont() - { - if (windowFont == null) - { - try - { - windowFont = new FontUIResource(Font.getFont("swing.plaf.metal.windowFont", - new Font(FONT_DEFAULT, Font.BOLD, FONT_SIZE+2))); - } - catch (Exception e) - { - windowFont = new FontUIResource(FONT_DEFAULT, Font.BOLD, FONT_SIZE+2); - } - } - return windowFont; - } - public FontUIResource getWindowTitleFont() {return _getWindowTitleFont();} - - /** - * Sub Text - * @return font - */ - protected static FontUIResource _getSubTextFont() - { - if (smallFont == null) - { - try - { - smallFont = new FontUIResource(Font.getFont("swing.plaf.metal.smallFont", - new Font(FONT_DEFAULT, Font.PLAIN, FONT_SIZE-2))); - } - catch (Exception e) - { - smallFont = new FontUIResource(FONT_DEFAULT, Font.PLAIN, FONT_SIZE-2); - } - } - return smallFont; - } - public FontUIResource getSubTextFont() {return _getSubTextFont();} - - /** - * Parses Color into String representation. - * Required as SystemColors and Alpha Colors have different formats - * @param c Color - * @return [r=102,g=102,b=153,a=255] - * @see #parseColor - */ - public static String getColorAsString (Color c) - { - if (c == null) - c = SystemColor.control; - StringBuffer sb = new StringBuffer("[r=").append(c.getRed()) - .append(",g=").append(c.getGreen()) - .append(",b=").append(c.getBlue()) - .append(",a=").append(c.getAlpha()) - .append("]"); - // System.out.println(sb.toString()); - return sb.toString(); - } // getColorAsString - - /** - * Set Default Colors - */ - public void setDefault() - { - } // setDefault - - //----------------------------------------------------- - - - public ColorUIResource getFocusColor() { - return getPrimary2(); - } - - public ColorUIResource getPrimaryControlShadow() { - return getPrimary3(); - } - - public ColorUIResource getMenuSelectedBackground() { - return getPrimary1(); - } - public ColorUIResource getMenuSelectedForeground() { - return WHITE; - } - - public ColorUIResource getMenuItemBackground() { - return WHITE; - } - - public ColorUIResource getToggleButtonCheckColor() { - return new ColorUIResource( 220, 241, 203); - } - - public void addCustomEntriesToTable(UIDefaults table) { - super.addCustomEntriesToTable(table); - Object[] uiDefaults = - { - "ScrollBar.thumbHighlight", - getPrimaryControlHighlight(), - PlasticScrollBarUI.MAX_BUMPS_WIDTH_KEY, - Integer.valueOf(22), - PlasticScrollBarUI.MAX_BUMPS_WIDTH_KEY, Integer.valueOf(30), - //"TabbedPane.selected", getWhite(), - "TabbedPane.selectHighlight", new ColorUIResource(231, 218, 188), - ExtendedTheme.ERROR_BG_KEY, - error, - ExtendedTheme.ERROR_FG_KEY, - txt_error, - ExtendedTheme.INACTIVE_BG_KEY, - inactive, - ExtendedTheme.INFO_BG_KEY, - info, - ExtendedTheme.MANDATORY_BG_KEY, - mandatory - }; - table.putDefaults(uiDefaults); - } -} diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereThemeInnova.java b/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereThemeInnova.java deleted file mode 100644 index fdf15f7308..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereThemeInnova.java +++ /dev/null @@ -1,111 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.adempiere.plaf; - -import javax.swing.plaf.ColorUIResource; - -/** - * Adempiere default Blue Metal Color Theme - * - * @author Jorg Janke, Adam Michau - * @version $Id: AdempiereThemeBlueMetal.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class AdempiereThemeInnova extends org.adempiere.plaf.AdempiereTheme -{ - /** - * Adempiere default Theme Blue Metal - */ - public AdempiereThemeInnova() - { - setDefault(); - s_theme = this; - s_name = NAME; - } // AdempiereThemeBlueMetal - - /** Name */ - public static final String NAME = "Adempiere Theme"; - - /** - * Set Defaults - */ - public void setDefault() - { - - - /** Blue 51,51,102 */ - primary0 = new ColorUIResource(103, 152, 203); - /** Blue 102, 102, 153 */ - //protected static ColorUIResource primary1; - primary1 = new ColorUIResource( 101, 138, 187); - /** Blue 153, 153, 204 */ - primary2 = new ColorUIResource(103, 152, 203); - /** Blue 204, 204, 255 */ - primary3= new ColorUIResource(233, 238, 245); // - - /** Black */ - //secondary0 = new ColorUIResource(0, 0, 0); - /** Gray 102, 102, 102 */ - //protected static ColorUIResource secondary1; - secondary1= new ColorUIResource(190, 179, 153); - /** Gray 153, 153, 153 */ - //protected static ColorUIResource secondary2; - secondary2= new ColorUIResource(246, 239, 224); - /** BlueGray 214, 224, 234 - background */ - //protected static ColorUIResource secondary3; - secondary3= new ColorUIResource(251, 248, 241); - /** White */ - //secondary4 = new ColorUIResource(255, 255, 255); - - /** Black */ - black = BLACK; - /** White */ - white = WHITE; - - /** Background for mandatory fields */ - mandatory = new ColorUIResource(233, 238, 245); // blueish - /** Background for fields in error 180,220,143 */ - error = new ColorUIResource(220, 241, 203); // green ; - /** Background for inactive fields */ - inactive = new ColorUIResource(241,239,222);//241,239,222 - /** Background for info fields */ - info = new ColorUIResource(251, 248, 251); // somewhat white - - /** Foreground Text OK */ - txt_ok =new ColorUIResource(0, 153, 255); // blue ; - /** Foreground Text Error */ - txt_error = new ColorUIResource(255, 0, 51); // red ; - - /** Black */ - // secondary0 = new ColorUIResource(0, 0, 0); - /** Control font */ - controlFont = null; - _getControlTextFont(); - /** System font */ - systemFont = null; - _getSystemTextFont(); - /** User font */ - userFont = null; - _getUserTextFont(); - /** Small font */ - smallFont = null; - _getSubTextFont(); - /** Window Title font */ - windowFont = null; - _getWindowTitleFont(); - /** Menu font */ - menuFont = null; - _getMenuTextFont(); - } // setDefault - -} // AdempiereThemeBlueMetal diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/PLAFEditor.java b/org.adempiere.ui.swing/src/org/adempiere/plaf/PLAFEditor.java deleted file mode 100644 index 951d2ca914..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/plaf/PLAFEditor.java +++ /dev/null @@ -1,611 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.adempiere.plaf; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.Dialog; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ResourceBundle; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.swing.DefaultComboBoxModel; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JDialog; -import javax.swing.JEditorPane; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JOptionPane; -import javax.swing.JPasswordField; -import javax.swing.JRadioButton; -import javax.swing.JScrollPane; -import javax.swing.JSplitPane; -import javax.swing.JTable; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.JTree; -import javax.swing.LookAndFeel; -import javax.swing.UIManager; -import javax.swing.WindowConstants; -import javax.swing.border.TitledBorder; -import javax.swing.plaf.metal.MetalLookAndFeel; -import javax.swing.plaf.metal.MetalTheme; - -import org.compiere.plaf.CompiereColor; -import org.compiere.plaf.CompiereLookAndFeel; -import org.compiere.swing.CButton; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTabbedPane; -import org.compiere.swing.CTextField; -import org.compiere.swing.CToggleButton; -import org.compiere.swing.ColorBlind; -import org.compiere.util.Ini; -import org.compiere.util.MiniBrowser; -import org.compiere.util.ValueNamePair; - -import sun.awt.AppContext; - -/** - * Adempiere PLAF Editor. - *

    - * start with new AdempierePLAFEditor() - * - * @author Jorg Janke - * @version $Id: AdempierePLAFEditor.java,v 1.3 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PLAFEditor extends JDialog - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -6010229234801706748L; - - - /** - * Default Constructor - * Don't Show Example - */ - public PLAFEditor() - { - super(); - init(false); - } // PLAFEditor - - /** - * Constructor - * @param showExample if true, show Example - */ - public PLAFEditor (boolean showExample) - { - super(); - init(true); - } // PLAFEditor - - /** - * Modal Dialog Constructor - * @param owner - * @param showExample if true, show Example - */ - public PLAFEditor(Dialog owner, boolean showExample) - { - super(owner, "", true); - init(true); - } // PLAFEditor - - /** - * Modal Frame Constructor - * @param owner - * @param showExample if true, show Example - */ - public PLAFEditor(Frame owner, boolean showExample) - { - super(owner, "", true); - init(true); - } // PLAFEditor - - /** Logger */ - private static Logger log = Logger.getLogger(PLAFEditor.class.getName()); - - - /************************************************************************** - * Init Editor - * @param showExample if true, show Example - */ - private void init (boolean showExample) - { - try - { - jbInit(); - dynInit(); - - // Display - example.setVisible(showExample); - blindLabel.setVisible(showExample); - blindField.setVisible(showExample); - AdempierePLAF.showCenterScreen(this); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - } - } // PLAFEditor - - /** Diable Theme Field */ - private boolean m_setting = false; - /** We did test for true color */ - private boolean m_colorTest = false; - - static ResourceBundle s_res = ResourceBundle.getBundle("org.compiere.plaf.PlafRes"); - static Object[] s_columns = new Object[] {"-0-", "-1-", "-2-", "-3-", "-O-", "-l-"}; - static Object[][] s_data = new Object[][] { - {"-00-", "-01-", "-02-", "-03-", "-0O-", "-0l-"}, - {"-10-", "-11-", "-12-", "-13-", "-1O-", "-1l-"}, - {"-20-", "-21-", "-22-", "-23-", "-2O-", "-2l-"}, - {"-30-", "-31-", "-32-", "-33-", "-3O-", "-3l-"}, - {"-O0-", "-O1-", "-O2-", "-O3-", "-OO-", "-Ol-"}, - {"-l0-", "-l1-", "-l2-", "-l3-", "-lO-", "-ll-"}}; - static Object[] s_pos = new Object[] {"Top", "Left", "Bottom", "Right"}; - - private CPanel mainPanel = new CPanel(new BorderLayout()); - private CPanel northPanel = new CPanel(); - private CPanel southPanel = new CPanel(); - private CButton bOK = AdempierePLAF.getOKButton(); - private CButton bCancel = AdempierePLAF.getCancelButton(); - private CButton bHelp = new CButton(); /** @todo Help Button */ - private GridBagLayout northLayout = new GridBagLayout(); - private CLabel lfLabel = new CLabel(); - private CComboBoxlfField = new CComboBox(AdempierePLAF.getPLAFs()); - private CLabel themeLabel = new CLabel(); - private CComboBoxthemeField = new CComboBox(AdempierePLAF.getThemes()); - private FlowLayout southLayout = new FlowLayout(); - private CButton rButton = new CButton(); - private CComboBoxblindField = new CComboBox(ColorBlind.COLORBLIND_TYPE); - private CLabel blindLabel = new CLabel(); - private BorderLayout mainLayout = new BorderLayout(); - // - private CTabbedPane example = new CTabbedPane(); - private CPanel jPanel1 = new CPanel(); - private TitledBorder exampleBorder; - private CPanel jPanel2 = new CPanel(); - private JLabel jLabel1 = new JLabel(); - private JTextField jTextField1 = new JTextField(); - private JCheckBox jCheckBox1 = new JCheckBox(); - private JRadioButton jRadioButton1 = new JRadioButton(); - private CButton jButton1 = new CButton(); - private CToggleButton jToggleButton1 = new CToggleButton(); - private CComboBoxjComboBox1 = new CComboBox(s_columns); - private JTextArea jTextArea1 = new JTextArea(); - private JTextPane jTextPane1 = new JTextPane(); - private JEditorPane jEditorPane1 = new JEditorPane(); - private JPasswordField jPasswordField1 = new JPasswordField(); - private JList jList1 = new JList(s_columns); - private JSplitPane jSplitPane1 = new JSplitPane(); - private BorderLayout borderLayout1 = new BorderLayout(); - private JScrollPane jScrollPane1 = new JScrollPane(); - private JTree jTree1 = new JTree(); - private JScrollPane jScrollPane2 = new JScrollPane(); - private JTable jTable1 = new JTable(s_data, s_columns); - private GridBagLayout gridBagLayout1 = new GridBagLayout(); - private CPanel jPanelFlat = new CPanel(new CompiereColor(new Color(255,205,255), true)); - private CPanel jPanelGradient = new CPanel(new CompiereColor(new Color(233,210,210), new Color(217,210,233))); - private CPanel jPanelTexture = new CPanel(new CompiereColor(CompiereColor.class.getResource("vincent.jpg"), Color.lightGray, 0.7f)); - private CPanel jPanelLines = new CPanel(new CompiereColor(new Color(178,181,205), new Color(193,193,205), 1.0f, 5)); - private JButton jButtonFlat = new JButton(); - private CButton jButtonGardient = new CButton(); - private JButton jButtonTexture = new JButton(); - private CButton jButtonLines = new CButton(); - private JComboBox jComboBoxFlat = new JComboBox(s_pos); - private JTextField jTextFieldFlat = new JTextField(); - private JLabel jLabelFlat = new JLabel(); - private CComboBoxjComboBoxGradient = new CComboBox(s_pos); - private CTextField jTextFieldGradient = new CTextField(); - private CLabel jLabelGradient = new CLabel(); - private JComboBox jComboBoxTexture = new JComboBox(s_pos); - private JTextField jTextFieldTexture = new JTextField(); - private JLabel jLabelTexture = new JLabel(); - private CComboBoxjComboBoxLines = new CComboBox(s_pos); - private CTextField jTextFieldLines = new CTextField(); - private CLabel jLabelLines = new CLabel(); - private CCheckBox jCheckBoxLines = new CCheckBox(); - private JCheckBox jCheckBoxTexture = new JCheckBox(); - private CCheckBox jCheckBoxGradient = new CCheckBox(); - private JCheckBox jCheckBoxFlat = new JCheckBox(); - - /** - * Static Layout - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); - this.setTitle(s_res.getString("LookAndFeelEditor")); - mainPanel.setLayout(mainLayout); - mainLayout.setHgap(5); - mainLayout.setVgap(5); - jTextFieldFlat.setColumns(10); - jTextFieldGradient.setColumns(10); - jTextFieldTexture.setColumns(10); - jTextFieldLines.setColumns(10); - jCheckBoxLines.setText("jCheckBox"); - jCheckBoxTexture.setText("jCheckBox"); - jCheckBoxGradient.setText("jCheckBox"); - jCheckBoxFlat.setText("jCheckBox"); - jPanelGradient.setToolTipText("Indented Level 1"); - jPanelTexture.setToolTipText("Indented Level 2"); - jPanelLines.setToolTipText("Indented Level 1"); - this.getContentPane().add(mainPanel, BorderLayout.CENTER); - // - lfLabel.setText(s_res.getString("LookAndFeel")); - lfField.addActionListener(this); - themeLabel.setText(s_res.getString("Theme")); - themeField.addActionListener(this); - rButton.setText(s_res.getString("Reset")); - rButton.addActionListener(this); - blindLabel.setText(s_res.getString("ColorBlind")); - blindField.addActionListener(this); - // - bOK.addActionListener(this); - bCancel.addActionListener(this); - bHelp.addActionListener(this); - // - northPanel.setLayout(northLayout); - southPanel.setLayout(southLayout); - southLayout.setAlignment(FlowLayout.RIGHT); - // - exampleBorder = new TitledBorder(s_res.getString("Example")); - example.setBorder(exampleBorder); - - jLabel1.setText("jLabel"); - jTextField1.setText("jTextField"); - jCheckBox1.setText("jCheckBox"); - jRadioButton1.setText("jRadioButton"); - jButton1.setText("jButton"); - jToggleButton1.setText("jToggleButton"); - jTextArea1.setText("jTextArea"); - jTextPane1.setText("jTextPane"); - jEditorPane1.setText("jEditorPane"); - jPasswordField1.setText("jPasswordField"); - jPanel2.setLayout(borderLayout1); - jPanel1.setLayout(gridBagLayout1); - jScrollPane1.setPreferredSize(new Dimension(100, 200)); - jScrollPane2.setPreferredSize(new Dimension(100, 200)); - jButtonFlat.setText("Confirm"); - jButtonGardient.setText("Input"); - jButtonTexture.setText("Message"); - jButtonLines.setText("Error"); - jTextFieldFlat.setText("jTextField"); - jLabelFlat.setText("jLabel"); - jTextFieldGradient.setText("jTextField"); - jLabelGradient.setText("jLabel"); - jTextFieldTexture.setText("jTextField"); - jLabelTexture.setText("jLabel"); - jTextFieldLines.setText("jTextField"); - jLabelLines.setText("jLabel"); - mainPanel.add(northPanel, BorderLayout.NORTH); - northPanel.add(lfLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - northPanel.add(lfField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - northPanel.add(themeLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - northPanel.add(themeField, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0)); - northPanel.add(rButton, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); - northPanel.add(blindLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); - northPanel.add(blindField, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 12), 0, 0)); - mainPanel.add(southPanel, BorderLayout.SOUTH); - southPanel.add(bCancel, null); - southPanel.add(bOK, null); - mainPanel.add(example, BorderLayout.CENTER); - example.add(jPanel1, "JPanel"); - jPanel1.add(jTextPane1, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.2 - ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0)); - jPanel1.add(jEditorPane1, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.2 - ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0)); - jPanel1.add(jList1, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.2 - ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0)); - jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - jPanel1.add(jTextField1, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - jPanel1.add(jCheckBox1, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 0, 0)); - jPanel1.add(jRadioButton1, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - jPanel1.add(jButton1, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.1 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - jPanel1.add(jToggleButton1, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.1 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - jPanel1.add(jTextArea1, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.2 - ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0)); - jPanel1.add(jComboBox1, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - jPanel1.add(jPasswordField1, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - example.add(jPanel2, "JPanel"); - jPanel2.add(jSplitPane1, BorderLayout.CENTER); - jSplitPane1.add(jScrollPane1, JSplitPane.LEFT); - jSplitPane1.add(jScrollPane2, JSplitPane.RIGHT); - jPanelFlat.setName("FlatP"); - jPanelGradient.setName("GradientP"); - jPanelTexture.setName("TextureP"); - jPanelLines.setName("LineP"); - example.add(jPanelFlat, "jPanel Flat"); - jPanelFlat.add(jButtonFlat, null); - jPanelFlat.add(jComboBoxFlat, null); - example.add(jPanelGradient, "jPanel Gradient 1"); - jPanelGradient.add(jButtonGardient, null); - jPanelGradient.add(jComboBoxGradient, null); - jPanelGradient.add(jLabelGradient, null); - jPanelGradient.add(jTextFieldGradient, null); - example.add(jPanelTexture, "jPanel Texture 2"); - jPanelTexture.add(jButtonTexture, null); - jPanelTexture.add(jComboBoxTexture, null); - jPanelTexture.add(jLabelTexture, null); - jPanelTexture.add(jTextFieldTexture, null); - example.add(jPanelLines, "jPanel Lines 1"); - jPanelLines.add(jButtonLines, null); - jPanelLines.add(jComboBoxLines, null); - jPanelLines.add(jLabelLines, null); - jPanelLines.add(jTextFieldLines, null); - jScrollPane2.getViewport().add(jTable1, null); - jScrollPane1.getViewport().add(jTree1, null); - jPanelFlat.add(jLabelFlat, null); - jPanelFlat.add(jTextFieldFlat, null); - jPanelLines.add(jCheckBoxLines, null); - jPanelTexture.add(jCheckBoxTexture, null); - jPanelGradient.add(jCheckBoxGradient, null); - jPanelFlat.add(jCheckBoxFlat, null); - } // jbInit - - /** - * Dynamic Init - */ - private void dynInit() - { - setLFSelection(); - // - jPanelGradient.setTabLevel(1); - jPanelTexture.setTabLevel(2); - jPanelLines.setTabLevel(1); - // - jComboBoxFlat.addActionListener(this); - jComboBoxGradient.addActionListener(this); - jComboBoxTexture.addActionListener(this); - jComboBoxLines.addActionListener(this); - // - jButton1.addActionListener(this); - jButtonFlat.addActionListener(this); - jButtonGardient.addActionListener(this); - jButtonTexture.addActionListener(this); - jButtonLines.addActionListener(this); - // - } // dynInit - - /** - * Set Picks From Environment - */ - private void setLFSelection() - { - m_setting = true; - // Search for PLAF - ValueNamePair plaf = null; - LookAndFeel lookFeel = UIManager.getLookAndFeel(); - String look = lookFeel.getClass().getName(); - for (int i = 0; i < AdempierePLAF.getPLAFs().length; i++) - { - ValueNamePair vp = AdempierePLAF.getPLAFs()[i]; - if (vp.getValue().equals(look)) - { - plaf = vp; - break; - } - } - if (plaf != null) - lfField.setSelectedItem(plaf); - - - // Search for Theme - MetalTheme metalTheme = null; - ValueNamePair theme = null; - boolean metal = UIManager.getLookAndFeel() instanceof MetalLookAndFeel; - themeField.setModel(new DefaultComboBoxModel(AdempierePLAF.getThemes())); - if (metal) - { - theme = null; - AppContext context = AppContext.getAppContext(); - metalTheme = (MetalTheme)context.get("currentMetalTheme"); - if (metalTheme != null) - { - String lookTheme = metalTheme.getName(); - for (int i = 0; i < AdempierePLAF.getThemes().length; i++) - { - ValueNamePair vp = AdempierePLAF.getThemes()[i]; - if (vp.getName().equals(lookTheme)) - { - theme = vp; - break; - } - } - } - if (theme != null) - themeField.setSelectedItem(theme); - } - m_setting = false; - if (log.isLoggable(Level.INFO)) log.info(lookFeel + " - " + metalTheme); - } // setLFSelection - - - /************************************************************************** - * ActionListener - * @param e - */ - public void actionPerformed(ActionEvent e) - { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - - // OK - Save & Finish - if (e.getSource() == bOK) - { - Ini.saveProperties(true); - dispose(); - } - // Cancel - Finish - else if (e.getSource() == bCancel) - { - dispose(); - } - else if (e.getSource() == bHelp) - { - new MiniBrowser("http://www.adempiere.com/wiki/index.php/LooksHelp"); - } - - // Look & Feel changed - else if (e.getSource() == lfField && !m_setting) - { - m_setting = true; // disable Theme setting - // set new theme - AdempierePLAF.setPLAF((ValueNamePair)lfField.getSelectedItem(), null, true); - AdempierePLAF.updateUI(this); - setLFSelection(); - m_setting = false; // enable Theme setting - } - // Theme Field Changed - else if (e.getSource() == themeField && !m_setting) - { - Ini.setProperty(Ini.P_UI_THEME, themeField.getSelectedItem().toString()); - AdempierePLAF.setPLAF((ValueNamePair)lfField.getSelectedItem(), (ValueNamePair)themeField.getSelectedItem(),true); - AdempierePLAF.updateUI(this); - } - - // Reset PLAFs - else if (e.getSource() == rButton) - { - AdempierePLAF.reset(); - AdempierePLAF.updateUI(this); - setLFSelection(); - ColorBlind.setColorType(ColorBlind.NORMAL); - } - - // ColorBlind - else if (e.getSource() == blindField) - { - int sel = blindField.getSelectedIndex(); - if (sel != ColorBlind.getColorType()) - { - // Test for True color - if (!m_colorTest) - { - m_colorTest = true; - int size = Toolkit.getDefaultToolkit().getColorModel().getPixelSize(); - if (size < 24) - JOptionPane.showMessageDialog(this, - "Your environment has only a pixel size of " + size - + ".\nTo see the effect, you need to have a pixel size of 24 (true color)", - "Insufficient Color Capabilities", - JOptionPane.ERROR_MESSAGE); - } - ColorBlind.setColorType(sel); - AdempierePLAF.updateUI(this); - } - } - - - // Change Tab Pacement - else if (e.getSource() == jComboBoxFlat || e.getSource() == jComboBoxGradient - || e.getSource() == jComboBoxTexture || e.getSource() == jComboBoxLines) - { - if (!m_setting) - { - m_setting = true; - int index = ((JComboBox)e.getSource()).getSelectedIndex(); - example.setTabPlacement(index+1); - jComboBoxFlat.setSelectedIndex(index); - jComboBoxGradient.setSelectedIndex(index); - jComboBoxTexture.setSelectedIndex(index); - jComboBoxLines.setSelectedIndex(index); - m_setting = false; - } - } - // Display Options - else if (e.getSource() == jButtonFlat) - JOptionPane.showConfirmDialog(this, "Confirm Dialog"); - else if (e.getSource() == jButtonGardient) - JOptionPane.showInputDialog(this, "Input Dialog"); - else if (e.getSource() == jButtonTexture) - JOptionPane.showMessageDialog(this, "Message Dialog"); - else if (e.getSource() == jButtonLines) - JOptionPane.showMessageDialog(this, "Message Dialog - Error", "Error", JOptionPane.ERROR_MESSAGE); - - // Test - else if (e.getSource() == jButton1) - { - } - - /********************/ - - // Metal - boolean metal = UIManager.getLookAndFeel() instanceof MetalLookAndFeel; - themeField.setEnabled(metal); - themeLabel.setEnabled(metal); - boolean adempiere = UIManager.getLookAndFeel() instanceof CompiereLookAndFeel; - - // ColorBlind - only with Adempiere L&F & Theme - boolean enableBlind = adempiere - && themeField.getSelectedItem() != null - && themeField.getSelectedItem().toString().indexOf("Adempiere") != -1; - blindField.setEnabled(enableBlind); - blindLabel.setEnabled(enableBlind); - if (e.getSource() != blindField && !enableBlind) - blindField.setSelectedIndex(0); - - // done - setCursor(Cursor.getDefaultCursor()); - } // actionPerformed - - /** - * Dispose - * Exit, if there is no real owning parent (not modal) - shortcut - */ - public void dispose() - { - super.dispose(); - if (!isModal()) - System.exit(0); - } // dispose - -} // AdempierePLAFEditor diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/PLAFEditorPanel.java b/org.adempiere.ui.swing/src/org/adempiere/plaf/PLAFEditorPanel.java deleted file mode 100644 index d88977579f..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/plaf/PLAFEditorPanel.java +++ /dev/null @@ -1,446 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.adempiere.plaf; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.GridLayout; -import java.awt.Insets; -import java.awt.event.FocusAdapter; -import java.awt.event.KeyAdapter; -import java.awt.event.MouseAdapter; -import java.awt.image.BufferedImage; -import java.util.ResourceBundle; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.swing.BorderFactory; -import javax.swing.BoxLayout; -import javax.swing.DefaultComboBoxModel; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JRadioButton; -import javax.swing.JRootPane; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.JTree; -import javax.swing.LookAndFeel; -import javax.swing.SwingUtilities; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.plaf.metal.MetalLookAndFeel; -import javax.swing.plaf.metal.MetalTheme; - -import org.compiere.swing.CButton; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTabbedPane; -import org.compiere.swing.CTextField; -import org.compiere.util.ValueNamePair; - -import sun.awt.AppContext; - -/** - * Look and feel selection panel. - * @author Low Heng Sin - * @version 2006-11-27 - */ -public class PLAFEditorPanel extends CPanel { - /** - * - */ - private static final long serialVersionUID = 3991197818429424319L; - - /** Logger */ - private static Logger log = Logger.getLogger(PLAFEditor.class.getName()); - - static ResourceBundle s_res = ResourceBundle.getBundle("org.compiere.plaf.PlafRes"); - static Object[] s_columns = new Object[] {"-0-", "-1-"}; - static Object[][] s_data = new Object[][] { - {"-00-", "-01-"}, - {"-10-", "-11-"}, - {"-20-", "-21-"}, - {"-30-", "-31-"}, - {"-O0-", "-O1-"}, - {"-l0-", "-l1-"}}; - - private PreviewPanel previewPanel = new PreviewPanel(); - private JList lookList = new JList(AdempierePLAF.getPLAFs()); - private JList themeList = new JList(); - - /** - * Instance variable to disable list event handling when updating list with value - * from UIManager - */ - private boolean m_setting; - - //preview components - private CTextField error = new CTextField(s_res.getString("Error")); - private CTextField mandatory = new CTextField(s_res.getString("Mandatory")); - CButton button = new CButton("Button"); - CPanel tabPage1 = new CPanel(); - - public PLAFEditorPanel() { - init(); - } - - private void init() { - setupUI(); - setupPreview(); - setLFSelection(); - } - - /** - * Create and layout UI components - */ - private void setupUI() { - this.setLayout(new BorderLayout()); - - CPanel selectionPanel = new CPanel(); - CPanel previewPart = new CPanel(); - add(selectionPanel, BorderLayout.CENTER); - add(previewPart, BorderLayout.SOUTH); - - //setup look and theme selection component - selectionPanel.setLayout(new GridBagLayout()); - CLabel label = new CLabel(s_res.getString("LookAndFeel")); - label.setForeground(AdempierePLAF.getPrimary1()); - label.setFont(label.getFont().deriveFont(Font.BOLD)); - selectionPanel.add(label, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, - GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); - label = new CLabel(s_res.getString("Theme")); - label.setForeground(AdempierePLAF.getPrimary1()); - label.setFont(label.getFont().deriveFont(Font.BOLD)); - selectionPanel.add(label, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, - GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 0, 0), 0, 0)); - - lookList.setVisibleRowCount(12); - JScrollPane scrollPane = new JScrollPane(lookList); - scrollPane.setBorder(BorderFactory.createLineBorder(AdempierePLAF.getSecondary1(), 1)); - selectionPanel.add(scrollPane, new GridBagConstraints(0, 1, 1, 1, 0.0, 1.0, - GridBagConstraints.NORTHWEST, GridBagConstraints.VERTICAL, new Insets(0, 5, 2, 2), 100, 0)); - - themeList.setVisibleRowCount(12); - scrollPane = new JScrollPane(themeList); - scrollPane.setBorder(BorderFactory.createLineBorder(AdempierePLAF.getSecondary1(), 1)); - selectionPanel.add(scrollPane, new GridBagConstraints(1, 1, 1, 1, 1.0, 1.0, - GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 2, 2, 5), 0, 0)); - - previewPart.setBorder(BorderFactory.createEmptyBorder()); - previewPart.setLayout(new GridBagLayout()); - label = new CLabel(s_res.getString("Preview")); - label.setForeground(AdempierePLAF.getPrimary1()); - label.setFont(label.getFont().deriveFont(Font.BOLD)); - previewPart.add(label, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, - GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); - previewPart.add(previewPanel, new GridBagConstraints(0, 1, 2, 1, 1.0, 1.0, - GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 5, 5, 5), 0, 0)); - - lookList.addListSelectionListener(new ListSelectionListener() { - public void valueChanged(ListSelectionEvent e) { - lookAndFeelSelectionChanged(e); - } - - }); - themeList.addListSelectionListener(new ListSelectionListener() { - public void valueChanged(ListSelectionEvent e) { - themeSelectionChanged(e); - } - - }); - } - - /** - * Handle theme selection changed - * @param e - */ - protected void themeSelectionChanged(ListSelectionEvent e) { - if (m_setting) return; - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - ValueNamePair laf = (ValueNamePair)lookList.getSelectedValue(); - ValueNamePair theme = (ValueNamePair)themeList.getSelectedValue(); - LookAndFeel currentLaf = UIManager.getLookAndFeel(); - MetalTheme currentTheme = MetalLookAndFeel.getCurrentTheme(); - AdempierePLAF.setPLAF(laf, theme, false); - previewPanel.refresh(currentLaf,currentTheme); - SwingUtilities.updateComponentTreeUI(previewPanel); - updatePreviewComponents(); - setLFSelection(); - setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - this.repaint(); - } - - /** - * Handle look and feel selection changed - * @param e - */ - protected void lookAndFeelSelectionChanged(ListSelectionEvent e) { - if (m_setting) return; - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - ValueNamePair laf = (ValueNamePair)lookList.getSelectedValue(); - LookAndFeel currentLaf = UIManager.getLookAndFeel(); - MetalTheme currentTheme = MetalLookAndFeel.getCurrentTheme(); - AdempierePLAF.setPLAF(laf, null, false); - previewPanel.refresh(currentLaf,currentTheme); - SwingUtilities.updateComponentTreeUI(previewPanel); - updatePreviewComponents(); - setLFSelection(); - setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - this.repaint(); - } - - private void updatePreviewComponents() { - error.setBackground(true); - mandatory.setMandatory(true); - button.setOpaque(true); - tabPage1.setOpaque(false); - } - - /** - * Create the preview UI components - */ - private void setupPreview() { - JRootPane rootPane = new JRootPane(); - previewPanel.setLayout(new BorderLayout()); - previewPanel.add(rootPane, BorderLayout.CENTER); - previewPanel.setBorder(BorderFactory.createLineBorder(AdempierePLAF.getSecondary1(), 1)); - GridLayout gridLayout = new GridLayout(1, 3); - gridLayout.setHgap(4); - rootPane.getContentPane().setLayout(gridLayout); - rootPane.setGlassPane(new GlassPane()); - rootPane.getGlassPane().setVisible(true); - CPanel column1 = new CPanel(); - rootPane.getContentPane().add(column1); - CPanel column2 = new CPanel(); - rootPane.getContentPane().add(column2); - CPanel column3 = new CPanel(); - rootPane.getContentPane().add(column3); - - column1.setLayout(new GridBagLayout()); - JTree jtree = new JTree(); - jtree.setFocusable(false); - jtree.setBorder(BorderFactory.createLineBorder(AdempierePLAF.getSecondary1(), 1)); - column1.add(jtree, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0, - GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5,5,2,2),0,0)); - CTextField normal = new CTextField("Text Field"); - normal.setFocusable(false); - column1.add(normal, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, - GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,5,5,2),0,0)); - error.setBackground(true); - error.setFocusable(false); - column1.add(error, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, - GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,2,5,2),0,0)); - - column2.setLayout(new GridBagLayout()); - JTable jtable = new JTable(s_data, s_columns); - JScrollPane scrollPane = new JScrollPane(jtable); - jtable.setFocusable(false); - scrollPane.setPreferredSize(jtable.getPreferredSize()); - column2.add(scrollPane, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0, - GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5,2,2,2),0,0)); - mandatory.setMandatory(true); - mandatory.setFocusable(false); - column2.add(mandatory, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, - GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,2,5,2),0,0)); - CTextField inactive = new CTextField(s_res.getString("Inactive")); - inactive.setEnabled(false); - column2.add(inactive, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, - GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,2,5,2),0,0)); - - column3.setLayout(new GridBagLayout()); - CTabbedPane tab = new CTabbedPane(); - column3.add(tab, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0, - GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5,2,2,5),0,0)); - CComboBox editable = new CComboBox(new Object[]{"Editable"}); - editable.setEditable(true); - editable.setFocusable(false); - column3.add(editable, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, - GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,2,5,2),0,0)); - CComboBox choice = new CComboBox(new Object[]{"Choice"}); - choice.setEditable(false); - choice.setFocusable(false); - column3.add(choice, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, - GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,2,5,5),0,0)); - - tabPage1.setLayout(new BoxLayout(tabPage1, BoxLayout.Y_AXIS)); - JRadioButton radio = new JRadioButton("Radio"); - radio.setSelected(true); - radio.setMargin(new Insets(5,5,5,5)); - radio.setFocusable(false); - radio.setOpaque(false); - tabPage1.add(radio); - CCheckBox checkBox = new CCheckBox("Checkbox"); - checkBox.setSelected(true); - checkBox.setMargin(new Insets(5,5,5,5)); - checkBox.setFocusable(false); - tabPage1.add(checkBox); - CLabel label = new CLabel("Label"); - label.setHorizontalAlignment(JLabel.LEFT); - label.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); - tabPage1.add(label); - button.setMargin(new Insets(5,5,5,5)); - button.setFocusable(false); - tabPage1.add(button); - tab.add(tabPage1, "tab1"); - tab.add(new CPanel(), "tab2"); - } - - /** - * Update the look list and theme list to show the current selection - */ - private void setLFSelection() - { - m_setting = true; - // Search for PLAF - ValueNamePair plaf = null; - LookAndFeel lookFeel = UIManager.getLookAndFeel(); - String look = lookFeel.getClass().getName(); - for (int i = 0; i < AdempierePLAF.getPLAFs().length; i++) - { - ValueNamePair vp = AdempierePLAF.getPLAFs()[i]; - if (vp.getValue().equals(look)) - { - plaf = vp; - break; - } - } - if (plaf != null) - lookList.setSelectedValue(plaf, true); - - - // Search for Theme - MetalTheme metalTheme = null; - ValueNamePair theme = null; - boolean metal = UIManager.getLookAndFeel() instanceof MetalLookAndFeel; - themeList.setModel(new DefaultComboBoxModel(AdempierePLAF.getThemes())); - if (metal) - { - theme = null; - AppContext context = AppContext.getAppContext(); - metalTheme = (MetalTheme)context.get("currentMetalTheme"); - if (metalTheme != null) - { - String lookTheme = metalTheme.getName(); - for (int i = 0; i < AdempierePLAF.getThemes().length; i++) - { - ValueNamePair vp = AdempierePLAF.getThemes()[i]; - if (vp.getName().equals(lookTheme)) - { - theme = vp; - break; - } - } - } - if (theme != null) - themeList.setSelectedValue(theme, true); - } - m_setting = false; - if (log.isLoggable(Level.INFO)) log.info(lookFeel + " - " + metalTheme); - } // setLFSelection - - /** - * Get look and feel selected by user - * @return selected look and feel - */ - public ValueNamePair getSelectedLook() { - return (ValueNamePair)lookList.getSelectedValue(); - } - - /** - * Get theme selected by user - * @return selected theme - */ - public ValueNamePair getSelectedTheme() { - return (ValueNamePair)themeList.getSelectedValue(); - } -} - -/** - * Glass pane to block input and mouse event from the preview components - * @author Low Heng Sin - */ -class GlassPane extends JComponent { - /** - * - */ - private static final long serialVersionUID = -4416920279272513L; - - GlassPane() { - addMouseListener(new MouseAdapter() {}); - addKeyListener(new KeyAdapter() {}); - addFocusListener(new FocusAdapter() {}); - } -} - -/** - * A custom panel, only repaint when look and feel or theme changed. - * @author Low Heng Sin - */ -class PreviewPanel extends CPanel { - /** - * - */ - private static final long serialVersionUID = 6028614986952449622L; - private boolean capture = true; - private LookAndFeel laf = null; - private MetalTheme theme = null; - private BufferedImage image; - - @Override - public void paint(Graphics g) { - if (capture) { - //capture preview image - image = (BufferedImage)createImage(this.getWidth(),this.getHeight()); - super.paint(image.createGraphics()); - g.drawImage(image, 0, 0, null); - capture = false; - if (laf != null) { - //reset to origianl setting - if (laf instanceof MetalLookAndFeel) - AdempierePLAF.setCurrentMetalTheme((MetalLookAndFeel)laf, theme); - try { - UIManager.setLookAndFeel(laf); - } catch (UnsupportedLookAndFeelException e) { - } - laf = null; - theme = null; - } - } else { - //draw captured preview image - if (image != null) - g.drawImage(image, 0, 0, null); - } - } - - /** - * Refresh look and feel preview, reset to original setting after - * refresh. - * @param currentLaf Current Look and feel - * @param currentTheme Current Theme - */ - public void refresh(LookAndFeel currentLaf, MetalTheme currentTheme) { - this.laf = currentLaf; - this.theme = currentTheme; - capture = true; - } -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/CL16.gif b/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/CL16.gif deleted file mode 100644 index 27d903c3e2cf63b6a22cafb96e0a7b3b5a190f3b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 929 zcmV;S177@zP)WFU8GbZ8({Xk{QrNlj4iWF>9@00RX{L_t(I%Vm?zYhz^; z#-I1|e!aQ(W6 zs@R1EoiZ(qg`|x)$z*QRo80@pE@m2wb5`fTd46y>&qMIP+Su5jNs`=}pPzrPTCL7< z&T)2jcC^30|8=|F{$+W2Szp~JSBJH=wb#QiTx~X+Z$wc9N+|%q7=t*DvA4JP)8XOa z-KC|aUoSQ6vRPeS{mA$IuND^<=fW_YK#eiT^BjyZl*{GmBuPGLHk*HJZ*TuO0j#X7 zyeg&KYBUOL9-&}yG^Yb(na1sz0N0g( z)*89iIKQ|+p63X|5aaRqMQ&LZbzK)qDcs^0c&*~&WXKS@0$(0<@bI4}2(1EO3`V07 z`rR&U+Xkf+gTWxFwANY(K{@AOjA1kyVK^M(1(9RM%~5hVX2PehwQUjWFU8GbZ8({Xk{QrNlj4iWF>9@00;?5L_t(o!=+bUY#dh= z{_g+G?s}cE*Xyq1rmkb+B#QE5HHlgwq*5qEGzgyP6A!%b#5)f>1gVOMgoKorLbLY;v zVHiG1Dg9QhRy+3SqmPc)YBf|U6>!cGMG<`8$DKQO?%ug`=XbvEUkHNWk0(x?==@&* zUVZgdv9hvq%oy|IdcA(|@ZrO#*XtmJfRN3fT5AzS5w2gqj@jASYwPRlCstQiFP=Je zD*N03UVQPz(e?H9pEJguIdI?rnVy~o=e(p$*z*EPTecU7-+4bltR5;C%*6RCWL(b$dMy| zdFP#X7C#lhnKNhhBuVmnrPSo!y?Ze}KHfborF6@AVToQ4#u!ja;dvg`*4F9(zBw~9 zbMexpOUn-gaQgJ=;UEZJE0@b(Xfzs_n3w=#43yHou@FjWS2hAEEI}!SloDYWRw<=V z?A^QfSC=ne?rZ|^_S`T2PZ0JH!wH#hf$we~xX<6wArxa)AmX*uTrA!sLg*Th=uO>+RC zlx_lAtJP30mr*K}o;`T*;NyK3xNzYDZ?#&#AcRbnN+pbskHc{sNGTzugb)IR5S;(} zM>zZLJdQl#!4-7Vz4wmRS`b2Dj6t5?1DzxZf*@d&(ub#~r(d~x^{U|j5XbQz08cuO z1Eo|KIp-XdQfRG_=QL{W5H2tk!n5JJFO3&!rbN1o@PlmdjHA}Mms(MdD>^ba?YX^VH{w1}Fb?8n+ao{)( zgb?`lPJtg?YT~79pTKhk%925GikaBPF9AP$dK^+t9|M)lM+sscu%=m>Ys1K+@@;*q>60EX%+-ht@jg zuIn1DwWgHPVo~o#{@NO*2P$}MY_yO0ZZ5Sk*XrQravOe};poFvlmzR3mun5*_mRYL zSGf=Zj4>oh0sw7F=_)Um%Xt(*Wn zBYeD`z+nWxxzWUg=U|&+$g>1A>%enZpK>8YH!KMu%e7i9r=z2z8Rz_Jmm2SbD5PLR z;GQEbE-s?gYJp}QJoQK!og_t;rikMX=091%t&f{vS%g|iK=m+bF;d!P|Esrd-OA{$ zUAwFh;RW@4gjrI>n+doVq=U`d7k%Wv|eizM72>4j#aULtcsg!IfRhi(-&irTkaDO zq9{6l{rdIWT>vk?{IaH$KBu)_OVhMl%@ilucqLnb*i|3EzQ!P$v4s%#))mRDkUYgDob#9V?Ai0d@#DugSH-ilvm-$eyu=v$n&){?N^MfwtGIVwR6-l8=0c(br&*qbA^>JfUcp!h$IhiZN!u7{l*}sAh~A&bj8CgL95N n&r_}SO1WIN588MC{{8en2DVv(%1P7t00000NkvXXu0mjfVR0cm diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/Cancel24.gif b/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/Cancel24.gif deleted file mode 100644 index d91a52dc0c631b17dc1132962d0b4495ab7c4221..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1268 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 O0000c-+2*wv2(<2J_t+h+ zs5rlI{^p#SO2-|aiODDi-jZP}W|aE1)~BmOR3$EA(Vi@w>U%ZDa$9qM8}c0HKK>=@ z`d4d)YqwsmShMx=n<-}wTJ%-CXPi)?Z+d)E$Kx3$zTq0>%B>G-<`ESK<06 zKLv;!Rde(>`RU=L2g~Ovo%n1M@bQ?*+>S*Vvl$k=|9v$za@qmb9gNTaiaD`NnxMxo zp5*#q&TW}{<`>WDw{ULpSLj^#x@qe3m+d`GEQ*uw+Md|dvtPsTSdE!)vF)Ukp32Aj azp#b`#_#;I)BX+6mkge+elF{r5}E*#afeO- diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/FloppyDrive.gif b/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/FloppyDrive.gif deleted file mode 100644 index f1d7a1985923fbe1f4717bd66985cceddd7f36e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 561 zcmV-10?z%3P)5 zlfR1-K@`V7GrPHjTF9HM`NVrQkDDElJ zh*(^!7J*!0<8G7eGMko`R|gs-Q{;YB;P_L1kWtz|QptJbUx`b_^gI`2FHBL4;MM*X{!l14cwR z_2@Z-zp4MN%F8SOFM*S{?yhVGkayn~0~8TqI2^8IPLgDaz=$YO6pI7cr1adIE z!Cnt0mkIxCb2uup1VxKFQ zFHx`8snu$;Ypta$OY%HtclSN{+6LaY0I-KRs*1G{?RJ}fzfZ5%quFdCB8Z476IU8FiYblx2x?4(A+YSrS4Zs8Cf4L!4Be*iJVj%d%NOmSsz3 z=Nti0RVweN0oIr=dq01j-|Vb6##tauQ#zdv-h0wCT{1i8Ai#-ZYcm3K@y^S2WB63J ze)C-Xt!_+AATT`#yRon%hQOY`kc+7sk?`XW{qqkxXGvR800000NkvXXu0mjf#Dw-o diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/HardDrive.gif b/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/HardDrive.gif deleted file mode 100644 index 5c3b8587f46fa03111cef37143e4c3386923b195..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 603 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP$3oE}V$LsSoA@P?#{r#7~tvR7-DgH>15x$Lk0q^`xiJYQ8;~4ElcHFfw{^N-dp!3h^jm2+;Geh z_&M{X(gTgRi$Z6%zLh**U1z-Qp=-CMr~fm{!;^oC=m$ zWxMghYF@68lb?Gozx=ZNTxz7-^->0(d5+IzTm%1b>2)>jTGuQ;>&0GvPKN8Rr>|vUM5mRlnNxtZet+01@UlW!AHnN#<_J z^_DrF`1kH78~N`Ga-+ZfwmtrM;;K~vp&?UMJS}ASB$5xknRD3ETwsNk(xIApMsxiR zD>G)yVw*b8$Mx5p-aBP9<&+m^GH8yM#dp00i_>zopr0C4;6C;$Ke diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/HomeFolder.gif b/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/HomeFolder.gif deleted file mode 100644 index 13d2c00d08a1a278e02348d3a66d11747e015892..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 528 zcmV+r0`L8aP)Ty^tSaylA~ zKBEC^ZTT$N2TO~u76?E+dh$@l?%Zp7X^iIO(hKtW{O#0A`gNcnnYh8$*R7x-eAsy3 zSbCmXNlyTT0K(x2U7g*5g2eS?d74rvrAWU`Jq5}FYb{!Pyvy#hnTv2D&Lp^eKOsHs z=36zvW-h|qnN^$Q^YtvvvK?HRUr{?(5ktW#HrmuE%R?a1=f7OggNl*6SO%c z1Q3y93#*$Li{tJY^14X%BWdk%wzI(QzQx_uAPNB(Ie>nsV%D0ZT S3$t$k0000W~QdMmlr4dytt0lBR3q?&; zsf}7ieW{ceqQ0~w%0ngR(l(+>6RT|+k)U#E5K0IT8=Mf^q}b(RJRV=>K69@7oZW{E z6%PeG5mk@0w56kc*8i=4U(N#l&kxlzdElw1LXir#G9KKfp!(p+CIA4}as(RoJ?ph< z1O7I&f4_Oh0lvTIXM4f;uUc2F*Hc}+k+#-Wgu^;CM({lsi;Ii6bn(1#X=2n?p8Ult zFa3J(jsOe{JflYw)=*=zShA`mbU-k=^sX0S3bG^fyY9h&Y0*p?-h1EjYvd&-0xsN}5e{ec8zp`u9n(Vo=?+@1vuxr;( zdmq{sySgZ`X-yEFtvWOgk1=u?K@veSA{RswfCnfq-Vjh%=E~LCoS`1w+!r}> z`egsc4Sj>7qo=I@ro(Oqz;w2~xpQOK_66FLgqDN`0whSeMC33|HYc(f!R7=@<79G1 zR#?~UctgM_n@*u@OS`XsbC~ID`%QIj>OTwYZ0%eZ%2h0^Y}4Vx_lPN%Kn_7UM6fv{ zi!o+0P8Ja?jWdIDG6RBDf;y{S&XkIM_uZ#~={xJ+gud6+5RKznriy?F03ZoPF5|En zk;92O#FS(p7l7|GQp#7bUC(1g#h|W*3RRm{G^d)Oyw!CBDCI>pp}|u&OviJALUW1W z5XfPSY{p=J20;=aPXl~c`BbR53&8+ajL0`#54zx_d_P(@05PouWhWVvm|mz_@rdpL z%pro!h%5%OI3t@Fa~VM@U-?0l0G~0c*1ZRa_*l7=MN?FF77CV; zEm~y&Hi2x;$YdNQ=VWLM6-Ror^Ck1VCFRVT6^W*xu2q7Jnai8PTCP~O7}F-}2Jk%d zx7RL?mRB}6dR!yt@?tf=@vcNFq!Z7Tt#q;MPAyjKiMhNvTru2n!C5w9&wr&dH~DBl zXojvc;|pzxI6l^@7iZ|Y^bJcm^55Je(FYX)}8FA}7hJYg1-a35r zueOloU{^~#GCY|bHykfJezouxm?|xcg}XZ2k`E^1(H;)UgKOs^&36r^nqq64qWZ=c zo_~(p(%U&WIB0zCpV5vzKj{tWp?`dH$8JN3$mEKqfFjN_hUtt&LRvl?;3b_4Ly)_H zc+f9d648MEqka3H6{TYF$yZ+d&7W_TpWP1N)t8?C*mbS%o_zO+NH&HNnVfaiHVO$w zN(#;#oeP7QYhS!Lk#s%h(}sZPo){lDi-q#w?ZlS^0089E>ACc^SXl6oRGyWdnJs7M z(n(@WGF`dv9Xr~do}Hc4HBsTj+OAxgCIxwRDY=&f@bb(1b5i;r&s>|KWevgAhEs`s z^x?6uUHa#H+b(``bm!Rk$tPB?jOqkRaAG~DPJIy589rD_Zf&U@k?op$|ML2Q6W`mj zV^yjpsV__mICk-FrhqlwD-exEzvwzub@1)O*BsXwdU5c%**o47Zr}0v!C0c_v4^*8 zK~K+GG)5!fTmvH@n_Iv;Zy(0^_{8P;jK1#Bp%?5s>Hq+=Hs>GOve|~O7~Xi}PslEm z;7Sh-4FL$vK|VL-<*a9NcX#vCnx=$dOrcyhK}f5*DU#?W3N0#5)c%sGQnK9pimif5HF z4xc%b`Q`k4vHV$+3KxK^jqc}hKnD=0MR0n$WKK?IhdVoaWpi_P-|pQ%*EVf>1k=-H zJDsi^IC5m<)oRriweP65#MgsrP)i1&8>;`03jjjtbb7j@qvM{jv9Z?C(NRC2&yO8H ze*BM~=Xn79n$UFzRPCK#bEB>$pqi*&8$}I72M}m)Z*TT}pJy_eVoksWVAn#{!U162 wYzgYQ39nnK)ttN0UffXS^-8b1am$VPZ%s-(_>=>Px# diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/NewFolder.gif b/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/NewFolder.gif deleted file mode 100644 index 628f4d50ffc3a350c8cdcbb089b25bcc7139001d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 635 zcmV->0)+jEP)K`lbtXsaQ;_vX7l#~~rDr9s7q55D1?^Pcy->cq+1jZ7wU zlQn3qYkyT=9D4NlK21=UuUwMzXD_T<^nH(qLk}pI%cq|`ef}hzKdJx=2+Z^gX$a(w z9jEZI&}<1~=5GIr#kTnFBp0JiPWk?d?LkQ*GNyW<-J8)xZA^$>*C zq1Y(iRq@)?S0J5PtwTX&lprAhpJoaZL@8vfr+s?gTEz;V*Ee=RvcJHi~u5nQVJ14 z1Y!}QNC=`B9SYSjB8Y@!qIE^U^ISG1t1MPDUl%wcY$LzW`je V_=-2-nyCN)002ovPDHLkV1icx6Sn{W diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/Ok24.gif b/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/Ok24.gif deleted file mode 100644 index 027d18f53194005ce4fd7feb1cacdd34079a2f86..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 936 zcmV;Z16TZsP)rlw3&J^L?ECq}sjrCW$9hBY3;Tn5Lvb!x^KyB%hAhV| z8)n;2+CN!iKiJ#|Gy1Q%5WKm#GFwAdYlLzO* z9noC6I#=U%g4;|0L@*fxAlSsTEC=1e8b5M?DJAbNU77ph+B^E%+B&~`|6Y0~?l_`Z zzB*rX#UzK3AQ0^SofFFdicQcBAMgV_pU-`_vRb-%X=YyL3Zl~A3*TN_XD1@{hT>8> z&E?9QHBY|5$-2NkO#~2+VOUT9)q3t5V?O2ehGO|b?%S2s(#?hWMKM;Ggd=lIdZ_eX ziqsp5yY2`tcr%>A1&BcVpKd9Fwt;@ydhTbLxwW|w8vg!=V|T8sUjC@Guq2B4aR3%l zxRBCiQlZl8jw00?4$tLebNQ`OZM-nc1+me)~`>$F|gAsmC}ugu{q93BFoI-7$sR3QM#+Qw>rK)f&&1* z{x0tHgRsh7Q_iablhQpL4oA3fq-3t5%GAu*^7PaKlaBXdfCz|_U4(I0Z$Iw%X{wLm z0Ko6xOYQY4eccbjs&I8#DUV6%9g9dQSusCJ((wQ~m`;mfyn{iwr~iE1@ss2v4geeg zUPOjfA+xfl9OgO-L?cQH7n}=#EXWd!jW8H?&>QshACEeI9H*z^hk@gfsOm^tc0J96 zumB8-V-F4gVcK5jZWPRE{~0000c51Uox{ZvFPmABOQO@lyk*M)EF8k`(QBS3i09%n#3r zpBXqU67(ap_3&?hFo@2LpX)uSHxw@vy&uw42XT~sa`d%&J=Q-U(WIS3N#DKz0000< KMNUMnLSTaOowC6I diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/Question.gif b/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/Question.gif deleted file mode 100644 index dc19aa1706d0f5e2a4b28ded5b126c29cd56194f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1482 zcmV;*1vUDKP)=kG(Ola9m-rMN!$C11Xr@Bf|e`~A=VlJmju z@_!aF+ZQd9sH*US5G=|U*xq)S!Cwu)GEsE5yMN)j%}Ye~8W+x-{CYBzX>L1=eXF^Y z*#KxNJvFNzSfqaSHsaz*;>q>%b(QC5lS`S!?A@+Ve6LT*7&3PQ>!Dct-&&lYl3dc*1QDYuFiXB%fvUj|U;2 z#g)6Pc&Za!mPzc60q7bBBdy75=f7vLtD49*bdp`L0Xw<^=i9SH7qwRF8n4_D0Lvue zjW=&LG8a_}ImX)efKU)ZkY2eDoIHB^g7DQg{@F6ApK}0R6E8=amQ_1LA7MvVkgZ#f z5L2hvj<01heh<#@XG9m)M|EB4ol^kIq^@G&vitS#z7RNh((QXo#f1?D;+ky*8GYF~_e#=M0sEoUF) zzS{eEcY@Dw~qax%?3bg>?HKPMtc%(9jS&ckZOOx0k-YKDKV%%J}#=Cr+Fo zyJ|0}I*gpBs=m3t|1mbt8bEh@daJ4xm%b9)b3Ch9E%oPCV@L#?YD8TtSejj{IKr7^G9i`(r6VE69b zSe8XB7Ne`H3n2u#z{oL3Q$H@;<}@nM``qIBe@ zkKcg<2RL@@7~yc3qeqWo7{=7NFNVGR378zC!c*{QUjKf}#Q4Pks=_0o#cLAs(rKh> zFy6kaRCLlWRlw2+EVcngu4=ZXH1p{~OO`BQ$BrEwI&=tCRm+Ocl)|#VAcJ+t z(Mv>XV>P(_~&a>^&`6qiQ_+<+Hw6@6N9@2JH%QA}3+Oca1TFbQOUERZYu^0(U= ki61CG0GL*0*x$B%4=3XEQPtwWDgXcg07*qoM6N<$f(_BmO8@`> diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/TreeClosed.gif b/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/TreeClosed.gif deleted file mode 100644 index 901edc9624a23d92a9fcbc0c9c450bf37409da18..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 498 zcmVT` z=fK?B+ueUcgw&mTx8?fP8#5oZ_IS4UlwPlQrCO;yj|7yQi?lwqqD*+(cr$(Vs9LE# z0Eh#m(;1HB@{s`NLMd=l3Z)da7uEYf05Hbjc`mO%_Gxx9%%#H)XKp%DNa@dEf@UYf zg64HNtq;9mzz z0TxYQt&biCWrx3zi1`R0A}FO05k$Zj!CGNxeauK0j4VSdL!1G*==LU59h96xI zMByWh2N4hikuew;S(yNSb=sUhdyWrZ|BROccMMviB*Wb(P{I#8i on>e<%XnEP;xA*VLo2x9V1Hy;2%BQg6_y7O^07*qoM6N<$g5ayrIRF3v diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/TreeLeaf.gif b/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/TreeLeaf.gif deleted file mode 100644 index 63042304b15eb0d8a2a49a46a8b173b15491f125..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 433 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHiqw7r(CjwgpoTFfcIMdAc};Se#xu$fAvHLdNM z)d?5jM{(8m3y-L Z81e!uVvii2AqEUw22WQ%mvv4FO#oLnw2%M* diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/TreeOpen.gif b/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/TreeOpen.gif deleted file mode 100644 index 1e074cd024aeaa1f774c335ad66fcf8187d5e587..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 523 zcmV+m0`&cfP)cVPQ;zF0Y6Y-;<5;ZC2-aEN-Ul%u85)#z*FfcH~`@T9H@$2A2@QE^U{K zOU+5f<~ZY!b4>9sJdaqU|7ecRED(i4_ZM({dP3`~*KF>d7ly8JK diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/UpFolder.gif b/org.adempiere.ui.swing/src/org/adempiere/plaf/icons/UpFolder.gif deleted file mode 100644 index fa9a7d71b5615dde4c5f702f95df533adadd56e0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 652 zcmV;70(1R|P)5 zlTT<9K@`TnH@h?0jfHw>O#jh>1nt2m6SAzrkW<%*%=Q}tRboP9pC%r$9&(LA+0sq)ybQD9srhR zz3Fxu)^6aqJl)?FN%nOeOgb)4?+M_zJQ@)DvRBSb2FFH|!GH*69hXP{3*flC1BAti zbJNzAm&ca3iTKDR3xq|-Y2`eKx?tij|4I5$vH1yqf%5H^Fb8J54jK)5$VM-C5%i8b<|k&Kxh=#FG>Ox&>r z4?sb}hlkg>1-vahgJcyDBP0eg&{{(&pkA-x@zeQAv9vj35<}`!ZpEItce&w-qk8xH z6RRw9@QrP7!N5#{!3lE@ZdYYZTfgiFi6Lb!&3aDLCbZTHrTP~zgJ5t59%w*hO6jv0-e|KhfXTN5%4RO;f>*i~TCP>z(RfwO(fCWQog*+6~q9~DAK}`&$ zR_M3%p%0~fkP3Fdmp)bS$>K*|5+YG!@Z%v-G{&YXnyA5KGjVt4_95AA%t~7mV=45& zpW&W+&;9@BoHKW3;D7sDle2NeU=0t!A z^MYk%O^(~Qk>lgInwk)*3PRv+X+b8Fi2i=^OG+9{D0%4ugre*(ip7lh#fxZ*7vo&N ze!?#V&gyC$t5#w4^f14))TyZI7cW(S36a;!%NxbDYsh30cXKmBQ4m5P#KckJZD|21 zv9Dhz6pg-TLgh;nplI5sh2`aX{K^%y>S`P-R}zoMX>D!g%$YNcjg6tjV(1$-@U*Xw zP$;Bm4#&Zla#ovAe!8kEd3E7Jc>(0LW5?vpn>S^9d%FZAAUirbWPg9Zym|Vxyr3xZ zQbB=it*DSDte$lSG+qBPTwJVLy}g-^7eZhdMrMuA=R*jAR#t{<(jZ zF=r#dgg3&m*rr5x_e8fhH)m?@^ZA|;kZwq$xf$VflIZCn9F0~3Z_ikO)8jc9Dku=+ zeSJ7&+6N27~yvZ^s@PAz<5h4dZij;=3Wso|~F?;N56-brTmaB2y`hLx)fd zBa0{!iLh?nI-=2N)|?)TF?#eUsRs}6mXrhr@82Ih4xN9S0TWbjZthpP4hPA>L0t9q zs09U?yH67g4-a$r@L`S|Il_}CPo61_5CSz2z`tu3wq@b7Ec`h+pO|3$lM=jNv~+1j zyt5PG_2S;SGm9LcyStmSXV22!-cDCnSJoOK1pbBw)L@XOw{9^%9G(X>|78hG(EY*S zFOj^wfYsB3r?C;erY4JA2tg)js!KOm z){)~d`rL0q6Lwd=_11TytqtjLklWUV;`e8fPsj88X&;FMzb#)*a$o?;%DCFw`~4Ov zcW0I05O@Ol`TM;iBiN&(xa;a>O)i8$(RFgRYysQG@#qn`fxwO*VSZKyet#P3|egZ>K3(G>LQefLiDZ#d3@|qsY zDL$mkjGysOi?`89%v+ z6o0~2z!o4UuPH@JTSysC!OvIK6dpuP@0~}M3_9>G{$ERP-Hjo06Kw=7#ldxy| jXC$Uzdc2&5|Azemil@Gh0_=Kr00000NkvXXu0mjflYoJh diff --git a/org.adempiere.ui.swing/src/org/adempiere/process/DefaultPrintShippingLabel.java b/org.adempiere.ui.swing/src/org/adempiere/process/DefaultPrintShippingLabel.java deleted file mode 100644 index 9465abe782..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/process/DefaultPrintShippingLabel.java +++ /dev/null @@ -1,164 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2012 Elaine Tan * - * Copyright (C) 2012 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.adempiere.process; - -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.geom.AffineTransform; -import java.awt.image.BufferedImage; -import java.awt.print.Book; -import java.awt.print.PageFormat; -import java.awt.print.Paper; -import java.awt.print.Printable; -import java.awt.print.PrinterException; -import java.awt.print.PrinterJob; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import javax.imageio.ImageIO; -import javax.print.Doc; -import javax.print.DocFlavor; -import javax.print.DocPrintJob; -import javax.print.PrintService; -import javax.print.SimpleDoc; -import javax.print.attribute.HashDocAttributeSet; -import javax.print.attribute.standard.DocumentName; - -import org.compiere.model.MAttachment; -import org.compiere.model.MAttachmentEntry; -import org.compiere.model.MShipperLabels; - -/** - * - * @author Elaine - * - */ -public class DefaultPrintShippingLabel implements IPrintShippingLabel -{ - @Override - public String printToLabelPrinter(MAttachment attachment, MShipperLabels labelType) throws Exception - { - MAttachmentEntry[] entries = attachment.getEntries(); - List list = new ArrayList(); - if (entries != null && entries.length > 0) - { - for (MAttachmentEntry entry : entries) - { - if (entry.getName().startsWith("shipping_label")) - list.add(entry); - } - if (list.size() > 0) - { - // Create Print Job - PrinterJob pjob = PrinterJob.getPrinterJob(); - if (pjob.printDialog()) - { - PrintService service = pjob.getPrintService(); - DocFlavor flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE; - for (MAttachmentEntry entry : list) - { - DocPrintJob job = service.createPrintJob(); - HashDocAttributeSet as = new HashDocAttributeSet(); - as.add(new DocumentName(entry.getName(), null)); - Doc doc = new SimpleDoc(entry.getData(), flavor, as); - job.print(doc, null); - } - } - } - } - return list.size() + " labels printed."; - } - - @Override - public String printImageLabel(MAttachment attachment, MShipperLabels labelType, String title) throws Exception - { - MAttachmentEntry[] entries = attachment.getEntries(); - List list = new ArrayList(); - if (entries != null && entries.length > 0) - { - for (MAttachmentEntry entry : entries) - { - if (entry.getName().startsWith("shipping_label") && entry.isGraphic()) - { - BufferedImage image = ImageIO.read(entry.getInputStream()); - if (image != null) - list.add(image); - } - } - - if (list.size() > 0) - { - // Create Print Job - Book book = new Book(); - PrinterJob pjob = PrinterJob.getPrinterJob(); - pjob.setJobName(title); - - if (pjob.printDialog()) - { - PageFormat pf = pjob.pageDialog(pjob.defaultPage()); - Paper p = pf.getPaper(); - BigDecimal width = labelType.getWidth(); - BigDecimal height = labelType.getHeight(); - - if (width != null && width.compareTo(BigDecimal.ZERO) > 0 && height != null && height.compareTo(BigDecimal.ZERO) > 0) - { - BigDecimal factor = new BigDecimal(72); - width = width.multiply(factor); - height = height.multiply(factor); - p.setImageableArea(p.getImageableX(), p.getImageableY(), width.doubleValue(), height.doubleValue()); - pf.setPaper(p); - } - - for (BufferedImage image : list) - book.append(new ImagePrintable(image), pf); - - pjob.setPageable(book); - pjob.print(); - } - } - } - return list.size() + " labels printed."; - } - - final static class ImagePrintable implements Printable - { - private BufferedImage image; - - protected ImagePrintable(BufferedImage image) - { - this.image = image; - } - - public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException - { - if (pageIndex > 0) - return Printable.NO_SUCH_PAGE; - - Graphics2D g2d = (Graphics2D) graphics; - // Set us to the upper left corner - g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY()); - AffineTransform at = new AffineTransform(); - at.translate(0, 0); - - // We need to scale the image properly so that it fits on one page. - double xScale = pageFormat.getImageableWidth() / image.getWidth(); - double yScale = pageFormat.getImageableHeight() / image.getHeight(); - - at.scale(xScale, yScale); - g2d.drawRenderedImage(image, at); - return Printable.PAGE_EXISTS; - } - } -} diff --git a/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/DefaultEditorFactory.java b/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/DefaultEditorFactory.java deleted file mode 100644 index 315eec57cd..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/DefaultEditorFactory.java +++ /dev/null @@ -1,308 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2010 Heng Sin Low * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.adempiere.ui.swing.factory; - -import org.compiere.grid.ed.ADempiereAutoCompleteDecorator; -import org.compiere.grid.ed.VAccount; -import org.compiere.grid.ed.VAssignment; -import org.compiere.grid.ed.VBinary; -import org.compiere.grid.ed.VButton; -import org.compiere.grid.ed.VChart; -import org.compiere.grid.ed.VCheckBox; -import org.compiere.grid.ed.VColor; -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VEditor; -import org.compiere.grid.ed.VFile; -import org.compiere.grid.ed.VImage; -import org.compiere.grid.ed.VLocation; -import org.compiere.grid.ed.VLocator; -import org.compiere.grid.ed.VLookup; -import org.compiere.grid.ed.VMemo; -import org.compiere.grid.ed.VNumber; -import org.compiere.grid.ed.VPAttribute; -import org.compiere.grid.ed.VPassword; -import org.compiere.grid.ed.VPaymentEditor; -import org.compiere.grid.ed.VString; -import org.compiere.grid.ed.VText; -import org.compiere.grid.ed.VTextLong; -import org.compiere.grid.ed.VURL; -import org.compiere.model.GridField; -import org.compiere.model.GridTab; -import org.compiere.model.MAccountLookup; -import org.compiere.model.MLocationLookup; -import org.compiere.model.MLocatorLookup; -import org.compiere.model.MPAttributeLookup; -import org.compiere.model.MPaymentLookup; -import org.compiere.util.DisplayType; - -/** - * - * @author hengsin - * - */ -public class DefaultEditorFactory implements IEditorFactory { - - @Override - public VEditor getEditor(GridTab mTab, GridField mField, boolean tableEditor) { - if (mField == null) - return null; - - VEditor editor = null; - int displayType = mField.getDisplayType(); - String columnName = mField.getColumnName(); - boolean mandatory = mField.isMandatory(false); // no context check - boolean readOnly = mField.isReadOnly(); - boolean updateable = mField.isUpdateable(); - int WindowNo = mField.getWindowNo(); - - // Not a Field - if (mField.isHeading()) - return null; - - // String (clear/password) - if (displayType == DisplayType.String - || displayType == DisplayType.PrinterName - || (tableEditor && (displayType == DisplayType.Text || displayType == DisplayType.TextLong)) ) - { - if (mField.isEncryptedField()) - { - VPassword vs = new VPassword (columnName, mandatory, readOnly, updateable, - mField.getDisplayLength(), mField.getFieldLength(), mField.getVFormat()); - vs.setName (columnName); - vs.setField (mField); - editor = vs; - } - else - { - VString vs = new VString (columnName, mandatory, readOnly, updateable, - mField.getDisplayLength(), mField.getFieldLength(), - mField.getVFormat(), mField.getObscureType()); - vs.setName (columnName); - vs.setField (mField); - if (mField.isAutocomplete()) { - ADempiereAutoCompleteDecorator.decorate(vs, mField.getEntries(), false); - } - editor = vs; - } - } - // URL - else if (displayType == DisplayType.URL) - { - VURL vs = new VURL (columnName, mandatory, readOnly, updateable, - mField.getDisplayLength(), mField.getFieldLength()); - vs.setName (columnName); - vs.setField (mField); - editor = vs; - } - - /** Printer Name - else if (displayType == DisplayType.PrinterName) - { - VPrinterName vs = new VPrinterName (columnName, mandatory, readOnly, updateable, - mField.getDisplayLength(), mField.getFieldLength(), mField.getVFormat()); - vs.setName (columnName); - vs.setField (mField); - editor = vs; - } **/ - - // File Path / Name - else if (displayType == DisplayType.FilePath || displayType == DisplayType.FileName) - { - VFile file = new VFile (columnName, mandatory, readOnly, updateable, - mField.getFieldLength(), displayType == DisplayType.FileName); - file.setName(columnName); - file.setField(mField); - editor = file; - } - - // Lookup - else if (DisplayType.isLookup(displayType) || displayType == DisplayType.ID) - { - VLookup vl = new VLookup(columnName, mandatory, readOnly, updateable, - mField.getLookup()); - vl.setName(columnName); - vl.setField (mField); - editor = vl; - } - - // Number - else if (DisplayType.isNumeric(displayType)) - { - VNumber vn = new VNumber(columnName, mandatory, readOnly, updateable, - displayType, mField.getHeader()); - vn.setRange(mField.getValueMin(), mField.getValueMax()); - vn.setName(columnName); - vn.setField (mField); - editor = vn; - } - - // YesNo - else if (displayType == DisplayType.YesNo) - { - VCheckBox vc = new VCheckBox(columnName, mandatory, readOnly, updateable, - mField.getHeader(), mField.getDescription(), tableEditor); - vc.setName(columnName); - vc.setField (mField); - editor = vc; - } - - // Text (single row) - else if (displayType == DisplayType.Text) - { - VText vt = new VText(columnName, mandatory, readOnly, updateable, - mField.getDisplayLength(), mField.getFieldLength()); - vt.setName(columnName); - vt.setField (mField); - editor = vt; - } - - // Memo (single row) - else if (displayType == DisplayType.Memo) - { - VMemo vt = new VMemo(columnName, mandatory, readOnly, updateable, - mField.getDisplayLength(), mField.getFieldLength()); - vt.setName(columnName); - vt.setField (mField); - editor = vt; - } - - // Date - else if (DisplayType.isDate(displayType)) - { - if (displayType == DisplayType.DateTime) - readOnly = true; - VDate vd = new VDate(columnName, mandatory, readOnly, updateable, - displayType, mField.getHeader()); - vd.setName(columnName); - vd.setField (mField); - editor = vd; - } - - // Location - else if (displayType == DisplayType.Location) - { - VLocation loc = new VLocation (mTab, columnName, mandatory, readOnly, updateable, - (MLocationLookup)mField.getLookup()); - loc.setName(columnName); - loc.setField (mField); - editor = loc; - } - - // Locator - else if (displayType == DisplayType.Locator) - { - VLocator loc = new VLocator (columnName, mandatory, readOnly, updateable, - (MLocatorLookup)mField.getLookup(), WindowNo); - loc.setName(columnName); - loc.setField (mField); - editor = loc; - } - - // Account - else if (displayType == DisplayType.Account) - { - //hengsin: bug [ 1711795 ] Combination copied itself in Grid mode - /* - VAccount acct = new VAccount (columnName, mandatory, readOnly, updateable, - (MAccountLookup)mField.getLookup(), mField.getHeader());*/ - VAccount acct = new VAccount (columnName, mandatory, readOnly, updateable, - new MAccountLookup (mField.getVO().ctx, mField.getWindowNo()), mField.getHeader()); - acct.setName(columnName); - acct.setField (mField); - editor = acct; - } - - // Button - else if (displayType == DisplayType.Button) - { - VButton button = new VButton(columnName, mandatory, readOnly, updateable, - mField.getHeader(), mField.getDescription(), mField.getHelp(), mField.getAD_Process_ID()); - button.setName(columnName); - button.setField (mField); - editor = button; - } - - // Assignment - else if (displayType == DisplayType.Assignment) - { - VAssignment assign = new VAssignment (mandatory, readOnly, updateable); - assign.setName(columnName); - assign.setField (mField); - editor = assign; - } - - // Color - else if (displayType == DisplayType.Color) - { - VColor color = new VColor (mTab, mandatory, readOnly); - color.setName(columnName); - color.setField (mField); - editor = color; - } - - // Image - else if (displayType == DisplayType.Image) - { - VImage image = new VImage (columnName, WindowNo); - image.setName(columnName); - image.setField (mField); - editor = image; - } - - // PAttribute - else if (displayType == DisplayType.PAttribute) - { - VPAttribute attrib = new VPAttribute (mTab, mandatory, readOnly, updateable, WindowNo, - (MPAttributeLookup)mField.getLookup()); - attrib.setName(columnName); - attrib.setField (mField); - editor = attrib; - } - - // Long Text (CLob) - else if (displayType == DisplayType.TextLong) - { - VTextLong vt = new VTextLong (columnName, mandatory, readOnly, updateable, - mField.getDisplayLength(), mField.getFieldLength()); - vt.setName(columnName); - vt.setField (mField); - editor = vt; - } - - // Binary (BLob) - else if (displayType == DisplayType.Binary) - { - VBinary bin = new VBinary (columnName, WindowNo); - bin.setName(columnName); - bin.setField (mField); - editor = bin; - } - - else if (displayType == DisplayType.Payment) - { - VPaymentEditor p = new VPaymentEditor (mField, columnName, mandatory, readOnly, updateable, (MPaymentLookup) mField.getLookup()); - editor = p; - } - - // Chart - else if (displayType == DisplayType.Chart ) - { - VChart chart = new VChart(mField.getAD_Chart_ID(), WindowNo); - editor = chart; - } - - return editor; - } - -} diff --git a/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/DefaultFormFactory.java b/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/DefaultFormFactory.java deleted file mode 100644 index 855b99e767..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/DefaultFormFactory.java +++ /dev/null @@ -1,77 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2013 Heng Sin Low * - * Copyright (C) 2013 Trek Global * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.adempiere.ui.swing.factory; - -import java.util.logging.Level; - -import org.adempiere.base.equinox.EquinoxExtensionLocator; -import org.compiere.apps.form.FormPanel; -import org.compiere.util.CLogger; - -/** - * @author hengsin - * - */ -public class DefaultFormFactory implements IFormFactory { - - private final static CLogger log = CLogger.getCLogger(DefaultFormFactory.class); - - /** - * default constructor - */ - public DefaultFormFactory() { - } - - /* (non-Javadoc) - * @see org.adempiere.ui.swing.factory.IFormFactory#newFormInstance(java.lang.String) - */ - @Override - public FormPanel newFormInstance(String formName) { - FormPanel form = EquinoxExtensionLocator.instance().locate(FormPanel.class, "org.adempiere.apps.Form", formName, null).getExtension(); - if (form == null) { - ClassLoader loader = Thread.currentThread().getContextClassLoader(); - Class clazz = null; - if (loader != null) { - try { - clazz = loader.loadClass(formName); - } catch (Exception e) { - if (log.isLoggable(Level.INFO)) { - log.log(Level.INFO, e.getLocalizedMessage(), e); - } - } - } - if (clazz == null) { - loader = this.getClass().getClassLoader(); - try { - clazz = loader.loadClass(formName); - } catch (Exception e) { - if (log.isLoggable(Level.INFO)) { - log.log(Level.INFO, e.getLocalizedMessage(), e); - } - } - } - if (clazz != null) { - try { - form = (FormPanel) clazz.newInstance(); - } catch (Exception e) { - if (log.isLoggable(Level.WARNING)) { - log.log(Level.WARNING, e.getLocalizedMessage(), e); - } - } - } - } - return form; - } - -} diff --git a/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/DefaultInfoFactory.java b/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/DefaultInfoFactory.java deleted file mode 100644 index 31b30f5d96..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/DefaultInfoFactory.java +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2010 Heng Sin Low * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.adempiere.ui.swing.factory; - -import java.awt.Frame; - -import org.compiere.apps.search.Info; -import org.compiere.apps.search.InfoAsset; -import org.compiere.apps.search.InfoAssignment; -import org.compiere.apps.search.InfoBPartner; -import org.compiere.apps.search.InfoCashLine; -import org.compiere.apps.search.InfoGeneral; -import org.compiere.apps.search.InfoInOut; -import org.compiere.apps.search.InfoInvoice; -import org.compiere.apps.search.InfoOrder; -import org.compiere.apps.search.InfoPayment; -import org.compiere.apps.search.InfoProduct; -import org.compiere.model.GridField; -import org.compiere.model.Lookup; -import org.compiere.model.MColumn; -import org.compiere.model.MInvoiceLine; -import org.compiere.model.MOrderLine; -import org.compiere.model.MProductPrice; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.eevolution.model.I_PP_Product_BOMLine; - -/** - * - * @author hengsin - * - */ -public class DefaultInfoFactory implements IInfoFactory { - - @SuppressWarnings("unused") - private final static CLogger log = CLogger.getCLogger(DefaultInfoFactory.class); - - @Override - public Info create(Frame frame, boolean modal, Lookup lookup, - GridField field, String tableName, String keyColumn, String queryValue, - boolean multiSelection, String whereClause) { - Info info = null; - String col = lookup.getColumnName(); // fully qualified name - if (col.indexOf('.') != -1) - col = col.substring(col.indexOf('.')+1); - boolean multipleSelection = false; - if (col.equals("M_Product_ID")) - { - int M_Warehouse_ID = Env.getContextAsInt(Env.getCtx(), lookup.getWindowNo(), "M_Warehouse_ID"); - int M_PriceList_ID = Env.getContextAsInt(Env.getCtx(), lookup.getWindowNo(), "M_PriceList_ID"); - - if(field != null) - { - int AD_Table_ID = MColumn.getTable_ID(Env.getCtx(), field.getAD_Column_ID(), null); - multipleSelection = (MOrderLine.Table_ID == AD_Table_ID) || (MInvoiceLine.Table_ID == AD_Table_ID) || (I_PP_Product_BOMLine.Table_ID == AD_Table_ID) || (MProductPrice.Table_ID == AD_Table_ID); - } - // Show Info - info = new InfoProduct (frame, true, lookup.getWindowNo(), - M_Warehouse_ID, M_PriceList_ID, queryValue, multipleSelection, whereClause); - } - else if (col.equals("C_BPartner_ID")) - { - boolean isSOTrx = true; // default - if (Env.getContext(Env.getCtx(), lookup.getWindowNo(), "IsSOTrx").equals("N")) - isSOTrx = false; - info = new InfoBPartner (frame, true, lookup.getWindowNo(), - queryValue, isSOTrx, multipleSelection, whereClause); - } - else // General Info - { - info = create (frame, true, lookup.getWindowNo(), - tableName, keyColumn, queryValue, multipleSelection, whereClause, true); - } - return info; - } - - @Override - public Info create(Frame frame, boolean modal, int WindowNo, - String tableName, String keyColumn, String value, - boolean multiSelection, String whereClause, boolean lookup) { - Info info = null; - - if (tableName.equals("C_BPartner")) - info = new InfoBPartner (frame, modal, WindowNo, value, !Env.getContext(Env.getCtx(),"IsSOTrx").equals("N"), - multiSelection, whereClause, lookup); - else if (tableName.equals("M_Product")) - info = new InfoProduct (frame, modal, WindowNo, - Env.getContextAsInt(Env.getCtx(), WindowNo, "M_Warehouse_ID"), - Env.getContextAsInt(Env.getCtx(), WindowNo, "M_PriceList_ID"), - value, multiSelection, whereClause, lookup); - else if (tableName.equals("C_Invoice")) - info = new InfoInvoice (frame, modal, WindowNo, value, - multiSelection, whereClause, lookup); - else if (tableName.equals("A_Asset")) - info = new InfoAsset (frame, modal, WindowNo, 0, value, - multiSelection, whereClause, lookup); - else if (tableName.equals("C_Order")) - info = new InfoOrder (frame, modal, WindowNo, value, - multiSelection, whereClause, lookup); - else if (tableName.equals("M_InOut")) - info = new InfoInOut (frame, modal, WindowNo, value, - multiSelection, whereClause, lookup); - else if (tableName.equals("C_Payment")) - info = new InfoPayment (frame, modal, WindowNo, value, - multiSelection, whereClause, lookup); - else if (tableName.equals("C_CashLine")) - info = new InfoCashLine (frame, modal, WindowNo, value, - multiSelection, whereClause); - else if (tableName.equals("S_ResourceAssigment")) - info = new InfoAssignment (frame, modal, WindowNo, value, - multiSelection, whereClause, lookup); - else { - info = new InfoGeneral (frame, modal, WindowNo, value, - tableName, keyColumn, - multiSelection, whereClause, lookup); - if (!info.loadedOK()) { - info.dispose(false); - info = null; - } - } - // - return info; - } - -} diff --git a/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/IEditorFactory.java b/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/IEditorFactory.java deleted file mode 100644 index df1dc595a8..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/IEditorFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2010 Heng Sin Low * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.adempiere.ui.swing.factory; - -import org.compiere.grid.ed.VEditor; -import org.compiere.model.GridField; -import org.compiere.model.GridTab; - -/** - * - * @author hengsin - * - */ -public interface IEditorFactory { - - /** - * Create Editor for MField. - * The Name is set to the column name for dynamic display management - * @param mTab MTab - * @param mField MField - * @param tableEditor true if table editor - * @return grid editor - */ - public VEditor getEditor (GridTab mTab, GridField mField, boolean tableEditor); -} diff --git a/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/IFormFactory.java b/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/IFormFactory.java deleted file mode 100644 index 90613f53e1..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/IFormFactory.java +++ /dev/null @@ -1,30 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2013 Heng Sin Low * - * Copyright (C) 2013 Trek Global * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.adempiere.ui.swing.factory; - -import org.compiere.apps.form.FormPanel; - -/** - * - * @author hengsin - * - */ -public interface IFormFactory { - - /** - * @param formName - * @return new form instance - */ - public FormPanel newFormInstance(String formName); -} diff --git a/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/IInfoFactory.java b/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/IInfoFactory.java deleted file mode 100644 index 87f0cda4b4..0000000000 --- a/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/IInfoFactory.java +++ /dev/null @@ -1,62 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2010 Heng Sin Low * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.adempiere.ui.swing.factory; - -import java.awt.Frame; - -import org.compiere.apps.search.Info; -import org.compiere.model.GridField; -import org.compiere.model.Lookup; - -/** - * - * @author hengsin - * - */ -public interface IInfoFactory { - - /** - * Factory Constructor - * @param frame parent frame - * @param modal new window is modal - * @param lookup Lookup - * @param field Grid field - * @param tableName table name of the search - * @param keyColumn key column of the search - * @param value query value - * @param multiSelection allow to select more than one row - * @param whereClause fully qualified where clause for the search - * @return special or general Info Window - */ - public Info create (Frame frame, boolean modal, Lookup lookup, GridField field, - String tableName, String keyColumn, String value, - boolean multiSelection, String whereClause); - - /** - * Factory Constructor - * @param frame parent frame - * @param modal new window is modal - * @param WindowNo window no - * @param tableName table name of the search - * @param keyColumn key column of the search - * @param value query value - * @param multiSelection allow to select more than one row - * @param whereClause fully qualified where clause for the search - * @param lookup - * @return special or general Info Window - */ - public Info create (Frame frame, boolean modal, int WindowNo, - String tableName, String keyColumn, String value, - boolean multiSelection, String whereClause, boolean lookup); -} diff --git a/org.adempiere.ui.swing/src/org/compiere/AdempiereClient.java b/org.adempiere.ui.swing/src/org/compiere/AdempiereClient.java deleted file mode 100644 index 6480138ef2..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/AdempiereClient.java +++ /dev/null @@ -1,205 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere; - -import java.util.logging.Level; - -import org.compiere.db.CConnection; -import org.compiere.model.MClient; -import org.compiere.model.MSystem; -import org.compiere.model.ModelValidationEngine; -import org.compiere.util.CLogFile; -import org.compiere.util.CLogMgt; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Ini; -import org.compiere.util.Login; -import org.compiere.util.SecureEngine; -import org.compiere.util.SecureInterface; -import org.compiere.util.Splash; - -/** - * Adempiere Control Class - * - * @author Jorg Janke - * @version $Id: Adempiere.java,v 1.8 2006/08/11 02:58:14 jjanke Exp $ - * - */ -public final class AdempiereClient -{ - /** Logging */ - private static CLogger log = null; - - /************************************************************************* - * Startup Client. - * - Print greeting, - * - Check Java version and - * - load ini parameters - * If it is a client, load/set PLAF and exit if error. - * If Client, you need to call startupEnvironment explicitly! - * For testing call method startupEnvironment - * @param isClient true for client - * @return successful startup - */ - public static synchronized boolean startup (boolean isClient) - { - // Already started - if (log != null) - return true; - - // Check Version - if (!Login.isJavaOK(isClient) && isClient) - System.exit(1); - - CLogMgt.initialize(isClient); - Ini.setClient (isClient); // Ini requires Logging - // Init Log - log = CLogger.getCLogger(AdempiereClient.class); - // Greeting - if (log.isLoggable(Level.INFO)) log.info(Adempiere.getSummaryAscii()); - // log.info(getAdempiereHome() + " - " + getJavaInfo() + " - " + getOSInfo()); - - // Load System environment - // EnvLoader.load(Ini.ENV_PREFIX); - - // System properties - Ini.loadProperties (false); - - // Set up Log - CLogMgt.setLevel(Ini.getProperty(Ini.P_TRACELEVEL)); - if (isClient && Ini.isPropertyBool(Ini.P_TRACEFILE)) - CLogMgt.addHandler(new CLogFile(Ini.findAdempiereHome(), true, isClient)); - - // Set UI - if (isClient) - { - if (CLogMgt.isLevelAll()) - log.log(Level.FINEST, System.getProperties().toString()); - } - - // Set Default Database Connection from Ini - DB.setDBTarget(CConnection.get()); - - if (isClient) // don't test connection - return false; // need to call - - return startupEnvironment(isClient); - } // startup - - /** - * Startup Adempiere Environment. - * Automatically called for Server connections - * For testing call this method. - * @param isClient true if client connection - * @return successful startup - */ - public static boolean startupEnvironment (boolean isClient) - { - startup(isClient); // returns if already initiated - if (!DB.isConnected()) - { - log.severe ("No Database"); - return false; - } - MSystem system = MSystem.get(Env.getCtx()); // Initializes Base Context too - if (system == null) - return false; - - // Initialize main cached Singletons - ModelValidationEngine.get(); - try - { - String className = system.getEncryptionKey(); - if (className == null || className.length() == 0) - { - className = System.getProperty(SecureInterface.ADEMPIERE_SECURE); - if (className != null && className.length() > 0 - && !className.equals(SecureInterface.ADEMPIERE_SECURE_DEFAULT)) - { - SecureEngine.init(className); // test it - system.setEncryptionKey(className); - system.saveEx(); - } - } - SecureEngine.init(className); - - // - if (isClient) - MClient.get(Env.getCtx(),0); // Login Client loaded later - else - MClient.getAll(Env.getCtx()); - } - catch (Exception e) - { - log.warning("Environment problems: " + e.toString()); - } - - // Start Workflow Document Manager (in other package) for PO - String className = null; - try - { - className = "org.compiere.wf.DocWorkflowManager"; - Class.forName(className); - // Initialize Archive Engine - className = "org.compiere.print.ArchiveEngine"; - Class.forName(className); - } - catch (Exception e) - { - log.warning("Not started: " + className + " - " + e.getMessage()); - } - - if (!isClient) - DB.updateMail(); - return true; - } // startupEnvironment - - - /** - * Main Method - * - * @param args optional start class - */ - public static void main (String[] args) - { - Splash.getSplash(); - startup(true); // error exit and initUI - - // Start with class as argument - or if nothing provided with Client - String className = "org.compiere.apps.AMenu"; - for (int i = 0; i < args.length; i++) - { - if (!args[i].equals("-debug")) // ignore -debug - { - className = args[i]; - break; - } - } - // - try - { - Class startClass = Class.forName(className); - startClass.newInstance(); - } - catch (Exception e) - { - System.err.println("ADempiere starting: " + className + " - " + e.toString()); - e.printStackTrace(); - } - } // main -} // Adempiere diff --git a/org.adempiere.ui.swing/src/org/compiere/acct/AcctViewer.java b/org.adempiere.ui.swing/src/org/compiere/acct/AcctViewer.java deleted file mode 100644 index b2f326b873..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/acct/AcctViewer.java +++ /dev/null @@ -1,819 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.acct; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.FlowLayout; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.sql.Timestamp; -import java.util.Iterator; -import java.util.logging.Level; - -import javax.swing.BorderFactory; -import javax.swing.ImageIcon; -import javax.swing.border.TitledBorder; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.PrintScreenPainter; -import org.compiere.apps.search.Info; -import org.compiere.grid.ed.VDate; -import org.compiere.model.MAcctSchema; -import org.compiere.model.MAcctSchemaElement; -import org.compiere.model.MColumn; -import org.compiere.model.MPeriod; -import org.compiere.model.X_C_AcctSchema_Element; -import org.compiere.report.core.RModel; -import org.compiere.report.core.RModelExcelExporter; -import org.compiere.report.core.ResultTable; -import org.compiere.swing.CButton; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CFrame; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CScrollPane; -import org.compiere.swing.CTabbedPane; -import org.compiere.util.CLogMgt; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; -import org.compiere.util.ValueNamePair; - -/** - * Account Viewer - * - * @author Jorg Janke - * @version $Id: AcctViewer.java,v 1.3 2006/08/10 01:00:27 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - * BF [ 1778534 ] Info Account: can't find product - * @author Colin Rooney (croo) - * BF [ 2006668 ] Selection of Product in the Accounting Viewer - */ -public class AcctViewer extends CFrame - implements ActionListener, ChangeListener -{ - /** - * - */ - private static final long serialVersionUID = -6160970582569467185L; - - /** - * Default constructor - */ - public AcctViewer() - { - this (0, 0, 0); - } // AcctViewer - - /** - * Detail Constructor - * - * @param AD_Client_ID Client - * @param AD_Table_ID Table - * @param Record_ID Record - */ - public AcctViewer(int AD_Client_ID, int AD_Table_ID, int Record_ID) - { - super (Msg.getMsg(Env.getCtx(), "AcctViewer")); - if (log.isLoggable(Level.INFO)) log.info("AD_Table_ID=" + AD_Table_ID + ", Record_ID=" + Record_ID); - setDefaultCloseOperation(DISPOSE_ON_CLOSE); - m_data = new AcctViewerData (Env.getCtx(), AEnv.createWindowNo(this), - AD_Client_ID, AD_Table_ID); - AEnv.addToWindowManager(this); - // - try - { - jbInit(); - dynInit (AD_Table_ID, Record_ID); - AEnv.showCenterScreen(this); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - dispose(); - } - } // AcctViewer - - /** State Info */ - private AcctViewerData m_data = null; - /** Image Icon */ - private ImageIcon m_iFind = new ImageIcon(org.compiere.Adempiere.getResource("images/Find16.gif")); - - /** Logger */ - private static CLogger log = CLogger.getCLogger(AcctViewer.class); - - /** @todo Display Record Info & Zoom */ - - // - private CPanel mainPanel = new CPanel(); - private CTabbedPane tabbedPane = new CTabbedPane(); - private CPanel query = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CScrollPane result = new CScrollPane(); - private ResultTable table = new ResultTable(); - private CPanel southPanel = new CPanel(); - private CButton bQuery = new CButton(); - private CButton bPrint = new CButton(); - private CButton bExport = new CButton(); - private CLabel statusLine = new CLabel(); - private BorderLayout southLayout = new BorderLayout(); - private BorderLayout queryLayout = new BorderLayout(); - private CPanel selectionPanel = new CPanel(); - private CPanel displayPanel = new CPanel(); - private TitledBorder displayBorder; - private TitledBorder selectionBorder; - private GridBagLayout displayLayout = new GridBagLayout(); - private CCheckBox displayQty = new CCheckBox(); - private CCheckBox displaySourceAmt = new CCheckBox(); -// private CPanel graphPanel = new CPanel(); - private CCheckBox displayDocumentInfo = new CCheckBox(); - private CLabel lSort = new CLabel(); - private CComboBox sortBy1 = new CComboBox(); - private CComboBox sortBy2 = new CComboBox(); - private CComboBox sortBy3 = new CComboBox(); - private CCheckBox group1 = new CCheckBox(); - private CCheckBox group2 = new CCheckBox(); - private CCheckBox group3 = new CCheckBox(); - private CLabel lGroup = new CLabel(); - private GridBagLayout selectionLayout = new GridBagLayout(); - private CComboBox selAcctSchema = new CComboBox(); - private CComboBox selPostingType = new CComboBox(); - private CCheckBox selDocument = new CCheckBox(); - private CComboBox selTable = new CComboBox(); - private CButton selRecord = new CButton(); - private CLabel lOrg = new CLabel(); - private CComboBox selOrg = new CComboBox(); - private CLabel lAcct = new CLabel(); - private CButton selAcct = new CButton(); - private CLabel lDate = new CLabel(); - private CLabel lacctSchema = new CLabel(); - private CLabel lpostingType = new CLabel(); - private VDate selDateFrom = new VDate("DateFrom", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateFrom")); - private VDate selDateTo = new VDate("DateTo", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateTo")); - private CLabel lsel1 = new CLabel(); - private CLabel lsel2 = new CLabel(); - private CLabel lsel3 = new CLabel(); - private CLabel lsel4 = new CLabel(); - private CLabel lsel5 = new CLabel(); - private CLabel lsel6 = new CLabel(); - private CLabel lsel7 = new CLabel(); - private CLabel lsel8 = new CLabel(); - private CButton sel1 = new CButton(); - private CButton sel2 = new CButton(); - private CButton sel3 = new CButton(); - private CButton sel4 = new CButton(); - private CButton sel5 = new CButton(); - private CButton sel6 = new CButton(); - private CButton sel7 = new CButton(); - private CButton sel8 = new CButton(); - // - private CButton bRePost = new CButton(); - private CCheckBox forcePost = new CCheckBox(); - private CComboBox sortBy4 = new CComboBox(); - private CCheckBox group4 = new CCheckBox(); - - /** - * Static Init. - *
    -	 *  - mainPanel
    -	 *      - tabbedPane
    -	 *          - query
    -	 *          - result
    -	 *          - graphPanel
    -	 *  
    - * @throws Exception - */ - private void jbInit() throws Exception - { - ImageIcon ii = new ImageIcon(org.compiere.Adempiere.getResource("images/InfoAccount16.gif")); - setIconImage(ii.getImage()); - // - mainLayout.setHgap(5); - mainLayout.setVgap(5); - mainPanel.setLayout(mainLayout); - selectionPanel.setLayout(selectionLayout); - this.getContentPane().add(mainPanel, BorderLayout.CENTER); - mainPanel.add(tabbedPane, BorderLayout.CENTER); - // Selection - selectionBorder = new TitledBorder(BorderFactory.createEtchedBorder( - Color.white,new Color(148, 145, 140)), Msg.getMsg(Env.getCtx(),"Selection")); - selectionPanel.setBorder(selectionBorder); - lacctSchema.setLabelFor(selAcctSchema); - lacctSchema.setText(Msg.translate(Env.getCtx(), "C_AcctSchema_ID")); - lpostingType.setLabelFor(selPostingType); - lpostingType.setText(Msg.translate(Env.getCtx(), "PostingType")); - selDocument.setText(Msg.getMsg(Env.getCtx(), "SelectDocument")); - selDocument.addActionListener(this); - - lOrg.setLabelFor(selOrg); - lOrg.setText(Msg.translate(Env.getCtx(), "AD_Org_ID")); - lAcct.setLabelFor(selAcct); - lAcct.setText(Msg.translate(Env.getCtx(), "Account_ID")); - lDate.setLabelFor(selDateFrom); - lDate.setText(Msg.translate(Env.getCtx(), "DateAcct")); - lsel1.setLabelFor(sel1); - lsel2.setLabelFor(sel2); - lsel3.setLabelFor(sel3); - lsel4.setLabelFor(sel4); - lsel5.setLabelFor(sel5); - lsel6.setLabelFor(sel6); - lsel7.setLabelFor(sel7); - lsel8.setLabelFor(sel8); - - // Display - displayBorder = new TitledBorder(BorderFactory.createEtchedBorder( - Color.white,new Color(148, 145, 140)), Msg.getMsg(Env.getCtx(),"Display")); - displayPanel.setBorder(displayBorder); - displayPanel.setLayout(displayLayout); - displayQty.setText(Msg.getMsg(Env.getCtx(), "DisplayQty")); - displaySourceAmt.setText(Msg.getMsg(Env.getCtx(), "DisplaySourceInfo")); - displayDocumentInfo.setText(Msg.getMsg(Env.getCtx(), "DisplayDocumentInfo")); - lSort.setText(Msg.getMsg(Env.getCtx(), "SortBy")); - lGroup.setText(Msg.getMsg(Env.getCtx(), "GroupBy")); - // - displayPanel.add(displaySourceAmt, new GridBagConstraints(0, 1, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - displayPanel.add(displayDocumentInfo, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - displayPanel.add(lSort, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - displayPanel.add(sortBy1, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); - displayPanel.add(sortBy2, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); - displayPanel.add(group1, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - displayPanel.add(group2, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - displayPanel.add(lGroup, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - displayPanel.add(displayQty, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - displayPanel.add(sortBy3, new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); - displayPanel.add(group3, new GridBagConstraints(1, 7, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - displayPanel.add(sortBy4, new GridBagConstraints(0, 8, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - displayPanel.add(group4, new GridBagConstraints(1, 8, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - // - selectionPanel.add(lacctSchema, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - selectionPanel.add(selAcctSchema, new GridBagConstraints(1, 0, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - - selectionPanel.add(selDocument, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(10, 5, 10, 5), 0, 0)); - selectionPanel.add(selTable, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(10, 5, 10, 5), 0, 0)); - selectionPanel.add(selRecord, new GridBagConstraints(2, 1, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(10, 5, 10, 5), 0, 0)); - - selectionPanel.add(lpostingType, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(selPostingType, new GridBagConstraints(1, 2, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(lDate, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(selDateFrom, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(selDateTo, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(lOrg, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 0, 0, 5), 0, 0)); - selectionPanel.add(selOrg, new GridBagConstraints(1, 4, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(lAcct, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(selAcct, new GridBagConstraints(1, 5, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(lsel1, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(lsel2, new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(lsel3, new GridBagConstraints(0, 8, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(sel1, new GridBagConstraints(1, 6, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(sel2, new GridBagConstraints(1, 7, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(sel3, new GridBagConstraints(1, 8, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(lsel4, new GridBagConstraints(0, 9, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(sel4, new GridBagConstraints(1, 9, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - - selectionPanel.add(lsel5, new GridBagConstraints(0, 10, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(sel5, new GridBagConstraints(1, 10, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(lsel6, new GridBagConstraints(0, 11, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(sel6, new GridBagConstraints(1, 11, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(lsel7, new GridBagConstraints(0, 12, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(sel7, new GridBagConstraints(1, 12, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(lsel8, new GridBagConstraints(0, 13, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - selectionPanel.add(sel8, new GridBagConstraints(1, 13, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - // - queryLayout.setHgap(5); - queryLayout.setVgap(5); - query.setLayout(queryLayout); - query.add(selectionPanel, BorderLayout.CENTER); - query.add(displayPanel, BorderLayout.EAST); - // - tabbedPane.add(query, Msg.getMsg(Env.getCtx(), "ViewerQuery")); - tabbedPane.add(result, Msg.getMsg(Env.getCtx(), "ViewerResult")); -// tabbedPane.add(graphPanel, Msg.getMsg(Env.getCtx(), "ViewerGraph")); - tabbedPane.addChangeListener(this); - result.getViewport().add(table, null); - // South - southLayout.setHgap(5); - southLayout.setVgap(5); - southPanel.setLayout(southLayout); - statusLine.setForeground(Color.blue); - statusLine.setBorder(BorderFactory.createLoweredBevelBorder()); - southPanel.add(statusLine, BorderLayout.CENTER); - bRePost.setText(Msg.getMsg(Env.getCtx(), "RePost")); - bRePost.setToolTipText(Msg.getMsg(Env.getCtx(), "RePostInfo")); - bRePost.addActionListener(this); - bRePost.setVisible(false); - forcePost.setText(Msg.getMsg(Env.getCtx(), "Force")); - forcePost.setToolTipText(Msg.getMsg(Env.getCtx(), "ForceInfo")); - forcePost.setVisible(false); - CPanel leftSide = new CPanel(new FlowLayout(FlowLayout.LEADING, 0, 0)); - leftSide.add(bRePost); - leftSide.add(forcePost); - southPanel.add(leftSide, BorderLayout.WEST); - // - bQuery.setIcon(Env.getImageIcon("Refresh16.gif")); - bQuery.setToolTipText(Msg.getMsg(Env.getCtx(), "Refresh")); - bQuery.addActionListener(this); - bPrint.setIcon(Env.getImageIcon("Print16.gif")); - bPrint.setToolTipText(Msg.getMsg(Env.getCtx(), "Print")); - bPrint.addActionListener(this); - bExport.setIcon(Env.getImageIcon("Export16.gif")); - bExport.setToolTipText(Msg.getMsg(Env.getCtx(), "Export")); - bExport.setVisible(tabbedPane.getSelectedIndex() == 1); - bExport.addActionListener(this); - CPanel rightSide = new CPanel(new FlowLayout(FlowLayout.TRAILING, 0, 0)); - rightSide.add(bExport); - rightSide.add(bPrint); - rightSide.add(bQuery); - southPanel.add(rightSide, BorderLayout.EAST); - this.getContentPane().add(southPanel, BorderLayout.SOUTH); - // - } // jbInit - - /** - * Dynamic Init - * - * @param AD_Table_ID table - * @param Record_ID record - */ - private void dynInit (int AD_Table_ID, int Record_ID) - { - m_data.fillAcctSchema(selAcctSchema); - selAcctSchema.addActionListener(this); - actionAcctSchema(); - // - m_data.fillTable(selTable); - selTable.addActionListener(this); - selRecord.setIcon(m_iFind); - selRecord.addActionListener(this); - selRecord.setText(""); - // - m_data.fillPostingType (selPostingType); - - // Mandatory Elements - m_data.fillOrg(selOrg); - selAcct.setActionCommand("Account_ID"); - selAcct.addActionListener(this); - selAcct.setText(""); - selAcct.setIcon(m_iFind); - - // Document Select - boolean haveDoc = AD_Table_ID != 0 && Record_ID != 0; - selDocument.setSelected (haveDoc); - actionDocument(); - actionTable(); - statusLine.setText(" " + Msg.getMsg(Env.getCtx(), "ViewerOptions")); - - // Initial Query - if (haveDoc) - { - m_data.AD_Table_ID = AD_Table_ID; - m_data.Record_ID = Record_ID; - actionQuery(); - } - } // dynInit - - /** - * Dispose - */ - public void dispose() - { - if (m_data != null) - m_data.dispose(); - m_data = null; - super.dispose(); - } // dispose; - - /************************************************************************** - * Tab Changed - * @param e ChangeEvent - */ - public void stateChanged(ChangeEvent e) - { - // if (log.isLoggable(Level.INFO)) log.info( "AcctViewer.stateChanged"); - boolean visible = m_data.documentQuery && tabbedPane.getSelectedIndex() == 1; - bRePost.setVisible(visible); - bExport.setVisible(tabbedPane.getSelectedIndex() == 1); - forcePost.setVisible(visible); - } // stateChanged - - - /** - * Action Performed (Action Listener) - * @param e ActionEvent - */ - public void actionPerformed(ActionEvent e) - { - // log.info(e.getActionCommand()); - Object source = e.getSource(); - if (source == selAcctSchema) - actionAcctSchema(); - else if (source == bQuery) - actionQuery(); - else if (source == selDocument) - actionDocument(); - else if (source == selTable) - actionTable(); - else if (source == bRePost) - actionRePost(); - else if (source == bPrint) - PrintScreenPainter.printScreen(this); - else if (source == bExport) - exportExcel(); - // InfoButtons - else if (source instanceof CButton) - actionButton((CButton)source); - } // actionPerformed - - /** - * New Acct Schema - */ - private void actionAcctSchema() - { - KeyNamePair kp = (KeyNamePair)selAcctSchema.getSelectedItem(); - if (kp == null) - return; - m_data.C_AcctSchema_ID = kp.getKey(); - m_data.ASchema = MAcctSchema.get(Env.getCtx(), m_data.C_AcctSchema_ID); - if (log.isLoggable(Level.INFO)) log.info(m_data.ASchema.toString()); - // - // Sort Options - sortBy1.removeAllItems(); - sortBy2.removeAllItems(); - sortBy3.removeAllItems(); - sortBy4.removeAllItems(); - sortAddItem(new ValueNamePair("","")); - sortAddItem(new ValueNamePair("DateAcct", Msg.translate(Env.getCtx(), "DateAcct"))); - sortAddItem(new ValueNamePair("DateTrx", Msg.translate(Env.getCtx(), "DateTrx"))); - sortAddItem(new ValueNamePair("C_Period_ID", Msg.translate(Env.getCtx(), "C_Period_ID"))); - // - CLabel[] labels = new CLabel[] {lsel1, lsel2, lsel3, lsel4, lsel5, lsel6, lsel7, lsel8}; - CButton[] buttons = new CButton[] {sel1, sel2, sel3, sel4, sel5, sel6, sel7, sel8}; - int selectionIndex = 0; - MAcctSchemaElement[] elements = m_data.ASchema.getAcctSchemaElements(); - for (int i = 0; i < elements.length && selectionIndex < labels.length; i++) - { - MAcctSchemaElement ase = elements[i]; - String columnName = ase.getColumnName(); - String displayColumnName = ase.getDisplayColumnName(); - // Add Sort Option - sortAddItem(new ValueNamePair(columnName, Msg.translate(Env.getCtx(), displayColumnName))); - // Additional Elements - if (!ase.isElementType(X_C_AcctSchema_Element.ELEMENTTYPE_Organization) - && !ase.isElementType(X_C_AcctSchema_Element.ELEMENTTYPE_Account)) - { - labels[selectionIndex].setText(Msg.translate(Env.getCtx(), displayColumnName)); - labels[selectionIndex].setVisible(true); - buttons[selectionIndex].setActionCommand(columnName); - buttons[selectionIndex].addActionListener(this); - buttons[selectionIndex].setIcon(m_iFind); - buttons[selectionIndex].setText(""); - buttons[selectionIndex].setVisible(true); - selectionIndex++; - } - } - // don't show remaining - while (selectionIndex < labels.length) - { - labels[selectionIndex].setVisible(false); - buttons[selectionIndex++].setVisible(false); - } - } // actionAcctSchema - - /** - * Add to Sort - * @param vn name pair - */ - private void sortAddItem(ValueNamePair vn) - { - sortBy1.addItem(vn); - sortBy2.addItem(vn); - sortBy3.addItem(vn); - sortBy4.addItem(vn); - } // sortAddItem - - /** - * Query - */ - private void actionQuery() - { - // Parameter Info - StringBuilder para = new StringBuilder(); - // Reset Selection Data - m_data.C_AcctSchema_ID = 0; - m_data.AD_Org_ID = 0; - - // Save Selection Choices - KeyNamePair kp = (KeyNamePair)selAcctSchema.getSelectedItem(); - if (kp != null) - m_data.C_AcctSchema_ID = kp.getKey(); - para.append("C_AcctSchema_ID=").append(m_data.C_AcctSchema_ID); - // - ValueNamePair vp = (ValueNamePair)selPostingType.getSelectedItem(); - m_data.PostingType = vp.getValue(); - para.append(", PostingType=").append(m_data.PostingType); - - // Document - m_data.documentQuery = selDocument.isSelected(); - para.append(", DocumentQuery=").append(m_data.documentQuery); - if (selDocument.isSelected()) - { - if (m_data.AD_Table_ID == 0 || m_data.Record_ID == 0) - return; - para.append(", AD_Table_ID=").append(m_data.AD_Table_ID) - .append(", Record_ID=").append(m_data.Record_ID); - } - else - { - m_data.DateFrom = (Timestamp)selDateFrom.getValue(); - para.append(", DateFrom=").append(m_data.DateFrom); - m_data.DateTo = (Timestamp)selDateTo.getValue(); - para.append(", DateTo=").append(m_data.DateTo); - kp = (KeyNamePair)selOrg.getSelectedItem(); - if (kp != null) - m_data.AD_Org_ID = kp.getKey(); - para.append(", AD_Org_ID=").append(m_data.AD_Org_ID); - // - Iterator it = m_data.whereInfo.values().iterator(); - while (it.hasNext()) - para.append(", ").append(it.next()); - } - - // Save Display Choices - m_data.displayQty = displayQty.isSelected(); - para.append(" - Display Qty=").append(m_data.displayQty); - m_data.displaySourceAmt = displaySourceAmt.isSelected(); - para.append(", Source=").append(m_data.displaySourceAmt); - m_data.displayDocumentInfo = displayDocumentInfo.isSelected(); - para.append(", Doc=").append(m_data.displayDocumentInfo); - // - m_data.sortBy1 = ((ValueNamePair)sortBy1.getSelectedItem()).getValue(); - m_data.group1 = group1.isSelected(); - para.append(" - Sorting: ").append(m_data.sortBy1).append("/").append(m_data.group1); - m_data.sortBy2 = ((ValueNamePair)sortBy2.getSelectedItem()).getValue(); - m_data.group2 = group2.isSelected(); - para.append(", ").append(m_data.sortBy2).append("/").append(m_data.group2); - m_data.sortBy3 = ((ValueNamePair)sortBy3.getSelectedItem()).getValue(); - m_data.group3 = group3.isSelected(); - para.append(", ").append(m_data.sortBy3).append("/").append(m_data.group3); - m_data.sortBy4 = ((ValueNamePair)sortBy4.getSelectedItem()).getValue(); - m_data.group4 = group4.isSelected(); - para.append(", ").append(m_data.sortBy4).append("/").append(m_data.group4); - - bQuery.setEnabled(false); - statusLine.setText(" " + Msg.getMsg(Env.getCtx(), "Processing")); - - if (log.isLoggable(Level.CONFIG)) log.config(para.toString()); - Thread.yield(); - - // Switch to Result pane - tabbedPane.setSelectedIndex(1); - - // Set TableModel with Query - table.setModel(m_data.query()); - - bQuery.setEnabled(true); - statusLine.setText(" " + Msg.getMsg(Env.getCtx(), "ViewerOptions")); - } // actionQuery - - /** - * Document selection - */ - private void actionDocument() - { - boolean doc = selDocument.isSelected(); - selTable.setEnabled(doc); - selRecord.setEnabled(doc); - // - selDateFrom.setReadWrite(!doc); - selDateTo.setReadWrite(!doc); - selOrg.setEnabled(!doc); - selAcct.setEnabled(!doc); - sel1.setEnabled(!doc); - sel2.setEnabled(!doc); - sel3.setEnabled(!doc); - sel4.setEnabled(!doc); - sel5.setEnabled(!doc); - sel6.setEnabled(!doc); - sel7.setEnabled(!doc); - sel8.setEnabled(!doc); - } // actionDocument - - /** - * Save Table selection (reset Record selection) - */ - private void actionTable() - { - ValueNamePair vp = (ValueNamePair)selTable.getSelectedItem(); - m_data.AD_Table_ID = ((Integer)m_data.tableInfo.get(vp.getValue())).intValue(); - if (log.isLoggable(Level.CONFIG)) log.config(vp.getValue() + " = " + m_data.AD_Table_ID); - // Reset Record - m_data.Record_ID = 0; - selRecord.setText(""); - selRecord.setActionCommand(vp.getValue() + "_ID"); - } // actionTable - - /** - * Action Button - * - * @param button pressed button - * @return ID - */ - private int actionButton(CButton button) - { - String keyColumn = button.getActionCommand(); - log.info(keyColumn); - String whereClause = "(IsSummary='N' OR IsSummary IS NULL)"; - String lookupColumn = keyColumn; - if (keyColumn.equals("Account_ID")) - { - lookupColumn = "C_ElementValue_ID"; - MAcctSchemaElement ase = m_data.ASchema - .getAcctSchemaElement(X_C_AcctSchema_Element.ELEMENTTYPE_Account); - if (ase != null) - whereClause += " AND C_Element_ID=" + ase.getC_Element_ID(); - } - else if (keyColumn.equals("User1_ID")) - { - lookupColumn = "C_ElementValue_ID"; - MAcctSchemaElement ase = m_data.ASchema - .getAcctSchemaElement(X_C_AcctSchema_Element.ELEMENTTYPE_UserElementList1); - if (ase != null) - whereClause += " AND C_Element_ID=" + ase.getC_Element_ID(); - } - else if (keyColumn.equals("User2_ID")) - { - lookupColumn = "C_ElementValue_ID"; - MAcctSchemaElement ase = m_data.ASchema - .getAcctSchemaElement(X_C_AcctSchema_Element.ELEMENTTYPE_UserElementList2); - if (ase != null) - whereClause += " AND C_Element_ID=" + ase.getC_Element_ID(); - } - else if (keyColumn.equals("AD_OrgTrx_ID")) - { - lookupColumn = "AD_Org_ID"; - } - else if (keyColumn.equals("UserElement1_ID")) // KTU - { - MAcctSchemaElement ase = m_data.ASchema.getAcctSchemaElement(X_C_AcctSchema_Element.ELEMENTTYPE_UserColumn1); - lookupColumn = MColumn.getColumnName(Env.getCtx(), ase.getAD_Column_ID()); - whereClause = ""; - } - else if (keyColumn.equals("UserElement2_ID")) // KTU - { - MAcctSchemaElement ase = m_data.ASchema.getAcctSchemaElement(X_C_AcctSchema_Element.ELEMENTTYPE_UserColumn2); - lookupColumn = MColumn.getColumnName(Env.getCtx(), ase.getAD_Column_ID()); - whereClause = ""; - } - else if (keyColumn.equals("M_Product_ID")) - { - whereClause = ""; - } - else if (selDocument.isSelected()) - whereClause = ""; - String tableName = lookupColumn.substring(0, lookupColumn.length()-3); - Info info = Info.create(this, true, m_data.WindowNo, tableName, lookupColumn, "", false, whereClause); - if (!info.loadedOK()) - { - info.dispose(); - info = null; - button.setText(""); - m_data.whereInfo.put(keyColumn, ""); - return 0; - } - info.setVisible(true); - String selectSQL = info.getSelectedSQL(); // C_Project_ID=100 or "" - Integer key = (Integer)info.getSelectedKey(); - info = null; - if (selectSQL == null || selectSQL.length() == 0 || key == null) - { - button.setText(""); - m_data.whereInfo.put(keyColumn, ""); // no query - return 0; - } - - // Save for query - if (log.isLoggable(Level.CONFIG)) log.config(keyColumn + " - " + key); - if (button == selRecord) // Record_ID - m_data.Record_ID = key.intValue(); - else - m_data.whereInfo.put(keyColumn, keyColumn + "=" + key.intValue()); - - // Display Selection and resize - button.setText(m_data.getButtonText(tableName, lookupColumn, selectSQL)); - pack(); - return key.intValue(); - } // actionButton - - /** - * RePost Record - */ - private void actionRePost() - { - if (m_data.documentQuery - && m_data.AD_Table_ID != 0 && m_data.Record_ID != 0) - { - // IDEMPIERE-2392 - if (! MPeriod.isOpen(Env.getCtx(), m_data.AD_Table_ID, m_data.Record_ID, null)) { - ADialog.error(0, this, "Error", Msg.getMsg(Env.getCtx(), "PeriodClosed")); - return; - } - - if (ADialog.ask(m_data.WindowNo, this, "PostImmediate?")) { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - boolean force = forcePost.isSelected(); - String error = AEnv.postImmediate (m_data.WindowNo, m_data.AD_Client_ID, - m_data.AD_Table_ID, m_data.Record_ID, force); - setCursor(Cursor.getDefaultCursor()); - if (error != null) - ADialog.error(0, this, "PostingError-N", error); - actionQuery(); - } - } - } // actionRePost - - /** - * Export to Excel - */ - private void exportExcel() { - RModel model = table.getRModel(); - if (model == null) { - return; - } - try { - RModelExcelExporter exporter = new RModelExcelExporter((RModel)model); - exporter.export(null, null); - } - catch (Exception e) { - ADialog.error(0, this, "Error", e.getLocalizedMessage()); - if (CLogMgt.isLevelFinest()) e.printStackTrace(); - } - } -} // AcctViewer diff --git a/org.adempiere.ui.swing/src/org/compiere/acct/AcctViewerData.java b/org.adempiere.ui.swing/src/org/compiere/acct/AcctViewerData.java deleted file mode 100644 index 0d7826e0aa..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/acct/AcctViewerData.java +++ /dev/null @@ -1,550 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.acct; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Properties; -import java.util.logging.Level; - -import javax.swing.JComboBox; - -import static org.compiere.model.SystemIDs.*; -import org.compiere.model.MAcctSchema; -import org.compiere.model.MAcctSchemaElement; -import org.compiere.model.MFactAcct; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MRefList; -import org.compiere.report.core.RColumn; -import org.compiere.report.core.RModel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Language; -import org.compiere.util.Msg; -import org.compiere.util.ValueNamePair; - - -/** - * Account Viewer State - maintains State information for the Account Viewer - * - * @author Jorg Janke - * @version $Id: AcctViewerData.java,v 1.3 2006/08/10 01:00:27 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *
  • BF [ 1748449 ] Info Account - Posting Type is not translated - *
  • BF [ 1778373 ] AcctViewer: data is not sorted proper - */ -class AcctViewerData -{ - /** - * Constructor - * @param ctx context - * @param windowNo window no - * @param ad_Client_ID client - * @param ad_Table_ID table - */ - public AcctViewerData (Properties ctx, int windowNo, int ad_Client_ID, int ad_Table_ID) - { - WindowNo = windowNo; - AD_Client_ID = ad_Client_ID; - if (AD_Client_ID == 0) - AD_Client_ID = Env.getContextAsInt(Env.getCtx(), WindowNo, "AD_Client_ID"); - if (AD_Client_ID == 0) - AD_Client_ID = Env.getContextAsInt(Env.getCtx(), "AD_Client_ID"); - AD_Table_ID = ad_Table_ID; - // - ASchemas = MAcctSchema.getClientAcctSchema(ctx, AD_Client_ID); - ASchema = ASchemas[0]; - } // AcctViewerData - - /** Window */ - public int WindowNo; - /** Client */ - public int AD_Client_ID; - /** All Acct Schema */ - public MAcctSchema[] ASchemas = null; - /** This Acct Schema */ - public MAcctSchema ASchema = null; - - // Selection Info - /** Document Query */ - public boolean documentQuery = false; - /** Acct Schema */ - public int C_AcctSchema_ID = 0; - /** Posting Type */ - public String PostingType = ""; - /** Organization */ - public int AD_Org_ID = 0; - /** Date From */ - public Timestamp DateFrom = null; - /** Date To */ - public Timestamp DateTo = null; - - // Document Table Selection Info - /** Table ID */ - public int AD_Table_ID; - /** Record */ - public int Record_ID; - - /** Containing Column and Query */ - public HashMap whereInfo = new HashMap(); - /** Containing TableName and AD_Table_ID */ - public HashMap tableInfo = new HashMap(); - - // Display Info - /** Display Qty */ - boolean displayQty = false; - /** Display Source Currency */ - boolean displaySourceAmt = false; - /** Display Document info */ - boolean displayDocumentInfo = false; - // - String sortBy1 = ""; - String sortBy2 = ""; - String sortBy3 = ""; - String sortBy4 = ""; - // - boolean group1 = false; - boolean group2 = false; - boolean group3 = false; - boolean group4 = false; - - /** Leasing Columns */ - private int m_leadingColumns = 0; - /** UserElement1 Reference */ - private String m_ref1 = null; - /** UserElement2 Reference */ - private String m_ref2 = null; - /** Logger */ - private static CLogger log = CLogger.getCLogger(AcctViewerData.class); - - /** - * Dispose - */ - public void dispose() - { - ASchemas = null; - ASchema = null; - // - whereInfo.clear(); - whereInfo = null; - // - Env.clearWinContext(WindowNo); - } // dispose - - - /************************************************************************** - * Fill Accounting Schema - * @param cb JComboBox to be filled - */ - protected void fillAcctSchema (JComboBox cb) - { - for (int i = 0; i < ASchemas.length; i++) - cb.addItem(new KeyNamePair(ASchemas[i].getC_AcctSchema_ID(), - ASchemas[i].getName())); - } // fillAcctSchema - - /** - * Fill Posting Type - * @param cb JComboBox to be filled - */ - protected void fillPostingType (JComboBox cb) - { - int AD_Reference_ID = REFERENCE_POSTING_TYPE; - ValueNamePair[] pt = MRefList.getList(Env.getCtx(), AD_Reference_ID, true); - for (int i = 0; i < pt.length; i++) - cb.addItem(pt[i]); - } // fillPostingType - - /** - * Fill Table with - * ValueNamePair (TableName, translatedKeyColumnName) - * and tableInfo with (TableName, AD_Table_ID) - * and select the entry for AD_Table_ID - * - * @param cb JComboBox to be filled - */ - protected void fillTable (JComboBox cb) - { - ValueNamePair select = null; - // - String sql = "SELECT AD_Table_ID, TableName FROM AD_Table t " - + "WHERE EXISTS (SELECT * FROM AD_Column c" - + " WHERE t.AD_Table_ID=c.AD_Table_ID AND c.ColumnName='Posted')" - + " AND IsView='N'"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - rs = pstmt.executeQuery(); - while (rs.next()) - { - int id = rs.getInt(1); - String tableName = rs.getString(2); - String name = Msg.translate(Env.getCtx(), tableName+"_ID"); - // - ValueNamePair pp = new ValueNamePair(tableName, name); - cb.addItem(pp); - tableInfo.put (tableName, Integer.valueOf(id)); - if (id == AD_Table_ID) - select = pp; - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - if (select != null) - cb.setSelectedItem(select); - } // fillTable - - /** - * Fill Org - * - * @param cb JComboBox to be filled - */ - protected void fillOrg (JComboBox cb) - { - KeyNamePair pp = new KeyNamePair(0, ""); - cb.addItem(pp); - String sql = "SELECT AD_Org_ID, Name FROM AD_Org WHERE AD_Client_ID=? ORDER BY Value"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, AD_Client_ID); - rs = pstmt.executeQuery(); - while (rs.next()) - cb.addItem(new KeyNamePair(rs.getInt(1), rs.getString(2))); - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs,pstmt); - rs = null; - pstmt = null; - } - } // fillOrg - - /** - * Get Button Text - * - * @param tableName table - * @param columnName column - * @param selectSQL sql - * @return Text on button - */ - protected String getButtonText (String tableName, String columnName, String selectSQL) - { - // SELECT () FROM tableName avd WHERE avd. - StringBuilder sql = new StringBuilder ("SELECT ("); - Language language = Env.getLanguage(Env.getCtx()); - sql.append(MLookupFactory.getLookup_TableDirEmbed(language, columnName, "avd")) - .append(") FROM ").append(tableName).append(" avd WHERE avd.").append(selectSQL); - String retValue = "<" + selectSQL + ">"; - Statement stmt = null; - ResultSet rs = null; - try - { - stmt = DB.createStatement(); - rs = stmt.executeQuery(sql.toString()); - if (rs.next()) - retValue = rs.getString(1); - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql.toString(), e); - } - finally - { - DB.close(rs, stmt); - rs = null; - stmt = null; - } - return retValue; - } // getButtonText - - /************************************************************************** - - /** - * Create Query and submit - * @return Report Model - */ - protected RModel query() - { - // Set Where Clause - StringBuilder whereClause = new StringBuilder(); - // Add Organization - if (C_AcctSchema_ID != 0) - whereClause.append(RModel.TABLE_ALIAS) - .append(".C_AcctSchema_ID=").append(C_AcctSchema_ID); - - // Posting Type Selected - if (PostingType != null && PostingType.length() > 0) - { - if (whereClause.length() > 0) - whereClause.append(" AND "); - whereClause.append(RModel.TABLE_ALIAS) - .append(".PostingType='").append(PostingType).append("'"); - } - - // - if (documentQuery) - { - if (whereClause.length() > 0) - whereClause.append(" AND "); - whereClause.append(RModel.TABLE_ALIAS).append(".AD_Table_ID=").append(AD_Table_ID) - .append(" AND ").append(RModel.TABLE_ALIAS).append(".Record_ID=").append(Record_ID); - } - else - { - // get values (Queries) - Iterator it = whereInfo.values().iterator(); - while (it.hasNext()) - { - String where = (String)it.next(); - if (where != null && where.length() > 0) // add only if not empty - { - if (whereClause.length() > 0) - whereClause.append(" AND "); - whereClause.append(RModel.TABLE_ALIAS).append(".").append(where); - } - } - if (DateFrom != null || DateTo != null) - { - if (whereClause.length() > 0) - whereClause.append(" AND "); - if (DateFrom != null && DateTo != null) - whereClause.append("TRUNC(").append(RModel.TABLE_ALIAS).append(".DateAcct) BETWEEN ") - .append(DB.TO_DATE(DateFrom)).append(" AND ").append(DB.TO_DATE(DateTo)); - else if (DateFrom != null) - whereClause.append("TRUNC(").append(RModel.TABLE_ALIAS).append(".DateAcct) >= ") - .append(DB.TO_DATE(DateFrom)); - else // DateTo != null - whereClause.append("TRUNC(").append(RModel.TABLE_ALIAS).append(".DateAcct) <= ") - .append(DB.TO_DATE(DateTo)); - } - // Add Organization - if (AD_Org_ID != 0) - { - if (whereClause.length() > 0) - whereClause.append(" AND "); - whereClause.append(RModel.TABLE_ALIAS).append(".AD_Org_ID=").append(AD_Org_ID); - } - } - - RModel rm = getRModel(); - - // Set Order By Clause - StringBuilder orderClause = new StringBuilder(); - if (sortBy1.length() > 0) - { - RColumn col = rm.getRColumn(sortBy1); - if (col != null) - orderClause.append(col.getDisplaySQL()); - else - orderClause.append(RModel.TABLE_ALIAS).append(".").append(sortBy1); - } - if (sortBy2.length() > 0) - { - if (orderClause.length() > 0) - orderClause.append(","); - RColumn col = rm.getRColumn(sortBy2); - if (col != null) - orderClause.append(col.getDisplaySQL()); - else - orderClause.append(RModel.TABLE_ALIAS).append(".").append(sortBy2); - } - if (sortBy3.length() > 0) - { - if (orderClause.length() > 0) - orderClause.append(","); - RColumn col = rm.getRColumn(sortBy3); - if (col != null) - orderClause.append(col.getDisplaySQL()); - else - orderClause.append(RModel.TABLE_ALIAS).append(".").append(sortBy3); - } - if (sortBy4.length() > 0) - { - if (orderClause.length() > 0) - orderClause.append(","); - RColumn col = rm.getRColumn(sortBy4); - if (col != null) - orderClause.append(col.getDisplaySQL()); - else - orderClause.append(RModel.TABLE_ALIAS).append(".").append(sortBy4); - } - if (orderClause.length() == 0) - orderClause.append(RModel.TABLE_ALIAS).append(".Fact_Acct_ID"); - - // Groups - if (group1 && sortBy1.length() > 0) - rm.setGroup(sortBy1); - if (group2 && sortBy2.length() > 0) - rm.setGroup(sortBy2); - if (group3 && sortBy3.length() > 0) - rm.setGroup(sortBy3); - if (group4 && sortBy4.length() > 0) - rm.setGroup(sortBy4); - - // Totals - rm.setFunction("AmtAcctDr", RModel.FUNCTION_SUM); - rm.setFunction("AmtAcctCr", RModel.FUNCTION_SUM); - - rm.query (Env.getCtx(), whereClause.toString(), orderClause.toString()); - - return rm; - } // query - - /** - * Create Report Model (Columns) - * @return Report Model - */ - private RModel getRModel() - { - Properties ctx = Env.getCtx(); - RModel rm = new RModel("Fact_Acct"); - // Add Key (Lookups) - ArrayList keys = createKeyColumns(); - int max = m_leadingColumns; - if (max == 0) - max = keys.size(); - for (int i = 0; i < max; i++) - { - String column = (String)keys.get(i); - if (column != null && column.startsWith("Date")) - rm.addColumn(new RColumn(ctx, column, DisplayType.Date)); - else if (column != null && column.endsWith("_ID")) - rm.addColumn(new RColumn(ctx, column, DisplayType.TableDir)); - } - // Main Info - rm.addColumn(new RColumn(ctx, "AmtAcctDr", DisplayType.Amount)); - rm.addColumn(new RColumn(ctx, "AmtAcctCr", DisplayType.Amount)); - if (displaySourceAmt) - { - if (!keys.contains("DateTrx")) - rm.addColumn(new RColumn(ctx, "DateTrx", DisplayType.Date)); - rm.addColumn(new RColumn(ctx, "C_Currency_ID", DisplayType.TableDir)); - rm.addColumn(new RColumn(ctx, "AmtSourceDr", DisplayType.Amount)); - rm.addColumn(new RColumn(ctx, "AmtSourceCr", DisplayType.Amount)); - rm.addColumn(new RColumn(ctx, "Rate", DisplayType.Amount, - "CASE WHEN (AmtSourceDr + AmtSourceCr) = 0 THEN 0" - + " ELSE (AmtAcctDr + AmtAcctCr) / (AmtSourceDr + AmtSourceCr) END")); - } - // Remaining Keys - for (int i = max; i < keys.size(); i++) - { - String column = (String)keys.get(i); - if (column != null && column.startsWith("Date")) - rm.addColumn(new RColumn(ctx, column, DisplayType.Date)); - else if (column.startsWith("UserElement")) - { - if (column.indexOf('1') != -1) - rm.addColumn(new RColumn(ctx, column, DisplayType.TableDir, null, 0, m_ref1)); - else - rm.addColumn(new RColumn(ctx, column, DisplayType.TableDir, null, 0, m_ref2)); - } - else if (column != null && column.endsWith("_ID")) - rm.addColumn(new RColumn(ctx, column, DisplayType.TableDir)); - } - // Info - if (!keys.contains("DateAcct")) - rm.addColumn(new RColumn(ctx, "DateAcct", DisplayType.Date)); - if (!keys.contains("C_Period_ID")) - rm.addColumn(new RColumn(ctx, "C_Period_ID", DisplayType.TableDir)); - if (displayQty) - { - rm.addColumn(new RColumn(ctx, "C_UOM_ID", DisplayType.TableDir)); - rm.addColumn(new RColumn(ctx, "Qty", DisplayType.Quantity)); - } - if (displayDocumentInfo) - { - rm.addColumn(new RColumn(ctx, "AD_Table_ID", DisplayType.TableDir)); - rm.addColumn(new RColumn(ctx, "Record_ID", DisplayType.ID)); - rm.addColumn(new RColumn(ctx, "Description", DisplayType.String)); - } - if (PostingType == null || PostingType.length() == 0) - rm.addColumn(new RColumn(ctx, "PostingType", DisplayType.List, // teo_sarca, [ 1664208 ] - RModel.TABLE_ALIAS+".PostingType", - MFactAcct.POSTINGTYPE_AD_Reference_ID, - null)); - return rm; - } // createRModel - - /** - * Create the key columns in sequence - * @return List of Key Columns - */ - private ArrayList createKeyColumns() - { - ArrayList columns = new ArrayList(); - m_leadingColumns = 0; - // Sorting Fields - columns.add(sortBy1); // may add "" - if (!columns.contains(sortBy2)) - columns.add(sortBy2); - if (!columns.contains(sortBy3)) - columns.add(sortBy3); - if (!columns.contains(sortBy4)) - columns.add(sortBy4); - - // Add Account Segments - MAcctSchemaElement[] elements = ASchema.getAcctSchemaElements(); - for (int i = 0; i < elements.length; i++) - { - if (m_leadingColumns == 0 && columns.contains("AD_Org_ID") && columns.contains("Account_ID")) - m_leadingColumns = columns.size(); - // - MAcctSchemaElement ase = elements[i]; - String columnName = ase.getColumnName(); - if (columnName.startsWith("UserElement")) - { - if (columnName.indexOf('1') != -1) - m_ref1 = ase.getDisplayColumnName(); - else - m_ref2 = ase.getDisplayColumnName(); - } - if (!columns.contains(columnName)) - columns.add(columnName); - } - if (m_leadingColumns == 0 && columns.contains("AD_Org_ID") && columns.contains("Account_ID")) - m_leadingColumns = columns.size(); - return columns; - } // createKeyColumns - -} // AcctViewerData diff --git a/org.adempiere.ui.swing/src/org/compiere/acct/package.html b/org.adempiere.ui.swing/src/org/compiere/acct/package.html deleted file mode 100644 index 9f32648211..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/acct/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - -

    Package org.compiere.acct

    - -Provide viewer for the viewing of account posting records. - -

    Related Documentation

    - -For overviews, tutorials, examples, guides, and tool documentation, please see: - - - - - - diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AArchive.java b/org.adempiere.ui.swing/src/org/compiere/apps/AArchive.java deleted file mode 100644 index eeaa5b368f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AArchive.java +++ /dev/null @@ -1,187 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.GraphicsConfiguration; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.logging.Level; - -import javax.swing.JComponent; -import javax.swing.JPopupMenu; - -import org.compiere.apps.form.ArchiveViewer; -import org.compiere.apps.form.FormFrame; -import org.compiere.model.MBPartner; -import static org.compiere.model.SystemIDs.*; -import org.compiere.swing.CMenuItem; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; - - -/** - * Archive Button Consequences. - * Popup Menu - * - * @author Jorg Janke - * @version $Id: AArchive.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class AArchive implements ActionListener -{ - /** - * Constructor - * @param invoker button - * @param AD_Table_ID table - * @param Record_ID record - */ - public AArchive (JComponent invoker, int AD_Table_ID, int Record_ID) - { - super (); - if (log.isLoggable(Level.CONFIG)) log.config("AD_Table_ID=" + AD_Table_ID + ", Record_ID=" + Record_ID); - m_AD_Table_ID = AD_Table_ID; - m_Record_ID = Record_ID; - getArchives(invoker); - } // AArchive - - /** The Table */ - private int m_AD_Table_ID; - /** The Record */ - private int m_Record_ID; - - /** The Popup */ - private JPopupMenu m_popup = new JPopupMenu("ArchiveMenu"); - private CMenuItem m_reports = null; - private CMenuItem m_reportsAll = null; - private CMenuItem m_documents = null; - /** Where Clause */ - StringBuffer m_where = null; - private GraphicsConfiguration m_graphicsconfig = null; - - /** Logger */ - private static CLogger log = CLogger.getCLogger (AArchive.class); - - /** - * Display Request Options - New/Existing. - * @param invoker button - */ - private void getArchives (JComponent invoker) - { - int reportCount = 0; - int documentCount = 0; - - m_where = new StringBuffer(); - m_where.append("(AD_Table_ID=").append(m_AD_Table_ID) - .append(" AND Record_ID=").append(m_Record_ID) - .append(")"); - // Get all for BP - if (m_AD_Table_ID == MBPartner.Table_ID) - m_where.append(" OR C_BPartner_ID=").append(m_Record_ID); - // - StringBuffer sql = new StringBuffer("SELECT IsReport, COUNT(*) FROM AD_Archive ") - .append("WHERE (AD_Table_ID=? AND Record_ID=?) "); - if (m_AD_Table_ID == MBPartner.Table_ID) - sql.append(" OR C_BPartner_ID=?"); - sql.append(" GROUP BY IsReport"); - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement (sql.toString(), null); - pstmt.setInt(1, m_AD_Table_ID); - pstmt.setInt(2, m_Record_ID); - if (m_AD_Table_ID == MBPartner.Table_ID) - pstmt.setInt(3, m_Record_ID); - rs = pstmt.executeQuery (); - while (rs.next ()) - { - if ("Y".equals(rs.getString(1))) - reportCount += rs.getInt(2); - else - documentCount += rs.getInt(2); - } - } - catch (Exception e) - { - log.log(Level.SEVERE, sql.toString(), e); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - - // - if (documentCount > 0) - { - m_documents = new CMenuItem(Msg.getMsg(Env.getCtx(), "ArchivedDocuments") - + " (" + documentCount + ")"); - m_popup.add(m_documents).addActionListener(this); - } - if (reportCount > 0) - { - m_reports = new CMenuItem(Msg.getMsg(Env.getCtx(), "ArchivedReports") - + " (" + reportCount + ")"); - m_popup.add(m_reports).addActionListener(this); - } - // All Reports - String sql1 = "SELECT COUNT(*) FROM AD_Archive WHERE AD_Table_ID=? AND IsReport='Y'"; - int allReports = DB.getSQLValue(null, sql1, m_AD_Table_ID); - if (allReports > 0) - { - m_reportsAll = new CMenuItem(Msg.getMsg(Env.getCtx(), "ArchivedReportsAll") - + " (" + reportCount + ")"); - m_popup.add(m_reportsAll).addActionListener(this); - } - - if (documentCount == 0 && reportCount == 0 && allReports == 0) - m_popup.add(Msg.getMsg(Env.getCtx(), "ArchivedNone")); - - m_graphicsconfig = invoker.getGraphicsConfiguration(); - // - if (invoker.isShowing()) - m_popup.show(invoker, 0, invoker.getHeight()); // below button - } // getZoomTargets - - /** - * Listner - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - int AD_Form_ID = FORM_ARCHIVEVIEWER; // ArchiveViewer - FormFrame ff = new FormFrame(m_graphicsconfig); - ff.openForm(AD_Form_ID); - ArchiveViewer av = (ArchiveViewer)ff.getFormPanel(); - // - if (e.getSource() == m_documents) - av.query(false, m_AD_Table_ID, m_Record_ID); - else if (e.getSource() == m_reports) - av.query(true, m_AD_Table_ID, m_Record_ID); - else // all Reports - av.query(true, m_AD_Table_ID, 0); - // - AEnv.addToWindowManager(ff); - ff.pack(); - AEnv.showCenterScreen(ff); - ff = null; - } // actionPerformed - -} // AArchive diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AChat.java b/org.adempiere.ui.swing/src/org/compiere/apps/AChat.java deleted file mode 100644 index 636b4e36e7..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AChat.java +++ /dev/null @@ -1,169 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.util.logging.Level; - -import javax.swing.JSplitPane; - -import org.compiere.model.MChat; -import org.compiere.model.MChatEntry; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextArea; -import org.compiere.swing.CTextPane; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Application Chat - * - * @author Jorg Janke - * @version $Id: AChat.java,v 1.3 2006/07/30 00:51:27 jjanke Exp $ - */ -public class AChat extends CDialog -{ - /** - * - */ - private static final long serialVersionUID = -8555071848521981730L; - - /** - * Constructor. - * loads Chat, if ID <> 0 - * @param frame frame - * @param WindowNo window no - * @param CM_Chat_ID chat - * @param AD_Table_ID table - * @param Record_ID record key - * @param Description description - * @param trxName transaction - */ - public AChat (Frame frame, int WindowNo, int CM_Chat_ID, - int AD_Table_ID, int Record_ID, String Description, - String trxName) - { - super (frame, Msg.getMsg(Env.getCtx(), "Chat") + " " + Description, true); - // needs to be modal otherwise APanel does not recongize change. - if (log.isLoggable(Level.CONFIG)) log.config("ID=" + CM_Chat_ID - + ", Table=" + AD_Table_ID + ", Record=" + Record_ID); - // - m_WindowNo = WindowNo; - // - try - { - staticInit(); - } - catch (Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - // Create Model - if (CM_Chat_ID > 0) - m_chat = new MChat (Env.getCtx(), CM_Chat_ID, trxName); - else - m_chat = new MChat (Env.getCtx(), AD_Table_ID, Record_ID, Description, trxName); - loadChat(); - // - try - { - AEnv.showCenterWindow(frame, this); - } - catch (Exception e) - { - } - newText.requestFocus(); - } // Attachment - - /** Window No */ - @SuppressWarnings("unused") - private int m_WindowNo; - /** Attachment */ - private MChat m_chat; - /** Change */ - //private boolean m_change = false; - /** Logger */ - private static CLogger log = CLogger.getCLogger(AChat.class); - - private CPanel mainPanel = new CPanel(new BorderLayout(5,5)); - private CTextPane historyText = new CTextPane(); - private CTextArea newText = new CTextArea(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - - /** - * Static Init. - * @throws Exception - */ - private void staticInit () throws Exception - { - this.getContentPane().add(mainPanel); - // - historyText.setPreferredSize(new Dimension(350,300)); - historyText.setReadWrite(false); - historyText.setMargin(new Insets(2,2,2,2)); - newText.setPreferredSize(new Dimension(350,200)); - newText.setMargin(new Insets(2,2,2,2)); - // - JSplitPane textPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, - historyText, newText); - mainPanel.add(textPane, BorderLayout.CENTER); - - //TODO Confidentiality - - // South - mainPanel.add(confirmPanel, BorderLayout.SOUTH); - confirmPanel.addActionListener(this); - } // staticInit - - /** - * Load Chat - */ - private void loadChat() - { - String text = m_chat.getHistory(MChat.CONFIDENTIALTYPE_Internal).toString(); - historyText.setText(text); - } // loadChat - - - /** - * Action Performed - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - String data = newText.getText(); - if (data != null && data.length() > 0) - { - log.config(data); - if (m_chat.get_ID() == 0) - m_chat.saveEx(); - MChatEntry entry = new MChatEntry(m_chat, data); - entry.saveEx(); - } // data to be saved - } - dispose(); - } // actionPerformed - -} // AChat diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ADialog.java b/org.adempiere.ui.swing/src/org/compiere/apps/ADialog.java deleted file mode 100644 index fc5a7356a9..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ADialog.java +++ /dev/null @@ -1,485 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.Container; -import java.awt.Dialog; -import java.awt.Frame; -import java.awt.Toolkit; -import java.awt.Window; -import java.util.Properties; -import java.util.logging.Level; - -import javax.swing.JDialog; -import javax.swing.JFrame; -import javax.swing.JOptionPane; - -import org.compiere.Adempiere; -import org.compiere.model.MUser; -import org.compiere.model.ModelValidationEngine; -import org.compiere.util.CLogMgt; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Trace; -import org.compiere.util.Util; - -/** - * Info Dialog Management - * - * @author Jorg Janke - * @version $Id: ADialog.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ - -public final class ADialog -{ - /** Show ADialogADialog - if false use JOptionPane */ - public static boolean showDialog = true; - /** Logger */ - private static CLogger log = CLogger.getCLogger(ADialog.class); - - /** - * Show plain message - * @param WindowNo Number of Window - * @param c Container (owner) - * @param clearHeading Translated Title of window - * @param clearMessage Translated message - * @param clearText Additional message - */ - public static void info (int WindowNo, Container c, String clearHeading, String clearMessage, String clearText) - { - if (log.isLoggable(Level.INFO)) log.info(clearHeading - + ": " + clearMessage + " " + clearText); - String out = clearMessage; - if (clearText != null && !clearText.equals("")) - out += "\n" + clearText; - // - Window parent = Env.getParent(c); - if (parent == null) - parent = AEnv.getWindow(WindowNo); - // - if (showDialog && parent != null) - { - if (parent instanceof JFrame) - new ADialogDialog ((JFrame)parent, - clearHeading, - out, - JOptionPane.INFORMATION_MESSAGE); - else - new ADialogDialog ((JDialog)parent, - clearHeading, - out, - JOptionPane.INFORMATION_MESSAGE); - } - else - JOptionPane.showMessageDialog(parent, - out + "\n", // message - clearHeading, // title - JOptionPane.INFORMATION_MESSAGE); - } // info - - /** - * Show message with info icon - * @param WindowNo Number of Window - * @param c Container (owner) - * @param AD_Message Message to be translated - * @param msg Additional message - */ - public static void info (int WindowNo, Container c, String AD_Message, String msg) - { - if (log.isLoggable(Level.INFO)) log.info(AD_Message + " - " + msg); - Properties ctx = Env.getCtx(); - StringBuilder out = new StringBuilder(); - if (AD_Message != null && !AD_Message.equals("")) - out.append(Msg.getMsg(ctx, AD_Message)); - if (msg != null && msg.length() > 0) - out.append("\n").append(msg); - // - Window parent = Env.getParent(c); - if (parent == null) - parent = AEnv.getWindow(WindowNo); - // - if (showDialog && parent != null) - { - if (parent instanceof JFrame) - new ADialogDialog ((JFrame)parent, - Env.getHeader(ctx, WindowNo), - out.toString(), - JOptionPane.INFORMATION_MESSAGE); - else - new ADialogDialog ((JDialog)parent, - Env.getHeader(ctx, WindowNo), - out.toString(), - JOptionPane.INFORMATION_MESSAGE); - } - else - JOptionPane.showMessageDialog(parent, - out.toString() + "\n", // message - Env.getHeader(ctx, WindowNo), // title - JOptionPane.INFORMATION_MESSAGE); - } // info - - /** - * Show message with info icon - * @param WindowNo Number of Window - * @param c Container (owner) - * @param AD_Message Message to be translated - */ - public static void info (int WindowNo, Container c, String AD_Message) - { - info (WindowNo, c, AD_Message, null); - } // info - - - /************************************************************************** - * Display warning with warning icon - * @param WindowNo Number of Window - * @param c Container (owner) - * @param AD_Message Message to be translated - * @param msg Additional message - */ - public static void warn (int WindowNo, Container c, String AD_Message, String msg) - { - if (log.isLoggable(Level.INFO)) log.info(AD_Message + " - " + msg); - Properties ctx = Env.getCtx(); - StringBuilder out = new StringBuilder(); - if (AD_Message != null && !AD_Message.equals("")) - out.append(Msg.getMsg(ctx, AD_Message)); - if (msg != null && msg.length() > 0) - out.append("\n").append(msg); - // - Window parent = Env.getParent(c); - if (parent == null) - parent = AEnv.getWindow(WindowNo); - // - if (showDialog && parent != null) - { - if (parent instanceof JFrame) - new ADialogDialog ((JFrame)parent, - Env.getHeader(ctx, WindowNo), - out.toString(), - JOptionPane.WARNING_MESSAGE); - else - new ADialogDialog ((JDialog)parent, - Env.getHeader(ctx, WindowNo), - out.toString(), - JOptionPane.WARNING_MESSAGE); - } - else - JOptionPane.showMessageDialog(parent, - out.toString() + "\n", // message - Env.getHeader(ctx, WindowNo), // title - JOptionPane.WARNING_MESSAGE); - } // warn (int, String) - - /** - * Display warning with warning icon - * @param WindowNo Number of Window - * @param c Container (owner) - * @param AD_Message Message to be translated - */ - public static void warn (int WindowNo, Container c, String AD_Message) - { - warn (WindowNo, c, AD_Message, null); - } // warn (int, String) - - - /************************************************************************** - * Display error with error icon - * @param WindowNo Number of Window - * @param c Container (owner) - * @param AD_Message Message to be translated - * @param msg Additional message - */ - public static void error (int WindowNo, Container c, String AD_Message, String msg) - { - if (log.isLoggable(Level.INFO)) log.info(AD_Message + " - " + msg); - if (CLogMgt.isLevelFinest()) - Trace.printStack(); - Properties ctx = Env.getCtx(); - StringBuilder out = new StringBuilder(); - if (AD_Message != null && !AD_Message.equals("")) - out.append(Msg.getMsg(ctx, AD_Message)); - if (msg != null && msg.length() > 0) - out.append("\n").append(msg); - // - Window parent = Env.getParent(c); - if (parent == null) - parent = AEnv.getWindow(WindowNo); - // - if (showDialog && parent != null) - { - if (parent instanceof JFrame) - new ADialogDialog ((JFrame)parent, - Env.getHeader(ctx, WindowNo), - out.toString(), - JOptionPane.ERROR_MESSAGE); - else if (parent instanceof JDialog) - new ADialogDialog ((JDialog)parent, - Env.getHeader(ctx, WindowNo), - out.toString(), - JOptionPane.ERROR_MESSAGE); - } - else - JOptionPane.showMessageDialog(AEnv.getWindow(WindowNo), - out.toString() + "\n", // message - Env.getHeader(ctx, WindowNo), // title - JOptionPane.ERROR_MESSAGE); - } // error (int, String) - - /** - * Display error with error icon - * @param WindowNo Number of Window - * @param c Container (owner) - * @param AD_Message Message to be translated - */ - public static void error (int WindowNo, Container c, String AD_Message) - { - error (WindowNo, c, AD_Message, null); - } // error (int, String) - - - /************************************************************************** - * Ask Question with question icon and (OK) (Cancel) buttons - * @param WindowNo Number of Window - * @param c Container (owner) - * @param AD_Message Message to be translated - * @param msg Additional clear text message - * @return true, if OK - */ - public static boolean ask (int WindowNo, Container c, String AD_Message, String msg) - { - if (log.isLoggable(Level.INFO)) log.info(AD_Message + " - " + msg); - Properties ctx = Env.getCtx(); - StringBuilder out = new StringBuilder(); - if (AD_Message != null && !AD_Message.equals("")) - out.append(Msg.getMsg(ctx, AD_Message)); - if (msg != null && msg.length() > 0) - out.append("\n").append(msg); - // - Window parent = Env.getParent(c); - if (parent == null) - parent = AEnv.getWindow(WindowNo); - - boolean retValue = false; - if (showDialog && parent != null) - { - if (parent instanceof JFrame) - { - ADialogDialog d = new ADialogDialog ((JFrame)parent, - Env.getHeader(ctx, WindowNo), - out.toString(), - JOptionPane.QUESTION_MESSAGE); - retValue = d.getReturnCode() == ADialogDialog.A_OK; - } - else - { - ADialogDialog d = new ADialogDialog ((JDialog)parent, - Env.getHeader(ctx, WindowNo), - out.toString(), - JOptionPane.QUESTION_MESSAGE); - retValue = d.getReturnCode() == ADialogDialog.A_OK; - } - } - else - { - Object[] optionsOC = {Util.cleanAmp(Msg.getMsg(ctx, "OK")), Util.cleanAmp(Msg.getMsg(ctx, "Cancel"))}; - int i = JOptionPane.showOptionDialog(parent, - out.toString() + "\n", // message - Env.getHeader(ctx, WindowNo), // title - JOptionPane.DEFAULT_OPTION, - JOptionPane.QUESTION_MESSAGE, - null, - optionsOC, - optionsOC[0]); - retValue = i == JOptionPane.YES_OPTION; - } - return retValue; - } // ask - - /** - * Ask Question with question icon and (OK) (Cancel) buttons - * @param WindowNo Number of Window - * @param c Container (owner) - * @param AD_Message Message to be translated - * @return true, if OK - */ - public static boolean ask (int WindowNo, Container c, String AD_Message) - { - return ask (WindowNo, c, AD_Message, null); - } // ask - - public static String askForInput(int WindowNo, Container c, String AD_Message) { - if (log.isLoggable(Level.INFO)) log.info(AD_Message); - Properties ctx = Env.getCtx(); - StringBuilder out = new StringBuilder(); - if (AD_Message != null && !AD_Message.equals("")) - out.append(Msg.getMsg(ctx, AD_Message)); - - // - Window parent = Env.getParent(c); - if (parent == null) - parent = AEnv.getWindow(WindowNo); - - String retValue = null; - if (parent != null) - { - if (parent instanceof JFrame) - { - ADialogDialog d = new ADialogDialog ((JFrame)parent, - Env.getHeader(ctx, WindowNo), - out.toString(), - ADialogDialog.INPUT_MESSAGE); - retValue = d.getReturnMsg(); - } - else - { - ADialogDialog d = new ADialogDialog ((JDialog)parent, - Env.getHeader(ctx, WindowNo), - out.toString(), - ADialogDialog.INPUT_MESSAGE); - retValue = d.getReturnMsg(); - } - } - return retValue; - } - - /************************************************************************** - * Display parsed development info Message string - * @param WindowNo Number of parent window (if zero, no parent window) - * @param c Container (owner) - * @param ParseString String to be parsed - */ - public static void clear (int WindowNo, Container c, String ParseString) - { - if (log.isLoggable(Level.INFO)) log.info( "Dialog.clear: " + ParseString); - Properties ctx = Env.getCtx(); - String parse = Env.parseContext(ctx, WindowNo, ParseString, false); - if (parse.length() == 0) - parse = "ERROR parsing: " + ParseString; - // - Window parent = Env.getParent(c); - if (parent == null) - parent = AEnv.getWindow(WindowNo); - // - if (showDialog && parent != null) - { - if (parent instanceof JFrame) - new ADialogDialog ((JFrame)parent, - Env.getHeader(ctx, WindowNo), - "=> " + parse, - JOptionPane.INFORMATION_MESSAGE); - else - new ADialogDialog ((JDialog)parent, - Env.getHeader(ctx, WindowNo), - "=> " + parse, - JOptionPane.INFORMATION_MESSAGE); - } - else - JOptionPane.showMessageDialog(parent, - "=> " + parse + "\n", // message - Env.getHeader(ctx, WindowNo), // title - JOptionPane.INFORMATION_MESSAGE); - } // clear - - - /** - * Display parsed development info Message string if condition is true - * @param WindowNo Number of parent window (if zero, no parent window) - * @param c Container (owner) - * @param ParseString Parsed Message - * @param condition to print must be true and debugging enabled - */ - public static void clear (int WindowNo, Container c, String ParseString, boolean condition) - { - if (!condition) - return; - clear(WindowNo, c, ParseString); - if (WindowNo == 0) - log.log(Level.SEVERE, "WIndowNo == 0"); - } // clear - - /** - * Display parsed development info Message string - * @param ParseString String to be parsed - * @deprecated - */ - public static void clear (String ParseString) - { - clear(0, null, ParseString); - } // clear - - /************************************************************************* - - /** - * Create Support EMail - * @param owner owner - * @param subject subkect - * @param message message - */ - public static void createSupportEMail(Dialog owner, String subject, String message) - { - log.config( "ADialog.createSupportEMail"); - String to = Adempiere.getSupportEMail(); - MUser from = MUser.get(Env.getCtx(), Env.getAD_User_ID(Env.getCtx())); - // - StringBuffer myMessage = new StringBuffer(message); - myMessage.append("\n"); - CLogMgt.getInfo(myMessage); - CLogMgt.getInfoDetail(myMessage, Env.getCtx()); - ModelValidationEngine.get().getInfoDetail(myMessage, Env.getCtx()); // teo_sarca - FR [ 1724662 ] - - @SuppressWarnings("unused") - EMailDialog emd = new EMailDialog(owner, - Msg.getMsg(Env.getCtx(), "EMailSupport"), - from, to, "Support: " + subject, myMessage.toString(), null); - } // createEmail - - /** - * Create Support EMail - * @param owner owner - * @param subject subkect - * @param message message - */ - public static void createSupportEMail(Frame owner, String subject, String message) - { - log.config( "ADialog.createSupportEMail"); - String to = Adempiere.getSupportEMail(); - MUser from = MUser.get(Env.getCtx(), Env.getAD_User_ID(Env.getCtx())); - // - StringBuffer myMessage = new StringBuffer(message); - myMessage.append("\n"); - CLogMgt.getInfo(myMessage); - CLogMgt.getInfoDetail(myMessage, Env.getCtx()); - ModelValidationEngine.get().getInfoDetail(myMessage, Env.getCtx()); // teo_sarca - FR [ 1724662 ] - - @SuppressWarnings("unused") - EMailDialog emd = new EMailDialog(owner, - Msg.getMsg(Env.getCtx(), "EMailSupport"), - from, to, "Support: " + subject, myMessage.toString(), null); - } // createEmail - - - /************************************************************************** - * Beep - */ - public static void beep() - { - Toolkit.getDefaultToolkit().beep(); - } // beep - -} // Dialog diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ADialogDialog.java b/org.adempiere.ui.swing/src/org/compiere/apps/ADialogDialog.java deleted file mode 100644 index 0900121fc7..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ADialogDialog.java +++ /dev/null @@ -1,359 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Dialog; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.event.WindowEvent; -import java.util.logging.Level; - -import javax.swing.Icon; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JOptionPane; -import javax.swing.KeyStroke; - -import org.compiere.model.MRole; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextField; -import org.compiere.swing.CTextPane; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Util; - -/** - * Dialog Windows - * - * @author Jorg Janke - * @version $Id: ADialogDialog.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public final class ADialogDialog extends CDialog implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 5670261006862936363L; - - public static final int INPUT_MESSAGE = 4; - /** - * Create Dialog Window for Frame - * - * @param frame - * @param title - * @param message - * @param messageType - */ - public ADialogDialog(Frame frame, String title, String message, int messageType) - { - super (frame, title, frame != null); - common (message, messageType); - AEnv.showCenterWindow(frame, this); - } // ADialogDialog - - /** - * Create Dialog Window for Dialog - * - * @param dialog - * @param title - * @param message - * @param messageType - */ - public ADialogDialog(Dialog dialog, String title, String message, int messageType) - { - super (dialog, title, dialog != null); - common (message, messageType); - AEnv.showCenterWindow(dialog, this); - } // ADialogDialog - - /** - * Common Init - * @param message - * @param messageType - */ - private void common (String message, int messageType) - { - try - { - setInfoMessage (message); - jbInit(messageType); - setInfoIcon (messageType); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "ADialogDialog.common - " + ex.getMessage()); - } - // Default Button - this.getRootPane().setDefaultButton(confirmPanel.getOKButton()); - } // common - - /** - * Window Events - requestFocus - * @param e - */ - protected void processWindowEvent(WindowEvent e) - { - super.processWindowEvent(e); - if (e.getID() == WindowEvent.WINDOW_OPENED) - confirmPanel.getOKButton().requestFocusInWindow(); - } // processWindowEvent - - /** Answer OK (0) */ - public static int A_OK = 0; - /** Answer Cancel (1) */ - public static int A_CANCEL = 1; - /** Answer Close (-1) - Default */ - public static int A_CLOSE = -1; - /** Answer */ - private int m_returnCode = A_CLOSE; - /** Logger */ - private static CLogger log = CLogger.getCLogger(ADialogDialog.class); - - private static Icon i_inform = Env.getImageIcon("Inform32.gif"); - private static Icon i_warn = Env.getImageIcon("Warn32.gif"); - private static Icon i_question = Env.getImageIcon("Question32.gif"); - private static Icon i_error = Env.getImageIcon("Error32.gif"); - - private JMenuBar menuBar = new JMenuBar(); - private JMenu mFile = AEnv.getMenu("File"); - private CMenuItem mEMail = new CMenuItem(); - private CMenuItem mPrintScreen = new CMenuItem(); - private CMenuItem mScreenShot = new CMenuItem(); - private CMenuItem mEnd = new CMenuItem(); - private CMenuItem mPreference = new CMenuItem(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - private CPanel westPanel = new CPanel(); - private CLabel iconLabel = new CLabel(); - private GridBagLayout westLayout = new GridBagLayout(); - private CTextPane info = new CTextPane (); - private CTextField input = new CTextField(); - private GridBagLayout infoLayout = new GridBagLayout(); - private CPanel infoPanel = new CPanel(); - - /** - * Static Constructor - * @throws Exception - */ - private void jbInit(int messageType) throws Exception - { - this.setJMenuBar(menuBar); - // - mEMail.setIcon(Env.getImageIcon("EMailSupport16.gif")); - mEMail.setText(Msg.getMsg(Env.getCtx(), "EMailSupport")); - mEMail.addActionListener(this); - mPrintScreen.setIcon(Env.getImageIcon("PrintScreen16.gif")); - mPrintScreen.setText(Msg.getMsg(Env.getCtx(), "PrintScreen")); - mPrintScreen.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, 0)); - mPrintScreen.addActionListener(this); - mScreenShot.setIcon(Env.getImageIcon("ScreenShot16.gif")); - mScreenShot.setText(Msg.getMsg(Env.getCtx(), "ScreenShot")); - mScreenShot.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, ActionEvent.SHIFT_MASK)); - mScreenShot.addActionListener(this); - mPreference.setIcon(Env.getImageIcon("Preference16.gif")); - mPreference.setText(Msg.getMsg(Env.getCtx(), "Preference")); - mPreference.addActionListener(this); - mEnd.setIcon(Env.getImageIcon("End16.gif")); - mEnd.setText(Msg.getMsg(Env.getCtx(), "End")); - mEnd.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK)); - mEnd.addActionListener(this); - // - westPanel.setLayout(westLayout); - westPanel.setName("westPanel"); - westPanel.setRequestFocusEnabled(false); - infoPanel.setLayout(infoLayout); - infoPanel.setName("infoPanel"); - infoPanel.setRequestFocusEnabled(false); - this.getContentPane().add(confirmPanel, BorderLayout.SOUTH); - this.getContentPane().add(westPanel, BorderLayout.WEST); - westPanel.add(iconLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(10, 10, 10, 10), 0, 0)); - this.getContentPane().add(infoPanel, BorderLayout.CENTER); - infoPanel.add(info, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0 - ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(10, 10, 10, 10), 0, 0)); - if(messageType == ADialogDialog.INPUT_MESSAGE) - infoPanel.add(input, new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0 - ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(10, 10, 10, 10), 0, 0)); - // - menuBar.add(mFile); - mFile.add(mPrintScreen); - mFile.add(mScreenShot); - mFile.addSeparator(); - mFile.add(mEMail); - if (MRole.getDefault().isShowPreference()) - mFile.add(mPreference); - mFile.addSeparator(); - mFile.add(mEnd); - // - confirmPanel.addActionListener(this); - } // jbinit - - - /** - * Convert to HTML and Calculate Size - * @param message message - */ - private void setInfoMessage(String message) - { - StringBuilder sb = new StringBuilder (message.length()+20); - sb.append(""); - String html = Util.maskHTML(message); - char[] chars = html.toCharArray(); - boolean first = true; - int paras = 0; - for (int i = 0; i < chars.length; i++) - { - char c = chars[i]; - if (c == '\n') - { - if (first) - { - sb.append(""); - first = false; - } - if (paras > 1) - sb.append("
    "); - else - sb.append("

    "); - paras++; - } - else - sb.append(c); - } - info.setText(sb.toString()); - Dimension size = info.getPreferredSize(); - size.width = 450; - size.height = (Math.max(paras, message.length()/60)+1) * 30; - size.height = Math.min(size.height, 600); - info.setPreferredSize(size); - // Log.print("Para=" + paras + " - " + info.getPreferredSize()); - - info.setRequestFocusEnabled(false); - info.setReadWrite(false); - info.setOpaque(false); - info.setBorder(null); - // - info.setCaretPosition(0); - } // calculateSize - - - /************************************************************************** - * Set Info - * @param messageType - */ - private void setInfoIcon (int messageType) - { - confirmPanel.getCancelButton().setVisible(false); - // - switch (messageType) - { - case JOptionPane.ERROR_MESSAGE: - iconLabel.setIcon(i_error); - break; - case JOptionPane.INFORMATION_MESSAGE: - iconLabel.setIcon(i_inform); - break; - case JOptionPane.QUESTION_MESSAGE: - confirmPanel.getCancelButton().setVisible(true); - iconLabel.setIcon(i_question); - break; - case JOptionPane.WARNING_MESSAGE: - iconLabel.setIcon(i_warn); - break; - case ADialogDialog.INPUT_MESSAGE: - confirmPanel.getCancelButton().setVisible(false); - iconLabel.setIcon(i_question); - break; - case JOptionPane.PLAIN_MESSAGE: - default: - break; - } // switch - } // setInfo - - - /************************************************************************** - * ActionListener - * @param e - */ - public void actionPerformed (ActionEvent e) - { - // log.finest( "ADialogDialog.actionPerformed - " + e); - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - m_returnCode = A_OK; - dispose(); - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL) || e.getSource() == mEnd) - { - m_returnCode = A_CANCEL; - dispose(); - } - else if (e.getSource() == mPrintScreen) - printScreen(); - else if (e.getSource() == mEMail) - { - String title = getTitle(); - String text = info.getText(); - dispose(); // otherwise locking - ADialog.createSupportEMail(this, title, text); - } - else if (e.getSource() == mPreference) - { - if (MRole.getDefault().isShowPreference()) - { - Preference p = new Preference (null, 0); - p.setVisible(true); - } - } - } // actionPerformed - - /** - * Get Return Code - * @return return code - */ - public int getReturnCode() - { - return m_returnCode; - } // getReturnCode - - /** - * PrintScreen - */ - private void printScreen() - { - PrintScreenPainter.printScreen(this); - } // printScreen - - /** - * Get entered message if dialog is a askForInput-Dialog - * @return - */ - public String getReturnMsg() { - return input.getText(); - } - -} // ADialogDialog diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AEnv.java b/org.adempiere.ui.swing/src/org/compiere/apps/AEnv.java deleted file mode 100644 index 1b102e809b..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AEnv.java +++ /dev/null @@ -1,1091 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import static org.compiere.model.SystemIDs.TABLE_AD_WF_ACTIVITY; -import static org.compiere.model.SystemIDs.TABLE_AD_WF_PROCESS; - -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.GraphicsConfiguration; -import java.awt.Insets; -import java.awt.Rectangle; -import java.awt.Toolkit; -import java.awt.Window; -import java.awt.event.ActionListener; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Set; -import java.util.logging.Level; - -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JComponent; -import javax.swing.JFrame; -import javax.swing.JMenu; -import javax.swing.JMenuItem; -import javax.swing.KeyStroke; -import javax.swing.RepaintManager; -import javax.swing.SwingConstants; -import javax.swing.SwingUtilities; - -import org.compiere.acct.Doc; -import org.compiere.db.CConnection; -import org.compiere.grid.ed.Calculator; -import org.compiere.interfaces.Server; -import org.compiere.model.MMenu; -import org.compiere.model.MQuery; -import org.compiere.model.MRole; -import org.compiere.model.MTable; -import org.compiere.swing.CButton; -import org.compiere.swing.CFrame; -import org.compiere.swing.CMenuItem; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Ini; -import org.compiere.util.Msg; -import org.compiere.util.Splash; - -/** - * Windows Application Environment and utilities - * - * @author Jorg Janke - * @version $Id: AEnv.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * - * @author Colin Rooney (croo) & kstan_79 RFE#1670185 - * @author victor.perez@e-evolution.com - * @see FR [ 1966328 ] New Window Info to MRP and CRP into View http://sourceforge.net/tracker/index.php?func=detail&aid=1966328&group_id=176962&atid=879335 - * - */ -public final class AEnv -{ - // Array of active Windows - private static ArrayList s_windows = new ArrayList(20); - - /** Array of hidden Windows */ - private static ArrayList s_hiddenWindows = new ArrayList(); - - /** Closing Window Indicator */ - private static boolean s_closingWindows = false; - - /** - * Hide Window - * @param window window - * @return true if window is hidden, otherwise close it - */ - static public boolean hideWindow(CFrame window) - { - if (!Ini.isCacheWindow() || s_closingWindows) - return false; - for (int i = 0; i < s_hiddenWindows.size(); i++) - { - CFrame hidden = s_hiddenWindows.get(i); - if (log.isLoggable(Level.INFO)) log.info(i + ": " + hidden); - if (hidden.getAD_Window_ID() == window.getAD_Window_ID()) - return false; // already there - } - if (window.getAD_Window_ID() != 0) // workbench - { - if (s_hiddenWindows.add(window)) - { - window.setVisible(false); - if (log.isLoggable(Level.INFO)) log.info(window.toString()); - // window.dispatchEvent(new WindowEvent(window, WindowEvent.WINDOW_ICONIFIED)); - if (s_hiddenWindows.size() > 10) { - CFrame toClose = s_hiddenWindows.remove(0); // sort of lru - try { - s_closingWindows = true; - toClose.dispose(); - } finally { - s_closingWindows = false; - } - } - return true; - } - } - return false; - } // hideWindow - - /** - * Show Window - * @param AD_Window_ID window - * @return true if window re-displayed - */ - static public CFrame showWindow (int AD_Window_ID) - { - for (int i = 0; i < s_hiddenWindows.size(); i++) - { - CFrame hidden = s_hiddenWindows.get(i); - if (hidden.getAD_Window_ID() == AD_Window_ID) - { - s_hiddenWindows.remove(i); - if (log.isLoggable(Level.INFO)) log.info(hidden.toString()); - hidden.setVisible(true); - // De-iconify window - teo_sarca [ 1707221 ] - int state = hidden.getExtendedState(); - if ((state & CFrame.ICONIFIED) > 0) - hidden.setExtendedState(state & ~CFrame.ICONIFIED); - // - hidden.toFront(); - return hidden; - } - } - return null; - } // showWindow - - /** - * Clode Windows. - */ - static void closeWindows () - { - s_closingWindows = true; - for (int i = 0; i < s_hiddenWindows.size(); i++) - { - CFrame hidden = s_hiddenWindows.get(i); - hidden.dispose(); - } - s_hiddenWindows.clear(); - s_closingWindows = false; - } // closeWindows - - /** - * Show window: de-iconify and bring it to front - * @author teo_sarca [ 1707221 ] - */ - public static void showWindow(Window window) { - window.setVisible(true); - if (window instanceof Frame) { - Frame f = (Frame)window; - int state = f.getExtendedState(); - if ((state & Frame.ICONIFIED) > 0) - f.setExtendedState(state & ~Frame.ICONIFIED); - } - window.toFront(); - } - - /** - * Show in the center of the screen. - * (pack, set location and set visibility) - * @param window Window to position - */ - public static void showCenterScreen(Window window) - { - positionCenterScreen(window); - showWindow(window); - } // showCenterScreen - - /** - * Show frame as maximized. - * @param frame - */ - public static void showMaximized(Frame frame) - { - frame.pack(); - frame.setExtendedState(Frame.MAXIMIZED_BOTH); - frame.setVisible(true); - frame.toFront(); - } - - /** - * Position window in center of the screen - * @param window Window to position - */ - public static void positionCenterScreen(Window window) - { - positionScreen (window, SwingConstants.CENTER); - } // positionCenterScreen - - /** - * Show in the center of the screen. - * (pack, set location and set visibility) - * @param window Window to position - * @param position SwingConstants - */ - public static void showScreen(Window window, int position) - { - positionScreen(window, position); - showWindow(window); - } // showScreen - - - /** - * Position window in center of the screen - * @param window Window to position - * @param position SwingConstants - */ - public static void positionScreen (Window window, int position) - { - window.pack(); - // take into account task bar and other adornments - GraphicsConfiguration config = window.getGraphicsConfiguration(); - Rectangle bounds = config.getBounds(); - Dimension sSize = bounds.getSize(); - Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(config); - sSize.width -= (insets.left + insets.right); - sSize.height -= (insets.top + insets.bottom); - - Dimension wSize = window.getSize(); - // fit on window - if (wSize.height > sSize.height) - wSize.height = sSize.height; - if (wSize.width > sSize.width) - wSize.width = sSize.width; - window.setSize(wSize); - // Center - int x = (sSize.width - wSize.width) / 2; - int y = (sSize.height - wSize.height) / 2; - if (position == SwingConstants.CENTER) - ; - else if (position == SwingConstants.NORTH_WEST) - { - x = 0; - y = 0; - } - else if (position == SwingConstants.NORTH) - { - y = 0; - } - else if (position == SwingConstants.NORTH_EAST) - { - x = (sSize.width - wSize.width); - y = 0; - } - else if (position == SwingConstants.WEST) - { - x = 0; - } - else if (position == SwingConstants.EAST) - { - x = (sSize.width - wSize.width); - } - else if (position == SwingConstants.SOUTH) - { - y = (sSize.height - wSize.height); - } - else if (position == SwingConstants.SOUTH_WEST) - { - x = 0; - y = (sSize.height - wSize.height); - } - else if (position == SwingConstants.SOUTH_EAST) - { - x = (sSize.width - wSize.width); - y = (sSize.height - wSize.height); - } - // - window.setLocation(bounds.x + x + insets.left, bounds.y + y + insets.top); - } // positionScreen - - /** - * Position in center of the parent window. - * (pack, set location and set visibility) - * @param parent Parent Window - * @param window Window to position - */ - public static void showCenterWindow(Window parent, Window window) - { - positionCenterWindow(parent, window); - showWindow(window); - } // showCenterWindow - - /** - * Position in center of the parent window - * - * @param parent Parent Window - * @param window Window to position - */ - public static void positionCenterWindow(Window parent, Window window) - { - if (parent == null) - { - positionCenterScreen(window); - return; - } - window.pack(); - // - Dimension sSize = Toolkit.getDefaultToolkit().getScreenSize(); - // take into account task bar and other adornments - GraphicsConfiguration config = window.getGraphicsConfiguration(); - Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(config); - sSize.width -= (insets.left + insets.right); - sSize.height -= (insets.top + insets.bottom); - - Dimension wSize = window.getSize(); - // fit on window - if (wSize.height > sSize.height) - wSize.height = sSize.height; - if (wSize.width > sSize.width) - wSize.width = sSize.width; - window.setSize(wSize); - // center in parent - Rectangle pBounds = parent.getBounds(); - // Parent is in upper left corner - if (pBounds.x == pBounds.y && pBounds.x == 0) - { - positionCenterScreen(window); - return; - } - // Find middle - int x = pBounds.x + ((pBounds.width-wSize.width)/2); - if (x < 0) - x = 0; - int y = pBounds.y + ((pBounds.height-wSize.height)/2); - if (y < 0) - y = 0; - - // Is it on Screen? - if (x + wSize.width > sSize.width) - x = sSize.width - wSize.width; - if (y + wSize.height > sSize.height) - y = sSize.height - wSize.height; - // - // System.out.println("Position: x=" + x + " y=" + y + " w=" + wSize.getWidth() + " h=" + wSize.getHeight() - // + " - Parent loc x=" + pLoc.x + " y=" + y + " w=" + pSize.getWidth() + " h=" + pSize.getHeight()); - window.setLocation(x + insets.left, y + insets.top); - } // positionCenterScreen - - - /************************************************************************* - * Get Button - * @param iconName - * @return button - */ - public static CButton getButton (String iconName) - { - CButton button = new CButton(Env.getImageIcon(iconName + "16.gif")); - button.setMargin(new Insets (0, 0, 0, 0)); - button.setToolTipText(Msg.getMsg(Env.getCtx(), iconName)); - button.setDefaultCapable(false); - return button; - } // getButton - - - /** - * Create Menu Title (translate it and set Mnemonics). - * Based on MS notation of &Help => H is Mnemonics - * - * @param AD_Message message - * @return JMenu - */ - public static JMenu getMenu (String AD_Message) - { - JMenu menu = new JMenu(); - String text = Msg.getMsg(Env.getCtx(), AD_Message); - int pos = text.indexOf('&'); - if (pos != -1 && text.length() > pos) // We have a nemonic - { - char ch = text.toUpperCase().charAt(pos+1); - if (ch != ' ') - { - text = text.substring(0, pos) + text.substring(pos+1); - menu.setMnemonic(ch); - } - } - menu.setText(text); - return menu; - } // getMenu - - /** - * Create Menu Item. - * @param actionName action command - * @param iconName optional name of the icon, defaults to action if null - * @param ks optional key stroke - * @param menu menu to add menu item to - * @param al action listener to register - * @return MenuItem - */ - public static JMenuItem addMenuItem (String actionName, String iconName, KeyStroke ks, - JMenu menu, ActionListener al) - { - if (iconName == null) - iconName = actionName; - String text = Msg.getMsg(Env.getCtx(), actionName); - ImageIcon icon = Env.getImageIcon2(iconName + "16"); - CMenuItem mi = new CMenuItem(text, icon); - mi.setActionCommand(actionName); - if (ks != null) - mi.setAccelerator(ks); - if (menu != null) - menu.add(mi); - if (al != null) - mi.addActionListener(al); - return mi; - } // addMenuItem - - /** - * Perform action command for common menu items. - * Created in AMenu.createMenu(), APanel.createMenu(), FormFrame.createMenu() - * @param actionCommand known action command - * @param WindowNo window no - * @param c Container parent - * @return true if actionCommand was found and performed - */ - public static boolean actionPerformed (String actionCommand, int WindowNo, Container c) - { - MRole role = MRole.getDefault(); - // File Menu ------------------------ - if (actionCommand.equals("PrintScreen")) - { - PrintScreenPainter.printScreen (getFrame(c)); - } - else if (actionCommand.equals("ScreenShot")) - { - ScreenShot.createJPEG(getFrame(c), null); - } - // else if (actionCommand.equals("Report")) - // { - // AEnv.showCenterScreen (new ProcessStart()); - // } - else if (actionCommand.equals("Exit")) - { - if (ADialog.ask(WindowNo, c, "ExitApplication?")) - { - AMenu aMenu = (AMenu)getWindow(0); - aMenu.dispose() ; - } - } - else if (actionCommand.equals("Logout")) - { - AMenu aMenu = (AMenu)getWindow(0); - aMenu.logout(); - } - - // View Menu ------------------------ - else if (actionCommand.equals("InfoProduct") && AEnv.canAccessInfo("PRODUCT")) - { - org.compiere.apps.search.Info.showProduct (getFrame(c), WindowNo); - } - else if (actionCommand.equals("InfoBPartner") && AEnv.canAccessInfo("BPARTNER")) - { - org.compiere.apps.search.Info.showBPartner (getFrame(c), WindowNo); - } - else if (actionCommand.equals("InfoAsset") && AEnv.canAccessInfo("ASSET")) - { - org.compiere.apps.search.Info.showAsset (getFrame(c), WindowNo); - } - else if (actionCommand.equals("InfoAccount") && - MRole.getDefault().isShowAcct() && - AEnv.canAccessInfo("ACCOUNT")) - { - new org.compiere.acct.AcctViewer(); - } - else if (actionCommand.equals("InfoSchedule") && AEnv.canAccessInfo("SCHEDULE")) - { - new org.compiere.apps.search.InfoSchedule (getFrame(c), null, false); - } - //FR [ 1966328 ] - else if (actionCommand.equals("InfoMRP") && AEnv.canAccessInfo("MRP")) - { - CFrame frame = (CFrame) getFrame(c); - int m_menu_id = MMenu.getMenu_ID("MRP Info"); - AMenu menu = AEnv.getAMenu(frame); - AMenuStartItem form = new AMenuStartItem (m_menu_id, true, Msg.translate(Env.getCtx(), "MRP Info"), menu); // async load - form.start(); - } - else if (actionCommand.equals("InfoCRP") && AEnv.canAccessInfo("CRP")) - { - CFrame frame = (CFrame) getFrame(c); - int m_menu_id = MMenu.getMenu_ID("CRP Info"); - AMenu menu = AEnv.getAMenu(frame); - AMenuStartItem form = new AMenuStartItem (m_menu_id, true, Msg.translate(Env.getCtx(), "CRP Info"), menu); // async load - form.start(); - } - else if (actionCommand.equals("InfoOrder") && AEnv.canAccessInfo("ORDER")) - { - org.compiere.apps.search.Info.showOrder (getFrame(c), WindowNo, ""); - } - else if (actionCommand.equals("InfoInvoice") && AEnv.canAccessInfo("INVOICE")) - { - org.compiere.apps.search.Info.showInvoice (getFrame(c), WindowNo, ""); - } - else if (actionCommand.equals("InfoInOut") && AEnv.canAccessInfo("INOUT")) - { - org.compiere.apps.search.Info.showInOut (getFrame(c), WindowNo, ""); - } - else if (actionCommand.equals("InfoPayment") && AEnv.canAccessInfo("PAYMENT")) - { - org.compiere.apps.search.Info.showPayment (getFrame(c), WindowNo, ""); - } - else if (actionCommand.equals("InfoCashLine") && AEnv.canAccessInfo("CASHJOURNAL")) - { - org.compiere.apps.search.Info.showCashLine (getFrame(c), WindowNo, ""); - } - else if (actionCommand.equals("InfoAssignment") && AEnv.canAccessInfo("RESOURCE")) - { - org.compiere.apps.search.Info.showAssignment (getFrame(c), WindowNo, ""); - } - - - // Go Menu ------------------------ - else if (actionCommand.equals("WorkFlow")) - { - startWorkflowProcess(0,0); - } - else if (actionCommand.equals("Home")) - { - showWindow(getWindow(0)); - } - - // Tools Menu ------------------------ - else if (actionCommand.equals("Calculator")) - { - Calculator calc = new org.compiere.grid.ed.Calculator(getFrame(c)); - calc.setDisposeOnEqual(false); - AEnv.showCenterScreen (calc); - } - else if (actionCommand.equals("Calendar")) - { - AEnv.showCenterScreen (new org.compiere.grid.ed.Calendar(getFrame(c))); - } - else if (actionCommand.equals("Editor")) - { - AEnv.showCenterScreen (new org.compiere.grid.ed.Editor(getFrame(c))); - } - else if (actionCommand.equals("Script")) - { - new BeanShellEditor(getFrame(c)); - } - else if (actionCommand.equals("Preference")) - { - if (role.isShowPreference()) { - AEnv.showCenterScreen(new Preference (getFrame(c), WindowNo)); - } - } - - // Help Menu ------------------------ - else if (actionCommand.equals("Online")) - { - Env.startBrowser(org.compiere.Adempiere.getOnlineHelpURL()); - } - else if (actionCommand.equals("EMailSupport")) - { - ADialog.createSupportEMail(getFrame(c), getFrame(c).getTitle(), "\n\n"); - } - else if (actionCommand.equals("About")) - { - AEnv.showCenterScreen(new AboutBox(getFrame(c))); - } - else - return false; - // - return true; - } // actionPerformed - - /** - * Set Text and Mnemonic for Button. - * Create Mnemonics of text containing '&'. - * Based on MS notation of &Help => H is Mnemonics - * @param b The button - * @param text The text with optional Mnemonics - */ - public static void setTextMnemonic (JButton b, String text) - { - if (text == null || b == null) - return; - int pos = text.indexOf('&'); - if (pos != -1) // We have a nemonic - { - char ch = text.charAt(pos+1); - b.setMnemonic(ch); - b.setText(text.substring(0, pos) + text.substring(pos+1)); - } - b.setText(text); - } // setTextMnemonic - - /** - * Get Mnemonic character from text. - * @param text text with '&' - * @return Mnemonic or 0 - */ - public static char getMnemonic (String text) - { - int pos = text.indexOf('&'); - if (pos != -1) // We have a nemonic - return text.charAt(pos+1); - return 0; - } // getMnemonic - - - /************************************************************************* - * Zoom - * @param AD_Table_ID - * @param Record_ID - */ - public static void zoom (int AD_Table_ID, int Record_ID) - { - int AD_Window_ID = Env.getZoomWindowID(AD_Table_ID, Record_ID); - // Nothing to Zoom to - if (AD_Window_ID == 0) - return; - - MTable table = MTable.get(Env.getCtx(), AD_Table_ID); - - AWindow frame = new AWindow(null); - if (!frame.initWindow(AD_Window_ID, MQuery.getEqualQuery(table.getTableName() + "_ID", Record_ID))) - return; - addToWindowManager(frame); - if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED)) - { - AEnv.showMaximized(frame); - } - else - { - AEnv.showCenterScreen(frame); - } - frame = null; - } // zoom - - /** - * Zoom - * @param query query - */ - public static void zoom (MQuery query) - { - if (query == null || query.getTableName() == null || query.getTableName().length() == 0) - return; - - int AD_Window_ID = Env.getZoomWindowID(query); - // Nothing to Zoom to - if (AD_Window_ID == 0) - return; - - AWindow frame = new AWindow(null); - if (!frame.initWindow(AD_Window_ID, query)) - return; - addToWindowManager(frame); - if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED)) - { - AEnv.showMaximized(frame); - } - else - { - AEnv.showCenterScreen(frame); - } - frame = null; - } // zoom - - /** - * Track open frame in window manager - * @param frame - */ - public static void addToWindowManager(CFrame frame) - { - JFrame top = getWindow(0); - if (top instanceof AMenu) - { - ((AMenu)top).getWindowManager().add(frame); - } - } - - /** - * FR [ 1966328 ] - * get AMenu - * @param frame - */ - public static AMenu getAMenu(CFrame frame) - { - JFrame top = getWindow(0); - if (top instanceof AMenu) - { - return (AMenu)top; - } - return null; - } - /** - * Exit System - * @param status System exit status (usually 0 for no error) - */ - public static void exit (int status) - { - Env.exitEnv(status); - } // exit - - public static void logout() - { - Env.logout(); - - Splash.getSplash().setVisible(true); - - //reload - new AMenu(); - } - - /** - * Is Workflow Process view enabled. - * @return true if enabled - */ - public static boolean isWorkflowProcess () - { - if (s_workflow == null) - { - s_workflow = Boolean.FALSE; - int AD_Table_ID = TABLE_AD_WF_PROCESS; // AD_WF_Process - if (MRole.getDefault().isTableAccess (AD_Table_ID, true)) // RO - s_workflow = Boolean.TRUE; - else - { - AD_Table_ID = TABLE_AD_WF_ACTIVITY; // AD_WF_Activity - if (MRole.getDefault().isTableAccess (AD_Table_ID, true)) // RO - s_workflow = Boolean.TRUE; - else - if (log.isLoggable(Level.CONFIG)) log.config(s_workflow.toString()); - } - // Get Window - if (s_workflow.booleanValue()) - { - s_workflow_Window_ID = DB.getSQLValue (null, - "SELECT AD_Window_ID FROM AD_Table WHERE AD_Table_ID=?", AD_Table_ID); - if (s_workflow_Window_ID == 0) - s_workflow_Window_ID = 297; // fallback HARDCODED - // s_workflow = Boolean.FALSE; - if (log.isLoggable(Level.CONFIG)) log.config(s_workflow + ", Window=" + s_workflow_Window_ID); - } - } - return s_workflow.booleanValue(); - } // isWorkflowProcess - - - /** - * Start Workflow Process Window - * @param AD_Table_ID optional table - * @param Record_ID optional record - */ - public static void startWorkflowProcess (int AD_Table_ID, int Record_ID) - { - if (s_workflow_Window_ID == 0) - return; - // - MQuery query = null; - if (AD_Table_ID != 0 && Record_ID != 0) - { - query = new MQuery("AD_WF_Process"); - query.addRestriction("AD_Table_ID", MQuery.EQUAL, AD_Table_ID); - query.addRestriction("Record_ID", MQuery.EQUAL, Record_ID); - } - // - AWindow frame = new AWindow(null); - if (!frame.initWindow(s_workflow_Window_ID, query)) - return; - addToWindowManager(frame); - if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) { - frame.pack(); - frame.setExtendedState(Frame.MAXIMIZED_BOTH); - frame.setVisible(true); - frame.toFront(); - } else - AEnv.showCenterScreen(frame); - frame = null; - } // startWorkflowProcess - - - /*************************************************************************/ - - /** Workflow Menu */ - private static Boolean s_workflow = null; - /** Workflow Menu */ - private static int s_workflow_Window_ID = 0; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(AEnv.class); - - /** - * Get Server Version - * @return Apps Server Version - * @see ALogin#checkVersion - */ - public static String getServerVersion () - { - return CConnection.get().getServerVersion(); - } // getServerVersion - - /** - * Post Immediate - * @param WindowNo window - * @param AD_Table_ID Table ID of Document - * @param AD_Client_ID Client ID of Document - * @param Record_ID Record ID of this document - * @param force force posting - * @return null if success, otherwise error - */ - public static String postImmediate (int WindowNo, int AD_Client_ID, - int AD_Table_ID, int Record_ID, boolean force) - { - if (log.isLoggable(Level.CONFIG)) log.config("Window=" + WindowNo - + ", AD_Table_ID=" + AD_Table_ID + "/" + Record_ID - + ", Force=" + force); - - return Doc.manualPosting(WindowNo, AD_Client_ID, AD_Table_ID, Record_ID, force); - } // postImmediate - - /** - * Cache Reset - * @param tableName table name - * @param Record_ID record id - */ - public static void cacheReset (String tableName, int Record_ID) - { - if (log.isLoggable(Level.CONFIG)) log.config("TableName=" + tableName + ", Record_ID=" + Record_ID); - - try - { - Server server = CConnection.get().getServer(); - if (server != null) - { - server.cacheReset(Env.getRemoteCallCtx(Env.getCtx()), tableName, Record_ID); - } - } - catch (Exception e) - { - log.log(Level.SEVERE, "ex", e); - } - } // cacheReset - - /** - * Update all windows after look and feel changes. - * @since 2006-11-27 - */ - public static void updateUI() - { - Set updated = updateUI0(); - JFrame top = getWindow(0); - if (top instanceof AMenu) - { - CFrame[] frames = ((AMenu)top).getWindowManager().getWindows(); - for (CFrame f : frames) - { - if (updated.contains(f)) continue; - SwingUtilities.updateComponentTreeUI(f); - f.validate(); - RepaintManager mgr = RepaintManager.currentManager(f); - Component childs[] = f.getComponents(); - for (Component c : childs) { - if (c instanceof JComponent) - mgr.markCompletelyDirty((JComponent)c); - } - f.repaint(); - updated.add(f); - } - } - } - - /** - * Validate permissions to access Info queries on the view menu - * @author kstan_79 - * @return true if access is allowed - */ - - public static boolean canAccessInfo(String infoWindowName) - { - boolean result=false; - int roleid= Env.getAD_Role_ID(Env.getCtx()); - String sqlRolePermission="Select COUNT(AD_ROLE_ID) AS ROWCOUNT FROM AD_ROLE WHERE AD_ROLE_ID=" + roleid - + " AND ALLOW_INFO_" + infoWindowName + "='Y'"; - - log.config(sqlRolePermission); - PreparedStatement prolestmt = null; - ResultSet rs = null; - try - { - prolestmt = DB.prepareStatement (sqlRolePermission, null); - - rs = prolestmt.executeQuery (); - - rs.next(); - - if (rs.getInt("ROWCOUNT")>0) - { - result=true; - } - else - { - return false; - } - } - catch (Exception e) - { - System.out.println(e); - log.log(Level.SEVERE, "(1)", e); - } - finally - { - DB.close(rs, prolestmt); - rs = null; prolestmt = null; - } - - return result; - } // canAccessInfo - - /** - * Update all windows after look and feel changes. - * @since 2006-11-27 - */ - public static SetupdateUI0() - { - Set updated = new HashSet(); - for (Container c : s_windows) - { - Window w = getFrame(c); - if (w == null) continue; - if (updated.contains(w)) continue; - SwingUtilities.updateComponentTreeUI(w); - w.validate(); - RepaintManager mgr = RepaintManager.currentManager(w); - Component childs[] = w.getComponents(); - for (Component child : childs) { - if (child instanceof JComponent) - mgr.markCompletelyDirty((JComponent)child); - } - w.repaint(); - updated.add(w); - } - for (Window w : s_hiddenWindows) - { - if (updated.contains(w)) continue; - SwingUtilities.updateComponentTreeUI(w); - w.validate(); - RepaintManager mgr = RepaintManager.currentManager(w); - Component childs[] = w.getComponents(); - for (Component child : childs) { - if (child instanceof JComponent) - mgr.markCompletelyDirty((JComponent)child); - } - w.repaint(); - updated.add(w); - } - return updated; - } - - /** - * Add Container and return WindowNo. - * The container is a APanel, AWindow or JFrame/JDialog - * @param win window - * @return WindowNo used for context - */ - public static int createWindowNo(Container win) - { - int retValue = s_windows.size(); - s_windows.add(win); - return retValue; - } // createWindowNo - - /** - * Search Window by comparing the Frames - * @param container container - * @return WindowNo of container or 0 - */ - public static int getWindowNo (Container container) - { - if (container == null) - return 0; - JFrame winFrame = getFrame(container); - if (winFrame == null) - return 0; - - // loop through windows - for (int i = 0; i < s_windows.size(); i++) - { - Container cmp = (Container)s_windows.get(i); - if (cmp != null) - { - JFrame cmpFrame = getFrame(cmp); - if (winFrame.equals(cmpFrame)) - return i; - } - } - return 0; - } // getWindowNo - - /** - * Return the JFrame pointer of WindowNo - or null - * @param WindowNo window - * @return JFrame of WindowNo - */ - public static JFrame getWindow (int WindowNo) - { - JFrame retValue = null; - try - { - retValue = getFrame ((Container)s_windows.get(WindowNo)); - } - catch (Exception e) - { - log.log(Level.SEVERE, e.toString()); - } - return retValue; - } // getWindow - - /** - * Remove window from active list - * @param WindowNo window - */ - public static void removeWindow (int WindowNo) - { - if (WindowNo>=0 && WindowNo < s_windows.size()) - s_windows.set(WindowNo, null); - } // removeWindow - - /************************************************************************** - * Get Frame of Window - * @param container Container - * @return JFrame of container or null - */ - public static JFrame getFrame (Container container) - { - Container element = container; - while (element != null) - { - if (element instanceof JFrame) - return (JFrame)element; - element = element.getParent(); - } - return null; - } // getFrame - - public static void reset(boolean finalCall) - { - closeWindows(); - - // Dismantle windows - /** - for (int i = 0; i < s_windows.size(); i++) - { - Container win = (Container)s_windows.get(i); - if (win.getClass().getName().endsWith("AMenu")) // Null pointer - ; - else if (win instanceof Window) - ((Window)win).dispose(); - else - win.removeAll(); - } - **/ - //bug [ 1574630 ] - if (s_windows.size() > 0) { - if (!finalCall) { - Container c = s_windows.get(0); - s_windows.clear(); - createWindowNo(c); - } else { - s_windows.clear(); - } - } - } -} // AEnv diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AExport.java b/org.adempiere.ui.swing/src/org/compiere/apps/AExport.java deleted file mode 100644 index 972b69db93..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AExport.java +++ /dev/null @@ -1,165 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2008 SC ARHIPAC SERVICE SRL. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.Component; -import java.awt.Cursor; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.logging.Level; - -import javax.swing.JFileChooser; - -import org.adempiere.base.IGridTabExporter; -import org.adempiere.base.equinox.EquinoxExtensionLocator; -import org.compiere.grid.GridController; -import org.compiere.grid.VTabbedPane; -import org.compiere.model.GridTab; -import org.compiere.util.CLogMgt; -import org.compiere.util.CLogger; -import org.compiere.util.ExtensionFileFilter; - -/** - * Export button consequences - * @author Teo Sarca, www.arhipac.ro - *

  • FR [ 1943731 ] Window data export functionality - */ -public class AExport -{ - private CLogger log = CLogger.getCLogger(getClass()); - private int m_WindowNo = 0; - private Map exporterMap = null; - private Map extensionMap = null; - private APanel parent; - - public AExport(APanel parent) - { - m_WindowNo = parent.getWindowNo(); - // - exporterMap = new HashMap(); - extensionMap = new HashMap(); - List exporterList = EquinoxExtensionLocator.instance().list(IGridTabExporter.class).getExtensions(); - for(IGridTabExporter exporter : exporterList) - { - String extension = exporter.getFileExtension(); - if (!extensionMap.containsKey(extension)) - { - extensionMap.put(extension, exporter.getFileExtensionLabel()); - exporterMap.put(extension, exporter); - } - } - JFileChooser chooser = new JFileChooser(); - for(Map.Entry entry : extensionMap.entrySet()) - { - chooser.addChoosableFileFilter(new ExtensionFileFilter(entry.getKey(), entry.getValue())); - } - - if (chooser.showSaveDialog(parent) != JFileChooser.APPROVE_OPTION) - return; - - // Create File - File outFile = ExtensionFileFilter.getFile(chooser.getSelectedFile(), chooser.getFileFilter()); - try - { - outFile.createNewFile(); - } - catch (IOException e) - { - log.log(Level.SEVERE, "", e); - ADialog.error(m_WindowNo, parent, "FileCannotCreate", e.getLocalizedMessage()); - return; - } - - String ext = outFile.getPath(); - // no extension - if (ext.lastIndexOf('.') == -1) - { - ADialog.error(m_WindowNo, parent, "FileInvalidExtension"); - return; - } - ext = ext.substring(ext.lastIndexOf('.')+1).toLowerCase(); - if (log.isLoggable(Level.CONFIG)) log.config( "File=" + outFile.getPath() + "; Type=" + ext); - - parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - this.parent = parent; - try - { - if (extensionMap.containsKey(ext)) - { - export(outFile, parent.getCurrentTab(), ext); - } - else - { - ADialog.error(m_WindowNo, parent, "FileInvalidExtension"); - } - } - catch (Exception e) - { - ADialog.error(m_WindowNo, parent, "Error", e.getLocalizedMessage()); - if (CLogMgt.isLevelFinest()) - e.printStackTrace(); - } - finally - { - parent.setCursor(Cursor.getDefaultCursor()); - } - } - - private void export(File outFile, GridTab tab, String extension) - throws Exception - { - boolean currentRowOnly = ADialog.ask(m_WindowNo, parent, "ExportCurrentRowOnly"); - - IGridTabExporter exporter = exporterMap.get(extension); - Set tables = new HashSet(); - List childs = new ArrayList(); - List includedList = tab.getIncludedTabs(); - for(GridTab included : includedList) - { - String tableName = included.getTableName(); - if (tables.contains(tableName)) - continue; - tables.add(tableName); - childs.add(included); - } - - int selected = parent.getSelectedTabIndex(); - VTabbedPane tabbedPane = (VTabbedPane) parent.getCurrentTabbedPane(); - for(int i = selected+1; i < tabbedPane.getTabCount(); i++) - { - Component c = tabbedPane.getComponentAt(i); - if (!(c instanceof GridController)) - continue; - - GridController gc = (GridController) c; - if (gc.getMTab() == null) - continue; - if (gc.getMTab().getTabLevel() <= tab.getTabLevel()) - break; - String tableName = gc.getMTab().getTableName(); - if (tables.contains(tableName)) - continue; - tables.add(tableName); - childs.add(gc.getMTab()); - } - - exporter.export(tab, childs, currentRowOnly, outFile,0); - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AFocusTraversalPolicy.java b/org.adempiere.ui.swing/src/org/compiere/apps/AFocusTraversalPolicy.java deleted file mode 100644 index 1b2e38d4f9..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AFocusTraversalPolicy.java +++ /dev/null @@ -1,179 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.Component; -import java.awt.Container; - -import javax.swing.JTabbedPane; -import javax.swing.JToolBar; -import javax.swing.LayoutFocusTraversalPolicy; - -import org.compiere.grid.VPanel; -import org.compiere.grid.ed.VEditor; -import org.compiere.swing.CEditor; - - -/** - * Adempiere Application Focus Traversal Policy - * - * @author Jorg Janke - * @version $Id: AFocusTraversalPolicy.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class AFocusTraversalPolicy extends LayoutFocusTraversalPolicy -{ - /** - * - */ - private static final long serialVersionUID = 6803932792562494878L; - - /** - * Get singleton - * @return AFocusTraversalPolicy - */ - public static AFocusTraversalPolicy get() - { - if (s_policy == null) - s_policy = new AFocusTraversalPolicy(); - return s_policy; - } // get - - /** Default Policy */ - private static AFocusTraversalPolicy s_policy = new AFocusTraversalPolicy(); - - /************************************************************************** - * Constructor - */ - public AFocusTraversalPolicy () - { - super(); - } // AFocusTraversalPolicy - - boolean m_default = false; - - /** - * Get Default Component - * @param aContainer container - * @return default or null - */ - public Component getDefaultComponent (Container aContainer) - { - // info ("Root: ", aContainer); - m_default = true; - Component c = super.getDefaultComponent (aContainer); - // info (" Default: ", c); - m_default = false; - return c; - } // getDefaultComponent - - /** - * Get First Component - * @param aContainer container - * @return first component to focus - */ - @Override - public Component getFirstComponent(Container aContainer) - { - Component c = null; - if (aContainer instanceof VPanel) - { - VEditor editor = ((VPanel)aContainer).getDefaultFocus(); - if (editor != null && editor.isReadWrite()) - c = editor.getFocusableComponent(); - if (c != null) - return c; - } - return super.getFirstComponent(aContainer); - } // getFirstComponent - - /** - * Determines whether the specified Component - * is an acceptable choice as the new focus owner. - * This method performs the following sequence of operations: - *
      - *
    1. Checks whether aComponent is visible, displayable, - * enabled, and focusable. If any of these properties is - * false, this method returns false. - *
    2. If aComponent is an instance of JTable, - * returns true. - *
    3. If aComponent is an instance of JComboBox, - * then returns the value of - * aComponent.getUI().isFocusTraversable(aComponent). - *
    4. If aComponent is a JComponent - * with a JComponent.WHEN_FOCUSED - * InputMap that is neither null - * nor empty, returns true. - *
    5. Returns the value of - * DefaultFocusTraversalPolicy.accept(aComponent). - *
    - * - * @param aComponent the Component whose fitness - * as a focus owner is to be tested - * @see java.awt.Component#isVisible - * @see java.awt.Component#isDisplayable - * @see java.awt.Component#isEnabled - * @see java.awt.Component#isFocusable - * @see javax.swing.plaf.ComboBoxUI#isFocusTraversable - * @see javax.swing.JComponent#getInputMap() - * @see java.awt.DefaultFocusTraversalPolicy#accept - * @return true if aComponent is a valid choice - * for a focus owner; - * otherwise false - */ - protected boolean accept(Component aComponent) - { - if (!super.accept(aComponent)) - return false; - - // TabbedPane - if (aComponent instanceof JTabbedPane) - return false; - // R/O Editors - if (aComponent instanceof CEditor) - { - CEditor ed = (CEditor)aComponent; - if (!ed.isReadWrite()) - return false; - if (m_default // get Default Focus - && ("AD_Client_ID".equals(aComponent.getName()) || "AD_Org_ID".equals(aComponent.getName()) )) - return false; - } - // Toolbar Buttons - if (aComponent.getParent() instanceof JToolBar) - return false; - // - return true; - } // accept - - /************************************************************************** - * Dump info - * @param title - * @param c - */ - /*private void info (String title, Component c) - { - System.out.print (title); - if (c == null) - System.out.println (" - null"); - else - { - System.out.print (c.getClass().getName()); - System.out.println (" - " + c.getName()); - } - } // info*/ - -} // AFocusTraversalPolicy diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AGlassPane.java b/org.adempiere.ui.swing/src/org/compiere/apps/AGlassPane.java deleted file mode 100644 index 63df3b5356..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AGlassPane.java +++ /dev/null @@ -1,268 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.util.logging.Level; - -import javax.swing.JPanel; -import javax.swing.Timer; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Glass Pane to display "waiting" and capture events while processing. - * - * @author Jorg Janke - * @version $Id: AGlassPane.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class AGlassPane extends JPanel implements MouseListener, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 618724937492933184L; - - /** - * Constructor - */ - public AGlassPane() - { - this.setOpaque(false); - this.setVisible(false); - this.addMouseListener(this); - } // AGlassPane - - /** The Image */ - public static Image s_image = Env.getImage("iD10030.png"); - /** The Message Font */ - public static Font s_font = new Font("Dialog", 3, 14); - /** The Message Color */ - public static Color s_color = AdempierePLAF.getTextColor_OK(); - - /** Gap between components */ - private static final int GAP = 4; - - /** The Message */ - private String m_message = Msg.getMsg(Env.getCtx(), "Processing"); - - /** Timer */ - private Timer m_timer; - /** Value of timer */ - private int m_timervalue = 0; - private int m_timermax = 0; - /** Logger */ - private static CLogger log = CLogger.getCLogger(AGlassPane.class); - - /** - * Set Message - * @param AD_Message to be translated - null resets to default message - */ - public void setMessage(String AD_Message) - { - if (AD_Message == null) - m_message = Msg.getMsg(Env.getCtx(), "Processing"); - else if (AD_Message.length() == 0) - m_message = AD_Message; // nothing - else - m_message = Msg.getMsg(Env.getCtx(), AD_Message); - if (isVisible()) - repaint(); - } // setMessage - - /** - * Get Message - * @return displayed message - */ - public String getMessage() - { - return m_message; - } // getMessage - - - /************************************************************************** - * Set and start Busy Counter if over 2 seconds - * @param time in seconds - */ - public void setBusyTimer (int time) - { - if (log.isLoggable(Level.CONFIG)) log.config("Time=" + time); - // should we display a progress bar? - if (time < 2 ) - { - m_timermax = 0; - if (isVisible()) - repaint(); - return; - } - - m_timermax = time; - m_timervalue = 0; - - // Start Timer - if(m_timer == null) - { - m_timer = new Timer (1000, this); // every second - } - m_timer.start(); - - if (!isVisible()) - setVisible(true); - repaint(); - } // setBusyTimer - - @Override - public void setVisible(boolean flag) { - if(!flag && m_timer != null) - { - m_timer.stop(); - } - super.setVisible(flag); - } - /** - * ActionListener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (m_timermax > 0) - { - m_timervalue++; - if (m_timervalue > m_timermax) - m_timervalue = 0; - repaint(); - } - } // actionPerformed - - - /************************************************************************** - * Paint Component. - *
    -	 *      image
    -	 *      message
    -	 *      progressBar
    -	 *  
    - * @param g - */ - public void paintComponent (Graphics g) - { - Dimension panelSize = getSize(); - g.setColor(new Color(1f,1f,1f, 0.4f)); // .5 is a bit too light - g.fillRect(0,0, panelSize.width, panelSize.height); - // - g.setFont(s_font); - g.setColor(s_color); - FontMetrics fm = g.getFontMetrics(); - Dimension messageSize = new Dimension (fm.stringWidth(m_message), fm.getAscent() + fm.getDescent()); - Dimension imageSize = new Dimension (s_image.getWidth(this), s_image.getHeight(this)); - Dimension progressSize = new Dimension(150, 15); - // System.out.println("Panel=" + panelSize + " - Message=" + messageSize + " - Image=" + imageSize + " - Progress=" + progressSize); - - // Horizontal layout - int height = imageSize.height + GAP + messageSize.height + GAP + progressSize.height; - if (height > panelSize.height) - { - log.log(Level.SEVERE, "Panel too small - height=" + panelSize.height); - return; - } - int yImage = (panelSize.height/2) - (height/2); - int yMessage = yImage + imageSize.height + GAP + fm.getAscent(); - int yProgress = yMessage + fm.getDescent() + GAP; - // System.out.println("yImage=" + yImage + " - yMessage=" + yMessage); - - // Vertical layout - if (imageSize.width > panelSize.width || messageSize.width > panelSize.width) - { - log.log(Level.SEVERE, "Panel too small - width=" + panelSize.width); - return; - } - int xImage = (panelSize.width/2) - (imageSize.width/2); - int xMessage = (panelSize.width/2) - (messageSize.width/2); - int xProgress = (panelSize.width/2) - (progressSize.width/2); - - g.drawImage(s_image, xImage, yImage, this); - g.drawString(m_message, xMessage, yMessage); - if (m_timermax > 0) - { - int pWidth = progressSize.width / m_timermax * m_timervalue; - g.setColor(AdempierePLAF.getPrimary3()); - g.fill3DRect(xProgress, yProgress, pWidth, progressSize.height, true); - g.setColor(AdempierePLAF.getPrimary2()); - g.draw3DRect(xProgress, yProgress, progressSize.width, progressSize.height, true); - } - } // paintComponent - - - /************************************************************************** - * Mouse Listener - * @param e - */ - public void mouseClicked(MouseEvent e) - { - if (isVisible()) - e.consume(); - } - /** - * Mouse Listener - * @param e - */ - public void mousePressed(MouseEvent e) - { - if (isVisible()) - e.consume(); - } - /** - * Mouse Listener - * @param e - */ - public void mouseReleased(MouseEvent e) - { - if (isVisible()) - e.consume(); - } - /** - * Mouse Listener - * @param e - */ - public void mouseEntered(MouseEvent e) - { - if (isVisible()) - e.consume(); - } - /** - * Mouse Listener - * @param e - */ - public void mouseExited(MouseEvent e) - { - if (isVisible()) - e.consume(); - } - -} // AGlassPane diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AKeyboardFocusManager.java b/org.adempiere.ui.swing/src/org/compiere/apps/AKeyboardFocusManager.java deleted file mode 100644 index 0d62480d6a..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AKeyboardFocusManager.java +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.DefaultKeyboardFocusManager; - -/** - * Apps Keyboard Focus Manager - * - * @author Jorg Janke - * @version $Id: AKeyboardFocusManager.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class AKeyboardFocusManager extends DefaultKeyboardFocusManager -{ - /** - * Get default Keyboard Focus Mgr - * @return focus manager - */ - public static AKeyboardFocusManager get() - { - if (s_kfm == null) - s_kfm = new AKeyboardFocusManager(); - return s_kfm; - } // get - - /** Default Focus Manager */ - private static AKeyboardFocusManager s_kfm = new AKeyboardFocusManager(); - - /** - * Constructor - */ - public AKeyboardFocusManager () - { - super (); - setDefaultFocusTraversalPolicy(AFocusTraversalPolicy.get()); - } // AKeyboardFocusManager - -} // AKeyboardFocusManager diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ALayout.java b/org.adempiere.ui.swing/src/org/compiere/apps/ALayout.java deleted file mode 100644 index 3b6ba7bf87..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ALayout.java +++ /dev/null @@ -1,418 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.LayoutManager; -import java.awt.LayoutManager2; -import java.util.Arrays; -import java.util.Iterator; - -/** - * Application Layout Manager. - * - * panel.setLayout(new ALayout()); - * panel.add(field11, new ALayoutConstraint(0,0)); - * panel.add(field12, null); - * panel.add(field13, null); - * panel.add(field14, null); - * panel.add(field21, new ALayoutConstraint(1,0)); - * - * - * @author Jorg Janke - * @version $Id: ALayout.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class ALayout implements LayoutManager2 -{ - /** - * Default Constructor with spacing of 2 and columns filled - */ - public ALayout() - { - this (2,4, true); - } // ALayout - - /** - * Detail Contructor - * @param spaceH horizontal space (top, between rows, button) - * @param spaceV vertical space (left, between columns, right) - * @param colFill fields are fully filled (rather then preferred size) - */ - public ALayout(int spaceH, int spaceV, boolean colFill) - { - setSpaceH(spaceH); - setSpaceV(spaceV); - m_colFill = colFill; - } // ALayout - - /** Data Storage */ - private ALayoutCollection m_data = new ALayoutCollection(); - /** Horizontal Space */ - private int m_spaceH; - /** Vertical Space */ - private int m_spaceV; - /** Column Fill */ - private boolean m_colFill; - - /** - * Add To Layout with NULL constraint - * - * @param name the string to be associated with the component - ignored - * @param comp the component to be added - */ - public void addLayoutComponent(String name, Component comp) - { - addLayoutComponent (comp, null); - } // addLayoutComponent - - /** - * Adds the specified component to the layout, using the specified - * constraint object. If the constraint is not a ALayoutConstraint - * the component is added with a NULL constraint. - *

    - * Components with a NULL constraint are added as the next column to the last row - * - * @param component the component to be added - * @param constraint where/how the component is added to the layout. - * @see ALayoutConstraint - */ - public void addLayoutComponent(Component component, Object constraint) - { - ALayoutConstraint con = null; - if (constraint instanceof ALayoutConstraint) - con = (ALayoutConstraint)constraint; - // - m_data.put(con, component); - } // addLayoutComponent - - /** - * Removes the specified component from the layout. - * @param comp the component to be removed - */ - public void removeLayoutComponent(Component comp) - { - if (!m_data.containsValue(comp)) - return; - Iterator it = m_data.keySet().iterator(); - while (it.hasNext()) - { - Object key = it.next(); - if (m_data.get(key).equals(comp)) - { - m_data.remove(key); - return; - } - } - } // removeLayoutComponent - - /** - * Calculates the preferred size dimensions for the specified - * container, given the components it contains. - * @param parent the container to be laid out - * @return Size - * @see #minimumLayoutSize - */ - public Dimension preferredLayoutSize(Container parent) - { - return calculateLayoutSize (parent, 'P'); - } // preferredLayoutSize - - /** - * Calculates the minimum size dimensions for the specified - * container, given the components it contains. - * @param parent the component to be laid out - * @return Size - * @see #preferredLayoutSize - */ - public Dimension minimumLayoutSize(Container parent) - { - return calculateLayoutSize (parent, 'm'); - } // minimumLayoutSize - - /** - * Calculates the maximum size dimensions for the specified container, - * given the components it contains. - * @param parent Parent Container - * @return Size - * @see java.awt.Component#getMaximumSize - * @see LayoutManager - */ - public Dimension maximumLayoutSize(Container parent) - { - return calculateLayoutSize (parent, 'M'); - } // maximumLayoutSize - - /** - * Calculate Layout Size - * @param parent Parent Container - * @param how P=Preferred - M=Maximum = m=Mimimum - * @return Size - */ - private Dimension calculateLayoutSize(Container parent, char how) - { - checkComponents(parent); - // -- Create 2D Dimension Array - int rows = getRowCount(); - int cols = getColCount(); - Dimension[][] dim = new Dimension[rows][cols]; - // - Object[] keys = m_data.keySet().toArray(); - Arrays.sort(keys); - for (int i = 0; i < keys.length; i++) - { - ALayoutConstraint constraint = (ALayoutConstraint)keys[i]; - Component component = (Component)m_data.get(keys[i]); - Dimension d = null; - if (how == 'P') - d = component.getPreferredSize(); - else if (how == 'M') - d = component.getMaximumSize(); - else - d = component.getMinimumSize(); - if (component.isVisible()) - dim [constraint.getRow()][constraint.getCol()] = d; - else - dim [constraint.getRow()][constraint.getCol()] = null; - } - - // -- Calculate 2D Dimension Size - Insets insets = parent.getInsets(); - Dimension retValue = new Dimension (insets.left+insets.right, insets.top+insets.bottom); - retValue.height += m_spaceH; - retValue.width += m_spaceV; - int maxWidth = 0; - for (int r = 0; r < rows; r++) - { - int height = 0; - int width = 0; - for (int c = 0; c < cols; c++) - { - Dimension d = dim[r][c]; - if (d != null) - { - width += d.width; - height = Math.max(height, d.height); - } - width += m_spaceV; - } // for all columns - retValue.height += height + m_spaceH; - maxWidth += Math.max(maxWidth, width); - } // for all rows - retValue.width += maxWidth; - // Log.trace(this,Log.l6_Database, "ALayout.calculateLayoutSize", retValue.toString()); - return retValue; - } // calculateLayoutSize - - /** - * Lays out the specified container. - * @param parent the container to be laid out - */ - public void layoutContainer(Container parent) - { - checkComponents(parent); - // -- Create 2D Component Array - int rows = getRowCount(); - int cols = getColCount(); - Component[][] com = new Component[rows][cols]; - // - Object[] keys = m_data.keySet().toArray(); - Arrays.sort(keys); - for (int i = 0; i < keys.length; i++) - { - ALayoutConstraint constraint = (ALayoutConstraint)keys[i]; - Component component = (Component)m_data.get(keys[i]); - if (component.isVisible()) - com [constraint.getRow()][constraint.getCol()] = component; - else - com [constraint.getRow()][constraint.getCol()] = null; - } - - // -- Calculate Column Size - int[] colWidth = new int[cols]; - int[] rowHeight = new int[rows]; - int columnWidth = m_spaceV; - for (int c = 0; c < cols; c++) - { - int width = 0; - for (int r = 0; r < rows; r++) - { - Component component = com[r][c]; - if (component != null) - { - width = Math.max (width, component.getPreferredSize().width); - rowHeight[r] = Math.max (rowHeight[r], component.getPreferredSize().height); - } - } - colWidth[c] = width; - columnWidth += width + m_spaceV; - } - - // -- Stretch/Squeeze Columns to fit target width - int parentWidth = parent.getSize().width; - double multiplier = (double)parentWidth / (double)columnWidth; - if (multiplier < .5) // limit sqeezing - multiplier = .5; - for (int c = 0; c < cols; c++) - colWidth[c] = (int) (colWidth[c] * multiplier); - int spaceV = (int)(m_spaceV * multiplier); - // -// log.fine( "ALayout.layoutContainer", -// "ParentWidth=" + parentWidth + ", ColumnWidth=" + columnWidth + ", SpaceV=" + spaceV + ", Multiplier=" + multiplier); - - // -- Lay out components - Insets insets = parent.getInsets(); - int posH = insets.top + m_spaceH; - for (int r = 0; r < rows; r++) - { - int posV = insets.left + spaceV; - int height = 0; - for (int c = 0; c < cols; c++) - { - Component component = com[r][c]; - if (component != null) - { - Dimension ps = component.getPreferredSize(); - int w = ps.width; - if (m_colFill || w > colWidth[c]) // limit or stretch - w = colWidth[c]; - int h = ps.height; - int topSpace = 0; - if (h < rowHeight[r]) // push a little bit lower - topSpace = (rowHeight[r] - h) / 3; - height = Math.max(height, h); - component.setBounds(posV, posH+topSpace, w, h); -// log.fine( "ALayout.layoutContainer", -// "Row=" + r + ", Col=" + c + ", PosV=" + posV + ", PosH=" + posH + "/" + topSpace + ", width=" + w + ", height=" + h); - } - posV += colWidth[c] + spaceV; - } // for all columns - posH += height + m_spaceH; - } // for all rows - } // layoutContainer - - /** - * Returns the alignment along the x axis. This specifies how - * the component would like to be aligned relative to other - * components. The value should be a number between 0 and 1 - * where 0 represents alignment along the origin, 1 is aligned - * the furthest away from the origin, 0.5 is centered, etc. - * @param target target - * @return 0f - */ - public float getLayoutAlignmentX(Container target) - { - return 0f; - } // getLayoutAlignmentX - - /** - * Returns the alignment along the y axis. This specifies how - * the component would like to be aligned relative to other - * components. The value should be a number between 0 and 1 - * where 0 represents alignment along the origin, 1 is aligned - * the furthest away from the origin, 0.5 is centered, etc. - * @param target target - * @return 0f - */ - public float getLayoutAlignmentY(Container target) - { - return 0f; - } // getLayoutAlignmentY - - /** - * Invalidates the layout, indicating that if the layout manager - * has cached information it should be discarded. - * @param target target - */ - public void invalidateLayout(Container target) - { - } // invalidateLayout - - /*************************************************************************/ - - /** - * Check target components and add components, which don't have no constraints - * @param target target - */ - private void checkComponents (Container target) - { - int size = target.getComponentCount(); - for (int i = 0; i < size; i++) - { - Component comp = target.getComponent(i); - if (!m_data.containsValue(comp)) - m_data.put(null, comp); - } - } // checkComponents - - /** - * Get Number of Rows - * @return no pf rows - */ - public int getRowCount() - { - return m_data.getMaxRow()+1; - } // getRowCount - - /** - * Get Number of Columns - * @return no of cols - */ - public int getColCount() - { - return m_data.getMaxCol()+1; - } // getColCount - - /** - * Set Horizontal Space (top, between rows, button) - * @param spaceH horizontal space (top, between rows, button) - */ - public void setSpaceH (int spaceH) - { - m_spaceH = spaceH; - } // setSpaceH - - /** - * Get Horizontal Space (top, between rows, button) - * @return spaceH horizontal space (top, between rows, button) - */ - public int getSpaceH() - { - return m_spaceH; - } // getSpaceH - - /** - * Set Vertical Space (left, between columns, right) - * @param spaceV vertical space (left, between columns, right) - */ - public void setSpaceV(int spaceV) - { - m_spaceV = spaceV; - } // setSpaceV - - /** - * Get Vertical Space (left, between columns, right) - * @return spaceV vertical space (left, between columns, right) - */ - public int getSpaceV() - { - return m_spaceV; - } // getSpaceV - -} // ALayout diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ALayoutCollection.java b/org.adempiere.ui.swing/src/org/compiere/apps/ALayoutCollection.java deleted file mode 100644 index bf660142f9..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ALayoutCollection.java +++ /dev/null @@ -1,135 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.Component; -import java.util.HashMap; -import java.util.Iterator; - -/** - * Collection of Components ordered based on ALayoutConstraint - * - * @author Jorg Janke - * @version $Id: ALayoutCollection.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -class ALayoutCollection extends HashMap -{ - /** - * - */ - private static final long serialVersionUID = -2906536401026546141L; - - /** - * Create Collection - */ - public ALayoutCollection() - { - super(); - } // ALayoutCollection - - /** - * Add a Component. - * If constraint is null, it is added to the last row as additional column - * @param constraint - * @param component - * @return component - * @throws IllegalArgumentException if component is not a Component - */ - public Object put (Object constraint, Object component) - { - if (!(component instanceof Component)) - throw new IllegalArgumentException ("ALayoutCollection can only add Component values"); - - if (constraint != null - && !containsKey(constraint) - && constraint instanceof ALayoutConstraint) - { - // Log.trace(this,Log.l6_Database, "ALayoutCollection.put", constraint.toString()); - return super.put (constraint, component); - } - - // We need to create constraint - if (super.size() == 0) - { - // Log.trace(this,Log.l6_Database, "ALayoutCollection.put - first"); - return super.put(new ALayoutConstraint(0,0), component); - } - - // Add to end of list - int row = getMaxRow(); - if (row == -1) - row = 0; - int col = getMaxCol(row) + 1; - ALayoutConstraint next = new ALayoutConstraint(row, col); - // Log.trace(this,Log.l6_Database, "ALayoutCollection.put - addEnd", next.toString()); - return super.put(next, component); - } // put - - /** - * Get Maximum Row Number - * @return max row no - or -1 if no row - */ - public int getMaxRow () - { - int maxRow = -1; - // - Iterator i = keySet().iterator(); - while (i.hasNext()) - { - ALayoutConstraint c = (ALayoutConstraint)i.next(); - maxRow = Math.max(maxRow, c.getRow()); - } - return maxRow; - } // getMaxRow - - /** - * Get Maximum Column Number - * @return max col no - or -1 if no column - */ - public int getMaxCol () - { - int maxCol = -1; - // - Iterator i = keySet().iterator(); - while (i.hasNext()) - { - ALayoutConstraint c = (ALayoutConstraint)i.next(); - maxCol = Math.max(maxCol, c.getCol()); - } - return maxCol; - } // getMaxCol - - /** - * Get Maximum Column Number for Row - * @param row - * @return max col no for row - or -1 if no col in row - */ - public int getMaxCol (int row) - { - int maxCol = -1; - // - Iterator i = keySet().iterator(); - while (i.hasNext()) - { - ALayoutConstraint c = (ALayoutConstraint)i.next(); - if (c.getRow() == row) - maxCol = Math.max(maxCol, c.getCol()); - } - return maxCol; - } // getMaxCol - -} // ALayoutCollection diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ALayoutConstraint.java b/org.adempiere.ui.swing/src/org/compiere/apps/ALayoutConstraint.java deleted file mode 100644 index 718fce2006..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ALayoutConstraint.java +++ /dev/null @@ -1,122 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - - -/** - * Application Layout Constraint to indicate grid position (immutable) - * - * @author Jorg Janke - * @version $Id: ALayoutConstraint.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class ALayoutConstraint implements Comparable -{ - /** - * Layout Constraint to indicate grid position - * @param row row 0..x - * @param col column 0..x - */ - public ALayoutConstraint(int row, int col) - { - m_row = row; - m_col = col; - } // ALayoutConstraint - - /** - * Create Next in Row - * @return ALayoutConstraint for additional column in same row - */ - public ALayoutConstraint createNext() - { - return new ALayoutConstraint(m_row, m_col+1); - } // createNext - - private int m_row; - private int m_col; - - /** - * Get Row - * @return roe no - */ - public int getRow() - { - return m_row; - } // getRow - - /** - * Get Column - * @return col no - */ - public int getCol() - { - return m_col; - } // getCol - - /** - * Compares this object with the specified object for order. Returns a - * negative integer, zero, or a positive integer as this object is less - * than, equal to, or greater than the specified object.

    - * - * @param o the Object to be compared. - * @return a negative integer if this object is less than the specified object, - * zero if equal, - * or a positive integer if this object is greater than the specified object. - */ - public int compareTo(Object o) - { - ALayoutConstraint comp = null; - if (o instanceof ALayoutConstraint) - comp = (ALayoutConstraint)o; - if (comp == null) - return +111; - - // Row compare - int rowComp = m_row - comp.getRow(); - if (rowComp != 0) - return rowComp; - // Column compare - return m_col - comp.getCol(); - } // compareTo - - /** - * Is Object Equal - * @param o - * @return true if equal - */ - public boolean equals(Object o) - { - if (o instanceof ALayoutConstraint) - return compareTo(o) == 0; - return false; - } // equal - - public int hashCode() - { - assert false : "hashCode not designed"; - return 42; // any arbitrary constant will do - } - - /** - * To String - * @return info - */ - public String toString() - { - return "ALayoutConstraint [Row=" + m_row + ", Col=" + m_col + "]"; - } // toString - -} // ALayoutConstraint diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java b/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java deleted file mode 100644 index 1e720e6f11..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java +++ /dev/null @@ -1,1235 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.WindowEvent; -import java.rmi.AccessException; -import java.sql.Timestamp; -import java.util.Locale; -import java.util.Properties; -import java.util.ResourceBundle; -import java.util.logging.Level; - -import javax.swing.JOptionPane; -import javax.swing.JPasswordField; -import javax.swing.SwingConstants; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.Adempiere; -import org.compiere.db.CConnection; -import org.compiere.db.CConnectionEditor; -import org.compiere.grid.ed.VComboBox; -import org.compiere.grid.ed.VDate; -import org.compiere.model.MSysConfig; -import org.compiere.model.MSystem; -import org.compiere.model.MUser; -import org.compiere.print.CPrinter; -import org.compiere.swing.CButton; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTabbedPane; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Ini; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Language; -import org.compiere.util.Login; -import org.compiere.util.Msg; -import org.compiere.util.Trx; -import org.compiere.util.Util; -import org.compiere.util.ValueNamePair; - -/** - * Application Login Window - * - * @author Jorg Janke - * @version $Id: ALogin.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public final class ALogin extends CDialog - implements ActionListener, ChangeListener -{ - /** - * - */ - private static final long serialVersionUID = -4397663968578607998L; - - /** - * Construct the dialog. - * Need to call initLogin for dynamic start - * @param parent parent - */ - public ALogin (Frame parent) - { - super (parent, "Login", true); // Modal - log.finer(""); - setDefaultCloseOperation(DISPOSE_ON_CLOSE); - m_WindowNo = AEnv.createWindowNo (null); - res = ResourceBundle.getBundle(RESOURCE); - // - try - { - jbInit(); - } - catch(Exception e) - { - log.severe(e.toString()); - } - // Focus to OK - this.getRootPane().setDefaultButton(confirmPanel.getOKButton()); - parent.setIconImage(Adempiere.getImage16()); - } // ALogin - - - public static final String ROLE_TYPES_SWING = "NULL,SW,SS"; //swing,support+null - protected static final String RESOURCE = "org.compiere.apps.ALoginRes"; - private static ResourceBundle res = ResourceBundle.getBundle(RESOURCE); - /** Logger */ - private static CLogger log = CLogger.getCLogger(ALogin.class); - - private static final int TAB_CONNECTION = 0; - private static final int TAB_DEFAULTS = 1; - private static final int TAB_CHANGE_PASSWORD = 2; - - private static final int NOT_CONNECTED = -1; - private static final int CONNECTED_OK = 0; - private static final int CONNECTED_OK_WITH_PASSWORD_EXPIRED = 1; - - private static final int NO_OF_SECURITY_QUESTION = 5; - private static final String SECURITY_QUESTION_PREFIX = "SecurityQuestion_"; - - private CPanel mainPanel = new CPanel(new BorderLayout()); - private CTabbedPane loginTabPane = new CTabbedPane(); - private CPanel connectionPanel = new CPanel(); - private CLabel hostLabel = new CLabel(); - private CConnectionEditor hostField = new CConnectionEditor(); - private CLabel userLabel = new CLabel(); - private CTextField userTextField = new CTextField(); - private CLabel passwordLabel = new CLabel(); - private JPasswordField passwordField = new JPasswordField(); - private CPanel defaultPanel = new CPanel(); - private CLabel clientLabel = new CLabel(); - private CLabel orgLabel = new CLabel(); - private CLabel dateLabel = new CLabel(); - private VDate dateField = new VDate(DisplayType.Date); - private VComboBox orgCombo = new VComboBox(); - private VComboBox clientCombo = new VComboBox(); - private CLabel warehouseLabel = new CLabel(); - private VComboBox warehouseCombo = new VComboBox(); - private CLabel printerLabel = new CLabel(); - private CPrinter printerField = new CPrinter(); - private CLabel roleLabel = new CLabel(); - private VComboBox roleCombo = new VComboBox(); - private CLabel copy0Label = new CLabel(); - private CLabel titleLabel = new CLabel(); - private CLabel versionLabel = new CLabel(); - private CLabel copy1Label = new CLabel(); - private GridBagLayout connectionLayout = new GridBagLayout(); - private GridBagLayout defaultPanelLayout = new GridBagLayout(); - private CLabel languageLabel = new CLabel(); - private VComboBox languageCombo = null; - private CLabel compileDate = new CLabel(); - private CPanel southPanel = new CPanel(); - private BorderLayout southLayout = new BorderLayout(); - private StatusBar statusBar = new StatusBar(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true, false, false, false, false, false, false); - - // IDEMPIERE-373 Implement User Locking - private CPanel changePasswordPanel = new CPanel(); - private GridBagLayout changePasswordPanelLayout = new GridBagLayout(); - private CLabel lblOldPassword = new CLabel(); - private CLabel lblNewPassword = new CLabel(); - private CLabel lblRetypeNewPassword = new CLabel(); - private JPasswordField txtOldPassword = new JPasswordField(); - private JPasswordField txtNewPassword = new JPasswordField(); - private JPasswordField txtRetypeNewPassword = new JPasswordField(); - // - private CLabel lblSecurityQuestion = new CLabel(); - private CLabel lblAnswer = new CLabel(); - private VComboBox lstSecurityQuestion = new VComboBox(); - private CTextField txtAnswer = new CTextField(); - - /** Server Connection */ - private CConnection m_cc; - /** Application User */ - private String m_user; - /** Application Password */ - private char[] m_pwd = new char[0]; - - /** Combo Active */ - private boolean m_comboActive = false; - /** Combo Active */ - private boolean m_okPressed = false; - /** Connection OK */ - private int m_connectionOK = -1; - /** Window No */ - private int m_WindowNo; - /** Context */ - private Properties m_ctx = Env.getCtx(); - - private Login m_login = null; - - - /************************************************************************** - * Component initialization - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setName("Login"); - //red1 - giving names to input fields for UISpec4J calling during tests - orgCombo.setName("orgCombo"); - clientCombo.setName("clientCombo"); - userTextField.setName("userTextField"); - passwordField.setName("passwordField"); - - if (DB.isConnected()) - Env.getLoginLanguages(); // to fill the s_language array on Language - languageCombo = new VComboBox(Language.getNames()); - - //red1 - end - - titleLabel.setFont(new java.awt.Font("Serif", 2, 10)); - titleLabel.setForeground(Color.blue); - titleLabel.setRequestFocusEnabled(false); - titleLabel.setToolTipText(Adempiere.getURL()); - titleLabel.setHorizontalTextPosition(SwingConstants.CENTER); - titleLabel.setIcon(Adempiere.getImageIconLogo()); - titleLabel.setText(Adempiere.getSubtitle()); - titleLabel.setVerticalTextPosition(SwingConstants.BOTTOM); - versionLabel.setRequestFocusEnabled(false); - versionLabel.setHorizontalAlignment(SwingConstants.RIGHT); - versionLabel.setHorizontalTextPosition(SwingConstants.RIGHT); - hostLabel.setRequestFocusEnabled(false); - hostLabel.setLabelFor(hostField); - hostField.addActionListener(this); - userLabel.setRequestFocusEnabled(false); - userLabel.setLabelFor(userTextField); - passwordLabel.setRequestFocusEnabled(false); - passwordLabel.setLabelFor(passwordField); - languageLabel.setLabelFor(languageCombo); - copy0Label.setFont(new java.awt.Font("Serif", 2, 10)); - copy0Label.setForeground(Color.blue); - copy0Label.setRequestFocusEnabled(false); - copy1Label.setRequestFocusEnabled(false); - roleLabel.setRequestFocusEnabled(false); - roleLabel.setLabelFor(roleCombo); - clientLabel.setRequestFocusEnabled(false); - orgLabel.setRequestFocusEnabled(false); - dateLabel.setRequestFocusEnabled(false); - warehouseLabel.setRequestFocusEnabled(false); - printerLabel.setRequestFocusEnabled(false); - compileDate.setHorizontalAlignment(SwingConstants.RIGHT); - compileDate.setHorizontalTextPosition(SwingConstants.RIGHT); - compileDate.setText(Adempiere.DATE_VERSION); - compileDate.setToolTipText(Adempiere.getImplementationVendor()); - southPanel.setLayout(southLayout); - loginTabPane.addChangeListener(this); - - // ConnectionTab - connectionPanel.setLayout(connectionLayout); - // - titleLabel.setHorizontalAlignment(SwingConstants.CENTER); - versionLabel.setText(Adempiere.MAIN_VERSION); - versionLabel.setToolTipText(Adempiere.getImplementationVersion()); - hostLabel.setHorizontalAlignment(SwingConstants.RIGHT); - hostLabel.setText("Host"); - hostLabel.setLabelFor(hostField); - connectionPanel.add(hostLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); - connectionPanel.add(hostField, new GridBagConstraints(1, 2, 3, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 12), 0, 0)); - userLabel.setHorizontalAlignment(SwingConstants.RIGHT); - userLabel.setText("User"); - userLabel.setLabelFor(userTextField); - connectionPanel.add(userLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); - userTextField.setText("System"); // default - connectionPanel.add(userTextField, new GridBagConstraints(1, 3, 3, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 12), 0, 0)); - passwordLabel.setHorizontalAlignment(SwingConstants.RIGHT); - passwordLabel.setText("Password"); - passwordLabel.setLabelFor(passwordField); - connectionPanel.add(passwordLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - passwordField.setText("System"); // default - connectionPanel.add(passwordField, new GridBagConstraints(1, 4, 3, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0)); - languageLabel.setHorizontalAlignment(SwingConstants.RIGHT); - languageLabel.setText("Language"); - languageLabel.setLabelFor(languageCombo); - languageCombo.addActionListener(this); - // @Trifon - begin - connectionPanel.add(languageLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); - connectionPanel.add(languageCombo, new GridBagConstraints(1, 5, 3, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 12), 0, 0)); - // @Trifon - end - copy0Label.setHorizontalAlignment(SwingConstants.RIGHT); - connectionPanel.add(copy0Label, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - - copy1Label.setText(Adempiere.COPYRIGHT); - connectionPanel.add(copy1Label, new GridBagConstraints(1, 6, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 12, 12), 0, 0)); - connectionPanel.add(compileDate, new GridBagConstraints(2, 1, 2, 1, 0.0, 0.0 - ,GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(2, 0, 0, 12), 0, 0)); - connectionPanel.add(titleLabel, new GridBagConstraints(0, 0, 2, 2, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - connectionPanel.add(versionLabel, new GridBagConstraints(2, 0, 2, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 5, 0, 12), 0, 0)); - - loginTabPane.add(connectionPanel, res.getString("Connection")); - - // DefaultTab - defaultPanel.setLayout(defaultPanelLayout); - // - clientLabel.setText("Client"); - clientLabel.setHorizontalAlignment(SwingConstants.RIGHT); - clientLabel.setLabelFor(clientCombo); - clientCombo.addActionListener(this); - defaultPanel.add(clientLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - defaultPanel.add(clientCombo, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - roleLabel.setText("Role"); - roleLabel.setHorizontalAlignment(SwingConstants.RIGHT); - roleLabel.setLabelFor(roleCombo); - roleCombo.addActionListener(this); - defaultPanel.add(roleLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); - defaultPanel.add(roleCombo, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 12), 0, 0)); - orgLabel.setText("Organization"); - orgLabel.setHorizontalAlignment(SwingConstants.RIGHT); - orgLabel.setLabelFor(orgCombo); - defaultPanel.add(orgLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - orgCombo.addActionListener(this); - defaultPanel.add(orgCombo, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0)); - dateLabel.setText("Date"); - dateLabel.setHorizontalAlignment(SwingConstants.RIGHT); - dateLabel.setLabelFor(dateField); - defaultPanel.add(dateLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); - defaultPanel.add(dateField, new GridBagConstraints(1, 4, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 12), 0, 0)); - // - warehouseLabel.setText("Warehouse"); - warehouseLabel.setHorizontalAlignment(SwingConstants.RIGHT); - warehouseLabel.setLabelFor(warehouseCombo); - printerLabel.setText("Printer"); - printerLabel.setHorizontalAlignment(SwingConstants.RIGHT); - printerLabel.setLabelFor(printerField); - - defaultPanel.add(printerLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 12, 5), 0, 0)); - defaultPanel.add(printerField, new GridBagConstraints(1, 5, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 12, 12), 0, 0)); - - defaultPanel.add(warehouseLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); - defaultPanel.add(warehouseCombo, new GridBagConstraints(1, 3, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 12), 0, 0)); - - // @Trifon - begin -/* - defaultPanel.add(languageLabel, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0 - , GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); - defaultPanel.add(languageCombo, new GridBagConstraints(1, 6, 3, 1, 1.0, 0.0 - , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 12), 0, 0)); -*/ - // @Trifon - end - // - loginTabPane.add(defaultPanel, res.getString("Defaults")); - - // IDEMPIERE-373 Implement User Locking - txtOldPassword.setName("txtOldPassword"); - lblOldPassword.setRequestFocusEnabled(false); - lblOldPassword.setLabelFor(txtOldPassword); - lblOldPassword.setHorizontalAlignment(SwingConstants.RIGHT); - lblOldPassword.setText(Msg.getMsg(m_ctx, "Old Password")); - - txtNewPassword.setName("txtNewPassword"); - lblNewPassword.setRequestFocusEnabled(false); - lblNewPassword.setLabelFor(txtNewPassword); - lblNewPassword.setHorizontalAlignment(SwingConstants.RIGHT); - lblNewPassword.setText(Msg.getMsg(m_ctx, "New Password")); - - txtRetypeNewPassword.setName("txtRetypeNewPassword"); - lblRetypeNewPassword.setRequestFocusEnabled(false); - lblRetypeNewPassword.setLabelFor(txtRetypeNewPassword); - lblRetypeNewPassword.setHorizontalAlignment(SwingConstants.RIGHT); - lblRetypeNewPassword.setText(Msg.getMsg(m_ctx, "New Password Confirm")); - - lstSecurityQuestion.setName("lstSecurityQuestion"); - lblSecurityQuestion.setRequestFocusEnabled(false); - lblSecurityQuestion.setLabelFor(lstSecurityQuestion); - lblSecurityQuestion.setHorizontalAlignment(SwingConstants.RIGHT); - lblSecurityQuestion.setText(Msg.getMsg(m_ctx, "SecurityQuestion")); - - lstSecurityQuestion.removeAllItems(); - for (int i = 1; i <= NO_OF_SECURITY_QUESTION; i++) - lstSecurityQuestion.addItem(new ValueNamePair(SECURITY_QUESTION_PREFIX + i, Msg.getMsg(m_ctx, SECURITY_QUESTION_PREFIX + i))); - - txtAnswer.setName("txtAnswer"); - lblAnswer.setRequestFocusEnabled(false); - lblAnswer.setLabelFor(txtAnswer); - lblAnswer.setHorizontalAlignment(SwingConstants.RIGHT); - lblAnswer.setText(Msg.getMsg(m_ctx, "Answer")); - - changePasswordPanel.setLayout(changePasswordPanelLayout); - - changePasswordPanel.add(lblOldPassword, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - changePasswordPanel.add(txtOldPassword, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - changePasswordPanel.add(lblNewPassword, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - changePasswordPanel.add(txtNewPassword, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - changePasswordPanel.add(lblRetypeNewPassword, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - changePasswordPanel.add(txtRetypeNewPassword, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - changePasswordPanel.add(lblSecurityQuestion, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - changePasswordPanel.add(lstSecurityQuestion, new GridBagConstraints(1, 3, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - changePasswordPanel.add(lblAnswer, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - changePasswordPanel.add(txtAnswer, new GridBagConstraints(1, 4, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - loginTabPane.add(changePasswordPanel, res.getString("ChangePassword")); - loginTabPane.setEnabledAt(TAB_CHANGE_PASSWORD, false); - // - - // Help - /* - helpPanel.setLayout(helpLayout); - helpPanel.setPreferredSize(new Dimension (100,100)); - helpPanel.add(helpScollPane, BorderLayout.CENTER); - loginTabPane.add(helpPanel, "?");*/ - // - this.getContentPane().add(mainPanel); - mainPanel.add(loginTabPane, BorderLayout.CENTER); - mainPanel.setName("loginMainPanel"); - mainPanel.add(southPanel, BorderLayout.SOUTH); - // - southPanel.add(confirmPanel, BorderLayout.NORTH); - southPanel.add(statusBar, BorderLayout.SOUTH); - //helpScollPane.getViewport().add(onlineHelp, null); - confirmPanel.addActionListener(this); - - CButton helpBtn = new CButton(Env.getImageIcon2("Help24")); - helpBtn.setActionCommand("onlineLoginHelp"); - helpBtn.addActionListener(this); - helpBtn.setToolTipText(res.getString("Help")); - confirmPanel.addComponent(helpBtn); - - statusBar.setStatusDB(null); - } // jbInit - - /** - * Set Initial & Ini Parameters - * Optional Automatic login - * @return true, if connected & parameters set - */ - public boolean initLogin() - { - m_cc = CConnection.get(); - hostField.setValue(m_cc); - - if ( Ini.isPropertyBool(Ini.P_VALIDATE_CONNECTION_ON_STARTUP)) { - validateConnection(); - } - - // Application/PWD - userTextField.setText(Ini.getProperty(Ini.P_UID)); - if (Ini.isPropertyBool(Ini.P_STORE_PWD)) - passwordField.setText(Ini.getProperty(Ini.P_PWD)); - else - passwordField.setText(""); - // - languageCombo.setSelectedItem(Ini.getProperty(Ini.P_LANGUAGE)); - - // AutoLogin - assumes that connection is OK - if (Ini.isPropertyBool(Ini.P_A_LOGIN)) - { - connectionOK (); - defaultsOK (); - if (m_connectionOK >= 0) // simulate - m_okPressed = true; - return m_connectionOK >= 0; - } - return false; - } // initLogin - - /** - * Window Events - requestFocus - * @param e event - */ - protected void processWindowEvent(WindowEvent e) - { - super.processWindowEvent(e); - if (e.getID() == WindowEvent.WINDOW_OPENED) - { - this.toFront(); - confirmPanel.getOKButton().requestFocusInWindow(); - } - } // processWindowEvent - - private void connectToDatabase() { - //Check connection - DB.setDBTarget(m_cc); - - //direct - DB.connect(); - } - - /** - * Validate Connection - */ - private void validateConnection() - { - m_connectionOK = -1; - - //make sure connecting to new database - DB.closeTarget(); - connectToDatabase(); - // - hostField.setDisplay(); - } // validateConnection - - - /************************************************************************* - * Exit action performed - */ - private void appExit() - { - m_connectionOK = -1; - dispose(); - } // appExit_actionPerformed - - - /** - * Return true, if logged in - * @return true if connected - */ - public boolean isConnected() - { - return m_connectionOK >= -1; - } // isConnected - - /** - * Did the user press OK - * @return true if user pressed final OK button - */ - public boolean isOKpressed() - { - return m_okPressed; - } // isOKpressed - - /************************************************************************** - * Action Event handler - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - confirmPanel.getOKButton().setEnabled(false); - - if (loginTabPane.getSelectedIndex() == TAB_CONNECTION) { - connectionOK(); // first ok - printerField.refresh(); - } - else if (loginTabPane.getSelectedIndex() == TAB_CHANGE_PASSWORD) - { - validateChangePassword(); - } - else - { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - m_okPressed = true; - // Dispose if OK - teo_sarca [ 1674663 ] - if(!defaultsOK()) - m_okPressed = false; - setCursor(Cursor.getDefaultCursor()); - } - - confirmPanel.getOKButton().setEnabled(true); - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - appExit(); - // - else if (e.getSource() == hostField) { - validateConnection(); - languageComboChanged(); - } - else if (e.getSource() == languageCombo) - languageComboChanged(); - // - else if (e.getSource() == clientCombo) - clientComboChanged(); - else if (e.getSource() == roleCombo) - roleComboChanged(); - else if (e.getSource() == orgCombo) - orgComboChanged(); - else if ("onlineLoginHelp".equals(e.getActionCommand())) - OnlineHelp.openInDefaultBrowser(); - } // actionPerformed - - - /************************************************************************** - * Connection OK pressed - */ - private void connectionOK () - { - log.info(""); - // - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - confirmPanel.getOKButton().setEnabled(false); - - m_connectionOK = tryConnection(); - - if (m_connectionOK >= 0) - { - // Verify Language & Load Msg - Language l = Language.getLoginLanguage(); - Env.verifyLanguage (m_ctx, l); - Env.setContext(m_ctx, Env.LANGUAGE, l.getAD_Language()); - Msg.getMsg(m_ctx, "0"); - - // Migration - MSystem system = MSystem.get(m_ctx); - if (system.isJustMigrated()) - { - statusBar.setStatusLine("Running: After Migration ....", true); - ADialog.info (m_WindowNo, this, "AfterMigration"); - Thread.yield(); - DB.afterMigration(m_ctx); - } - // Set Defaults - printerField.setValue(Ini.getProperty(Ini.P_PRINTER)); - - if (m_connectionOK == CONNECTED_OK_WITH_PASSWORD_EXPIRED) - loginTabPane.setSelectedIndex(TAB_CHANGE_PASSWORD); - else // Change Tab to Default - loginTabPane.setSelectedIndex(TAB_DEFAULTS); - } - - confirmPanel.getOKButton().setEnabled(true); - setCursor(Cursor.getDefaultCursor()); - } // connectionOK - - private void validateChangePassword() - { - String oldPassword = new String(txtOldPassword.getPassword()); - String newPassword = new String(txtNewPassword.getPassword()); - String retypeNewPassword = new String(txtRetypeNewPassword.getPassword()); - - String securityQuestion = null; - if (lstSecurityQuestion.getSelectedItem() != null) - securityQuestion = ((ValueNamePair) lstSecurityQuestion.getSelectedItem()).getName(); - String answer = txtAnswer.getText(); - - if (Util.isEmpty(oldPassword)) - { - statusBar.setStatusLine(Msg.getMsg(m_ctx, "OldPasswordMandatory"), true); - return; - } - - if (Util.isEmpty(retypeNewPassword)) - { - statusBar.setStatusLine(Msg.getMsg(m_ctx, "NewPasswordConfirmMandatory"), true); - return; - } - - if (!newPassword.equals(retypeNewPassword)) - { - statusBar.setStatusLine(Msg.getMsg(m_ctx, "PasswordNotMatch"), true); - return; - } - - if (Util.isEmpty(securityQuestion)) - { - statusBar.setStatusLine(Msg.getMsg(m_ctx, "SecurityQuestionMandatory"), true); - return; - } - - if (Util.isEmpty(answer)) - { - statusBar.setStatusLine(Msg.getMsg(m_ctx, "AnswerMandatory"), true); - return; - } - - String m_userPassword = new String(m_pwd); - if (!oldPassword.equals(m_userPassword)) - { - statusBar.setStatusLine(Msg.getMsg(m_ctx, "OldPasswordNoMatch"), true); - return; - } - - if (MSysConfig.getBooleanValue(MSysConfig.CHANGE_PASSWORD_MUST_DIFFER, true)) - { - if (oldPassword.equals(newPassword)) - { - statusBar.setStatusLine(Msg.getMsg(m_ctx, "NewPasswordMustDiffer"), true); - return; - } - } - - Trx trx = null; - try - { - String trxName = Trx.createTrxName("ChangePasswordTrx"); - trx = Trx.get(trxName, true); - - for (int index = 0; index < clientCombo.getItemCount(); index++) - { - KeyNamePair clientKNPair = (KeyNamePair) clientCombo.getItemAt(index); - int clientId = clientKNPair.getKey(); - Env.setContext(m_ctx, "#AD_Client_ID", clientId); - MUser user = MUser.get(m_ctx, m_user); - if (user == null) - { - trx.rollback(); - log.severe("Could not find user '" + m_user + "'"); - statusBar.setStatusLine("Could not find user '" + m_user + "'", true); - return; - } - - user.setPassword(newPassword); - user.setIsExpired(false); - user.setSecurityQuestion(securityQuestion); - user.setAnswer(answer); - if (!user.save(trx.getTrxName())) - { - trx.rollback(); - statusBar.setStatusLine("Could not update user", true); - return; - } - } - - trx.commit(); - } - catch (Exception e) - { - if (trx != null) - trx.rollback(); - } - finally - { - if (trx != null) - trx.close(); - } - - passwordField.setText(newPassword); - m_pwd = newPassword.toCharArray(); - m_connectionOK = CONNECTED_OK; - loginTabPane.setSelectedIndex(TAB_DEFAULTS); - } - - /** - * Change of tab <-> - * @param e event - */ - public void stateChanged(ChangeEvent e) - { -// if (loginTabPane.getSelectedIndex() == 3) // allow access to help -// return; - - if (!(String.valueOf(passwordField.getPassword()).equals(String.valueOf(m_pwd)) - && userTextField.getText().equals(m_user))) - m_connectionOK = -1; - // - if (m_connectionOK == CONNECTED_OK_WITH_PASSWORD_EXPIRED) - { - statusBar.setStatusLine(txt_PasswordExpired); - loginTabPane.setSelectedIndex(TAB_CHANGE_PASSWORD); - } - else if (m_connectionOK == CONNECTED_OK) - statusBar.setStatusLine(txt_LoggedIn); - else - { - statusBar.setStatusLine(txt_NotConnected, true); - loginTabPane.setSelectedIndex(TAB_CONNECTION); - } - confirmPanel.getOKButton().requestFocus(); - } // loginTabPane - - - /************************************************************************** - * Defaults OK pressed - * @return true if ok - */ - private boolean defaultsOK () - { - log.info(""); - - KeyNamePair org = (KeyNamePair)orgCombo.getSelectedItem(); - if (org == null) - return false; - - // Set Properties - Ini.setProperty(Ini.P_CONNECTION, CConnection.get().toStringLong()); - Ini.setProperty(Ini.P_LANGUAGE, (String)languageCombo.getSelectedItem()); - - String error = m_login.validateLogin(org); - if (error != null && error.length() > 0) - { - ADialog.info(m_WindowNo, this, error); - appExit(); - return false; - } - - // Load Properties and save Ini values - statusBar.setStatusLine("Loading Preferences"); - String msg = m_login.loadPreferences (org, - (KeyNamePair)warehouseCombo.getSelectedItem(), - dateField.getTimestamp(), printerField.getDisplay()); - if (msg.length() > 0) - ADialog.info(m_WindowNo, this, msg); - - // Check Apps Server - DB Checked in Menu - checkVersion(); // exits if conflict - - // Close - we are done - if (m_connectionOK >= 0) - this.dispose(); - return m_connectionOK >= 0; - } // defaultsOK - - - /************************************************************************** - * Try to connect. - * - Get Connection - * - Compare User info - * @return true if connected - */ - private int tryConnection() - { - m_user = userTextField.getText(); - m_pwd = passwordField.getPassword(); - - // Establish connection - if (!DB.isConnected(false)) - validateConnection(); - - if (!DB.isConnected(false)) - { - statusBar.setStatusLine(txt_NoDatabase, true); - hostField.setBackground(AdempierePLAF.getFieldBackground_Error()); - return NOT_CONNECTED; - } - - // Reference check - Ini.setProperty(Ini.P_ADEMPIERESYS, "Reference".equalsIgnoreCase(CConnection.get().getDbUid())); - - // Reference check - Ini.setProperty(Ini.P_LOGMIGRATIONSCRIPT, "Reference".equalsIgnoreCase(CConnection.get().getDbUid())); - - // Get Clients - m_login = new Login(m_ctx); - KeyNamePair[] clients = null; - try - { - clients = m_login.getClients(m_user, new String(m_pwd), ROLE_TYPES_SWING); - if (clients == null || clients.length == 0) - { - String loginErrMsg = m_login.getLoginErrMsg(); - if (loginErrMsg != null && loginErrMsg.length() > 0) - statusBar.setStatusLine(loginErrMsg, true); - else - statusBar.setStatusLine(txt_UserPwdError, true); - - userTextField.setBackground(AdempierePLAF.getFieldBackground_Error()); - passwordField.setBackground(AdempierePLAF.getFieldBackground_Error()); - return NOT_CONNECTED; - } - } - catch (Throwable e) - { - if (e.getCause() instanceof AccessException) - { - statusBar.setStatusLine(txt_UserPwdError, true); - userTextField.setBackground(AdempierePLAF.getFieldBackground_Error()); - passwordField.setBackground(AdempierePLAF.getFieldBackground_Error()); - return NOT_CONNECTED; - } - else - { - log.log(Level.SEVERE, CLogger.getRootCause(e).getLocalizedMessage(), CLogger.getRootCause(e)); - statusBar.setStatusLine(CLogger.getRootCause(e).getLocalizedMessage(), true); - return NOT_CONNECTED; - } - } - - // Delete existing role items - m_comboActive = true; - if (clientCombo.getItemCount() > 0) - clientCombo.removeAllItems(); - - // Initial role - KeyNamePair iniValue = null; - String iniDefault = Ini.getProperty(Ini.P_CLIENT); - - // fill roles - for (int i = 0; i < clients.length; i++) - { - clientCombo.addItem(clients[i]); - if (clients[i].getName().equals(iniDefault)) - iniValue = clients[i]; - } - if (iniValue != null){ - clientCombo.setSelectedItem(iniValue); - } else { - clientCombo.setSelectedItem(clients[0]); - } - - - if (clientCombo.getItemCount() == 1) - { - clientCombo.setSelectedIndex(0); - clientCombo.setVisible(false); - clientLabel.setVisible(false); - } - else - { - clientLabel.setVisible(true); - clientCombo.setVisible(true); - } - - userTextField.setBackground(AdempierePLAF.getFieldBackground_Normal()); - passwordField.setBackground(AdempierePLAF.getFieldBackground_Normal()); - // - this.setTitle(hostField.getDisplay()); - m_comboActive = false; - clientComboChanged(); - - if (m_login.isPasswordExpired()) - { - statusBar.setStatusLine(txt_PasswordExpired); - return CONNECTED_OK_WITH_PASSWORD_EXPIRED; - } - else - { - statusBar.setStatusLine(txt_LoggedIn); - return CONNECTED_OK; - } - } // tryConnection - - /** - * Client changed - fill Role List - */ - private void clientComboChanged () - { - KeyNamePair client = (KeyNamePair)clientCombo.getSelectedItem(); - if (client == null || m_comboActive) - return; - if (log.isLoggable(Level.CONFIG)) log.config(": " + client); - m_comboActive = true; - // @Trifon - Set Proper "#AD_Client_ID", #AD_User_ID and "#SalesRep_ID" - // https://sourceforge.net/tracker/?func=detail&aid=2957215&group_id=176962&atid=879332 - Env.setContext(m_ctx, "#AD_Client_ID", client.getKey()); - MUser user = MUser.get (m_ctx, userTextField.getText()); - if (user != null) { - Env.setContext(m_ctx, "#AD_User_Name", userTextField.getText()); - Env.setContext(m_ctx, "#AD_User_ID", user.getAD_User_ID()); - Env.setContext(m_ctx, "#SalesRep_ID", user.getAD_User_ID()); - } - // - KeyNamePair[] roles = m_login.getRoles(userTextField.getText(), client, ROLE_TYPES_SWING); - // Make role Combo visible - roleCombo.setVisible(true); - roleLabel.setVisible(true); - - // delete existing rol/org items - if (roleCombo.getItemCount() > 0) - roleCombo.removeAllItems(); - if (orgCombo.getItemCount() > 0) - orgCombo.removeAllItems(); - // No Clients - if (roles == null || roles.length == 0) - { - statusBar.setStatusLine(txt_RoleError, true); - m_comboActive = false; - return; - } - // initial rol - KeyNamePair iniValue = null; - String iniDefault = Ini.getProperty(Ini.P_ROLE); - - // fill roles - for (int i = 0; i < roles.length; i++) - { - roleCombo.addItem(roles[i]); - if (roles[i].getName().equals(iniDefault)) - iniValue = roles[i]; - } - // fini - if (iniValue != null) - roleCombo.setSelectedItem(iniValue); - // - // If we have only one role, we can hide the combobox - metas-2009_0021_AP1_G94 - if(roleCombo.getItemCount()==1 && ! MSysConfig.getBooleanValue(MSysConfig.ALogin_ShowOneRole, true)) - { - roleCombo.setSelectedIndex(0); - roleCombo.setVisible(false); - roleLabel.setVisible(false); - - } - - m_comboActive = false; - roleComboChanged(); - } // roleComboChanged - - - /** - * role changed - fill Org & Warehouse List - */ - private void roleComboChanged() - { - KeyNamePair rol = (KeyNamePair)roleCombo.getSelectedItem(); - if (rol == null || m_comboActive) - return; - if (log.isLoggable(Level.CONFIG)) log.config(": " + rol); - m_comboActive = true; - - if( Env.getContextAsInt(m_ctx, "#AD_Client_ID") > 0 ) - { - MUser user = MUser.get (m_ctx, userTextField.getText()); - if (user != null) { - Env.setContext(m_ctx, "#AD_User_ID", user.getAD_User_ID() ); - Env.setContext(m_ctx, "#SalesRep_ID", user.getAD_User_ID() ); - } - } - - // - KeyNamePair[] orgs = m_login.getOrgs(rol); - // delete existing cleint items - if (orgCombo.getItemCount() > 0) - orgCombo.removeAllItems(); - - // No Orgs - if (orgs == null || orgs.length == 0) - { - statusBar.setStatusLine(txt_RoleError, true); - m_comboActive = false; - return; - } - // initial client - KeyNamePair orgValue = null; - KeyNamePair orgValue2 = null; - String iniDefault = Ini.getProperty(Ini.P_ORG); - - // fill orgs - for (int i = 0; i < orgs.length; i++) - { - orgCombo.addItem(orgs[i]); - if (orgs[i].getName().equals(iniDefault)) - orgValue = orgs[i]; - if (orgValue2 == null && orgs[i].getKey() != 0) - orgValue2 = orgs[i]; // first non-0 org - } - // Non-0 Org exists and last login was with 0 - if (orgValue2 != null && orgValue != null && orgValue.getKey() == 0) - orgValue = orgValue2; - // Last Org - if (orgValue != null) - orgCombo.setSelectedItem(orgValue); - // Get first Org - else - orgValue = (KeyNamePair)orgCombo.getSelectedItem(); - // - m_comboActive = false; - orgComboChanged(); - } // clientComboChanged - - /** - * Org changed - fill Warehouse List - */ - private void orgComboChanged() - { - KeyNamePair org = (KeyNamePair)orgCombo.getSelectedItem(); - if (org == null || m_comboActive) - return; - if (log.isLoggable(Level.CONFIG)) log.config(": " + org); - m_comboActive = true; - // - KeyNamePair[] whs = m_login.getWarehouses(org); - // Delete existing warehouse items - if (warehouseCombo.getItemCount() > 0) - warehouseCombo.removeAllItems(); - - // fill warehouses - if (whs != null) - { - // initial warehouse - KeyNamePair iniValue = null; - String iniDefault = Ini.getProperty(Ini.P_WAREHOUSE); - for (int i = 0; i < whs.length; i++) - { - warehouseCombo.addItem(whs[i]); - if (whs[i].getName().equals(iniDefault)) - iniValue = whs[i]; - } - if (iniValue != null) - warehouseCombo.setSelectedItem(iniValue); - } - m_comboActive = false; - } // orgComboChanged - - - /** - * Check Version - * @return true if version is OK and - * false if version could not be checked or is not the same - * @see AEnv#getServerVersion - */ - private boolean checkVersion() - { - boolean retValue = false; - try - { - String version = AEnv.getServerVersion(); - if (Adempiere.DATE_VERSION.equals(version)) - { - if (log.isLoggable(Level.CONFIG)) log.config("Server = Client - " + version); - retValue = true; - } - else if (version != null) - { - StringBuilder msg = new StringBuilder (">>\n"); - msg.append(res.getString("VersionConflict")).append("\n") - .append(res.getString("VersionInfo")).append("\n"); - msg.append(version == null ? "null" : version).append(" <> ") - .append(Adempiere.DATE_VERSION).append("\n"); - msg.append(res.getString("PleaseUpgrade")).append("\n<<"); - JOptionPane.showMessageDialog(null, msg.toString(), - Adempiere.getName() + " - " + res.getString("VersionConflict"), - JOptionPane.ERROR_MESSAGE); - AEnv.exit(1); - } - } - catch (Exception e) - { - log.severe("Contact Server failed - " - + e.getClass().toString() + ": " + e.getMessage()); - } - return retValue; - } // checkVersion - - - /************************************************************************** - * Language issues - */ - private String // txt_Connected, - txt_NotConnected, txt_NoDatabase, - txt_UserPwdError, txt_RoleError, txt_LoggedIn, - txt_PasswordExpired; - - /** - * Change Language - */ - private void languageComboChanged () - { - String langName = (String)languageCombo.getSelectedItem(); - // log.info( "Language: " + langName); - Language language = Language.getLanguage(langName); - Language.setLoginLanguage(language); - Env.setContext(m_ctx, Env.LANGUAGE, language.getAD_Language()); - - // Locales - Locale loc = language.getLocale(); - Locale.setDefault(loc); - this.setLocale(loc); - res = ResourceBundle.getBundle(RESOURCE, loc); - // - this.setTitle(res.getString("Login")); - hostLabel.setText(res.getString("Host")); - boolean email_login = (DB.isConnected() && MSysConfig.getBooleanValue(MSysConfig.USE_EMAIL_FOR_LOGIN, false)); - if (email_login) - userLabel.setText(res.getString("EMail")); - else - userLabel.setText(res.getString("User")); - userLabel.setToolTipText(res.getString("EnterUser")); - passwordLabel.setText(res.getString("Password")); - passwordLabel.setToolTipText(res.getString("EnterPassword")); - languageLabel.setText(res.getString("Language")); - languageLabel.setToolTipText(res.getString("SelectLanguage")); - // - roleLabel.setText(res.getString("Role")); - clientLabel.setText(res.getString("Client")); - orgLabel.setText(res.getString("Organization")); - dateLabel.setText(res.getString("Date")); - warehouseLabel.setText(res.getString("Warehouse")); - printerLabel.setText(res.getString("Printer")); - defaultPanel.setToolTipText(res.getString("Defaults")); - connectionPanel.setToolTipText(res.getString("Connection")); - // - // txt_Connected = res.getString("Connected"); - txt_NotConnected = res.getString("NotConnected"); - txt_NoDatabase = res.getString("DatabaseNotFound"); - txt_UserPwdError = res.getString("UserPwdError"); - txt_RoleError = res.getString("RoleNotFound"); - txt_LoggedIn = res.getString("Authorized"); - txt_PasswordExpired = res.getString("PasswordExpired"); - // - loginTabPane.setTitleAt(0, res.getString("Connection")); - if (loginTabPane.getTabCount() > 1) - loginTabPane.setTitleAt(1, res.getString("Defaults")); - confirmPanel.getOKButton().setToolTipText(res.getString("Ok")); - confirmPanel.getCancelButton().setToolTipText(res.getString("Cancel")); - - // DateField with new format - dateField.setFormat(); - dateField.setValue(new Timestamp(System.currentTimeMillis())); - // - if (m_connectionOK == CONNECTED_OK) - { - this.setTitle(hostField.getDisplay()); - statusBar.setStatusLine(txt_LoggedIn); - } - else if (m_connectionOK == CONNECTED_OK_WITH_PASSWORD_EXPIRED) - { - this.setTitle(hostField.getDisplay()); - statusBar.setStatusLine(txt_PasswordExpired); - } - else - { - this.setTitle(res.getString("Login")); - statusBar.setStatusLine(txt_NotConnected, true); - } - } // languageCombo_actionPerformed - -} // ALogin diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ALoginTest.java b/org.adempiere.ui.swing/src/org/compiere/apps/ALoginTest.java deleted file mode 100644 index 43d93eb20e..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ALoginTest.java +++ /dev/null @@ -1,441 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Dialog; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.IOException; -import java.net.InetAddress; -import java.net.Socket; -import java.net.UnknownHostException; -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; - -/** - * Connection Test - * ** Not Translated ** - * - * @author Jorg Janke - * @version $Id: ALoginTest.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class ALoginTest extends CDialog - implements ActionListener, Runnable -{ - /** - * - */ - private static final long serialVersionUID = 23728881908041435L; - - /** - * Consatructor - */ - public ALoginTest (Dialog frame, String host, String dbName, String port, String uid, String pwd) - { - super (frame, "Connect Test: " + host, true); - m_host = host; - m_dbName = dbName; - m_port = port; - m_uid = uid; - m_pwd = pwd; - try - { - jbInit(); - pack(); - } - catch(Exception ex) - { - inform ("Internal Error = " + ex.getMessage()); - } - // Start Tests - try - { - m_worker = new Thread(this); - m_worker.start(); - } - catch (Exception e1) - { - inform ("Internal Error = " + e1); - } - AEnv.showCenterScreen(this); - } // ALoginTest - - private String m_host; - private String m_port; - private String m_dbName; - private String m_uid; - private String m_pwd; - private Thread m_worker; - - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel southPanel = new CPanel(); - private JButton bOK = new JButton(); - private JScrollPane infoPane = new JScrollPane(); - private JTextArea info = new JTextArea(); - private FlowLayout southLayout = new FlowLayout(); - - /** - * Static Layout - */ - void jbInit() throws Exception - { - setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - mainPanel.setLayout(mainLayout); - bOK.setText("Exit"); - bOK.addActionListener(this); - info.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - southPanel.setLayout(southLayout); - southLayout.setAlignment(FlowLayout.RIGHT); - infoPane.setPreferredSize(new Dimension(400, 400)); - getContentPane().add(mainPanel); - mainPanel.add(southPanel, BorderLayout.SOUTH); - southPanel.add(bOK, null); - mainPanel.add(infoPane, BorderLayout.CENTER); - infoPane.getViewport().add(info, null); - } // jbInit - - /** - * Inform - */ - private void inform (String text) - { - System.out.println(text); - info.append(text); - info.append("\n"); - info.setCaretPosition(info.getText().length()); - } // inform - - /** - * Action Listener - */ - public void actionPerformed (ActionEvent e) - { - if (e.getSource() == bOK) - { - while (m_worker != null && m_worker.isAlive()) - m_worker.interrupt(); - dispose(); - } - } // actionEvent - - /** - * Run individual tests - */ - public void run () - { - String vmName = System.getProperty("java.vm.name"); - String vmVersion = System.getProperty("java.vm.version"); - inform ("Using Java=" + vmName + " " + vmVersion); - inform (""); - // - boolean found = false; - boolean foundJDBC = false; - inform("*** Testing connection to Server: " + m_host + " ***"); - if (m_host == null || m_host.length() == 0) - { - inform ("ERROR: invalid host name"); - return; - } - String host = m_host; - inform("Trying Echo - Port 7"); - found = testHostPort(host, 7); - - inform("Trying FTP - Port 21"); - if (testHostPort (host, 21) && !found) - found = true; - - inform("Trying HTTP - Port 80"); - if (testHostPort (host, 80) && !found) - found = true; - - inform("Trying Kerberos - Port 88"); - if (testHostPort (host, 88) && !found) - found = true; - - inform("Trying NetBios Session - Port 139"); - if (testHostPort (host, 139) && !found) - found = true; - - inform("Trying RMI - Port 1099"); - if (testHostPort (host, 1099) && !found) - found = true; - - inform("Trying Oracle Connection Manager - Port 1630"); - if (testHostPort (host, 1630) && !found) - found = true; - - inform("Trying Oracle JDBC - TCP Port 1521"); - foundJDBC = testHostPort (host, 1521); - - int jdbcPort = 0; - try - { - jdbcPort = Integer.parseInt(m_port); - } - catch (Exception e) - { - inform ("ERROR: Cannot parse port=" + m_port); - inform (e.getMessage()); - return; - } - if (jdbcPort != 1521) - { - inform("Trying Oracle JDBC - TCP Port " + jdbcPort); - if (testHostPort (host, jdbcPort) && !foundJDBC) - foundJDBC = true; - } - - // Test Interrupt - if (m_worker != null && m_worker.isInterrupted()) - return; - - /** Info */ - - if (found && foundJDBC) - { - inform ("*** Server found: " + host + " ***"); - inform (""); - } - else if (!found && foundJDBC) - { - inform ("*** Server found: " + host + " (JDBC only) ***"); - inform (""); - } - else if (found && !foundJDBC) - { - inform ("ERROR: Server found: " + host + " - but no JDBC ***"); - inform ("Make sure that the Oracle Listener process is active"); - return; - } - else - { - inform ("ERROR: Server NOT found: " + host + "***"); - inform ("End Test: Make sure that you can ping the Server"); - return; - } - - /*********************************************************************/ - - inform ("Connect to DB: " + m_dbName); - - inform ("Connect with entered parameters"); - if (!testJDBC(host, jdbcPort, m_dbName, m_uid, m_pwd)) - { - if (m_worker != null && m_worker.isInterrupted()) - return; - - if (jdbcPort != 1521) - { - inform ("Connect with standard JDBC port 1521"); - if (testJDBC(host, 1521, m_dbName, m_uid, m_pwd)) - { - inform ("Please set port to 1521"); - return; - } - if (m_worker != null && m_worker.isInterrupted()) - return; - } - - inform ("Connect with user system/manager"); - if (testJDBC(host, 1521, m_dbName, "system", "manager")) - { - inform ("Please check ADEMPIERE user id and password"); - inform (".... and please change SYSTEM password"); - return; - } - } - - inform ("*** Adempiere database found: " + host + ":" + jdbcPort + "/" + m_dbName + " ***"); - if (m_worker != null && m_worker.isInterrupted()) - return; - - /*********************************************************************/ - - inform (""); - inform ("Testing available application users:"); - testAdempiereUsers(host, jdbcPort); - - inform (""); - inform ("*** Test complete **"); - } // run - - /** - * Test Host Port - */ - private boolean testHostPort (String host, int port) - { - Socket pingSocket = null; - try - { - /* Resolve address. */ - InetAddress server = InetAddress.getByName(host); - /* Establish socket. */ - pingSocket = new Socket(server, port); - } - catch (UnknownHostException e) - { - inform (" Unknown Host: " + e ); - } - catch (IOException io ) - { - inform (" IO Exception: " + io ); - } - - if (pingSocket != null) - { - try - { - pingSocket.close(); - } - catch (IOException e) - { - inform (" IO close exception: " + e ); - } - inform (" *** success ***"); - return true; - } - else - { - return false; - } - } // testHostPort - - /** - * Test JDBC - */ - private boolean testJDBC (String host, int port, String sid, String uid, String pwd) - { - /** - try - { - inform (" Registering Driver: oracle.jdbc.driver.OracleDriver"); - DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); - inform (" - driver registered"); - DriverManager.setLoginTimeout(5); - DriverManager.setLogWriter(new PrintWriter(System.out)); - inform (" - driver initialized"); - } - catch (SQLException e) - { - inform ("ERROR: " + e.getMessage()); - return false; - } - **/ - - boolean ok = false; - - String urlC = "jdbc:oracle:thin:@//" + host + ":" + port + "/" + sid; - try - { - inform (" Trying Client connection URL=" + urlC + ", User=" + uid); - Connection con = DriverManager.getConnection(urlC, uid, pwd); - inform (" - connected"); - // - DatabaseMetaData conMD = con.getMetaData(); - inform(" - Driver Name:\t" + conMD.getDriverName()); - inform(" - Driver Version:\t" + conMD.getDriverVersion()); - inform(" - DB Name:\t" + conMD.getDatabaseProductName()); - inform(" - DB Version:\t" + conMD.getDatabaseProductVersion()); - // - con.close(); - inform (" *** success ***"); - ok = true; - } - catch (SQLException e) - { - inform (" ERROR: " + e.getMessage()); - } - - String urlS = "jdbc:oracle:oci8:@"; - try - { - inform (" Trying Server connection URL=" + urlS + ", User=" + uid); - Connection con = DriverManager.getConnection(urlS, uid, pwd); - inform (" - connected"); - // - DatabaseMetaData conMD = con.getMetaData(); - inform(" - Driver Name:\t" + conMD.getDriverName()); - inform(" - Driver Version:\t" + conMD.getDriverVersion()); - inform(" - DB Name:\t" + conMD.getDatabaseProductName()); - inform(" - DB Version:\t" + conMD.getDatabaseProductVersion()); - // - con.close(); - inform (" *** success ***"); - } - catch (SQLException e) - { - inform (" ERROR: " + e.getMessage()); - } - - return ok; - } // testJDBC - - /** - * Test Adempiere Users - */ - private void testAdempiereUsers(String host, int port) - { - String sql = "SELECT Name, Password FROM AD_User WHERE IsActive='Y'"; - String urlC = "jdbc:oracle:thin:@//" + host + ":" + port + "/" + m_dbName; - try - { - inform (" - Client connection URL=" + urlC + ", User=" + m_uid); - Connection con = DriverManager.getConnection(urlC, m_uid, m_pwd); - inform (" - connected"); - Statement stmt = con.createStatement(); - inform (" - statement created"); - ResultSet rs = stmt.executeQuery(sql); - inform (" - query executed listing active application users:"); - while (rs.next()) - { - String user = rs.getString(1); - String password = rs.getString(2); - String answer = ">> User = " + user; - if ((user.equals("System") || user.equals("SuperUser")) && password.equals("System")) - answer += " with standard password (should be changed)"; - inform (answer); - } - rs.close(); - inform (" - query closed"); - stmt.close(); - inform (" - statement closed"); - con.close(); - inform (" - connection closed"); - } - catch (SQLException e) - { - inform (" ERROR: " + e.getMessage()); - } - } // testAdempiereUsers -} // ALoginTest diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AMenu.java b/org.adempiere.ui.swing/src/org/compiere/apps/AMenu.java deleted file mode 100644 index b0ea2a3932..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AMenu.java +++ /dev/null @@ -1,839 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.GridLayout; -import java.awt.Insets; -import java.awt.KeyboardFocusManager; -import java.awt.Point; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowEvent; -import java.awt.event.WindowListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.math.BigDecimal; -import java.text.MessageFormat; -import java.util.Properties; -import java.util.UUID; -import java.util.logging.Level; - -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.JComponent; -import javax.swing.JFrame; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JProgressBar; -import javax.swing.KeyStroke; -import javax.swing.UIManager; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import org.adempiere.apps.graph.PAPanel; -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.Adempiere; -import org.compiere.apps.wf.WFActivity; -import org.compiere.apps.wf.WFPanel; -import org.compiere.grid.tree.VTreePanel; -import org.compiere.model.MRole; -import org.compiere.model.MSession; -import org.compiere.model.MSysConfig; -import org.compiere.model.MSystem; -import org.compiere.model.MTreeNode; -import org.compiere.model.MUser; -import static org.compiere.model.SystemIDs.*; -import org.compiere.swing.CButton; -import org.compiere.swing.CFrame; -import org.compiere.swing.CPanel; -import org.compiere.swing.CScrollPane; -import org.compiere.swing.CTabbedPane; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.IEnvEventListener; -import org.compiere.util.Ini; -import org.compiere.util.Language; -import org.compiere.util.Msg; -import org.compiere.util.Splash; -/** - * Application Menu Controller - * - * @author Jorg Janke - * @version $Id: AMenu.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * - * @author Colin Rooney (croo) RFE#1670185 restrict access to info queries - * @author victor.perez@e-evolution.com - *

  • FR [ 1966328 ] New Window Info to MRP and CRP into View - *
  • http://sourceforge.net/tracker/index.php?func=detail&aid=1966328&group_id=176962&atid=879335 - *
  • BF[2992649] Issue in Workflow Activities when the records are ordered - *
  • https://sourceforge.net/tracker/?func=detail&aid=2992649&group_id=176962&atid=879332 - * - */ -public final class AMenu extends CFrame - implements ActionListener, PropertyChangeListener, ChangeListener, IEnvEventListener -{ - /** - * generated serialVersionUID - */ - private static final long serialVersionUID = 5255914306969824011L; - - static { - AdempierePLAF.setPLAF (); - } - - /** - * Application Start and Menu - */ - public AMenu () - { - super(); - - UIManager.put( "ClassLoader", this.getClass().getClassLoader()); - - Splash splash = Splash.getSplash(); - // - m_WindowNo = AEnv.createWindowNo(this); - // Login - initSystem (splash); // login - splash.setText(Msg.getMsg(m_ctx, "Loading")); - splash.toFront(); - splash.paint(splash.getGraphics()); - - // - if (!Adempiere.startupEnvironment(true)) // Load Environment - System.exit(1); - MSession session = MSession.get (Env.getCtx(), true); // Start Session - session.setWebSession(UUID.randomUUID().toString()); - session.setDescription(session.getDescription() + " " + "Swing Client"); - session.saveEx(); - - // Setting close operation/listener - teo_sarca [ 1684168 ] - setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); - addWindowListener(new WindowListener() { - public void windowClosing(WindowEvent e) { - if (!ADialog.ask(0, null, "ExitApplication?")) - return; - dispose(); - } - public void windowActivated(WindowEvent e) {} - public void windowClosed(WindowEvent e) {} - public void windowDeactivated(WindowEvent e) {} - public void windowDeiconified(WindowEvent e) {} - public void windowIconified(WindowEvent e) {} - public void windowOpened(WindowEvent e) {} - }); - - // Preparation - wfActivity = new WFActivity(this); - wfPanel = new WFPanel(this); - treePanel = new VTreePanel (m_WindowNo, true, false); // !editable & hasBar - - try - { - jbInit(); - createMenu(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "AMenu", ex); - } - - // initialize & load tree - int AD_Role_ID = Env.getAD_Role_ID(Env.getCtx()); - int AD_Tree_ID = DB.getSQLValue(null, - "SELECT COALESCE(r.AD_Tree_Menu_ID, ci.AD_Tree_Menu_ID)" - + "FROM AD_ClientInfo ci" - + " INNER JOIN AD_Role r ON (ci.AD_Client_ID=r.AD_Client_ID) " - + "WHERE AD_Role_ID=?", AD_Role_ID); - if (AD_Tree_ID <= 0) - AD_Tree_ID = TREE_MENUPRIMARY; // Menu - treePanel.initTree(AD_Tree_ID); - - // Translate - Env.setContext(m_ctx, m_WindowNo, "_WinInfo_WindowName", Msg.getMsg(m_ctx, "Menu")); - setTitle(Env.getHeader(m_ctx, m_WindowNo)); - - progressBar.setString(Msg.getMsg(m_ctx, "SelectProgram")); - - // Finish UI - Point loc = Ini.getWindowLocation(0); - if (loc == null) - loc = new Point(0,0); - this.setLocation(loc); - this.pack(); - this.setVisible(true); - if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED)) - this.setExtendedState(Frame.MAXIMIZED_BOTH); - else - this.setState(Frame.NORMAL); - this.validate(); - m_AD_User_ID = Env.getContextAsInt(m_ctx, "#AD_User_ID"); - m_AD_Role_ID = Env.getContextAsInt(m_ctx, "#AD_Role_ID"); - updateInfo(); - // - infoUpdater = new InfoUpdater(); - infoUpdaterThread = new Thread(infoUpdater, "InfoUpdater"); - infoUpdaterThread.start(); - - // Auto Expand Tree - nmicoud IDEMPIERE 195 - if (MUser.get(m_ctx).isMenuAutoExpand()) - treePanel.expandTree(true); - // Auto Expand Tree - nmicoud IDEMPIERE 195 - - Env.setContext(Env.getCtx(), "#UIClient", "swing"); - - // - Env.addEventListener(this); - // -// ReportCtl.setReportViewerProvider(new SwingViewerProvider()); - // - splash.dispose(); - splash = null; - } // AMenu - - private int m_WindowNo; - private Properties m_ctx = Env.getCtx(); - private boolean m_startingItem = false; - /** The User */ - private int m_AD_User_ID; - /** The Role */ - private int m_AD_Role_ID; - - /** Center Tabbed Pane index: Menu */ - @SuppressWarnings("unused") - private int m_tabMenu = 0; - /** Center Tabbed Pane index: Activities */ - private int m_tabActivities = 1; - /** Center Tabbed Pane index: Workflow */ - private int m_tabWorkflow = 2; - - // Links - private int m_request_Menu_ID = 0; - private int m_note_Menu_ID = 0; - private String m_requestSQL = null; -// private DecimalFormat m_memoryFormat = DisplayType.getNumberFormat(DisplayType.Integer); - /** Logger */ - private static CLogger log = CLogger.getCLogger(AMenu.class); - - /** The Info Update instance **/ - private InfoUpdater infoUpdater = null; - /** The Info Update thread **/ - private Thread infoUpdaterThread = null; - - private WindowManager windowManager = new WindowManager(); - - - /************************************************************************** - * Init System. - * -- do not get Msg as environment not initialized yet -- - *
    -	 *	- Login - in not successful, exit
    -	 *  
    - * @param splash splash window - */ - private void initSystem (Splash splash) - { - // Default Image - this.setIconImage(Adempiere.getImage16()); - - // Focus Traversal - KeyboardFocusManager.setCurrentKeyboardFocusManager(AKeyboardFocusManager.get()); - // FocusManager.getCurrentManager().setDefaultFocusTraversalPolicy(AFocusTraversalPolicy.get()); - // this.setFocusTraversalPolicy(AFocusTraversalPolicy.get()); - - /** - * Show Login Screen - if not successful - exit - */ - log.finer("Login"); - - ALogin login = new ALogin(splash); - if (!login.initLogin()) // no automatic login - { - // Center the window - try - { - AEnv.showCenterScreen(login); // HTML load errors - } - catch (Exception ex) - { - log.severe(ex.toString()); - } - if (!login.isConnected() || !login.isOKpressed()) - AEnv.exit(1); - } - } // initSystem - - // UI - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CTabbedPane centerPane = new CTabbedPane(); - private CPanel southPanel = new CPanel(); - private BorderLayout southLayout = new BorderLayout(); - private JMenuBar menuBar = new JMenuBar(); - protected JProgressBar progressBar = new JProgressBar(0,100); - private CPanel infoPanel = new CPanel(); - private CButton bNotes = new CButton(); - private CButton bRequests = new CButton(); - private GridLayout infoLayout = new GridLayout(); - private JProgressBar memoryBar = new JProgressBar(); - // Tabs - private PAPanel paPanel = null; - private VTreePanel treePanel = null; - private WFActivity wfActivity = null; - private WFPanel wfPanel = null; - private WindowMenu m_WindowMenu; - - /** - * Static Init. - *
    -	 *  - mainPanel
    -	 * 		- centerPane
    -	 *      	- treePanel
    -	 * 			- wfActivity
    -	 * 			- wfPanel
    -	 *      - southPanel
    -	 *          - infoPanel
    -	 *              - bNotes
    -	 *              - bTask
    -	 *              - memoryBar
    -	 *          - wfPanel
    -	 *          - progressBar
    -	 *  
    - * @throws Exception - */ - void jbInit() throws Exception - { - this.setName("Menu"); - this.setLocale(Language.getLoginLanguage().getLocale()); - this.setJMenuBar(menuBar); - // - mainPanel.setLayout(mainLayout); - mainLayout.setHgap(0); - mainLayout.setVgap(2); - // - treePanel.addPropertyChangeListener(VTreePanel.NODE_SELECTION, this); - // - infoPanel.setLayout(infoLayout); - infoLayout.setColumns(2); - infoLayout.setHgap(4); - infoLayout.setVgap(0); - // bNotes.setRequestFocusEnabled(false); - bNotes.setToolTipText(""); - bNotes.setActionCommand("Notes"); - bNotes.addActionListener(this); - bNotes.setIcon(Env.getImageIcon("GetMail24.gif")); - bNotes.setMargin(new Insets(0, 0, 0, 0)); - // bRequests.setRequestFocusEnabled(false); - bRequests.setActionCommand("Requests"); - bRequests.addActionListener(this); - bRequests.setIcon(Env.getImageIcon("Request24.gif")); - bRequests.setMargin(new Insets(0, 0, 0, 0)); - // - southLayout.setHgap(0); - southLayout.setVgap(1); - // - memoryBar.setStringPainted(true); - memoryBar.setOpaque(false); - memoryBar.setBorderPainted(false); - memoryBar.addMouseListener(new AMenu_MouseAdapter()); - // - progressBar.setStringPainted(true); - progressBar.setOpaque(false); - // - getContentPane().add(mainPanel); - mainPanel.add(centerPane, BorderLayout.CENTER); - mainPanel.add(southPanel, BorderLayout.SOUTH); - mainPanel.add(Box.createHorizontalStrut(3), BorderLayout.EAST); - mainPanel.add(Box.createHorizontalStrut(3), BorderLayout.WEST); - - // Tabs - centerPane.setFont(centerPane.getFont().deriveFont(centerPane.getFont().getSize2D()+1)); - paPanel = PAPanel.get(); - if (paPanel != null) - { - //centerPane.add(paPanel, Msg.getMsg(m_ctx, "PAPanel")); - centerPane.addTab(Msg.getMsg(m_ctx, "PAPanel"), Env.getImageIcon2("InfoAccount16"), paPanel); - m_tabMenu++; - m_tabActivities++; - m_tabWorkflow++; - } - treePanel.setBorder(BorderFactory.createEmptyBorder(2,3,2,3)); - //centerPane.add(treePanel, Msg.getMsg(m_ctx, "Menu")); - centerPane.addTab(Msg.getMsg(m_ctx, "Menu"), Env.getImageIcon2("Home16"), treePanel); - //centerPane.add(new CScrollPane(wfActivity), Msg.getMsg (m_ctx, "WorkflowActivities") + ": 0"); - centerPane.addTab(Msg.getMsg (m_ctx, "WorkflowActivities") + ": 0", Env.getImageIcon2("Assignment16"), new CScrollPane(wfActivity)); - //centerPane.add(new CScrollPane(wfPanel), Msg.getMsg (m_ctx, "WorkflowPanel")); - centerPane.addTab(Msg.getMsg (m_ctx, "WorkflowPanel"), Env.getImageIcon2("WorkFlow16"), new CScrollPane(wfPanel)); - centerPane.addChangeListener (this); - // - southPanel.setLayout(southLayout); - southPanel.add(infoPanel, BorderLayout.NORTH); - southPanel.add(progressBar, BorderLayout.SOUTH); - // - infoPanel.add(bNotes, null); - infoPanel.add(bRequests, null); - infoPanel.add(memoryBar, null); - // - int loc = Ini.getDividerLocation(); - if (loc > 0) - treePanel.setDividerLocation(loc); - } // jbInit - - /** - * Get Preferred Size - * @return preferred Size - */ - public Dimension getPreferredSize() - { - Dimension dim = Ini.getWindowDimension(0); - if (dim == null) - dim = new Dimension (350, 500); - return dim; - } // getPreferredSize - - - /** - * Create Menu - */ - private void createMenu() - { - // File - JMenu mFile = AEnv.getMenu("File"); - menuBar.add(mFile); - AEnv.addMenuItem("PrintScreen", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, 0), mFile, this); - AEnv.addMenuItem("ScreenShot", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, ActionEvent.SHIFT_MASK), mFile, this); - mFile.addSeparator(); - AEnv.addMenuItem("Logout", null, KeyStroke.getKeyStroke(KeyEvent.VK_L, ActionEvent.SHIFT_MASK + ActionEvent.ALT_MASK), mFile, this); - AEnv.addMenuItem("Exit", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.SHIFT_MASK+ActionEvent.ALT_MASK), mFile, this); - - // View - JMenu mView = AEnv.getMenu("View"); - menuBar.add(mView); - - if (MRole.getDefault().isAllow_Info_Product()) - { - AEnv.addMenuItem("InfoProduct", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK), mView, this); - } - if (MRole.getDefault().isAllow_Info_BPartner()) - { - AEnv.addMenuItem("InfoBPartner", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK+ActionEvent.CTRL_MASK), mView, this); - } - if (MRole.getDefault().isShowAcct() && MRole.getDefault().isAllow_Info_Account()) - { - AEnv.addMenuItem("InfoAccount", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK+ActionEvent.CTRL_MASK), mView, this); - } - if (MRole.getDefault().isAllow_Info_Schedule()) - { - AEnv.addMenuItem("InfoSchedule", null, null, mView, this); - } - //FR [ 1966328 ] -// if (MRole.getDefault().isAllow_Info_MRP()) -// { -// AEnv.addMenuItem("InfoMRP", "Info", null, mView, this); -// } -// if (MRole.getDefault().isAllow_Info_CRP()) -// { -// AEnv.addMenuItem("InfoCRP", "Info", null, mView, this); -// } - mView.addSeparator(); - if (MRole.getDefault().isAllow_Info_Order()) - { - AEnv.addMenuItem("InfoOrder", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_Invoice()) - { - AEnv.addMenuItem("InfoInvoice", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_InOut()) - { - AEnv.addMenuItem("InfoInOut", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_Payment()) - { - AEnv.addMenuItem("InfoPayment", "Info", null, mView, this); - } -// if (MRole.getDefault().isAllow_Info_CashJournal()) -// { -// AEnv.addMenuItem("InfoCashLine", "Info", null, mView, this); -// } - if (MRole.getDefault().isAllow_Info_Resource()) - { - AEnv.addMenuItem("InfoAssignment", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_Asset()) - { - AEnv.addMenuItem("InfoAsset", "Info", null, mView, this); - } - - // Tools - JMenu mTools = AEnv.getMenu("Tools"); - menuBar.add(mTools); - AEnv.addMenuItem("Calculator", null, null, mTools, this); - AEnv.addMenuItem("Calendar", null, null, mTools, this); - AEnv.addMenuItem("Editor", null, null, mTools, this); - MUser user = MUser.get(Env.getCtx()); - if (user.isAdministrator()) - AEnv.addMenuItem("Script", null, null, mTools, this); - if (AEnv.isWorkflowProcess()) - AEnv.addMenuItem("WorkFlow", null, null, mTools, this); - if (MRole.getDefault().isShowPreference()) - { - mTools.addSeparator(); - AEnv.addMenuItem("Preference", null, null, mTools, this); - } - - //Window Menu - m_WindowMenu = new WindowMenu(windowManager, this); - menuBar.add(m_WindowMenu); - KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_W, ActionEvent.CTRL_MASK); - this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(ks, "ShowAllWindow"); - AppsAction action = new AppsAction("ShowAllWindow", ks, false); - this.getRootPane().getActionMap().put("ShowAllWindow", action); - action.setDelegate(this); - - // Help - JMenu mHelp = AEnv.getMenu("Help"); - menuBar.add(mHelp); - AEnv.addMenuItem("Online", null, null, mHelp, this); - AEnv.addMenuItem("EMailSupport", null, null, mHelp, this); - AEnv.addMenuItem("About", null, null, mHelp, this); - } // createMenu - - /** - * Dispose - end system - */ - public void dispose() - { - preDispose(); - // - super.dispose(); - AEnv.exit(0); - } // dispose - - private void preDispose() { - // clean up - save window state - Ini.setWindowDimension(0, getSize()); - Ini.setDividerLocation(treePanel.getDividerLocation()); - Ini.setWindowLocation(0, getLocation()); - Ini.saveProperties(true); - // - infoUpdater.stop = true; - try { - infoUpdaterThread.join(50); - } catch(InterruptedException ire) { - } finally { - infoUpdaterThread = null; - infoUpdater = null; - } - } - - public void logout() - { - windowManager.close(); - preDispose(); - super.dispose(); - AEnv.logout(); - } - - /** - * Window Events - requestFocus - * @param e event - */ - protected void processWindowEvent(WindowEvent e) - { - super.processWindowEvent(e); - if (e.getID() == WindowEvent.WINDOW_OPENED) - { - treePanel.getSearchField().requestFocusInWindow(); - // this.toFront(); - } - } // processWindowEvent - - /** - * Set Busy - * @param value true if buzy - */ - protected void setBusy (boolean value) - { - m_startingItem = value; - if (value) - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - else - setCursor(Cursor.getDefaultCursor()); - // setEnabled (!value); // causes flicker - } // setBusy - - /** - * Selection in tree - launch Application - * @param e PropertyChangeEvent - */ - public void propertyChange(PropertyChangeEvent e) - { - - MTreeNode nd = (MTreeNode)e.getNewValue(); - if (log.isLoggable(Level.INFO)) log.info(nd.getNode_ID() + " - " + nd.toString()); - - // ignore summary items & when loading - if (m_startingItem || nd.isSummary()) - return; - - String sta = nd.toString(); - progressBar.setString(sta); - int cmd = nd.getNode_ID(); - - (new AMenuStartItem(cmd, true, sta, this)).start(); // async load - //hengsin, updateInfo is call again in AMenuStartItem - //updateInfo(); - } // propertyChange - - - /************************************************************************** - * ActionListener - * @param e ActionEvent - */ - public void actionPerformed(ActionEvent e) - { - // Buttons - if (e.getSource() == bNotes) - gotoNotes(); - else if (e.getSource() == bRequests) - gotoRequests(); - else if (e.getActionCommand().equals("ShowAllWindow")) - m_WindowMenu.expose(); - else if (!AEnv.actionPerformed(e.getActionCommand(), m_WindowNo, this)) - log.log(Level.SEVERE, "unknown action=" + e.getActionCommand()); - //updateInfo(); - } // actionPerformed - - /** - * Get number of open Notes - * @return number of notes - */ - private int getNotes() - { - String sql = "SELECT COUNT(1) FROM AD_Note " - + "WHERE AD_Client_ID=? AND AD_User_ID IN (0,?)" - + " AND Processed='N'"; - int retValue = DB.getSQLValue(null, sql, Env.getAD_Client_ID(Env.getCtx()), m_AD_User_ID); - return retValue; - } // getNotes - - /** - * Open Note Window - */ - private void gotoNotes() - { - // AD_Table_ID for AD_Note = 389 HARDCODED - if (m_note_Menu_ID == 0) - m_note_Menu_ID = DB.getSQLValue(null, "SELECT AD_Menu_ID " - + "FROM AD_Menu m" - + " INNER JOIN AD_TABLE t ON (t.AD_Window_ID=m.AD_Window_ID) " - + "WHERE t.AD_Table_ID=?", 389); - if (m_note_Menu_ID == 0) - m_note_Menu_ID = MENU_NOTICE; // fallback HARDCODED - (new AMenuStartItem (m_note_Menu_ID, true, Msg.translate(m_ctx, "AD_Note_ID"), this)).start(); // async load - } // gotoMessage - - /** - * Ger Number of open Requests - * @return number of requests - */ - private int getRequests() - { - if (m_requestSQL == null) - m_requestSQL = MRole.getDefault().addAccessSQL ("SELECT COUNT(1) FROM R_Request " - + "WHERE (SalesRep_ID=? OR AD_Role_ID=?) AND Processed='N'" - + " AND (DateNextAction IS NULL OR TRUNC(DateNextAction) <= TRUNC(SysDate))" - + " AND (R_Status_ID IS NULL OR R_Status_ID IN (SELECT R_Status_ID FROM R_Status WHERE IsClosed='N'))", - "R_Request", false, true); // not qualified - RW - int retValue = DB.getSQLValue(null, m_requestSQL, m_AD_User_ID, m_AD_Role_ID); - return retValue; - } // getRequests - - /** - * Open Request Window - */ - private void gotoRequests() - { - // AD_Table_ID for R_Request = 417 HARDCODED - // if (m_request_Menu_ID == 0) // Goes to Request (all) - // m_request_Menu_ID = DB.getSQLValue (null, "SELECT AD_Menu_ID " - // + "FROM AD_Menu m" - // + " INNER JOIN AD_TABLE t ON (t.AD_Window_ID=m.AD_Window_ID) " - // + "WHERE t.AD_Table_ID=?", 417); - if (m_request_Menu_ID == 0) - m_request_Menu_ID = WINDOW_MY_REQUESTS; // My Requests - (new AMenuStartItem (m_request_Menu_ID, true, Msg.translate(m_ctx, "R_Request_ID"), this)).start(); // async load - } // gotoRequests - - /** - * Show Memory Info - run GC if required - Update Requests/Memos/Activities - */ - public void updateInfo() - { - double total = Runtime.getRuntime().totalMemory() / 1024; - double free = Runtime.getRuntime().freeMemory() / 1024; - double used = total - free; - double percent = used * 100 / total; - // - memoryBar.setMaximum((int)total); - memoryBar.setValue((int)used); - String msg = MessageFormat.format("{0,number,integer} MB - {1,number,integer}%", - new Object[] {BigDecimal.valueOf(total / 1024), BigDecimal.valueOf(percent)}); - memoryBar.setString(msg); - // - // msg = MessageFormat.format("Total Memory {0,number,integer} kB - Free {1,number,integer} kB", - msg = Msg.getMsg(m_ctx, "MemoryInfo", - new Object[] {BigDecimal.valueOf(total), BigDecimal.valueOf(free)}); - memoryBar.setToolTipText(msg); - // progressBar.repaint(); - - // CarlosRuiz - globalqss - [ 1881285 ] Remove unnecessary calls to System.gc - // if (percent > 50) - // System.gc(); - - if (DB.isConnected()) - { - // Requests - int requests = getRequests(); - bRequests.setText(Msg.translate(m_ctx, "R_Request_ID") + ": " + requests); - // Memo - int notes = getNotes(); - bNotes.setText(Msg.translate(m_ctx, "AD_Note_ID") + ": " + notes); - // Activities - int activities = wfActivity.getActivitiesCount(); - centerPane.setTitleAt(m_tabActivities, Msg.getMsg (m_ctx, "WorkflowActivities") + ": " + activities); - /* - log.config(msg - + ", Processors=" + Runtime.getRuntime().availableProcessors() - + ", Requests=" + requests + ", Notes=" + notes + ", Activities=" + activities - + "," + CConnection.get().getStatus() - ); - */ - MSystem.get(m_ctx).info(); - } - } // updateInfo - - - /** - * Update Activities Label - */ - public void updateActivities(int act_length) - { - centerPane.setTitleAt(m_tabActivities, Msg.getMsg (m_ctx, "WorkflowActivities") + ": " + act_length); - } // updateInfo - - /************************************************************************* - * Start Workflow Activity - * @param AD_Workflow_ID id - */ - protected void startWorkFlow (int AD_Workflow_ID) - { - centerPane.setSelectedIndex(m_tabWorkflow); // switch - wfPanel.load(AD_Workflow_ID, false); - } // startWorkFlow - - - /** - * Change Listener (tab) - * @see javax.swing.event.ChangeListener#stateChanged(javax.swing.event.ChangeEvent) - * @param e event - */ - public void stateChanged (ChangeEvent e) - { - //updateInfo(); - // show activities - if (centerPane.getSelectedIndex() == m_tabActivities) - { - wfActivity.loadActivities(); - } - } // stateChanged - - public WindowManager getWindowManager() { - return windowManager; - } - - /************************************************************************** - * Mouse Listener - */ - class AMenu_MouseAdapter extends MouseAdapter - { - /** - * Invoked when the mouse has been clicked on a component. - * @param e event - */ - public void mouseClicked(MouseEvent e) - { - if (e.getClickCount() > 1) - { - updateInfo(); - System.gc(); - //updateInfo(); - } - } - } // AMenu_MouseAdapter - - - /************************************************************************** - * OS Start - * @param args Array of String arguments (ignored) - */ - public static void main(String[] args) - { - Splash.getSplash(); - Adempiere.startup(true); // needs to be here for UI - new AMenu(); - } // main - - class InfoUpdater implements Runnable - { - boolean stop = false; - - public void run() - { - int sleep = MSysConfig.getIntValue(MSysConfig.MENU_INFOUPDATER_SLEEP_MS, 60000, Env.getAD_Client_ID(Env.getCtx())); - while(stop == false) - { - updateInfo(); - - try { - Thread.sleep(sleep); - } catch(InterruptedException ire) { } - } - } - } - - - @Override - public void onClearWindowContext(int windowNo) { - AEnv.removeWindow(windowNo); - } - - @Override - public void onReset(boolean finalCall) { - AEnv.reset(finalCall); - } - -} // AMenu diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AMenuStartItem.java b/org.adempiere.ui.swing/src/org/compiere/apps/AMenuStartItem.java deleted file mode 100644 index 7f6640c7e1..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AMenuStartItem.java +++ /dev/null @@ -1,354 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.logging.Level; - -import javax.swing.SwingUtilities; -import javax.swing.Timer; - -import org.compiere.apps.form.FormFrame; -import org.compiere.model.MTask; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Ini; -import org.compiere.util.Msg; - - -/** - * Start application action ( process, workflow, window, form, task ) - * of a menu item ( ad_menu ) or workflow node ( ad_wf_node ). - * - * @author Jorg Janke - * @version $Id: AMenuStartItem.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class AMenuStartItem extends Thread implements ActionListener -{ - /** - * Start Menu Item - * - * @param ID ID - * @param isMenu false if Workflow - * @param name Name - * @param menu Menu - */ - public AMenuStartItem (int ID, boolean isMenu, String name, AMenu menu) - { - m_ID = ID; - m_isMenu = isMenu; - m_name = name; - m_menu = menu; - if (menu != null) - m_increment = (menu.progressBar.getMaximum()-menu.progressBar.getMinimum()) / 5; - } // UpdateProgress - - /** The ID */ - private int m_ID = 0; - private boolean m_isMenu = false; - private String m_name; - private AMenu m_menu; - /** Logger */ - private static CLogger log = CLogger.getCLogger(AMenuStartItem.class); - - // Reset Progress Bar - private Runnable m_resetPB = new Runnable() - { - public void run() - { - m_value = 0; - if (m_menu != null) - m_menu.progressBar.setValue(0); - } - }; - // Progress Bar tick - private Runnable m_tickPB = new Runnable() - { - public void run() - { - if (m_menu == null) - return; - // 100/5 => 20 ticks - every .5 sec => 10 seconds loadtime - final int tick = 5; - if (m_menu.progressBar.getValue() < (m_menu.progressBar.getMaximum() - tick)) - m_menu.progressBar.setValue(m_menu.progressBar.getValue() + tick); - } - }; - // Progress Bar max state - private Runnable m_updatePB = new Runnable() - { - public void run() - { - if (m_menu == null) - return; - m_value += m_increment; - if (m_menu.progressBar.getValue() > m_value) // max value - m_menu.progressBar.setValue(m_value); - } - }; - /** Value */ - int m_value = 0; - /** Increment */ - int m_increment = 20; - /** Timer */ - private Timer m_timer = new Timer(500, this); // every 1/2 second - - /** - * Start Menu Item - */ - public void run() - { - if (m_menu != null) - m_menu.setBusy (true); - SwingUtilities.invokeLater(m_resetPB); - m_timer.start(); - SwingUtilities.invokeLater(m_updatePB); - PreparedStatement pstmt = null; - ResultSet rs = null; - String errmsg = null; - try - { - String sql = "SELECT * FROM AD_Menu WHERE AD_Menu_ID=?"; - if (!m_isMenu) - sql = "SELECT * FROM AD_WF_Node WHERE AD_WF_Node_ID=?"; - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_ID); - rs = pstmt.executeQuery(); - - SwingUtilities.invokeLater(m_updatePB); - if (rs.next()) // should only be one - { - String Action = rs.getString("Action"); - String IsSOTrx = "Y"; - if (m_isMenu) - IsSOTrx = rs.getString("IsSOTrx"); - int cmd; - if (Action.equals("W")) // Window - { - cmd = rs.getInt("AD_Window_ID"); - startWindow(0, cmd); - } - else if (Action.equals("P") || Action.equals("R")) // Process & Report - { - cmd = rs.getInt("AD_Process_ID"); - startProcess(cmd, IsSOTrx); - } - else if (Action.equals("B")) // Workbench - { - cmd = rs.getInt("AD_Workbench_ID"); - startWindow (cmd, 0); - } - else if (Action.equals("F")) // WorkFlow - { - if (m_isMenu) - cmd = rs.getInt("AD_Workflow_ID"); - else - cmd = rs.getInt("Workflow_ID"); - if (m_menu != null) - m_menu.startWorkFlow(cmd); - } - else if (Action.equals("T")) // Task - { - cmd = rs.getInt("AD_Task_ID"); - startTask(cmd); - } - else if (Action.equals("X")) // Form - { - cmd = rs.getInt("AD_Form_ID"); - startForm(cmd); - } - else - log.log(Level.SEVERE, "No valid Action in ID=" + m_ID); - } // for all records - - SwingUtilities.invokeLater(m_updatePB); - } - catch (Exception e) - { - log.log(Level.SEVERE, "ID=" + m_ID, e); - errmsg = Msg.parseTranslation(Env.getCtx(), e.getMessage()); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - // Show error if any - if (errmsg != null) - ADialog.error(0, null, "Error", errmsg); - - try {Thread.sleep(1000);} // 1 sec - catch (InterruptedException ie) {} - - // ready for next - m_timer.stop(); - SwingUtilities.invokeLater(m_resetPB); - if (m_menu != null) - { - //m_menu.updateInfo(); - m_menu.setBusy(false); - } - } // run - - - /** - * Actlion Listener for Timer - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - SwingUtilities.invokeLater(m_tickPB); - } // actionPerformed - - /** - * Start Window - * - * @param AD_Workbench_ID workbench - * @param AD_Window_ID window - */ - private void startWindow(int AD_Workbench_ID, int AD_Window_ID) - { - AWindow frame = (AWindow)AEnv.showWindow(AD_Window_ID); - if (frame != null) { - m_menu.getWindowManager().add(frame); - return; - } - - if (Ini.isPropertyBool(Ini.P_SINGLE_INSTANCE_PER_WINDOW)) { - frame = m_menu.getWindowManager().find(AD_Window_ID); - if ( frame != null ) { - frame.toFront(); - return; - } - } - - SwingUtilities.invokeLater(m_updatePB); // 1 - frame = new AWindow(m_menu.getGraphicsConfiguration()); - boolean OK = false; - if (AD_Workbench_ID != 0) - OK = frame.initWorkbench(AD_Workbench_ID); - else - OK = frame.initWindow(AD_Window_ID, null); // No Query Value - if (!OK) - return; - - SwingUtilities.invokeLater(m_updatePB); // 2 - if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) - { - AEnv.showMaximized(frame); - } - - // Center the window - SwingUtilities.invokeLater(m_updatePB); // 3 - if (!(Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED)) ) - { - frame.validate(); - AEnv.showCenterScreen(frame); - } - - m_menu.getWindowManager().add(frame); - -// if (wfPanel.isVisible()) -// m_WF_Window = frame; // maintain one reference - frame = null; - } // startWindow - - /** - * Start Process. - * Start/show Process Dialog which calls ProcessCtl - * @param AD_Process_ID process - * @param IsSOTrx is SO trx - */ - private void startProcess (int AD_Process_ID, String IsSOTrx) - { - SwingUtilities.invokeLater(m_updatePB); // 1 - boolean isSO = false; - if (IsSOTrx != null && IsSOTrx.equals("Y")) - isSO = true; - m_timer.stop(); - ProcessDialog pd = new ProcessDialog (m_menu.getGraphicsConfiguration(), AD_Process_ID, isSO); - if (!pd.init()) - return; - m_timer.start(); - m_menu.getWindowManager().add(pd); - - SwingUtilities.invokeLater(m_updatePB); // 2 - pd.getContentPane().invalidate(); - pd.getContentPane().validate(); - pd.pack(); - // Center the window - SwingUtilities.invokeLater(m_updatePB); // 3 - AEnv.showCenterScreen(pd); - } // startProcess - - /** - * Start OS Task - * @param AD_Task_ID task - */ - private void startTask (int AD_Task_ID) - { - SwingUtilities.invokeLater(m_updatePB); // 1 - // Get Command - MTask task = null; - if (AD_Task_ID > 0) - task = new MTask(Env.getCtx(), AD_Task_ID, null); - if (task.get_ID() != AD_Task_ID) - task = null; - if (task == null) - return; - SwingUtilities.invokeLater(m_updatePB); // 2 - m_menu.getWindowManager().add(new ATask(m_name, task)); - // ATask.start(m_name, task); - } // startTask - - /** - * Start Form - * @param AD_Form_ID form - */ - private void startForm (int AD_Form_ID) - { - FormFrame ff = null; - if (Ini.isPropertyBool(Ini.P_SINGLE_INSTANCE_PER_WINDOW)) { - ff = m_menu.getWindowManager().findForm(AD_Form_ID); - if ( ff != null ) { - ff.toFront(); - return; - } - } - ff = new FormFrame(m_menu.getGraphicsConfiguration()); - SwingUtilities.invokeLater(m_updatePB); // 1 - boolean ok = ff.openForm(AD_Form_ID); - if (!ok) { - ff.dispose(); - return; - } - m_menu.getWindowManager().add(ff); - SwingUtilities.invokeLater(m_updatePB); // 2 - - // Center the window - SwingUtilities.invokeLater(m_updatePB); // 3 - if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) { - AEnv.showMaximized(ff); - } else - AEnv.showCenterScreen(ff); - } // startForm - -} // StartItem diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java deleted file mode 100644 index a73a42c411..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java +++ /dev/null @@ -1,3191 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - * @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ] * - *****************************************************************************/ -package org.compiere.apps; - -import static org.compiere.model.SystemIDs.PROCESS_AD_CHANGELOG_REDO; -import static org.compiere.model.SystemIDs.PROCESS_AD_CHANGELOG_UNDO; -import static org.compiere.model.SystemIDs.REFERENCE_DOCUMENTACTION; -import static org.compiere.model.SystemIDs.REFERENCE_PAYMENTRULE; -import static org.compiere.model.SystemIDs.REFERENCE_POSTED; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Image; -import java.awt.Point; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.io.File; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.TreeMap; -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.BorderFactory; -import javax.swing.ImageIcon; -import javax.swing.JDialog; -import javax.swing.JFrame; -import javax.swing.JList; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.JTabbedPane; -import javax.swing.JTable; -import javax.swing.JToolBar; -import javax.swing.KeyStroke; -import javax.swing.ListSelectionModel; -import javax.swing.SwingUtilities; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.event.PopupMenuEvent; -import javax.swing.event.PopupMenuListener; - -import org.adempiere.util.Callback; -import org.adempiere.util.IProcessUI; -import org.compiere.apps.form.FormFrame; -import org.compiere.apps.search.Find; -import org.compiere.grid.APanelTab; -import org.compiere.grid.GridController; -import org.compiere.grid.GridSynchronizer; -import org.compiere.grid.ICreateFrom; -import org.compiere.grid.RecordAccessDialog; -import org.compiere.grid.VCreateFromFactory; -import org.compiere.grid.VOnlyCurrentDays; -import org.compiere.grid.VSortTab; -import org.compiere.grid.VTabbedPane; -import org.compiere.grid.ed.VButton; -import org.compiere.grid.ed.VDocAction; -import org.compiere.grid.ed.VPostIt; -import org.compiere.model.DataStatusEvent; -import org.compiere.model.DataStatusListener; -import org.compiere.model.GridField; -import org.compiere.model.GridTab; -import org.compiere.model.GridTable; -import org.compiere.model.GridWindow; -import org.compiere.model.GridWindowVO; -import org.compiere.model.GridWorkbench; -import org.compiere.model.Lookup; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MProcess; -import org.compiere.model.MProjectIssue; -import org.compiere.model.MQuery; -import org.compiere.model.MRole; -import org.compiere.model.MToolBarButtonRestrict; -import org.compiere.model.MUser; -import org.compiere.model.MWindow; -import org.compiere.model.X_AD_ToolBarButton; -import org.compiere.plaf.CompiereColor; -import org.compiere.print.AReport; -import org.compiere.process.DocAction; -import org.compiere.process.ProcessInfo; -import org.compiere.process.ProcessInfoUtil; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogMgt; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Language; -import org.compiere.util.Msg; -import org.compiere.util.Util; - -/** - * Main Panel of application window. - *
    - *  Structure:
    - *      (MenuBar) -> to be added to owning window
    - *		northPanel  (ToolBar)
    - *		tabPanel
    - *		southPanel  (StatusBar)
    - *  
    - * - * @author Jorg Janke - * @version $Id: APanel.java,v 1.4 2006/07/30 00:51:27 jjanke Exp $ - * - * Colin Rooney 2007/03/20 RFE#1670185 & related BUG#1684142 - Extend Sec to Info Queries - * @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ] - * @contributor fer_luck@centuryon.com , FR [ 1757088 ] - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *
  • BF [ 1824621 ] History button can't be canceled - *
  • BF [ 1941271 ] VTreePanel is modifying even if is save wasn't successfull - *
  • FR [ 1943731 ] Window data export functionality - *
  • FR [ 1974354 ] VCreateFrom.create should be more flexible - *
  • BF [ 1996056 ] Report error message is not displayed - *
  • BF [ 1998575 ] Document Print is discarding any error - * @author Teo Sarca, teo.sarca@gmail.com - *
  • BF [ 2876892 ] Save included tab before calling button action - * https://sourceforge.net/tracker/?func=detail&aid=2876892&group_id=176962&atid=879332 - * @author victor.perez@e-evolution.com - * @see FR [ 1966328 ] New Window Info to MRP and CRP into View http://sourceforge.net/tracker/index.php?func=detail&aid=1966328&group_id=176962&atid=879335 - * @autor tobi42, metas GmBH - *
  • BF [ 2799362 ] You can press New button a lot of times - * @author Cristina Ghita, www.arhipac.ro - * @see FR [ 2877111 ] See identifiers columns when delete records https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2877111&group_id=176962 - * - * @author hengsin, hengsin.low@idalica.com - * @see FR [2887701] https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2887701&group_id=176962 - * @sponsor www.metas.de - */ -public final class APanel extends CPanel - implements DataStatusListener, ChangeListener, ActionListener, IProcessUI -{ - /** - * - */ - private static final long serialVersionUID = 8668865618093531311L; - - private boolean isNested = false; - private boolean ToolBarMenuRestictionLoaded = false; - - /** - * Constructs a new instance. - * Need to call initPanel for dynamic initialization - */ - //FR [ 1757088 ] - public APanel(GridController gc, int windowNo){ - super(); - isNested = true; - m_ctx = Env.getCtx(); - try{ - m_curGC = gc; - gc.addDataStatusListener(this); - m_curTab = gc.getMTab(); - - Component tabElement = null; - tabElement = gc; - VTabbedPane tabPane = new VTabbedPane(false); - tabPane.addTab(m_curTab.getName().toString(), m_curTab, tabElement); - m_curWinTab = tabPane; - m_curWindowNo = windowNo; - jbInit(); - initSwitchLineAction(); - } - catch(Exception e){ - log.log(Level.SEVERE, "", e); - } - - createMenu(); - - MRole role = MRole.getDefault(); - m_curGC.query (m_onlyCurrentRows, m_onlyCurrentDays, role.getMaxQueryRecords()); - m_curTab.navigateCurrent(); // updates counter - m_curGC.dynamicDisplay(0); - } - - public APanel(AWindow window) - { - super(); - m_window = window; - - m_ctx = Env.getCtx(); - // - try - { - jbInit(); - } - catch (Exception e) - { - log.log(Level.SEVERE, "", e); - } - createMenu(); - } // APanel - - /** Logger */ - private static CLogger log = CLogger.getCLogger(APanel.class); - - private AWindow m_window; - private boolean isCancel = false; //Goodwill - - /** - * Dispose - */ - public void dispose() - { - // log.config(""); - // ignore changes - m_disposing = true; - // - if (m_curAPanelTab != null) - { - m_curAPanelTab.unregisterPanel(); - m_curAPanelTab = null; - } - // close panels - tabPanel.dispose(this); - tabPanel = null; - // All Workbenches - for (int i = 0; i < m_mWorkbench.getWindowCount(); i++) - { - m_curWindowNo = m_mWorkbench.getWindowNo(i); - if (log.isLoggable(Level.INFO)) log.info("#" + m_curWindowNo); - Env.setAutoCommit(m_ctx, m_curWindowNo, false); - m_mWorkbench.dispose(i); - Env.clearWinContext(m_ctx, m_curWindowNo); - } // all Workbenchens - - // Get rid of remaining model - if (m_mWorkbench != null) - m_mWorkbench.dispose(); - m_mWorkbench = null; - // MenuBar - if (menuBar != null) - menuBar.removeAll(); - menuBar = null; - // ToolBar - if (toolBar != null) - toolBar.removeAll(); - toolBar = null; - // Prepare GC - this.removeAll(); - } // dispose - - /** - * The Layout. - */ - private BorderLayout mainLayout = new BorderLayout(); - private VTabbedPane tabPanel = new VTabbedPane(true); - private StatusBar statusBar = new StatusBar(); - private CPanel northPanel = new CPanel(); - private JToolBar toolBar = new JToolBar(); - private JMenuBar menuBar = new JMenuBar(); - private FlowLayout northLayout = new FlowLayout(); - - /** - * Initializes the state of this instance. - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setLocale(Language.getLoginLanguage().getLocale()); - this.setLayout(mainLayout); - - // tabPanel - mainLayout.setHgap(2); - mainLayout.setVgap(2); - if (isNested) - this.add(m_curGC, BorderLayout.CENTER); - else - { - CPanel dummy = new CPanel(); - dummy.setLayout(new BorderLayout()); - dummy.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 2)); - dummy.add(tabPanel, BorderLayout.CENTER); - this.add(dummy, BorderLayout.CENTER); - } - // southPanel - this.add(statusBar, BorderLayout.SOUTH); - // northPanel - this.add(northPanel, BorderLayout.NORTH); - northPanel.setLayout(northLayout); - northLayout.setAlignment(FlowLayout.LEFT); - toolBar.putClientProperty("JToolBar.isRollover", Boolean.TRUE); - toolBar.setBorderPainted(false); - toolBar.setFloatable(false); // teo_sarca, [ 1666591 ] Toolbar should not be floatable - northPanel.add(toolBar, null); - } // jbInit - - private AppsAction aPrevious, aNext, aParent, aDetail, aFirst, aLast, - aNew, aCopy, aDelete, aPrint, aPrintPreview, - aExport = null, - aRefresh, aHistory, aAttachment, aChat, aMulti, aFind, - aWorkflow, aZoomAcross, aRequest, aWinSize, aArchive, - aProcess; - /** Ignore Button */ - public AppsAction aIgnore; - /** Save Button */ - public AppsAction aSave; - /** Save & Create Button*/ - public AppsAction aSaveAndCreate; - /** Private Lock Button */ - public AppsAction aLock; - // Local (added to toolbar) - @SuppressWarnings("unused") - private AppsAction aReport, aEnd, aHome, aHelp, aProduct, aLogout, - aAccount, aCalculator, aCalendar, aEditor, aPreference, aScript, - aOnline, aMailSupport, aAbout, aPrintScr, aScrShot, aExit, aBPartner, - aDeleteSelection, aShowAllWindow, aPostIt; - - private SwitchAction aSwitchLinesDownAction, aSwitchLinesUpAction; - - private WindowMenu m_WindowMenu; - /************************************************************************** - * Create Menu and Toolbar and registers keyboard actions. - * - started from constructor - */ - private void createMenu() - { - /** - * Menu - */ - // menuBar.setHelpMenu(); - // File - JMenu mFile = AEnv.getMenu("File"); - menuBar.add(mFile); - aPrintScr = addAction("PrintScreen", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, 0), false); - aScrShot = addAction("ScreenShot", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, ActionEvent.SHIFT_MASK), false); - aReport = addAction("Report", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_F11, 0), false); - aPrint = addAction("Print", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_F12, 0), false); - aPrintPreview = addAction("PrintPreview", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.SHIFT_MASK+ActionEvent.ALT_MASK), false); - if (MRole.getDefault().isCanExport()) - { - aExport = addAction("Export", mFile, null, false); - } - mFile.addSeparator(); - aEnd = addAction("End", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK), false); - aLogout = addAction("Logout", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_L, ActionEvent.SHIFT_MASK+ActionEvent.ALT_MASK), false); - aExit = addAction("Exit", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.SHIFT_MASK+ActionEvent.ALT_MASK), false); - // Edit - JMenu mEdit = AEnv.getMenu("Edit"); - menuBar.add(mEdit); - aNew = addAction("New", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0), false); - aSave = addAction("Save", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0), false); - aSaveAndCreate = addAction("SaveCreate", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.CTRL_MASK), false); - mEdit.addSeparator(); - aCopy = addAction("Copy", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_F2, ActionEvent.SHIFT_MASK), false); - aDelete = addAction("Delete", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0), false); - aDeleteSelection = addAction("DeleteSelection", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_D, ActionEvent.CTRL_MASK), false); - aIgnore = addAction("Ignore", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), false); - aRefresh = addAction("Refresh", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0), false); - mEdit.addSeparator(); - aFind = addAction("Find", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0), true); // toggle - if (m_isPersonalLock) - aLock = addAction("Lock", mEdit, null, true); // toggle - // View - JMenu mView = AEnv.getMenu("View"); - menuBar.add(mView); - if (MRole.getDefault().isAllow_Info_Product()) - { - aProduct = addAction("InfoProduct", mView, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK), false); - } - if (MRole.getDefault().isAllow_Info_BPartner()) - { - aBPartner = addAction("InfoBPartner", mView, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.SHIFT_MASK+ActionEvent.ALT_MASK), false); - } - if (MRole.getDefault().isShowAcct() && MRole.getDefault().isAllow_Info_Account()) - { - aAccount = addAction("InfoAccount",mView, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK+ActionEvent.CTRL_MASK), false); - } - if (MRole.getDefault().isAllow_Info_Schedule()) - { - AEnv.addMenuItem("InfoSchedule", null, null, mView, this); - } - //FR [ 1966328 ] -// if (MRole.getDefault().isAllow_Info_MRP()) -// { -// AEnv.addMenuItem("InfoMRP", "Info", null, mView, this); -// } -// if (MRole.getDefault().isAllow_Info_CRP()) -// { -// AEnv.addMenuItem("InfoCRP", "Info", null, mView, this); -// } - mView.addSeparator(); - if (MRole.getDefault().isAllow_Info_Order()) - { - AEnv.addMenuItem("InfoOrder", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_Invoice()) - { - AEnv.addMenuItem("InfoInvoice", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_InOut()) - { - AEnv.addMenuItem("InfoInOut", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_Payment()) - { - AEnv.addMenuItem("InfoPayment", "Info", null, mView, this); - } -// if (MRole.getDefault().isAllow_Info_CashJournal()) -// { -// AEnv.addMenuItem("InfoCashLine", "Info", null, mView, this); -// } - if (MRole.getDefault().isAllow_Info_Resource()) - { - AEnv.addMenuItem("InfoAssignment", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_Asset()) - { - AEnv.addMenuItem("InfoAsset", "Info", null, mView, this); - } - - - - mView.addSeparator(); - aAttachment = addAction("Attachment", mView, KeyStroke.getKeyStroke(KeyEvent.VK_F7, 0), true); // toggle - aPostIt = addAction("PostIt", mView, null, true); - aChat = addAction("Chat", mView, null, true); // toggle - aHistory = addAction("History", mView, KeyStroke.getKeyStroke(KeyEvent.VK_F9, 0), true); // toggle - mView.addSeparator(); - aMulti = addAction("Multi", mView, KeyStroke.getKeyStroke(KeyEvent.VK_F8, 0), true); // toggle - // Go - JMenu mGo = AEnv.getMenu("Go"); - menuBar.add(mGo); - aFirst = addAction("First", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, ActionEvent.ALT_MASK), false); - aPrevious = addAction("Previous", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_UP, ActionEvent.ALT_MASK), false); - aNext = addAction("Next", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, ActionEvent.ALT_MASK), false); - aLast = addAction("Last", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, ActionEvent.ALT_MASK), false); - mGo.addSeparator(); - aParent = addAction("Parent", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, ActionEvent.ALT_MASK), false); - aDetail = addAction("Detail", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, ActionEvent.ALT_MASK), false); - mGo.addSeparator(); - aZoomAcross = addAction("ZoomAcross", mGo, null, false); - aRequest = addAction("Request", mGo, null, false); - aArchive = addAction("Archive", mGo, null, false); - aHome = addAction("Home", mGo, null, false); - // Tools - JMenu mTools = AEnv.getMenu("Tools"); - menuBar.add(mTools); - aCalculator = addAction("Calculator", mTools, null, false); - aCalendar = addAction("Calendar", mTools, null, false); - aEditor = addAction("Editor", mTools, null, false); - MUser user = MUser.get(Env.getCtx()); - if (user.isAdministrator()) - aScript = addAction("Script", mTools, null, false); - if ("Y".equals(Env.getContext(m_ctx, "#SysAdmin"))) // set in DB.loginDB - aWinSize = addAction("WinSize", mTools, null, false); - if (AEnv.isWorkflowProcess()) - aWorkflow = addAction("WorkFlow", mTools, null, false); - if (MRole.getDefault().isShowPreference()) - { - mTools.addSeparator(); - aPreference = addAction("Preference", mTools, null, false); - } - - //Window - AMenu aMenu = (AMenu)AEnv.getWindow(0); - m_WindowMenu = new WindowMenu(aMenu.getWindowManager(), m_window); - menuBar.add(m_WindowMenu); - aShowAllWindow = addAction("ShowAllWindow", null, KeyStroke.getKeyStroke(KeyEvent.VK_W, ActionEvent.CTRL_MASK), false); - - // Help - JMenu mHelp = AEnv.getMenu("Help"); - menuBar.add(mHelp); - aHelp = addAction("Help", mHelp, KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0), false); - aOnline = addAction("Online", mHelp, null, false); - aMailSupport = addAction("EMailSupport", mHelp, null, false); - aAbout = addAction("About", mHelp, null, false); - - // - aProcess=addAction("Process",null,null,false); - - /** - * ToolBar - */ - toolBar.add(aIgnore.getButton()); // ESC - toolBar.addSeparator(); - toolBar.add(aHelp.getButton()); // F1 - toolBar.add(aNew.getButton()); - toolBar.add(aCopy.getButton()); - toolBar.add(aDelete.getButton()); - toolBar.add(aDeleteSelection.getButton()); - toolBar.add(aSave.getButton()); - toolBar.add(aSaveAndCreate.getButton()); - toolBar.add(aProcess.getButton()); - toolBar.addSeparator(); - toolBar.add(aRefresh.getButton()); // F5 - toolBar.add(aFind.getButton()); - toolBar.add(aAttachment.getButton()); - toolBar.add(aPostIt.getButton()); - toolBar.add(aChat.getButton()); - toolBar.add(aMulti.getButton()); - toolBar.addSeparator(); - //FR [ 1757088 ] - if((m_curGC == null) || (m_curGC != null && !m_curGC.isDetailGrid())){ - toolBar.add(aHistory.getButton()); // F9 - toolBar.add(aHome.getButton()); // F10 is Windows Menu Key - toolBar.add(aParent.getButton()); - toolBar.add(aDetail.getButton()); - toolBar.addSeparator(); - } - - toolBar.add(aFirst.getButton()); - toolBar.add(aPrevious.getButton()); - toolBar.add(aNext.getButton()); - toolBar.add(aLast.getButton()); - toolBar.addSeparator(); - toolBar.add(aReport.getButton()); - toolBar.add(aArchive.getButton()); - toolBar.add(aPrintPreview.getButton()); - toolBar.add(aPrint.getButton()); - // FR [ 1757088 ] - if((m_curGC == null) || (m_curGC != null && !m_curGC.isDetailGrid())){ - toolBar.addSeparator(); - if (m_isPersonalLock) - toolBar.add(aLock.getButton()); - toolBar.add(aZoomAcross.getButton()); - if (aWorkflow != null) - toolBar.add(aWorkflow.getButton()); - toolBar.add(aRequest.getButton()); - if (MRole.getDefault().isAllow_Info_Product()) - { - toolBar.add(aProduct.getButton()); - } - toolBar.addSeparator(); - toolBar.add(aEnd.getButton()); - } - - // - if (CLogMgt.isLevelAll()) - Util.printActionInputMap(this); - } // createMenu - - - /** - * Add (Toggle) Action to Toolbar and Menu - * @param actionName action name - * @param menu manu - * @param accelerator accelerator - * @param toggle toggle button - * @return AppsAction - */ - private AppsAction addAction (String actionName, JMenu menu, KeyStroke accelerator, boolean toggle) - { - AppsAction action = new AppsAction(actionName, accelerator, toggle); - if (menu != null) - menu.add(action.getMenuItem()); - action.setDelegate(this); - // AbstractButton b = action.getButton(); - // String s = null; - // if (b != null) - // s = b.getToolTipText(); - - // Key Strokes - if (accelerator != null) - { - getInputMap(WHEN_IN_FOCUSED_WINDOW).put(accelerator, actionName); - getActionMap().put(actionName, action); - } - // - return action; - } // addAction - - /** - * Return MenuBar - * @return JMenuBar - */ - public JMenuBar getMenuBar() - { - return menuBar; - } // getMenuBar - - /** - * Get Title of Window - * @return String with Title - */ - public String getTitle() - { - if (m_mWorkbench != null && m_mWorkbench.getWindowCount() > 1) - { - StringBuilder sb = new StringBuilder(); - sb.append(m_mWorkbench.getName()).append(" ") - .append(Env.getContext(m_ctx, "#AD_User_Name")).append("@") - .append(Env.getContext(m_ctx, "#AD_Client_Name")).append(".") - .append(Env.getContext(m_ctx, "#AD_Org_Name")).append(" [") - .append(Env.getContext(m_ctx, "#DB_UID")).append("]"); - return sb.toString(); - } - return Env.getHeader(m_ctx, m_curWindowNo); - } // getTitle - - - private Properties m_ctx; - - /** Workbench Model */ - private GridWorkbench m_mWorkbench; - /** Current MTab */ - private GridTab m_curTab; - /** Current GridController */ - private GridController m_curGC; - /** Current Window Panel */ - private JTabbedPane m_curWinTab = null; - /** Current Window No */ - private int m_curWindowNo; - /** Current Window Panel Index */ - private int m_curTabIndex = -1; - /** Current Tab Order */ - private APanelTab m_curAPanelTab = null; - - /** Dispose active */ - private boolean m_disposing = false; - /** Save Error Message indicator */ - private boolean m_errorDisplayed = false; - /** Only current row flag */ - private boolean m_onlyCurrentRows = true; - /** Number of days to show 0=all */ - private int m_onlyCurrentDays = 0; - /** Process Info */ - private boolean m_isLocked = false; - /** Show Personal Lock */ - private boolean m_isPersonalLock = MRole.getDefault().isPersonalLock(); - /** Last Modifier of Action Event */ - private int m_lastModifiers; - - private HashMap includedMap; - - - /************************************************************************** - * Dynamic Panel Initialization - either single window or workbench. - *
    -	 *  either
    -	 *  - Workbench tabPanel    (VTabbedPane)
    -	 *      - Tab               (GridController)
    -	 *  or
    -	 *  - Workbench tabPanel    (VTabbedPane)
    -	 *      - Window            (VTabbedPane)
    -	 *          - Tab           (GridController)
    -	 *  
    - * tabPanel - * @param AD_Workbench_ID if > 0 this is a workbench, AD_Window_ID ignored - * @param AD_Window_ID if not a workbench, Window ID - * @param query if not a Workbench, Zoom Query - additional SQL where clause - * @return true if Panel is initialized successfully - */ - public boolean initPanel (int AD_Workbench_ID, int AD_Window_ID, MQuery query) - { - if (log.isLoggable(Level.INFO)) log.info("WB=" + AD_Workbench_ID + ", Win=" + AD_Window_ID + ", Query=" + query); - this.setName("APanel" + AD_Window_ID); - - // Single Window - if (AD_Workbench_ID == 0) - m_mWorkbench = new GridWorkbench(m_ctx, AD_Window_ID); - else - // Workbench - { - // m_mWorkbench = new MWorkbench(m_ctx); - // if (!m_mWorkbench.initWorkbench (AD_Workbench_ID)) - // { - // log.log(Level.SEVERE, "APanel.initWindow - No Workbench Model"); - // return false; - // } - // tabPanel.setWorkbench(true); - // tabPanel.addChangeListener(this); - ADialog.warn(0, this, "","Not implemented yet"); - return false; - } - - Dimension windowSize = m_mWorkbench.getWindowSize(); - - MQuery detailQuery = null; - /** - * WorkBench Loop - */ - for (int wb = 0; wb < m_mWorkbench.getWindowCount(); wb++) - { - // Get/set WindowNo - m_curWindowNo = AEnv.createWindowNo (this); // Timing: ca. 1.5 sec - m_mWorkbench.setWindowNo(wb, m_curWindowNo); - // Set AutoCommit for this Window - Env.setAutoCommit(m_ctx, m_curWindowNo, Env.isAutoCommit(m_ctx)); - boolean autoNew = Env.isAutoNew(m_ctx); - Env.setAutoNew(m_ctx, m_curWindowNo, autoNew); - - // Workbench Window - VTabbedPane window = null; - // just one window - if (m_mWorkbench.getWindowCount() == 1) - { - window = tabPanel; - window.setWorkbench(false); - } - else - { - VTabbedPane tp = new VTabbedPane(false); - window = tp; - } - // Window Init - window.addChangeListener(this); - - /** - * Init Model - */ - int wbType = m_mWorkbench.getWindowType(wb); - - /** - * Window - */ - if (wbType == GridWorkbench.TYPE_WINDOW) - { - includedMap = new HashMap(4); - // - GridWindowVO wVO = Env.getMWindowVO(m_curWindowNo, m_mWorkbench.getWindowID(wb), 0); - if (wVO == null) - { - ADialog.error(0, null, "AccessTableNoView", "(No Window Model Info)"); - return false; - } - GridWindow mWindow = new GridWindow (wVO, true); // Timing: ca. 0.3-1 sec - // Set SO/AutoNew for Window - Env.setContext(m_ctx, m_curWindowNo, "IsSOTrx", mWindow.isSOTrx()); - if (!autoNew && mWindow.isTransaction()) - Env.setAutoNew(m_ctx, m_curWindowNo, true); - m_mWorkbench.setMWindow(wb, mWindow); - if (wb == 0) - m_onlyCurrentRows = mWindow.isTransaction(); // default = only current - if (windowSize == null) - windowSize = mWindow.getWindowSize(); - - /** - * Window Tabs - */ - int tabSize = mWindow.getTabCount(); - boolean goSingleRow = query != null; // Zoom Query - for (int tab = 0; tab < tabSize; tab++) - { - boolean included = false; - // MTab - if (tab == 0) mWindow.initTab(0); - GridTab gTab = mWindow.getTab(tab); - Env.setContext(m_ctx, m_curWindowNo, tab, GridTab.CTX_TabLevel, Integer.toString(gTab.getTabLevel())); - // Query first tab - if (tab == 0) - { - // initial user query for single workbench tab - if (m_mWorkbench.getWindowCount() == 1) - { - if (query != null && query.getZoomTableName() != null && query.getZoomColumnName() != null - && query.getZoomValue() instanceof Integer && (Integer)query.getZoomValue() > 0) - { - if (!query.getZoomTableName().equalsIgnoreCase(gTab.getTableName())) - { - detailQuery = query; - query = new MQuery(); - query.addRestriction("1=2"); - } - } - isCancel = false; //Goodwill - query = initialQuery (query, gTab); - if (isCancel) return false; //Cancel opening window - if (query != null && query.getRecordCount() <= 1) - goSingleRow = true; - } - else if (wb != 0) - // workbench dynamic query for dependent windows - { - query = m_mWorkbench.getQuery(); - } - // Set initial Query on first tab - if (query != null) - { - m_onlyCurrentRows = false; // Query might involve history - gTab.setQuery(query); - } - if (wb == 0) - m_curTab = gTab; - } // query on first tab - - Component tabElement = null; - // GridController - if (gTab.isSortTab()) - { - VSortTab st = new VSortTab(m_curWindowNo, gTab.getAD_Table_ID(), - gTab.getAD_ColumnSortOrder_ID(), gTab.getAD_ColumnSortYesNo_ID()); - st.setTabLevel(gTab.getTabLevel()); - tabElement = st; - } - else // normal tab - { - GridController gc = new GridController(); // Timing: ca. .1 sec - CompiereColor cc = CompiereColor.getCompiereColor(mWindow.getColor()); - if (cc != null) - gc.setBackgroundColor(cc); // set color on Window level - gc.initGrid(gTab, false, m_curWindowNo, this, mWindow, (tab != 0)); // will set color on Tab level - // Timing: ca. 6-7 sec for first .2 for next - gc.addDataStatusListener(this); - gc.registerESCAction(aIgnore); // register Escape Key - // Set First Tab - if (wb == 0 && tab == 0) - { - m_curGC = gc; - Dimension size = gc.getPreferredSize(); // Screen Sizing - size.width += 4; - size.height += 4; - gc.setPreferredSize(size); - } - tabElement = gc; - // If we have a zoom query, switch to single row - if (tab == 0 && goSingleRow) - gc.switchSingleRow(); - - // FR [ 1757088 ] - GridField[] fields = gc.getMTab().getFields(); - int m_tab_id = 0; - for(int f =0 ; f < fields.length ; f ++) - { - m_tab_id = fields[f].getIncluded_Tab_ID(); - if ( m_tab_id != 0) - { - includedMap.put(m_tab_id, gc); - } - } - - // Is this tab included? - if (includedMap.size() > 0) - { - GridController parent = (GridController)includedMap.get(Integer.valueOf(gTab.getAD_Tab_ID())); - if (parent != null) - { - // FR [ 1757088 ] - gc.removeDataStatusListener(this); - GridSynchronizer synchronizer = new GridSynchronizer(mWindow, parent, gc); - if (parent == m_curGC) - synchronizer.activateChild(); - included = parent.includeTab(gc,this,synchronizer); - } - } - initSwitchLineAction(); - } // normal tab - - if (!included) // Add to TabbedPane - { - StringBuilder tabName = new StringBuilder (); - tabName.append (""); - if (gTab.isReadOnly()) - tabName.append(""); - int pos = gTab.getName ().indexOf (" "); - if (pos == -1) - tabName.append (gTab.getName ()).append ("
     "); - else - { - tabName.append (gTab.getName().substring (0, pos)) - .append ("
    ") - .append (gTab.getName().substring(pos + 1)); - } - if (gTab.isReadOnly()) - tabName.append("
    "); - // Carlos Ruiz - globalqss - IDEMPIERE-38 Tabs from a same window can't be translated the same way - tabName.append(""); - tabName.append (""); - // Add Tab - sets ALT- and Shift-ALT- - window.addTab (tabName.toString(), gTab, tabElement); - } - } // Tab Loop - // Tab background - // window.setBackgroundColor(new AdempiereColor(Color.magenta, Color.green)); - } // Type-MWindow - - // Single Workbench Window Tab - if (m_mWorkbench.getWindowCount() == 1) - { - window.setToolTipText(m_mWorkbench.getDescription(wb)); - } - else - // Add Workbench Window Tab - { - tabPanel.addTab(m_mWorkbench.getName(wb), m_mWorkbench.getIcon(wb), window, m_mWorkbench.getDescription(wb)); - } - // Used for Env.getHeader - Env.setContext(m_ctx, m_curWindowNo, "_WinInfo_WindowName", m_mWorkbench.getName(wb)); - - } // Workbench Loop - - // stateChanged (<->) triggered - toolBar.setName(getTitle()); - m_curTab.getTableModel().setChanged(false); - // Set Detail Button - aDetail.setEnabled(0 != m_curWinTab.getTabCount()-1); - - // Enable/Disable Tabs dynamically - if (m_curWinTab instanceof VTabbedPane) - ((VTabbedPane)m_curWinTab).evaluate(null); - // Size - if (windowSize != null) - setPreferredSize(windowSize); - else - revalidate(); - - if (detailQuery != null && zoomToDetailTab(detailQuery)) { - return true; - } - - Dimension size = getPreferredSize(); - if (log.isLoggable(Level.INFO)) log.info( "fini - " + size); - m_curWinTab.requestFocusInWindow(); - return true; - } // initPanel - - private boolean zoomToDetailTab(MQuery query) { - if (query != null && query.getZoomTableName() != null && query.getZoomColumnName() != null) - { - GridTab gTab = m_mWorkbench.getMWindow(0).getTab(0); - if (!query.getZoomTableName().equalsIgnoreCase(gTab.getTableName())) - { - int tabSize = m_mWorkbench.getMWindow(0).getTabCount(); - - for (int tab = 0; tab < tabSize; tab++) - { - gTab = m_mWorkbench.getMWindow(0).getTab(tab); - if (gTab.isSortTab()) - continue; - - if (gTab.getTableName().equalsIgnoreCase(query.getZoomTableName())) - { - if (doZoomToDetail(gTab, query, tab)) { - return true; - } - } - } - } - } - return false; - } - - private boolean doZoomToDetail(GridTab gTab, MQuery query, int tabIndex) { - GridField[] fields = gTab.getFields(); - for (GridField field : fields) - { - if (field.getColumnName().equalsIgnoreCase(query.getZoomColumnName())) - { - m_mWorkbench.getMWindow(0).initTab(tabIndex); - int parentId = DB.getSQLValue(null, "SELECT " + gTab.getLinkColumnName() + " FROM " + gTab.getTableName() + " WHERE " + query.getWhereClause()); - if (parentId > 0) - { - MapparentMap = new TreeMap(); - int index = tabIndex; - int oldpid = parentId; - GridTab currentTab = gTab; - while (index > 0) - { - index--; - GridTab pTab = m_mWorkbench.getMWindow(0).getTab(index); - if (pTab.getTabLevel() < currentTab.getTabLevel()) - { - m_mWorkbench.getMWindow(0).initTab(index); - if (index > 0) - { - if (pTab.getLinkColumnName() != null && pTab.getLinkColumnName().trim().length() > 0) - { - int pid = DB.getSQLValue(null, "SELECT " + pTab.getLinkColumnName() + " FROM " + pTab.getTableName() + " WHERE " + currentTab.getLinkColumnName() + " = ?", oldpid); - if (pid > 0) - { - parentMap.put(index, new Object[]{currentTab.getLinkColumnName(), oldpid}); - oldpid = pid; - currentTab = pTab; - } - else - { - parentMap.clear(); - break; - } - } - } - else - { - parentMap.put(index, new Object[]{currentTab.getLinkColumnName(), oldpid}); - } - } - } - for(Map.Entry entry : parentMap.entrySet()) - { - GridTab pTab = m_mWorkbench.getMWindow(0).getTab(entry.getKey()); - Object[] value = entry.getValue(); - MQuery pquery = new MQuery(pTab.getAD_Table_ID()); - pquery.addRestriction((String)value[0], "=", value[1]); - pTab.setQuery(pquery); - GridController gc = (GridController) tabPanel.getComponentAt(entry.getKey()); - gc.activate(); - gc.query(false, 0, 0); - } - - - MQuery targetQuery = new MQuery(gTab.getAD_Table_ID()); - targetQuery.addRestriction(gTab.getLinkColumnName(), "=", parentId); - gTab.setQuery(targetQuery); - GridController gc = null; - if (!includedMap.containsKey(gTab.getAD_Tab_ID())) - { - int target = tabPanel.findTabindex(gTab); - gc = (GridController) tabPanel.getComponentAt(target); - } - else - { - GridController parent = includedMap.get(gTab.getAD_Tab_ID()); - gc = parent.findChild(gTab); - } - gc.activate(); - gc.query(false, 0, 0); - - GridTable table = gTab.getTableModel(); - int count = table.getRowCount(); - for(int i = 0; i < count; i++) - { - int id = table.getKeyID(i); - if (id == ((Integer)query.getZoomValue()).intValue()) - { - if (!includedMap.containsKey(gTab.getAD_Tab_ID())) - { - tabPanel.setSelectedIndex(tabPanel.findTabindex(gTab)); - } - else - { - GridController parent = includedMap.get(gTab.getAD_Tab_ID()); - int pindex = tabPanel.findTabindex(parent.getMTab()); - if (pindex >= 0) - tabPanel.setSelectedIndex(pindex); - } - gTab.navigate(i); - return true; - } - } - } - } - } - return false; - } - - /** - * Get Current Window No - * @return win no - */ - public int getWindowNo() - { - return m_curWindowNo; - } // getWindowNo - - /** - * Initial Query - * @param query initial query - * @param mTab tab - * @return query or null - */ - private MQuery initialQuery (MQuery query, GridTab mTab) - { - MRole role = MRole.getDefault(m_ctx, false); - // We have a (Zoom) query - if (query != null && query.isActive() && !role.isQueryMax(query.getRecordCount())) - return query; - // - StringBuffer where = new StringBuffer(Env.parseContext(m_ctx, m_curWindowNo, mTab.getWhereExtended(), false)); - // Query automatically if high volume and no query - boolean require = mTab.isHighVolume(); - if (!require && !m_onlyCurrentRows) // No Trx Window - { - /* Where Extended already appended above, check for variables */ - if (query != null) - { - String wh2 = query.getWhereClause(); - if (wh2.length() > 0) - { - if (where.length() > 0) - where.append (" AND "); - where.append(wh2); - } - } - // - StringBuffer sql = new StringBuffer("SELECT COUNT(*) FROM ") - .append(mTab.getTableName()); - if (where.length() > 0) - sql.append(" WHERE ").append(where); - // Does not consider security - int no = DB.getSQLValue(null, sql.toString()); - // - require = MRole.getDefault().isQueryRequire(no); - } - // Show Query - if (require) - { - GridField[] findFields = mTab.getFields(); - Find find = new Find (AEnv.getFrame(this), m_curWindowNo, mTab.getName(), - mTab.getAD_Tab_ID(), mTab.getAD_Table_ID(), mTab.getTableName(), - where.toString(), findFields, 10); // no query below 10 - query = find.getQuery(); - isCancel = (query == null);//Goodwill - find.dispose(); - find = null; - } - return query; - } // initialQuery - - - /** - * Get Window Index - * @return Window Index - */ - private int getWindowIndex() - { - // only one window - if (m_mWorkbench.getWindowCount() == 1) - return 0; - // workbench - return tabPanel.getSelectedIndex(); - } // getWindowIndex - - /** - * Is first Tab (on Window) - * @return true if the panel displays the first tab - */ - private boolean isFirstTab() - { - return m_curWinTab.getSelectedIndex() == 0; - } // isFirstTab - - /** - * Get Window Image - * @return image or null - */ - public Image getImage() - { - return m_mWorkbench.getImage(getWindowIndex()); - } // getImage - - - /************************************************************************** - * Data Status Listener (row change) ^ | v - * @param e event - */ - public void dataStatusChanged (DataStatusEvent e) - { - if (m_disposing) - return; - if (log.isLoggable(Level.INFO)) log.info(e.getMessage()); - String dbInfo = e.getMessage(); - if (m_curTab != null && m_curTab.isQueryActive()) - dbInfo = "[ " + dbInfo + " ]"; - statusBar.setStatusDB(dbInfo, e); - if (!isNested) - m_window.setTitle(getTitle()); - - // Set Message / Info - if (e.getAD_Message() != null || e.getInfo() != null) - { - StringBuilder sb = new StringBuilder(); - String msg = e.getMessage(); - if (msg != null && msg.length() > 0) - sb.append(Msg.getMsg(m_ctx, e.getAD_Message())); - String info = e.getInfo(); - if (info != null && info.length() > 0) - { - if (sb.length() > 0 && !sb.toString().trim().endsWith(":")) - sb.append(": "); - sb.append(info); - } - if (sb.length() > 0) - { - int pos = sb.indexOf("\n"); - if (pos != -1) // replace CR/NL - sb.replace(pos, pos+1, " - "); - setStatusLine (sb.toString (), e.isError ()); - } - } - - // Confirm Error - if (e.isError() && !e.isConfirmed()) - { - ADialog.error(m_curWindowNo, this, e.getAD_Message(), e.getInfo()); - e.setConfirmed(true); // show just once - if MTable.setCurrentRow is involved the status event is re-issued - m_errorDisplayed = true; - } - // Confirm Warning - else if (e.isWarning() && !e.isConfirmed()) - { - ADialog.warn(m_curWindowNo, this, e.getAD_Message(), e.getInfo()); - e.setConfirmed(true); // show just once - if MTable.setCurrentRow is involved the status event is re-issued - } - - // update Navigation - boolean firstRow = e.isFirstRow(); - aFirst.setEnabled(!firstRow); - aPrevious.setEnabled(!firstRow); - boolean lastRow = e.isLastRow(); - aNext.setEnabled(!lastRow); - aLast.setEnabled(!lastRow); - - // update Change - - boolean changed = e.isChanged() || e.isInserting(); - //int changedColumn = e.getChangedColumn(); - //boolean inserting = e.isInserting(); - - if(e.getAD_Message() != null && e.getAD_Message().equals("Saved")) - changed = false; - boolean readOnly = m_curTab.isReadOnly(); - boolean insertRecord = !readOnly; - boolean deleteRecord = !readOnly; - if (insertRecord) - insertRecord = m_curTab.isInsertRecord(); - aNew.setEnabled(!changed && insertRecord); - aCopy.setEnabled(!changed && insertRecord); - aRefresh.setEnabled(!changed); - if (deleteRecord) - deleteRecord = m_curTab.isDeleteRecord(); - aDelete.setEnabled(!changed && deleteRecord); - aDeleteSelection.setEnabled(!changed && !readOnly); - // - if (readOnly && m_curTab.isAlwaysUpdateField()) - readOnly = false; - aIgnore.setEnabled(changed && !readOnly); - aSave.setEnabled(changed && !readOnly); - aSaveAndCreate.setEnabled(changed && !readOnly); - // - // No Rows - if (e.getTotalRows() == 0 && insertRecord) { - aNew.setEnabled(true); - aDelete.setEnabled(false); - aDeleteSelection.setEnabled(false); - } - - // Single-Multi - aMulti.setPressed(!m_curGC.isSingleRow()); - - // History (on first Tab only) - if (isFirstTab()) - aHistory.setPressed(!m_curTab.isOnlyCurrentRows()); - - // Transaction info - String trxInfo = m_curTab.getStatusLine(); - if (trxInfo != null) - statusBar.setInfo(trxInfo); - - // Check Attachment - boolean canHaveAttachment = m_curTab.canHaveAttachment(); // not single _ID column - // - if (canHaveAttachment && e.isLoading() && m_curTab.getCurrentRow() > e.getLoadedRows()) - canHaveAttachment = false; - if (canHaveAttachment && m_curTab.getRecord_ID() == -1) // No Key - canHaveAttachment = false; - if (canHaveAttachment) - { - aAttachment.setEnabled(true); - aAttachment.setPressed(m_curTab.hasAttachment()); - aPostIt.setEnabled(true); - aPostIt.setPressed(m_curTab.hasPostIt()); - aChat.setEnabled(true); - aChat.setPressed(m_curTab.hasChat()); - } - else - { - aAttachment.setEnabled(false); - aPostIt.setEnabled(false); - aChat.setEnabled(false); - } - // Lock Indicator - if (m_isPersonalLock) - aLock.setPressed(m_curTab.isLocked()); - - if (m_curWinTab instanceof VTabbedPane) - ((VTabbedPane)m_curWinTab).evaluate(e); - // log.info("- fini", e.getMessage()); - } // dataStatusChanged - - /** - * Set Status Line to text - * @param text clear text - * @param error error flag - */ - public void setStatusLine (String text, boolean error) - { - if (log.isLoggable(Level.FINE)) log.fine(text); - statusBar.setStatusLine(text, error); - } // setStatusLine - - /** - * Indicate Busy - * @param busy busy - * @param focus request focus - */ - private void setBusy (boolean busy, boolean focus) - { - m_isLocked = busy; - // - JFrame frame = AEnv.getFrame(this); - if (frame == null) // during init - return; - if (frame instanceof AWindow) - ((AWindow)frame).setBusy(busy); - // String processing = Msg.getMsg(m_ctx, "Processing"); - if (busy) - { - // setStatusLine(processing); - this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - } - else - { - this.setCursor(Cursor.getDefaultCursor()); - frame.setCursor(Cursor.getDefaultCursor()); - if (focus) - m_curGC.requestFocus(); - // if (statusBar.getStatusLine().equals(processing)) - // statusBar.setStatusLine(""); - } - } // set Busy - - - /************************************************************************** - * Change Listener - (tab change) <-> - * @param e event - */ - public void stateChanged (ChangeEvent e) - { - if (m_disposing) - return; - if (log.isLoggable(Level.INFO)) log.info(e.toString()); - setBusy(true, true); - - VTabbedPane tp = (VTabbedPane)e.getSource(); - boolean back = false; - boolean isAPanelTab = false; - - //int previousIndex = 0; - - // Workbench Tab Change - if (tp.isWorkbench()) - { - int WBIndex = tabPanel.getSelectedIndex(); - m_curWindowNo = m_mWorkbench.getWindowNo(WBIndex); - // Window Change - if (log.isLoggable(Level.INFO)) log.info("curWin=" + m_curWindowNo + " - Win=" + tp); - if (tp.getSelectedComponent() instanceof JTabbedPane) - m_curWinTab = (JTabbedPane)tp.getSelectedComponent(); - else - throw new java.lang.IllegalArgumentException("Window does not contain Tabs"); - if (m_curWinTab.getSelectedComponent() instanceof GridController) { - m_curGC = (GridController)m_curWinTab.getSelectedComponent(); - initSwitchLineAction(); - } - // else if (m_curWinTab.getSelectedComponent() instanceof APanelTab) - // isAPanelTab = true; - else - throw new java.lang.IllegalArgumentException("Window-Tab does not contain GridControler"); - // change pointers - m_curTabIndex = m_curWinTab.getSelectedIndex(); - } - else - { - // Just a Tab Change - if (log.isLoggable(Level.INFO)) log.info("Tab=" + tp); - m_curWinTab = tp; - int tpIndex = m_curWinTab.getSelectedIndex(); - // detect no tab change - if (tpIndex == m_curTabIndex) return; - back = tpIndex < m_curTabIndex; - GridController gc = null; - if (m_curWinTab.getSelectedComponent() instanceof GridController) - gc = (GridController)m_curWinTab.getSelectedComponent(); - else if (m_curWinTab.getSelectedComponent() instanceof APanelTab) - isAPanelTab = true; - else - throw new java.lang.IllegalArgumentException("Tab does not contain GridControler"); - // Save old Tab - if (m_curGC != null) - { - m_curGC.stopEditor(true); - // has anything changed? - if (m_curTab.needSave(true, false)) - { // do we have real change - if (m_curTab.needSave(true, true)) - { - // Automatic Save - if (Env.isAutoCommit(m_ctx, m_curWindowNo)) - { - if (!m_curTab.dataSave(true)) - { // there is a problem, so we go back - showLastError(); - m_curWinTab.setSelectedIndex(m_curTabIndex); - setBusy(false, true); - return; - } - } - // explicitly ask when changing tabs - else if (ADialog.ask(m_curWindowNo, this, "SaveChanges?", m_curTab.getCommitWarning())) - { // yes we want to save - if (!m_curTab.dataSave(true)) - { // there is a problem, so we go back - showLastError(); - m_curWinTab.setSelectedIndex(m_curTabIndex); - setBusy(false, true); - return; - } - } - else // Don't save - { - int newRecord= m_curTab.getTableModel().getNewRow(); //VOSS COM - - if( newRecord == -1) - m_curTab.dataIgnore(); - else - { - m_curWinTab.setSelectedIndex(m_curTabIndex); - setBusy(false, true); - return; - } - } - } - - else // new record, but nothing changed - m_curTab.dataIgnore(); - } // there is a change - } - if (m_curAPanelTab != null) - { - m_curAPanelTab.saveData(); - m_curAPanelTab.unregisterPanel(); - m_curAPanelTab = null; - } - - // new tab - // if (m_curTabIndex >= 0) - // m_curWinTab.setForegroundAt(m_curTabIndex, AdempierePLAF.getTextColor_Normal()); - // m_curWinTab.setForegroundAt(tpIndex, AdempierePLAF.getTextColor_OK()); - // previousIndex = m_curTabIndex; - m_curTabIndex = tpIndex; - if (!isAPanelTab) { - m_curGC = gc; - initSwitchLineAction(); - } - } - - // Sort Tab Handling - if (isAPanelTab) - { - m_curAPanelTab = (APanelTab)m_curWinTab.getSelectedComponent(); - m_curAPanelTab.registerAPanel(this); - m_curAPanelTab.loadData(); - // Consider that APanelTab (e.g. VSortTab) is not navigable - teo_sarca [ 1705444 ] - aFirst.setEnabled(false); - aPrevious.setEnabled(false); - aNext.setEnabled(false); - aLast.setEnabled(false); - } - else // Cur Tab Setting - { - int gwTabIndex = m_mWorkbench.getMWindow(0).getTabIndex(m_curGC.getMTab()); - //boolean needValidate = false; - if (m_mWorkbench.getMWindow(0).isTabInitialized(gwTabIndex) == false) - { - m_mWorkbench.getMWindow(0).initTab(gwTabIndex); - //needValidate = true; - } - m_curGC.activate(); - m_curTab = m_curGC.getMTab(); - - // Refresh only current row when tab is current - if (back && m_curTab.isCurrent()) - m_curTab.dataRefresh(); - else // Requery & autoSize - { - MRole role = MRole.getDefault(); - m_curGC.query (m_onlyCurrentRows, m_onlyCurrentDays, role.getMaxQueryRecords()); - /* - if (m_curGC.isNeedToSaveParent()) - { - // there is a problem, so we go back - ADialog.error(m_curWindowNo, this, "SaveParentFirst"); - m_curWinTab.setSelectedIndex(previousIndex); - setBusy(false, true); - return; - }*/ - } - // Set initial record - if (m_curTab.getRowCount() == 0) - { - // Automatically create New Record, if none & tab not RO - if (!m_curTab.isReadOnly() - && (Env.isAutoNew(m_ctx, m_curWindowNo) || m_curTab.isQueryNewRecord())) - { - if (log.isLoggable(Level.CONFIG)) log.config("No record - New - AutoNew=" + Env.isAutoNew(m_ctx, m_curWindowNo) - + " - QueryNew=" + m_curTab.isQueryNewRecord()); - m_curTab.dataNew(false); - } - else // No Records found - { - aSave.setEnabled(false); - aSaveAndCreate.setEnabled(false); - aDelete.setEnabled(false); - aDeleteSelection.setEnabled(false); - } - m_curTab.navigateCurrent(); // updates counter - m_curGC.dynamicDisplay(0); - } - /* - if (needValidate) - { - JFrame frame = Env.getFrame(APanel.this); - if (frame != null) - { - //not sure why, the following lines is needed to make dynamic resize work - //tested on jdk1.5, 1.6 using jgoodies look and feel - frame.getPreferredSize(); - - if (frame.getExtendedState() != JFrame.MAXIMIZED_BOTH) - { - frame.setMinimumSize(frame.getSize()); - revalidate(); - SwingUtilities.invokeLater(new Runnable() { - - public void run() { - JFrame frame = Env.getFrame(APanel.this); - frame.validate(); - AEnv.showCenterScreen(frame); - frame.setMinimumSize(null); - } - - }); - } - } - }*/ - // else ##CHANGE - // m_curTab.navigateCurrent(); - } - - // Update <-> Navigation - aDetail.setEnabled(m_curTabIndex != m_curWinTab.getTabCount()-1); - aParent.setEnabled(m_curTabIndex != 0 && m_curWinTab.getTabCount() > 1); - - // History (on first tab only) - if (m_mWorkbench.getMWindow(getWindowIndex()).isTransaction()) - aHistory.setEnabled(isFirstTab()); - else - { - aHistory.setPressed(false); - aHistory.setEnabled(false); - } - // Document Print - aPrint.setEnabled(m_curTab.isPrinted()); - aPrintPreview.setEnabled(m_curTab.isPrinted()); - // Query - aFind.setPressed(m_curTab.isQueryActive()); - - // Order Tab - if (isAPanelTab) - { - aMulti.setPressed(false); - aMulti.setEnabled(false); - aNew.setEnabled(false); - aDelete.setEnabled(false); - aDeleteSelection.setEnabled(false); - aFind.setEnabled(false); - aRefresh.setEnabled(false); - aAttachment.setEnabled(false); - aPostIt.setEnabled(false); - aChat.setEnabled(false); - } - else // Grid Tab - { - aMulti.setEnabled(true); - aMulti.setPressed(!m_curGC.isSingleRow()); - aFind.setEnabled(true); - aRefresh.setEnabled(true); - aAttachment.setEnabled(true); - aPostIt.setEnabled(true); - aChat.setEnabled(true); - - // IDEMPIERE-587 - Swing: Toolbar Button to start Process from button fields - // tbayen - 2013-01-22 - GridField[] fields = m_curGC.getMTab().getFields(); - boolean processEnabled=false; - for(GridField field:fields){ - if (field.isToolbarButton() && field.isDisplayed()){ - processEnabled=true; - break; - } - } - aProcess.setEnabled(processEnabled); - } - - // - m_curWinTab.requestFocusInWindow(); - setBusy(false, true); - - if (!ToolBarMenuRestictionLoaded) - { - updateToolBarAndMenuWithRestriction(); - ToolBarMenuRestictionLoaded = true; - } - - log.config( "fini"); - } // stateChanged - - /** - * Navigate to Detail Tab -> - */ - private void cmd_detail() - { - int index = m_curWinTab.getSelectedIndex(); - if (index == m_curWinTab.getTabCount()-1) - return; - //hengsin, bug [ 1637763 ] - if (m_curWinTab instanceof VTabbedPane) - { - VTabbedPane tabPane = (VTabbedPane)m_curWinTab; - index++; - while ( index < tabPane.getTabCount() ) - { - if (tabPane.isEnabledAt(index)) - { - m_curGC.getTable().removeEditor(); - m_curGC.acceptEditorChanges(); - tabPane.setSelectedIndex(index); - break; - } - else - index++; - } - } - else - { - m_curGC.getTable().removeEditor(); - m_curGC.acceptEditorChanges(); - m_curWinTab.setSelectedIndex(index+1); - } - - } // navigateDetail - - /** - * Navigate to Parent Tab <- - */ - private void cmd_parent() - { - int index = m_curWinTab.getSelectedIndex(); - if (index == 0) - return; - //hengsin, bug [ 1637763 ] - if (m_curWinTab instanceof VTabbedPane) - { - VTabbedPane tabPane = (VTabbedPane)m_curWinTab; - index--; - while ( index >= 0 ) - { - if (tabPane.isEnabledAt(index)) - { - m_curGC.getTable().removeEditor(); - m_curGC.acceptEditorChanges(); - tabPane.setSelectedIndex(index); - break; - } - else - index--; - } - } - else - { - m_curGC.getTable().removeEditor(); - m_curGC.acceptEditorChanges(); - m_curWinTab.setSelectedIndex(index-1); - } - } // navigateParent - - - /************************************************************************** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (log.isLoggable(Level.INFO)) log.info(e.getActionCommand() + " - " + e.getModifiers()); - // + " - " + new Timestamp(e.getWhen()) + " " + isUILocked()); - if (m_disposing || isUILocked()) - return; - - m_lastModifiers = e.getModifiers(); - String cmd = e.getActionCommand(); - // Do ScreenShot w/o busy - if (cmd.equals("ScreenShot")) - { - AEnv.actionPerformed (e.getActionCommand(), m_curWindowNo, this); - return; - } - - // Problem: doubleClick detection - can't disable button as clicking button may change button status - if (!cmd.equals(aShowAllWindow.getName())) - setBusy (true, true); - // Command Buttons - if (e.getSource() instanceof VButton) - { - setStatusLine(processButtonCallout((VButton)e.getSource()), true); - actionButton((VButton)e.getSource()); - setBusy(false, true); - return; - } - - try - { - // File - if (cmd.equals(aReport.getName())) - cmd_report(); - else if (cmd.equals(aPrint.getName())) - cmd_print(); - else if (cmd.equals(aPrintPreview.getName())) - cmd_print(true); - else if (aExport != null && cmd.equals(aExport.getName())) - cmd_export(); - else if (cmd.equals(aEnd.getName())) - cmd_end(false); - else if (cmd.equals(aExit.getName())) - cmd_end(true); - // Edit - else if (cmd.equals(aNew.getName())) - cmd_new(false); - else if (cmd.equals(aSave.getName())) - cmd_save(true); - else if (cmd.equals(aSaveAndCreate.getName())) - cmd_saveAndCreate(true); - else if (cmd.equals(aCopy.getName())) - cmd_new(true); - else if (cmd.equals(aDelete.getName())) - cmd_delete(); - else if (cmd.equals(aDeleteSelection.getName())) - cmd_deleteSelection(); - else if (cmd.equals(aIgnore.getName())) - cmd_ignore(); - else if (cmd.equals(aRefresh.getName())) - cmd_refresh(); - else if (cmd.equals(aFind.getName())) - cmd_find(); - else if (m_isPersonalLock && cmd.equals(aLock.getName())) - cmd_lock(); - else if (cmd.equals(aProcess.getName())) - cmd_process(); - // View - else if (cmd.equals(aAttachment.getName())) - cmd_attachment(); - else if (cmd.equals(aPostIt.getName())) - cmd_postIt(); - else if (cmd.equals(aChat.getName())) - cmd_chat(); - else if (cmd.equals(aHistory.getName())) - cmd_history(); - else if (cmd.equals(aMulti.getName())) - m_curGC.switchRowPresentation(); - // Go - else if (cmd.equals(aHome.getName())) { - // show main menu - teo_sarca [ 1706409, 1707221 ] - setBusy(false, false); - AEnv.showWindow(AEnv.getWindow(0)); - return; - } - else if (cmd.equals(aFirst.getName())) - { /*cmd_save(false);*/ - m_curGC.getTable().removeEditor(); - m_curGC.acceptEditorChanges(); - m_curTab.navigate(0); - } - else if (cmd.equals(aSwitchLinesUpAction.getName())) - { - //up-key + shift - m_curGC.getTable().removeEditor(); - m_curTab.switchRows(m_curTab.getCurrentRow(), m_curTab.getCurrentRow() - 1, m_curGC.getTable().getSortColumn(), m_curGC.getTable().isSortAscending()); - m_curGC.getTable().requestFocus(); - } - else if (cmd.equals(aPrevious.getName())) - { /* cmd_save(false); */ - //up-image + shift - m_curGC.getTable().removeEditor(); - m_curGC.acceptEditorChanges(); - if ((e.getModifiers() & ActionEvent.SHIFT_MASK) != 0) { - m_curTab.switchRows(m_curTab.getCurrentRow(), m_curTab.getCurrentRow() - 1, m_curGC.getTable().getSortColumn(), m_curGC.getTable().isSortAscending()); - } else { - m_curTab.navigateRelative(-1); - } - } - else if (cmd.equals(aSwitchLinesDownAction.getName())) - { - //down-key + shift - m_curGC.getTable().removeEditor(); - m_curTab.switchRows(m_curTab.getCurrentRow(), m_curTab.getCurrentRow() + 1, m_curGC.getTable().getSortColumn(), m_curGC.getTable().isSortAscending()); - m_curGC.getTable().requestFocus(); - } - else if (cmd.equals(aNext.getName())) - { /* cmd_save(false); */ - //down-image + shift - m_curGC.getTable().removeEditor(); - m_curGC.acceptEditorChanges(); - if ((e.getModifiers() & ActionEvent.SHIFT_MASK) != 0) { - m_curTab.switchRows(m_curTab.getCurrentRow(), m_curTab.getCurrentRow() + 1, m_curGC.getTable().getSortColumn(), m_curGC.getTable().isSortAscending()); - } else { - m_curTab.navigateRelative(+1); - } - } - else if (cmd.equals(aLast.getName())) - { /*cmd_save(false);*/ - m_curGC.getTable().removeEditor(); - m_curGC.acceptEditorChanges(); - m_curTab.navigate(m_curTab.getRowCount()-1); - } - else if (cmd.equals(aParent.getName())) - cmd_parent(); - else if (cmd.equals(aDetail.getName())) - cmd_detail(); - else if (cmd.equals(aZoomAcross.getName())) - cmd_zoomAcross(); - else if (cmd.equals(aRequest.getName())) - cmd_request(); - else if (cmd.equals(aArchive.getName())) - cmd_archive(); - // Tools - else if (aWorkflow != null && cmd.equals(aWorkflow.getName())) - { - if (m_curTab.getRecord_ID() <= 0) - ; - else if (m_curTab.getTabNo() == 0 && m_mWorkbench.getMWindow(getWindowIndex()).isTransaction()) - AEnv.startWorkflowProcess(m_curTab.getAD_Table_ID(), m_curTab.getRecord_ID()); - else - AEnv.startWorkflowProcess(m_curTab.getAD_Table_ID(), m_curTab.getRecord_ID()); - } - else if (aWinSize != null && cmd.equals(aWinSize.getName())) - cmd_winSize(); - // Help - else if (cmd.equals(aHelp.getName())) - cmd_help(); - // General Commands (Environment) - else if (cmd.equals(aLogout.getName())) - cmd_logout(); - else if (cmd.equals(aShowAllWindow.getName())) - m_WindowMenu.expose(); - else if (!AEnv.actionPerformed (e.getActionCommand(), m_curWindowNo, this)) - log.log(Level.SEVERE, "No action for: " + cmd); - } - catch (Exception ex) - { - log.log(Level.SEVERE, cmd, ex); - String msg = ex.getMessage(); - if (msg == null || msg.length() == 0) - msg = ex.toString(); - msg = Msg.parseTranslation(m_ctx, msg); - ADialog.error(m_curWindowNo, this, "Error", msg); - } - // - m_curWinTab.requestFocusInWindow(); - setBusy(false, true); - } // actionPerformed - - private void cmd_logout() { - JFrame top = AEnv.getWindow(0); - if (top instanceof AMenu) { - ((AMenu)top).logout(); - } - - } - - /************************************************************************** - * Process Callout(s). - *

    - * The Callout is in the string of - * "class.method;class.method;" - * If there is no class name, i.e. only a method name, the class is regarded - * as CalloutSystem. - * The class needs to comply with the Interface Callout. - * - * @param field field - * @return error message or "" - * @see org.compiere.model.Callout - */ - private String processButtonCallout (VButton button) - { - GridField field = m_curTab.getField(button.getColumnName()); - return m_curTab.processCallout(field); - } // processButtonCallout - - /** - * Create New Record - * @param copy true if current record is to be copied - */ - private void cmd_new (boolean copy) - { - if (log.isLoggable(Level.CONFIG)) log.config("copy=" + copy); - if (!m_curTab.isInsertRecord()) - { - log.warning("Insert Record disabled for Tab"); - return; - } - - m_curGC.stopEditor(true); - m_curGC.acceptEditorChanges(); - - // BF [ 2799362 ] attempt to save if save action is enabled. Using - // m_curTab.needSave instead might miss unfilled mandatory fields. - if(aSave.isEnabled()){ - // Automatic Save - if (Env.isAutoCommit(m_ctx, m_curWindowNo)) - { - if (!cmd_save(true)) - { - return; - } - } - // explicitly ask when changing tabs - else if (ADialog.ask(m_curWindowNo, this, "SaveChanges?", m_curTab.getCommitWarning())) - { // yes we want to save - if (!cmd_save(true)) - { - return; - } - } - else // Don't save - m_curTab.dataIgnore(); - } - if (copy && m_curTab.getCurrentRow() < 0) - copy = false; - m_curTab.dataNew (copy); - m_curGC.dynamicDisplay(0); - // m_curTab.getTableModel().setChanged(false); - } // cmd_new - - /** - * Confirm & delete record - */ - private void cmd_delete() - { - if (m_curTab.isReadOnly()) - return; - int keyID = m_curTab.getRecord_ID(); - if (ADialog.ask(m_curWindowNo, this, "DeleteRecord?")) - if (m_curTab.dataDelete()) - m_curGC.rowChanged(false, keyID); - m_curGC.dynamicDisplay(0); - } // cmd_delete - - /** - * Show a list to select one or more items to delete. - */ - private void cmd_deleteSelection(){ - if (m_curTab.isReadOnly()) - return; - //show table with deletion rows -> by identifiers columns - JPanel messagePanel = new JPanel(); - JList list = new JList(); - JScrollPane scrollPane = new JScrollPane(list); - Vector data = new Vector(); - // FR [ 2877111 ] - final String keyColumnName = m_curTab.getKeyColumnName(); - String sql = null; - if (! "".equals(keyColumnName)) { - sql = MLookupFactory.getLookup_TableDirEmbed(Env.getLanguage(m_ctx), keyColumnName, "[?","?]") - .replace("[?.?]", "?"); - } - int noOfRows = m_curTab.getRowCount(); - for(int i = 0; i < noOfRows; i++) - { - StringBuffer displayValue = new StringBuffer(); - if ("".equals(keyColumnName)) - { - ArrayList parentColumnNames = m_curTab.getParentColumnNames(); - for (Iterator iter = parentColumnNames.iterator(); iter.hasNext();) - { - String columnName = iter.next(); - GridField field = m_curTab.getField(columnName); - if(field.isLookup()){ - Lookup lookup = field.getLookup(); - if (lookup != null){ - displayValue = displayValue.append(lookup.getDisplay(m_curTab.getValue(i,columnName))).append(" | "); - } else { - displayValue = displayValue.append(m_curTab.getValue(i,columnName)).append(" | "); - } - } else { - displayValue = displayValue.append(m_curTab.getValue(i,columnName)).append(" | "); - } - } - } else { - final int id = m_curTab.getKeyID(i); - String value = DB.getSQLValueStringEx(null, sql, id); - if (value != null) - value = value.replace(" - ", " | "); - displayValue.append(value); - // Append ID - if (displayValue.length() == 0 || CLogMgt.isLevelFine()) - { - if (displayValue.length() > 0) - displayValue.append(" | "); - displayValue.append("<").append(id).append(">"); - } - } - // - data.add(displayValue.toString()); - } - // FR [ 2877111 ] - list.setListData(data); - - list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); - messagePanel.add(scrollPane); - - final JOptionPane pane = new JOptionPane( - messagePanel, // message - JOptionPane.QUESTION_MESSAGE, // messageType - JOptionPane.OK_CANCEL_OPTION); // optionType - final JDialog deleteDialog = pane.createDialog(this.getParent(), Msg.getMsg(m_ctx, "DeleteSelection")); - deleteDialog.setVisible(true); - Integer okCancel = (Integer) pane.getValue(); - if(okCancel != null && okCancel == JOptionPane.OK_OPTION) - { - log.fine("ok"); - List selectedValues = list.getSelectedValuesList(); - for (int i = 0; i < selectedValues.size(); i++) - { - if (log.isLoggable(Level.FINE)) log.fine(selectedValues.get(i).toString()); - } - int[] indices = list.getSelectedIndices(); - Arrays.sort(indices); - int offset = 0; - for (int i = 0; i < indices.length; i++) - { - //m_curTab.setCurrentRow(indices[i]-offset); - m_curTab.navigate(indices[i]-offset); - int keyID = m_curTab.getRecord_ID(); - if (m_curTab.dataDelete()) - { - m_curGC.rowChanged(false, keyID); - offset++; - } - } - m_curGC.dynamicDisplay(0); - } - else - { - log.fine("cancel"); - } - }//cmd_deleteSelection - - /** - * If required ask if you want to save and save it - * @param manualCmd true if invoked manually (i.e. force) - * @return true if saved - */ - public boolean cmd_save (boolean manualCmd) - { - if (m_curAPanelTab != null) - manualCmd = false; - if (log.isLoggable(Level.CONFIG)) log.config("Manual=" + manualCmd); - m_errorDisplayed = false; - m_curGC.stopEditor(true); - m_curGC.acceptEditorChanges(); - - if (m_curAPanelTab != null) - { - m_curAPanelTab.saveData(); - aSave.setEnabled(false); // set explicitly - aSaveAndCreate.setEnabled(false); - } - - if (m_curTab.getCommitWarning().length() > 0 && m_curTab.needSave(true, false)) - if (!ADialog.ask(m_curWindowNo, this, "SaveChanges?", m_curTab.getCommitWarning())) - return false; - - // manually initiated - boolean retValue = m_curTab.dataSave(manualCmd); - // if there is no previous error - if (manualCmd && !retValue && !m_errorDisplayed) - { - showLastError(); - } - if (retValue) - m_curGC.rowChanged(true, m_curTab.getRecord_ID()); - if (manualCmd) { - m_curGC.dynamicDisplay(0); - if (!isNested) - m_window.setTitle(getTitle()); - } - - //BEGIN - [FR 1953734] - if(m_curGC.isDetailGrid() && retValue){ - m_curGC.getGCParent().refreshMTab(m_curGC); - } - //END - [FR 1953734] - - return retValue; - } // cmd_save - - private void showLastError() { - String msg = CLogger.retrieveErrorString(null); - if (msg != null) - ADialog.error(m_curWindowNo, this, null, msg); - else - ADialog.error(m_curWindowNo, this, "SaveIgnored"); - setStatusLine(Msg.getMsg(m_ctx, "SaveIgnored"), true); - } - - public boolean cmd_saveAndCreate(boolean manualCmd) - { - boolean retValue = cmd_save(manualCmd); - if(retValue) - cmd_new(false); - return retValue; - } - - private long m_popup_closingtime=0; - - /** - * opens a pulldown menu to start processes from "Button" type fields. - */ - // IDEMPIERE-587 - Swing: Toolbar Button to start Process from button fields - // tbayen - 2013-01-22 - public void cmd_process() { - if(System.currentTimeMillis()-m_popup_closingtime<200) - return; // closed through the same click - user has clicked to close the menu - GridField[] fields = m_curGC.getMTab().getFields(); - final ArrayList processFields = new ArrayList(); - for (GridField field : fields) { - if (field.isToolbarButton() && field.isDisplayed()) { - processFields.add(field); - } - } - JPopupMenu popup = new JPopupMenu(); - popup.addPopupMenuListener(new PopupMenuListener() { - @Override - public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { - m_popup_closingtime=System.currentTimeMillis(); - } - - @Override public void popupMenuWillBecomeVisible(PopupMenuEvent e) {} - @Override public void popupMenuCanceled(PopupMenuEvent e) {} - }); - - for (GridField field : processFields) { - if (field.isDisplayed(true)) { - ImageIcon icon = Env.getImageIcon2("Process16"); - String text = field.getHeader(); - Color color = null; - // Record_ID for Zoom Buttons (see - // http://www.adempiere.com/Entering_Data_-_Fields_and_Buttons#Button) - if (field.getColumnName().endsWith("_ID") - && !field.getColumnName().equals("Record_ID")) { - MLookupFactory.get(Env.getCtx(), - field.getWindowNo(), 0, field.getAD_Column_ID(), - DisplayType.Search); - } else if (field.getAD_Reference_Value_ID() != 0) { - // Assuming List - MLookupFactory.get(Env.getCtx(), - field.getWindowNo(), 0, field.getAD_Column_ID(), - DisplayType.List); - } - - // Special Buttons - int AD_Reference_ID = -1; - String columnName = field.getColumnName(); - if (columnName.equals("PaymentRule")) { - AD_Reference_ID = REFERENCE_PAYMENTRULE; - color = Color.blue; - icon = Env.getImageIcon("Payment16.gif"); // 29*14 - } else if (columnName.equals("DocAction")) { - AD_Reference_ID = REFERENCE_DOCUMENTACTION; - color = Color.blue; - icon = Env.getImageIcon("Process16.gif"); // 16*16 - } else if (columnName.equals("CreateFrom")) { - icon = Env.getImageIcon("Copy16.gif"); // 16*16 - } else if (columnName.equals("Record_ID")) { - icon = Env.getImageIcon("Zoom16.gif"); // 16*16 - text = Msg.getMsg(Env.getCtx(), "ZoomDocument"); - } else if (columnName.equals("Posted")) { - AD_Reference_ID = REFERENCE_POSTED; - color = Color.magenta; - icon = Env.getImageIcon("InfoAccount16.gif"); // 16*16 - } - - Map values = null; - if (AD_Reference_ID > 0) { - values = new HashMap(); - String SQL; - if (Env.isBaseLanguage(Env.getCtx(), "AD_Ref_List")) - SQL = "SELECT Value, Name FROM AD_Ref_List WHERE AD_Reference_ID=?"; - else - SQL = "SELECT l.Value, t.Name FROM AD_Ref_List l, AD_Ref_List_Trl t " - + "WHERE l.AD_Ref_List_ID=t.AD_Ref_List_ID" - + " AND t.AD_Language='" - + Env.getAD_Language(Env.getCtx()) - + "'" - + " AND l.AD_Reference_ID=?"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try { - pstmt = DB.prepareStatement(SQL, null); - pstmt.setInt(1, AD_Reference_ID); - rs = pstmt.executeQuery(); - while (rs.next()) { - String value = rs.getString(1); - String name = rs.getString(2); - values.put(value, name); - } - } catch (SQLException e) { - log.log(Level.SEVERE, SQL, e); - } - finally{ - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - // Nothing to show or Record_ID - if (field.getValue() == null - || field.getColumnName().equals("Record_ID")) - ; - else if (values != null) - text = (String) values.get(field.getValue()); - // Display it - } // setValue - - JMenuItem item = new JMenuItem(text, icon); - item.setForeground(color); - item.setName(field.getColumnName()); - popup.add(item); - item.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - JMenuItem menuItem = ((JMenuItem)e.getSource()); - String columnName=menuItem.getName(); - GridField callingField = m_curTab.getField(columnName); - // - setStatusLine(m_curTab.processCallout(callingField), true); - actionButtonCleanUp(menuItem.getName(), - callingField.getAD_Process_ID(), callingField.getHeader()); - } - }); - } - } - popup.show(aProcess.getButton(), -1, aProcess.getButton().getHeight()); - } - - /** - * Ignore - */ - private void cmd_ignore() - { - m_curGC.stopEditor(false); - // Ignore changes in APanelTab (e.g. VSortTab) - teo_sarca [ 1705429 ] - if (m_curAPanelTab != null) - { - m_curAPanelTab.loadData(); - } - m_curTab.dataIgnore(); - m_curTab.dataRefresh(true); - m_curGC.dynamicDisplay(0); - - } // cmd_ignore - - /** - * Refresh - */ - private void cmd_refresh() - { - cmd_save(false); - m_curTab.dataRefreshAll(); - m_curGC.dynamicDisplay(0); - } // cmd_refresh - - /** - * Print standard Report - */ - private void cmd_report () - { - log.info(""); - if (!MRole.getDefault().isCanReport(m_curTab.getAD_Table_ID())) - { - ADialog.error(m_curWindowNo, this, "AccessCannotReport"); - return; - } - - cmd_save(false); - - // Query - MQuery query = new MQuery(m_curTab.getTableName()); - // Link for detail records - String queryColumn = m_curTab.getLinkColumnName(); - // Current row otherwise - if (queryColumn.length() == 0) - queryColumn = m_curTab.getKeyColumnName(); - // Find display - String infoName = null; - String infoDisplay = null; - for (int i = 0; i < m_curTab.getFieldCount(); i++) - { - GridField field = m_curTab.getField(i); - if (field.isKey()) - infoName = field.getHeader(); - if ((field.getColumnName().equals("Name") || field.getColumnName().equals("DocumentNo") ) - && field.getValue() != null) - infoDisplay = field.getValue().toString(); - if (infoName != null && infoDisplay != null) - break; - } - if (queryColumn.length() != 0) - { - if (queryColumn.endsWith("_ID")) - query.addRestriction(queryColumn, MQuery.EQUAL, - Integer.valueOf(Env.getContextAsInt(m_ctx, m_curWindowNo, queryColumn)), - infoName, infoDisplay); - else - query.addRestriction(queryColumn, MQuery.EQUAL, - Env.getContext(m_ctx, m_curWindowNo, queryColumn), - infoName, infoDisplay); - } - - new AReport (m_curTab.getAD_Table_ID(), aReport.getButton(), query, this, m_curWindowNo, m_curTab.getWhereExtended()); - } // cmd_report - - - /** - * Zoom Across Menu - */ - private void cmd_zoomAcross() - { - int record_ID = m_curTab.getRecord_ID(); - if (log.isLoggable(Level.INFO)) log.info("ID=" + record_ID); - if (record_ID <= 0) - return; - - // Query - MQuery query = new MQuery(); - // Current row - String link = m_curTab.getKeyColumnName(); - // Link for detail records - if (link.length() == 0) - link = m_curTab.getLinkColumnName(); - if (link.length() != 0) - { - if (link.endsWith("_ID")) - query.addRestriction(link, MQuery.EQUAL, - Integer.valueOf(Env.getContextAsInt(m_ctx, m_curWindowNo, link))); - else - query.addRestriction(link, MQuery.EQUAL, - Env.getContext(m_ctx, m_curWindowNo, link)); - } - new AZoomAcross(aZoomAcross.getButton(), m_curTab.getTableName(), - m_curTab.getAD_Window_ID(), query); - } // cmd_zoom - - /** - * Open/View Request - */ - private void cmd_request() - { - int record_ID = m_curTab.getRecord_ID(); - if (log.isLoggable(Level.INFO)) log.info("ID=" + record_ID); - if (record_ID <= 0) - return; - - int AD_Table_ID = m_curTab.getAD_Table_ID(); - int C_BPartner_ID = 0; - Object BPartner_ID = m_curTab.getValue("C_BPartner_ID"); - if (BPartner_ID != null) - C_BPartner_ID = ((Integer)BPartner_ID).intValue(); - new ARequest (aRequest.getButton(), AD_Table_ID, record_ID, C_BPartner_ID); - } // cmd_request - - /** - * Open/View Archive - */ - private void cmd_archive() - { - int record_ID = m_curTab.getRecord_ID(); - if (log.isLoggable(Level.INFO)) log.info("ID=" + record_ID); - if (record_ID <= 0) - return; - - int AD_Table_ID = m_curTab.getAD_Table_ID(); - new AArchive (aArchive.getButton(), AD_Table_ID, record_ID); - } // cmd_archive - - /** - * Print specific Report - or start default Report - */ - private void cmd_print() - { - cmd_print(false); - } - - /** - * Print specific Report - or start default Report - */ - private void cmd_print(boolean printPreview) - { - // Get process defined for this tab - int AD_Process_ID = m_curTab.getAD_Process_ID(); - if (log.isLoggable(Level.INFO)) log.info("ID=" + AD_Process_ID); - - // No report defined - if (AD_Process_ID == 0) - { - cmd_report(); - return; - } - - cmd_save(false); - // - int table_ID = m_curTab.getAD_Table_ID(); - int record_ID = m_curTab.getRecord_ID(); - ProcessInfo pi = new ProcessInfo (getTitle(), AD_Process_ID, table_ID, record_ID); - pi.setAD_User_ID (Env.getAD_User_ID(m_ctx)); - pi.setAD_Client_ID (Env.getAD_Client_ID(m_ctx)); - pi.setPrintPreview(printPreview); - pi.setAD_Process_UU(m_curTab.getAD_Process_UU()); - - ClientProcessCtrl.process(this, m_curWindowNo, pi, null); // calls lockUI, unlockUI - statusBar.setStatusLine(pi.getSummary(), pi.isError()); - } // cmd_print - - /** - * Find - Set Query - */ - private void cmd_find() - { - if (m_curTab == null) - return; - cmd_save(false); - // Gets Fields from AD_Field_v - GridField[] findFields = GridField.createFields(m_ctx, m_curWindowNo, 0, m_curTab.getAD_Tab_ID()); - Find find = new Find (AEnv.getFrame(this), m_curWindowNo, m_curTab.getName(), - m_curTab.getAD_Tab_ID(), m_curTab.getAD_Table_ID(), m_curTab.getTableName(), - m_curTab.getWhereExtended(), findFields, 1); - MQuery query = find.getQuery(); - find.dispose(); - find = null; - - // Confirmed query - if (query != null) - { - m_onlyCurrentRows = false; // search history too - m_curTab.setQuery(query); - m_curGC.query(m_onlyCurrentRows, m_onlyCurrentDays, 0); // autoSize - } - aFind.setPressed(m_curTab.isQueryActive()); - } // cmd_find - - /** - * Attachment - */ - private void cmd_attachment() - { - int record_ID = m_curTab.getRecord_ID(); - if (log.isLoggable(Level.INFO)) log.info("Record_ID=" + record_ID); - if (record_ID == -1) // No Key - { - aAttachment.setEnabled(false); - return; - } - - @SuppressWarnings("unused") - Attachment va = new Attachment (AEnv.getFrame(this), m_curWindowNo, - m_curTab.getAD_AttachmentID(), m_curTab.getAD_Table_ID(), record_ID, null); - // - aAttachment.setPressed(m_curTab.hasAttachment()); - } // attachment - - /** - * Chat - */ - private void cmd_chat() - { - int record_ID = m_curTab.getRecord_ID(); - if (log.isLoggable(Level.INFO)) log.info("Record_ID=" + record_ID); - if (record_ID == -1) // No Key - { - aChat.setEnabled(false); - return; - } - // Find display - String infoName = null; - String infoDisplay = null; - for (int i = 0; i < m_curTab.getFieldCount(); i++) - { - GridField field = m_curTab.getField(i); - if (field.isKey()) - infoName = field.getHeader(); - if ((field.getColumnName().equals("Name") || field.getColumnName().equals("DocumentNo") ) - && field.getValue() != null) - infoDisplay = field.getValue().toString(); - if (infoName != null && infoDisplay != null) - break; - } - String description = infoName + ": " + infoDisplay; - // - // AChat va = - new AChat (AEnv.getFrame(this), m_curWindowNo, - m_curTab.getCM_ChatID(), m_curTab.getAD_Table_ID(), record_ID, - description, null); - // - aChat.setPressed(m_curTab.hasChat()); - } // chat - - /** - * Lock - */ - private void cmd_lock() - { - if (log.isLoggable(Level.INFO)) log.info("Modifiers=" + m_lastModifiers); - if (!m_isPersonalLock) - return; - int record_ID = m_curTab.getRecord_ID(); - if (record_ID == -1) // No Key - return; - // Control Pressed - if ((m_lastModifiers & ActionEvent.CTRL_MASK) != 0) - { - new RecordAccessDialog(AEnv.getFrame(this), m_curTab.getAD_Table_ID(), record_ID); - } - else - { - m_curTab.lock (Env.getCtx(), record_ID, aLock.getButton().isSelected()); - } - aLock.setPressed(m_curTab.isLocked()); - } // lock - - /** - * Toggle History - */ - private void cmd_history() - { - if (log.isLoggable(Level.INFO)) log.info(""); - if (m_mWorkbench.getMWindow(getWindowIndex()).isTransaction()) - { - if (m_curTab.needSave(true, true) && !cmd_save(false)) - return; - - Point pt = new Point (0, aHistory.getButton().getBounds().height); - SwingUtilities.convertPointToScreen(pt, aHistory.getButton()); - VOnlyCurrentDays ocd = new VOnlyCurrentDays(AEnv.getFrame(this), pt); - if (!ocd.isCancel()) { - m_onlyCurrentDays = ocd.getCurrentDays(); - if (m_onlyCurrentDays == 1) // Day - { - m_onlyCurrentRows = true; - m_onlyCurrentDays = 0; // no Created restriction - } - else - m_onlyCurrentRows = false; - // - m_curTab.setQuery(null); // reset previous queries - MRole role = MRole.getDefault(); - int maxRows = role.getMaxQueryRecords(); - // - if (log.isLoggable(Level.CONFIG)) log.config("OnlyCurrent=" + m_onlyCurrentRows - + ", Days=" + m_onlyCurrentDays - + ", MaxRows=" + maxRows); - m_curGC.query(m_onlyCurrentRows, m_onlyCurrentDays, maxRows ); // autoSize - } - // Restore history button's pressed status - else { - if (isFirstTab()) - aHistory.setPressed(!m_curTab.isOnlyCurrentRows()); - } - } - } // cmd_history - - /** - * Help - */ - private void cmd_help() - { - log.info(""); - Help hlp = new Help (AEnv.getFrame(this), this.getTitle(), m_mWorkbench.getMWindow(getWindowIndex())); - hlp.setVisible(true); - } // cmd_help - - /** - * Close this screen - after save - * @param exit ask if user wants to exit application - */ - private void cmd_end (boolean exit) - { - boolean exitSystem = false; - if (!cmd_save(false)) - return; - if (exit && ADialog.ask(m_curWindowNo, this, "ExitApplication?")) - exitSystem = true; - - AEnv.getFrame(this).dispose(); // calls this dispose - - if (exitSystem) - AEnv.exit(0); - } // cmd_end - - /** - * Set Window Size - */ - private void cmd_winSize() - { - Dimension size = getSize(); - if (!ADialog.ask(m_curWindowNo, this, "WinSizeSet", - "x=" + size.width + " - y=" + size.height)) - { - setPreferredSize(null); - SwingUtilities.getWindowAncestor(this).pack(); - size = new Dimension (0,0); - } - // - MWindow win = MWindow.get(m_ctx, m_curTab.getAD_Window_ID()); - win.setWindowSize(size); - win.saveEx(); - } // cmdWinSize - - private void cmd_export() - { - new AExport(this); - } - - private void cmd_postIt() - { - int record_ID = m_curTab.getRecord_ID(); - if (log.isLoggable(Level.INFO)) log.info("Record_ID=" + record_ID); - if (record_ID == -1) // No Key - { - aChat.setEnabled(false); - return; - } - // Find display - String infoName = null; - String infoDisplay = null; - for (int i = 0; i < m_curTab.getFieldCount(); i++) - { - GridField field = m_curTab.getField(i); - if (field.isKey()) - infoName = field.getHeader(); - if ((field.getColumnName().equals("Name") || field.getColumnName().equals("DocumentNo") ) - && field.getValue() != null) - infoDisplay = field.getValue().toString(); - if (infoName != null && infoDisplay != null) - break; - } - String header = infoName + ": " + infoDisplay; - // - - new VPostIt (AEnv.getFrame(this), header, m_curTab.getAD_PostIt_ID(), m_curTab.getAD_Table_ID(), record_ID, null); - aPostIt.setPressed(m_curTab.hasPostIt()); - } // cmd_postIt - - /************************************************************************** - * Start Button Process - * @param vButton button - */ - private void actionButton (VButton vButton){ - if (log.isLoggable(Level.INFO)) log.info(vButton.toString()); - String title = vButton.getDescription(); - if (title == null || title.length() == 0) - title = vButton.getName(); - actionButtonCleanUp(vButton.getColumnName(), vButton.getProcess_ID(), title); - } - - private void actionButtonCleanUp(String columnName, int processID, String title) - { - - if (m_curTab.hasChangedCurrentTabAndParents()) { - String msg = CLogger.retrieveErrorString("Please ReQuery Window"); - ADialog.error(m_curWindowNo, this, null, msg); - return; - } - - boolean startWOasking = false; -// boolean batch = false; - String col = columnName; - - // Zoom - if (col.equals("Record_ID")) - { - int AD_Table_ID = Env.getContextAsInt (m_ctx, m_curWindowNo, "AD_Table_ID"); - int Record_ID = Env.getContextAsInt (m_ctx, m_curWindowNo, "Record_ID"); - AEnv.zoom(AD_Table_ID, Record_ID); - return; - } // Zoom - - // save first --------------- - if (m_curTab.needSave(true, false)) - if (!cmd_save(true)) - return; - // Save included tabs if necessary - teo_sarca BF [ 2876892 ] - for (GridTab includedTab : m_curTab.getIncludedTabs()) - { - if (includedTab.needSave(true, false)) - if(!includedTab.dataSave(true)) - return; - } - // - int table_ID = m_curTab.getAD_Table_ID(); - // Record_ID - int record_ID = m_curTab.getRecord_ID(); - // Record_ID - Language Handling - if (record_ID == -1 && m_curTab.getKeyColumnName().equals("AD_Language")) - record_ID = Env.getContextAsInt (m_ctx, m_curWindowNo, "AD_Language_ID"); - // Record_ID - Change Log ID - if (record_ID == -1 - && (processID == PROCESS_AD_CHANGELOG_UNDO || processID == PROCESS_AD_CHANGELOG_REDO)) - { - Integer id = (Integer)m_curTab.getValue("AD_ChangeLog_ID"); - record_ID = id.intValue(); - } - // Ensure it's saved - if (record_ID == -1 && m_curTab.getKeyColumnName().endsWith("_ID")) - { - ADialog.error(m_curWindowNo, this, "SaveErrorRowNotFound"); - return; - } - - boolean isProcessMandatory = false; - // Pop up Document Action (Workflow) - if (col.equals("DocAction")) - { - isProcessMandatory = true; - VDocAction vda = new VDocAction(m_curWindowNo, m_curTab, null, record_ID); - // Something to select from? - if (vda.getNumberOfOptions() == 0) - { - vda.dispose (); - log.info("DocAction - No Options"); - return; - } - else - { - vda.setVisible(true); - if (!vda.isStartProcess()) - return; -// batch = vda.isBatch(); - startWOasking = true; - vda.dispose(); - } - } // DocAction - - // Pop up Create From - else if (col.equals("CreateFrom")) - { - // Run form only if the button has no process defined - teo_sarca [ 1974354 ] - if (processID <= 0) - { - ICreateFrom cf = VCreateFromFactory.create(m_curTab); - if(cf != null) - { - if(cf.isInitOK()) - { - cf.showWindow(); - cf.closeWindow(); - m_curTab.dataRefresh(); - } - else - cf.closeWindow(); - return; - } - // else may start process - } - } // CreateFrom - - // Posting ----- - else if (col.equals("Posted") && MRole.getDefault().isShowAcct()) - { - // Check Doc Status - String processed = Env.getContext(m_ctx, m_curWindowNo, "Processed"); - if (!processed.equals("Y")) - { - String docStatus = Env.getContext(m_ctx, m_curWindowNo, "DocStatus"); - if (DocAction.STATUS_Completed.equals(docStatus) - || DocAction.STATUS_Closed.equals(docStatus) - || DocAction.STATUS_Reversed.equals(docStatus) - || DocAction.STATUS_Voided.equals(docStatus) - || table_ID == MProjectIssue.Table_ID) // document without status - ; - else - { - ADialog.error(m_curWindowNo, this, "PostDocNotComplete"); - return; - } - } - - // try to get table and record id from context data (eg for unposted view) - // otherwise use current table/record - int tableId = Env.getContextAsInt(m_ctx, m_curWindowNo, "AD_Table_ID", true); - int recordId = Env.getContextAsInt(m_ctx, m_curWindowNo, "Record_ID", true); - if ( tableId == 0 || recordId == 0 ) - { - tableId = m_curTab.getAD_Table_ID(); - recordId = m_curTab.getRecord_ID(); - } - - // Check Post Status - Object ps = m_curTab.getValue("Posted"); - if (ps != null && ps.equals("Y")) - { - new org.compiere.acct.AcctViewer (Env.getContextAsInt (m_ctx, m_curWindowNo, "AD_Client_ID"), - tableId, recordId); - } - else - { - if (ADialog.ask(m_curWindowNo, this, "PostImmediate?")) - { - boolean force = ps != null && !ps.equals ("N"); // force when problems - String error = AEnv.postImmediate (m_curWindowNo, Env.getAD_Client_ID(m_ctx), - tableId, recordId, force); - if (error != null) - ADialog.error(m_curWindowNo, this, "PostingError-N", error); - cmd_refresh(); - } - } - return; - } // Posted - - /** - * Start Process ---- - * or invoke user form - */ - - if (log.isLoggable(Level.CONFIG)) log.config("Process_ID=" + processID + ", Record_ID=" + record_ID); - if (processID == 0) - { - if (isProcessMandatory) - { - ADialog.error(m_curWindowNo, this, null, Msg.parseTranslation(m_ctx, "@NotFound@ @AD_Process_ID@")); - } - return; - } - // Save item changed - if (m_curTab.needSave(true, false)) - if (!cmd_save(true)) - return; - - // call form - MProcess pr = new MProcess(m_ctx, processID, null); - int form_ID = pr.getAD_Form_ID(); - if (form_ID != 0 ) - { - - if (m_curTab.needSave(true, false)) - if (!cmd_save(true)) - return; - - FormFrame ff = new FormFrame(getGraphicsConfiguration()); - ProcessInfo pi = new ProcessInfo (title, processID, table_ID, record_ID); - pi.setAD_User_ID (Env.getAD_User_ID(m_ctx)); - pi.setAD_Client_ID (Env.getAD_Client_ID(m_ctx)); - pi.setAD_Process_UU(pr.getAD_Process_UU()); - ff.setProcessInfo(pi); - ff.openForm(form_ID, m_curTab); - ff.pack(); - AEnv.showCenterScreen(ff); - return; - } - else { - ProcessModalDialog dialog = new ProcessModalDialog(m_ctx, AEnv.getWindow(m_curWindowNo), Env.getHeader(m_ctx, m_curWindowNo), - this, m_curWindowNo, processID, table_ID, - record_ID, startWOasking); - if (dialog.isValidDialog()) - { - dialog.validate(); - dialog.pack(); - AEnv.showCenterWindow(AEnv.getWindow(m_curWindowNo), dialog); - } - } - } // actionButton - - - /************************************************************************** - * Lock User Interface. - * Called from the Worker before processing - * @param pi process info - */ - public void lockUI (ProcessInfo pi) - { - // log.fine("" + pi); - setBusy(true, false); - } // lockUI - - /** - * Unlock User Interface. - * Called from the Worker when processing is done - * @param pi of execute ASync call - */ - public void unlockUI (ProcessInfo pi) - { - // log.fine("" + pi); - boolean notPrint = pi != null - && pi.getAD_Process_ID() != m_curTab.getAD_Process_ID() - && pi.isReportingProcess() == false; - // - setBusy(false, notPrint); - // Process Result - if (notPrint) // refresh if not print - { - // Refresh data - m_curTab.dataRefresh(); - // Timeout - if (pi.isTimeout()) // set temporarily to R/O - Env.setContext(m_ctx, m_curWindowNo, "Processed", "Y"); - m_curGC.dynamicDisplay(0); - // Update Status Line - setStatusLine(pi.getSummary(), pi.isError()); - if ( pi.isError() ) - ADialog.error(m_curWindowNo, this, null, pi.getSummary()); - // Get Log Info - ProcessInfoUtil.setLogFromDB(pi); - String logInfo = pi.getLogInfo(); - if (logInfo.length() > 0) - ADialog.info(m_curWindowNo, this, Env.getHeader(m_ctx, m_curWindowNo), - pi.getTitle(), logInfo); // clear text - } - else - { - // Update Status Line - setStatusLine(pi.getSummary(), pi.isError()); - if ( pi.isError() ) - ADialog.error(m_curWindowNo, this, null, pi.getSummary()); - } - } // unlockUI - - /** - * Is the UI locked (Internal method) - * @return true, if UI is locked - */ - public boolean isUILocked() - { - return m_isLocked; - } // isLoacked - - /** - * Method to be executed async. - * Called from the ASyncProcess worker - * @param pi process info - */ - public void executeASync (ProcessInfo pi) - { - log.config("-"); - } // executeASync - - /** - * Get Current Tab - * @return current tab - */ - public GridTab getCurrentTab() - { - return m_curTab; - } // getCurrentTab - - /** - * Get the number of tabs in the panels JTabbedPane. - * @return no of tabs in the JTabbedPane of the panel - */ - public int noOfTabs() { - return m_curWinTab.getTabCount(); - } - - /** - * Get the selected tab index of the panels JTabbedPane. - * @return selected index of JTabbedPane - */ - public int getSelectedTabIndex() { - return m_curWinTab.getSelectedIndex(); - } - - /** - * Set the tab index of the panels JTabbedPane. - */ - public void setSelectedTabIndex(int index) { - m_curWinTab.setSelectedIndex(index); - } - - /** - * Get the name of the selected tab in the panels JTabbedPane. - * @return name of selected tab - */ - public String getSelectedTabName() { - String title = m_curWinTab.getTitleAt(m_curWinTab.getSelectedIndex()); - title = title.substring(title.indexOf("")+6); - title = title.substring(0,title.indexOf('<')); - return title; - } - - /** - * String representation - * @return String representation - */ - public String toString() - { - String s = "APanel[curWindowNo=" + m_curWindowNo; - if (m_mWorkbench != null) - s += ",WB=" + m_mWorkbench.toString(); - s += "]"; - return s; - } // toString - - /** - * Simple action class for the resort of tablelines (switch line no). Delegates actionPerformed - * to APanel. - * - * @author Karsten Thiemann, kthiemann@adempiere.org - * - */ - class SwitchAction extends AbstractAction { - /** - * - */ - private static final long serialVersionUID = 3837712049468116744L; - - /** the action listener - APanel */ - private ActionListener al; - - /** action name */ - private String name; - - /** - * Constructor. - * @param name - * @param accelerator - * @param al - */ - SwitchAction(String name, KeyStroke accelerator, ActionListener al) { - super(name); - putValue(Action.NAME, name); // Display - putValue(Action.SHORT_DESCRIPTION, name); // Tooltip - putValue(Action.ACCELERATOR_KEY, accelerator); // KeyStroke - putValue(Action.ACTION_COMMAND_KEY, name); // ActionCammand - this.al = al; - this.name = name; - } - - public void actionPerformed(ActionEvent e) { - al.actionPerformed(e); - } // actionPerformed - - public String getName() { - return name; - } - } - - /** - * Removes the default KeyStroke action for the up/down keys and adds switch - * line actions. - */ - private void initSwitchLineAction() { - aSwitchLinesDownAction = new SwitchAction("switchLinesDown", KeyStroke.getKeyStroke( - KeyEvent.VK_DOWN, ActionEvent.SHIFT_MASK), this); - aSwitchLinesUpAction = new SwitchAction("switchLinesUp", KeyStroke.getKeyStroke( - KeyEvent.VK_UP, ActionEvent.SHIFT_MASK), this); - - JTable table = m_curGC.getTable(); - table.getInputMap(CPanel.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put( - KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, ActionEvent.SHIFT_MASK), "none"); - table.getInputMap(CPanel.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put( - KeyStroke.getKeyStroke(KeyEvent.VK_UP, ActionEvent.SHIFT_MASK), "none"); - table.getInputMap(CPanel.WHEN_FOCUSED).put( - KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, ActionEvent.SHIFT_MASK), "none"); - table.getInputMap(CPanel.WHEN_FOCUSED).put( - KeyStroke.getKeyStroke(KeyEvent.VK_UP, ActionEvent.SHIFT_MASK), "none"); - - getInputMap(CPanel.WHEN_IN_FOCUSED_WINDOW).put( - KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, ActionEvent.SHIFT_MASK), - aSwitchLinesDownAction.getName()); - getActionMap().put(aSwitchLinesDownAction.getName(), aSwitchLinesDownAction); - getInputMap(CPanel.WHEN_IN_FOCUSED_WINDOW).put( - KeyStroke.getKeyStroke(KeyEvent.VK_UP, ActionEvent.SHIFT_MASK), - aSwitchLinesUpAction.getName()); - getActionMap().put(aSwitchLinesUpAction.getName(), aSwitchLinesUpAction); - } - - /** - * @return boolean - */ - public boolean isNested() { - return isNested; - } - - /** - * @return JTabbedPane - */ - public JTabbedPane getCurrentTabbedPane() { - return m_curWinTab; - } - - @Override - public void statusUpdate(String message) { - JFrame frame = AEnv.getFrame(this); - if (frame == null) // during init - return; - if (frame instanceof AWindow) - ((AWindow)frame).setBusyMessage(message); - } - - private void updateToolBarAndMenuWithRestriction() - { - int ToolBarButton_ID = 0; - - int[] restrictionList = MToolBarButtonRestrict.getOfWindow(m_ctx, MRole.getDefault().getAD_Role_ID(), m_window.getAD_Window_ID(), false, null); - if (log.isLoggable(Level.INFO)) log.info("restrictionList="+restrictionList.toString()); - - for (int i = 0; i < restrictionList.length; i++) - { - ToolBarButton_ID= restrictionList[i]; - - X_AD_ToolBarButton tbt = new X_AD_ToolBarButton(m_ctx, ToolBarButton_ID, null); - String restrictName = tbt.getComponentName(); - if (log.isLoggable(Level.CONFIG)) log.config("tbt="+tbt.getAD_ToolBarButton_ID() + " / " + restrictName); - boolean found=false; - - // remove from ToolBar - for (int t = 0; t < toolBar.getComponentCount() && !found; t++) - { - if (toolBar.getComponent(t).getName()==null) // separator - continue; - - if (toolBar.getComponent(t).getName().equals(restrictName)) - { - toolBar.remove(t); - found=true; - } - } - - // Remove from Menu - found=false; - for (int m1 = 0; m1 < menuBar.getComponentCount() && !found; m1++) - { - JMenu menu = menuBar.getMenu(m1); // File, Edit, View... - - for (int m2 = 0; m2 < menu.getItemCount() && !found; m2++) // New, Copy, Save... - { - if (menu.getItem(m2)==null) // separator - continue; - - if (menu.getItem(m2).getActionCommand().equals(restrictName)) - { - menu.remove(m2); - found=true; - } - } // menuItems - } // Menu (File, Edit, View, ...) - } // All restrictions - - } // updateToolBarAndMenuWithRestriction - - @Override - public void ask(String message, Callback callback) { - boolean b = ADialog.ask(m_curWindowNo, this, message); - if (callback != null) { - callback.onCallback(b); - } - } - - @Override - public void download(File file) { - } - - @Override - public void askForInput(String message, Callback callback) { - String s = ADialog.askForInput(m_curWindowNo, this, message); - if(callback != null) - callback.onCallback(s); - } - -} // APanel diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ARequest.java b/org.adempiere.ui.swing/src/org/compiere/apps/ARequest.java deleted file mode 100644 index 65a1c01faf..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ARequest.java +++ /dev/null @@ -1,271 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.GraphicsConfiguration; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.logging.Level; - -import javax.swing.JComponent; -import javax.swing.JPopupMenu; - -import org.compiere.model.GridTab; -import org.compiere.model.MAsset; -import org.compiere.model.MBPartner; -import org.compiere.model.MCampaign; -import org.compiere.model.MInOut; -import org.compiere.model.MInvoice; -import org.compiere.model.MOrder; -import org.compiere.model.MOrderLine; -import org.compiere.model.MPayment; -import org.compiere.model.MProduct; -import org.compiere.model.MProject; -import org.compiere.model.MQuery; -import org.compiere.model.MRMA; -import org.compiere.model.MRequest; -import org.compiere.model.MUser; -import static org.compiere.model.SystemIDs.*; -import org.compiere.swing.CMenuItem; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; - - -/** - * Request Button Action. - * Popup Menu - * - * @author Jorg Janke - * @version $Id: ARequest.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *
  • BF [ 1904928 ] Request: Related Request field not filled - */ -public class ARequest implements ActionListener -{ - /** - * Constructor - * @param invoker invoker button - * @param AD_Table_ID table - * @param Record_ID record - * @param C_BPartner_ID optional bp - */ - public ARequest (JComponent invoker, int AD_Table_ID, int Record_ID, - int C_BPartner_ID) - { - super (); - if (log.isLoggable(Level.CONFIG)) log.config("AD_Table_ID=" + AD_Table_ID + ", Record_ID=" + Record_ID); - m_AD_Table_ID = AD_Table_ID; - m_Record_ID = Record_ID; - m_C_BPartner_ID = C_BPartner_ID; - getRequests(invoker); - } // ARequest - - /** The Table */ - private int m_AD_Table_ID; - /** The Record */ - private int m_Record_ID; - /** BPartner */ - private int m_C_BPartner_ID; - - /** The Popup */ - private JPopupMenu m_popup = new JPopupMenu("RequestMenu"); - private CMenuItem m_new = null; - private CMenuItem m_active = null; - private CMenuItem m_all = null; - private GraphicsConfiguration m_graphicsconfig = null; - /** Where Clause */ - StringBuffer m_where = null; - - - /** Logger */ - private static CLogger log = CLogger.getCLogger (ARequest.class); - - /** - * Display Request Options - New/Existing. - * @param invoker button - */ - private void getRequests (JComponent invoker) - { - m_new = new CMenuItem(Msg.getMsg(Env.getCtx(), "RequestNew")); - m_new.setIcon(Env.getImageIcon("New16.gif")); - m_popup.add(m_new).addActionListener(this); - m_graphicsconfig = invoker.getGraphicsConfiguration(); - // - int activeCount = 0; - int inactiveCount = 0; - m_where = new StringBuffer(); - m_where.append("(AD_Table_ID=").append(m_AD_Table_ID) - .append(" AND Record_ID=").append(m_Record_ID) - .append(")"); - // - if (m_AD_Table_ID == MUser.Table_ID) - m_where.append(" OR AD_User_ID=").append(m_Record_ID) - .append(" OR SalesRep_ID=").append(m_Record_ID); - else if (m_AD_Table_ID == MBPartner.Table_ID) - m_where.append(" OR C_BPartner_ID=").append(m_Record_ID); - else if (m_AD_Table_ID == MOrder.Table_ID) - m_where.append(" OR C_Order_ID=").append(m_Record_ID); - else if (m_AD_Table_ID == MInvoice.Table_ID) - m_where.append(" OR C_Invoice_ID=").append(m_Record_ID); - else if (m_AD_Table_ID == MPayment.Table_ID) - m_where.append(" OR C_Payment_ID=").append(m_Record_ID); - else if (m_AD_Table_ID == MProduct.Table_ID) - m_where.append(" OR M_Product_ID=").append(m_Record_ID); - else if (m_AD_Table_ID == MProject.Table_ID) - m_where.append(" OR C_Project_ID=").append(m_Record_ID); - else if (m_AD_Table_ID == MCampaign.Table_ID) - m_where.append(" OR C_Campaign_ID=").append(m_Record_ID); - else if (m_AD_Table_ID == MAsset.Table_ID) - m_where.append(" OR A_Asset_ID=").append(m_Record_ID); - // - String sql = "SELECT Processed, COUNT(*) " - + "FROM R_Request WHERE " + m_where - + " GROUP BY Processed " - + "ORDER BY Processed DESC"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement (sql, null); - rs = pstmt.executeQuery (); - while (rs.next ()) - { - if ("Y".equals(rs.getString(1))) - inactiveCount = rs.getInt(2); - else - activeCount += rs.getInt(2); - } - } - catch (Exception e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - // - if (activeCount > 0) - { - m_active = new CMenuItem(Msg.getMsg(Env.getCtx(), "RequestActive") - + " (" + activeCount + ")"); - m_popup.add(m_active).addActionListener(this); - } - if (inactiveCount > 0) - { - m_all = new CMenuItem(Msg.getMsg(Env.getCtx(), "RequestAll") - + " (" + (activeCount + inactiveCount) + ")"); - m_popup.add(m_all).addActionListener(this); - } - // - if (invoker.isShowing()) - m_popup.show(invoker, 0, invoker.getHeight()); // below button - } // getZoomTargets - - /** - * Listner - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - MQuery query = null; - if (e.getSource() == m_active) - { - query = new MQuery(""); - String where = "(" + m_where + ") AND Processed='N'"; - query.addRestriction(where); - query.setRecordCount(0); - } - else if (e.getSource() == m_all) - { - query = new MQuery(""); - query.addRestriction(m_where.toString()); - query.setRecordCount(0); - } - else if (e.getSource() == m_new) - { - query = new MQuery(""); - query.addRestriction("1=2"); - query.setRecordCount(0); - } - // - int AD_Window_ID = WINDOW_REQUESTS_ALL; // 232=all - 201=my - AWindow frame = new AWindow(m_graphicsconfig); - if (!frame.initWindow(AD_Window_ID, query)) - return; - AEnv.addToWindowManager(frame); - // New - set Table/Record - if (e.getSource() == m_new) - { - GridTab tab = frame.getAPanel().getCurrentTab(); - tab.dataNew (false); - tab.setValue("AD_Table_ID", Integer.valueOf(m_AD_Table_ID)); - tab.setValue("Record_ID", Integer.valueOf(m_Record_ID)); - // - if (m_C_BPartner_ID != 0) - tab.setValue("C_BPartner_ID", Integer.valueOf(m_C_BPartner_ID)); - // - if (m_AD_Table_ID == MBPartner.Table_ID) - tab.setValue("C_BPartner_ID", Integer.valueOf(m_Record_ID)); - else if (m_AD_Table_ID == MUser.Table_ID) - tab.setValue("AD_User_ID", Integer.valueOf(m_Record_ID)); - // - else if (m_AD_Table_ID == MProject.Table_ID) - tab.setValue("C_Project_ID", Integer.valueOf(m_Record_ID)); - else if (m_AD_Table_ID == MAsset.Table_ID) - tab.setValue("A_Asset_ID", Integer.valueOf(m_Record_ID)); - // - else if (m_AD_Table_ID == MOrder.Table_ID) - tab.setValue("C_Order_ID", Integer.valueOf(m_Record_ID)); - else if (m_AD_Table_ID == MInvoice.Table_ID) - tab.setValue("C_Invoice_ID", Integer.valueOf(m_Record_ID)); - // - else if (m_AD_Table_ID == MProduct.Table_ID) - tab.setValue("M_Product_ID", Integer.valueOf(m_Record_ID)); - else if (m_AD_Table_ID == MPayment.Table_ID) - tab.setValue("C_Payment_ID", Integer.valueOf(m_Record_ID)); - // - else if (m_AD_Table_ID == MInOut.Table_ID) - tab.setValue("M_InOut_ID", Integer.valueOf(m_Record_ID)); - else if (m_AD_Table_ID == MRMA.Table_ID) - tab.setValue("M_RMA_ID", Integer.valueOf(m_Record_ID)); - // - else if (m_AD_Table_ID == MCampaign.Table_ID) - tab.setValue("C_Campaign_ID", Integer.valueOf(m_Record_ID)); - // - else if (m_AD_Table_ID == MRequest.Table_ID) - tab.setValue(MRequest.COLUMNNAME_R_RequestRelated_ID, Integer.valueOf(m_Record_ID)); - // FR [2842165] - Order Ref link from SO line creating new request - else if (m_AD_Table_ID == MOrderLine.Table_ID) { - MOrderLine oLine = new MOrderLine(Env.getCtx(), m_Record_ID, null); - if (oLine != null) { - tab.setValue(MOrderLine.COLUMNNAME_C_Order_ID, Integer.valueOf(oLine.getC_Order_ID())); - } - } - } - AEnv.showCenterScreen(frame); - frame = null; - } // actionPerformed - -} // ARequest diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ATask.java b/org.adempiere.ui.swing/src/org/compiere/apps/ATask.java deleted file mode 100644 index d63566287f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ATask.java +++ /dev/null @@ -1,132 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.logging.Level; - -import javax.swing.JScrollPane; -import javax.swing.JTextArea; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.Adempiere; -import org.compiere.model.MTask; -import org.compiere.swing.CFrame; -import org.compiere.util.CLogger; -import org.compiere.util.Task; - - -/** - * Application Task - * - * @author Jorg Janke - * @version $Id: ATask.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class ATask extends CFrame - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -8998998120736876682L; - - /** - * Start Application Task - * @param task task model - */ - static public void start (final String title, final MTask task) - { - new Thread() - { - public void run() - { - new ATask(title, task); - } - }.start(); - } // start - - - /************************************************************************** - * Full Constructor - * @param title title - * @param task task - */ - public ATask (String title, MTask task) - { - super (title); - this.setIconImage(Adempiere.getImage16()); - try - { - jbInit(); - AEnv.showCenterScreen(this); - // - if (task.isServerProcess()) - info.setText("Executing on Server ..."); - else - info.setText("Executing locally ..."); - String result = task.execute(); - info.setText(result); - confirmPanel.getCancelButton().setEnabled(false); - confirmPanel.getOKButton().setEnabled(true); - } - catch(Exception e) - { - log.log(Level.SEVERE, task.toString(), e); - } - } // ATask - - private Task m_task = null; - /** Logger */ - private static CLogger log = CLogger.getCLogger(ATask.class); - - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - private JScrollPane infoScrollPane = new JScrollPane(); - private JTextArea info = new JTextArea(); - - /** - * Static Layout - * @throws Exception - */ - private void jbInit() throws Exception - { - info.setEditable(false); - info.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - infoScrollPane.getViewport().add(info, null); - infoScrollPane.setPreferredSize(new Dimension(500,300)); - this.getContentPane().add(infoScrollPane, BorderLayout.CENTER); - this.getContentPane().add(confirmPanel, BorderLayout.SOUTH); - // - confirmPanel.addActionListener(this); - confirmPanel.getOKButton().setEnabled(false); - } // jbInit - - - /** - * Action Listener - * @param e - */ - public void actionPerformed (ActionEvent e) - { - if (m_task != null && m_task.isAlive()) - m_task.interrupt(); - dispose(); - } // actionPerformed - -} // ATask diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AWindow.java b/org.adempiere.ui.swing/src/org/compiere/apps/AWindow.java deleted file mode 100644 index aa5a68b86d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AWindow.java +++ /dev/null @@ -1,215 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.GraphicsConfiguration; -import java.awt.Image; -import java.awt.event.WindowEvent; -import java.util.logging.Level; - -import org.compiere.model.MQuery; -import org.compiere.swing.CFrame; -import org.compiere.util.CLogger; -import org.compiere.util.Env; - -/** - * Main Application Window. - * - Constructs, initializes and positions JFrame - * - Gets content, menu, title from APanel - * - * @author Jorg Janke - * @version $Id: AWindow.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * - * @author Teo Sarca, www.arhipac.ro - *
  • BF [ 1836908 ] Report customize NPE when no window access - */ -public class AWindow extends CFrame -{ - /** - * - */ - private static final long serialVersionUID = -1925388774073536474L; - - /** - * @deprecated - * Standard Constructor - requires initWindow - */ - public AWindow () - { - this(null); - } // AWindow - - /** - * Standard Constructor - requires initWindow - * @param gc - */ - public AWindow (GraphicsConfiguration gc) - { - super(gc); - // Set UI Components - this.setIconImage(Env.getImage("mWindow.png")); - this.getContentPane().add(m_APanel, BorderLayout.CENTER); - this.setGlassPane(m_glassPane); - } // AWindow - - /** The GlassPane */ - private AGlassPane m_glassPane = new AGlassPane(); - /** Application Window */ - private APanel m_APanel = new APanel(this); - - /** Logger */ - private static CLogger log = CLogger.getCLogger(AWindow.class); - - /** - * Dynamic Initialization Workbench - * @param AD_Workbench_ID workbench - * @return true if loaded OK - */ - protected boolean initWorkbench (int AD_Workbench_ID) - { - this.setName("AWindow_WB_" + AD_Workbench_ID); - boolean loadedOK = m_APanel.initPanel (AD_Workbench_ID, 0, null); - // - commonInit(); - return loadedOK; - } // initWorkbench - - /** - * Dynamic Initialization Single Window - * @param AD_Window_ID window - * @param query query - * @return true if loaded OK - */ - public boolean initWindow (int AD_Window_ID, MQuery query) - { - this.setName("AWindow_" + AD_Window_ID); - setAD_Window_ID(AD_Window_ID); - // - boolean loadedOK = m_APanel.initPanel (0, AD_Window_ID, query); - if (loadedOK) - { - commonInit(); - } - return loadedOK; - } // initWindow - - /** - * Common Init. - * After APanel loaded - */ - private void commonInit() - { - this.setJMenuBar(m_APanel.getMenuBar()); - this.setTitle(m_APanel.getTitle()); - // - Image image = m_APanel.getImage(); - if (image != null) - setIconImage(image); - } // commonInit - - - /************************************************************************* - * Set Window Busy - * @param busy busy - */ - public void setBusy (boolean busy) - { - if (busy == m_glassPane.isVisible()) - return; - if (log.isLoggable(Level.CONFIG)) log.config(getName() + " - " + busy); - m_glassPane.setMessage(null); - m_glassPane.setVisible(busy); - if (busy) - m_glassPane.requestFocus(); - } // setBusy - - /** - * Set Busy Message - * @param AD_Message message - */ - public void setBusyMessage (String AD_Message) - { - m_glassPane.setMessage(AD_Message); - } // setBusyMessage - - /** - * Set and start Busy Counter - * @param time in seconds - */ - public void setBusyTimer (int time) - { - m_glassPane.setBusyTimer (time); - } // setBusyTimer - - /** - * Window Events - * @param e event - */ - protected void processWindowEvent(WindowEvent e) - { - super.processWindowEvent(e); -// System.out.println(">> Apps WE_" + e.getID() // + " Frames=" + getFrames().length -// + " " + e); - } // processWindowEvent - - /** - * Get Application Panel - * @return application panel - */ - public APanel getAPanel() - { - return m_APanel; - } // getAPanel - - /** - * Dispose - */ - public void dispose() - { - if (AEnv.hideWindow(this)) - return; - if (log.isLoggable(Level.INFO)) log.info(toString()); - if (m_APanel != null) - m_APanel.dispose(); - m_APanel = null; - this.removeAll(); - super.dispose(); - // System.gc(); - } // dispose - - /** - * Get Window No of Panel - * @return window no - */ - public int getWindowNo() - { - if (m_APanel != null) - return m_APanel.getWindowNo(); - return 0; - } // getWindowNo - - /** - * String Representation - * @return Name - */ - public String toString() - { - return getName() + "_" + getWindowNo(); - } // toString - -} // AWindow \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AWindowListener.java b/org.adempiere.ui.swing/src/org/compiere/apps/AWindowListener.java deleted file mode 100644 index a993779225..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AWindowListener.java +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.Window; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.awt.event.WindowStateListener; - -/** - * Convenience Class to tunnel Events. - * - * Forwards Window Events like windowClosed to the WindowState listener. - * Usually, a WindowStateListener gets only state events (minimized,..) - * This allows implementing a single method (windowStateChanged) - * to receive potentially all window events. - *

    - * Implemented: - * e.getID() == WindowEvent.WINDOW_CLOSED - * - * @author Jorg Janke - * @version $Id: AWindowListener.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class AWindowListener extends WindowAdapter -{ - /** - * Constructor - * - * @param win Window - * @param l Listener - */ - public AWindowListener (Window win, WindowStateListener l) - { - m_window = win; - m_listener = l; - win.addWindowListener(this); - } // AWindowListener - - /** The Window */ - @SuppressWarnings("unused") - private Window m_window; - /** The Listener */ - private WindowStateListener m_listener; - - /** - * Invoked when a window has been closed. - * Forwarded. - * @param e event to be forwarded - */ - public void windowClosed(WindowEvent e) - { - m_listener.windowStateChanged(e); - } // windowClosed - -} // AWindowListenr diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AZoomAcross.java b/org.adempiere.ui.swing/src/org/compiere/apps/AZoomAcross.java deleted file mode 100644 index 5300f6d493..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AZoomAcross.java +++ /dev/null @@ -1,137 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Level; - -import javax.swing.JComponent; -import javax.swing.JPopupMenu; - -import org.adempiere.model.ZoomInfoFactory; -import org.compiere.model.MQuery; -import org.compiere.model.PO; -import org.compiere.model.Query; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Ini; -import org.compiere.util.Msg; - -/** - * Application Zoom Across Launcher. - * Called from APanel; Queries available Zoom Targets for Table. - * - * @author Jorg Janke - * @version $Id: AZoomAcross.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - FR [ 1762465 ] - * @author afalcone - Bug Fix [ 1659420 ] Usability: zoom across - * @author Tobias Schoeneberg, www.metas.de - FR [ 2897194 ] Advanced Zoom and RelationTypes - */ -public class AZoomAcross -{ - /** - * Constructor - * @param invoker component to display popup (optional) - * @param tableName zoom source table (i.e. the table we start from) - * @param query query that specifies the zoom source PO (i.e. the PO we start from) - */ - public AZoomAcross (JComponent invoker, String tableName, final int windowID, MQuery query) - { - this(invoker, new Query(Env.getCtx(), tableName, - query.getWhereClause(), null).first(), windowID); - } - - public AZoomAcross(JComponent invoker, PO po, final int windowID) { - - if (logger.isLoggable(Level.CONFIG)) logger.config("PO=" + po+", WindowID="+windowID); - - mkZoomTargets(po, windowID); - - for (final ZoomInfoFactory.ZoomInfo zoomInfo : zoomInfos) { - - final String label = zoomInfo.destinationDisplay + " (#" - + zoomInfo.query.getRecordCount() + ")"; - - m_popup.add(label).addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - launchZoom(zoomInfo); - } - }); - } - - if (zoomInfos.isEmpty()) { - m_popup.add(Msg.getMsg(Env.getCtx(), "NoZoomTarget")); // Added - } - if (invoker.isShowing()) { - m_popup.show(invoker, 0, invoker.getHeight()); - } - } - - private final JPopupMenu m_popup = new JPopupMenu("ZoomMenu"); - - private static final CLogger logger = CLogger.getCLogger(AZoomAcross.class); - - private final List zoomInfos = new ArrayList(); - - private void mkZoomTargets(final PO po, final int windowID) { - - for (final ZoomInfoFactory.ZoomInfo zoomInfo : ZoomInfoFactory.retrieveZoomInfos(po, - windowID)) { - - if (zoomInfo.query.getRecordCount() == 0) { - if (logger.isLoggable(Level.FINE)) logger.fine("No target records for destination " - + zoomInfo.destinationDisplay); - continue; - } - zoomInfos.add(zoomInfo); - } - } - - - /** - * Launch Zoom - * @param pp KeyPair - */ - private void launchZoom (final ZoomInfoFactory.ZoomInfo zoomInfo) - { - final int AD_Window_ID = zoomInfo.windowId; - final MQuery query = zoomInfo.query; - - if (logger.isLoggable(Level.INFO)) logger.info("AD_Window_ID=" + AD_Window_ID - + " - " + query); - - AWindow frame = new AWindow(null); - if (!frame.initWindow(AD_Window_ID, query)) - return; - AEnv.addToWindowManager(frame); - if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) - { - AEnv.showMaximized(frame); - } - else - { - AEnv.showCenterScreen(frame); - } - frame = null; - } // launchZoom - -} // AZoom diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AboutBox.java b/org.adempiere.ui.swing/src/org/compiere/apps/AboutBox.java deleted file mode 100644 index 46ae0a4a1f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AboutBox.java +++ /dev/null @@ -1,165 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.GridLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.SwingConstants; - -import org.compiere.Adempiere; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextArea; -import org.compiere.util.CLogMgt; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * About Dialog - * - * @author Jorg Janke - * @version $Id: AboutBox.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public final class AboutBox extends CDialog implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -5126987147443121045L; - - /** - * Constructor for modal about dialog - * @param parent parent - */ - public AboutBox(JFrame parent) - { - super (parent, true); - try - { - jbInit(); - } - catch(Exception e) - { - System.out.println(e.getMessage()); - } - // - labelVersion.setText(Adempiere.getVersion()); - labelCopyright.setText(Adempiere.COPYRIGHT); - infoArea.setText(CLogMgt.getInfo(null).toString()); - // create 5 pt border - Dimension d = imageControl.getPreferredSize(); - imageControl.setPreferredSize(new Dimension(d.width+10, d.height+10)); - // - AEnv.positionCenterWindow(parent, this); - } // AWindow_AboutBox - - private CPanel panel = new CPanel(); - private CPanel mainPanel = new CPanel(); - private JLabel imageControl = new JLabel(); - private JLabel labelHeading = new JLabel(); - private JLabel labelVersion = new JLabel(); - private JLabel labelCopyright = new JLabel(); - private JLabel labelDescription = new JLabel(); - private BorderLayout panelLayout = new BorderLayout(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel northPanel = new CPanel(); - private CPanel headerPanel = new CPanel(); - private GridLayout headerLayout = new GridLayout(); - private CTextArea infoArea = new CTextArea(); - private BorderLayout northLayout = new BorderLayout(); - private ConfirmPanel confirmPanel = new ConfirmPanel(false); - - /** - * Init - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setTitle(Msg.translate(Env.getCtx(), "About")); - // - setResizable(false); - labelHeading.setFont(new java.awt.Font("Dialog", 1, 14)); - labelHeading.setHorizontalAlignment(SwingConstants.CENTER); - labelHeading.setHorizontalTextPosition(SwingConstants.CENTER); - labelHeading.setText(" Smart ERP & CRM Business Solution "); - labelVersion.setHorizontalAlignment(SwingConstants.CENTER); - labelVersion.setHorizontalTextPosition(SwingConstants.CENTER); - labelVersion.setText("."); - labelCopyright.setHorizontalAlignment(SwingConstants.CENTER); - labelCopyright.setHorizontalTextPosition(SwingConstants.CENTER); - labelCopyright.setText("."); - labelDescription.setForeground(Color.blue); - labelDescription.setHorizontalAlignment(SwingConstants.CENTER); - labelDescription.setHorizontalTextPosition(SwingConstants.CENTER); - labelDescription.setText(Adempiere.getURL()); - // - imageControl.setFont(new java.awt.Font("Serif", 2, 10)); - imageControl.setForeground(Color.blue); - imageControl.setAlignmentX((float) 0.5); - imageControl.setHorizontalAlignment(SwingConstants.CENTER); - imageControl.setHorizontalTextPosition(SwingConstants.CENTER); - imageControl.setIcon(Adempiere.getImageIconLogo()); - imageControl.setText(Adempiere.getSubtitle()); - imageControl.setVerticalTextPosition(SwingConstants.BOTTOM); - // - mainPanel.setLayout(mainLayout); - mainLayout.setHgap(10); - mainLayout.setVgap(10); - northPanel.setLayout(northLayout); - northLayout.setHgap(10); - northLayout.setVgap(10); - panel.setLayout(panelLayout); - panelLayout.setHgap(10); - panelLayout.setVgap(10); - headerPanel.setLayout(headerLayout); - headerLayout.setColumns(1); - headerLayout.setRows(4); - // - infoArea.setReadWrite(false); - - this.getContentPane().add(panel, null); - panel.add(northPanel, BorderLayout.NORTH); - northPanel.add(imageControl, BorderLayout.WEST); - northPanel.add(headerPanel, BorderLayout.CENTER); - headerPanel.add(labelHeading, null); - headerPanel.add(labelCopyright, null); - headerPanel.add(labelVersion, null); - headerPanel.add(labelDescription, null); - panel.add(mainPanel, BorderLayout.CENTER); - mainPanel.add(infoArea, BorderLayout.CENTER); - mainPanel.add(confirmPanel, BorderLayout.SOUTH); - confirmPanel.addActionListener(this); - } // jbInit - - - /** - * ActionListener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if(e.getActionCommand().equals(ConfirmPanel.A_OK)) - dispose(); - } // actionPerformed -} // AboutBox diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AppsAction.java b/org.adempiere.ui.swing/src/org/compiere/apps/AppsAction.java deleted file mode 100644 index 55f8a3ea98..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AppsAction.java +++ /dev/null @@ -1,316 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.AbstractAction; -import javax.swing.AbstractButton; -import javax.swing.Action; -import javax.swing.Icon; -import javax.swing.ImageIcon; -import javax.swing.JComponent; -import javax.swing.JMenuItem; -import javax.swing.KeyStroke; - -import org.compiere.swing.CButton; -import org.compiere.swing.CCheckBoxMenuItem; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CToggleButton; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Application Action. - * Creates Action with MenuItem and Button, delegate execution of action to an attached ActionListener instance - * The ActionCommand is translated for display - * If translated text contains &, the next character is the Mnemonic - * - * @author Jorg Janke - * @version $Id: AppsAction.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public final class AppsAction extends AbstractAction -{ - /** - * - */ - private static final long serialVersionUID = 8522301377339185496L; - - /** - * Application Action - * - * @param action base action command - used as AD_Message for Text and Icon name - * @param accelerator optional keystroke for accelerator - * @param toggle is toggle action (maintains state) - */ - public AppsAction (String action, KeyStroke accelerator, boolean toggle) - { - this (action, accelerator, null, toggle); - } - /** - * Application Action - * - * @param action base action command - used as AD_Message for Text and Icon name - * @param accelerator optional keystroke for accelerator - * @param text text, if null defered from action - */ - public AppsAction (String action, KeyStroke accelerator, String text) - { - this (action, accelerator, text, false); - } // AppsAction - - /** - * Application Action - * - * @param action base action command - used as AD_Message for Text and Icon name - * @param accelerator optional keystroke for accelerator - * @param toolTipText text, if null defered from action - * @param toggle is toggle action (maintains state) - */ - public AppsAction (String action, KeyStroke accelerator, String toolTipText, boolean toggle) - { - super(); - m_action = action; - m_accelerator = accelerator; - m_toggle = toggle; - - // Data - if (toolTipText == null) - toolTipText = Msg.getMsg(Env.getCtx(), action); - int pos = toolTipText.indexOf('&'); - if (pos != -1 && toolTipText.length() > pos) // We have a nemonic - creates ALT-_ - { - Character ch = Character.valueOf(toolTipText.toUpperCase().charAt(pos+1)); - if (ch != ' ') - { - toolTipText = toolTipText.substring(0, pos) + toolTipText.substring(pos+1); - putValue(Action.MNEMONIC_KEY, Integer.valueOf(ch.hashCode())); - } - } - // - Icon small = getIcon(action, true); - Icon large = getIcon(action, false); - Icon largePressed = null; - - // ToggleIcons have the pressed name with X - if (m_toggle) - { - m_smallPressed = getIcon(action+"X", true); - if (m_smallPressed == null) - m_smallPressed = small; - largePressed = getIcon(action+"X", false); - if (largePressed == null) - largePressed = large; - } - - // Attributes - putValue(Action.NAME, toolTipText); // Display - putValue(Action.SMALL_ICON, small); // Icon - putValue(Action.SHORT_DESCRIPTION, toolTipText); // Tooltip - putValue(Action.ACTION_COMMAND_KEY, m_action); // ActionCammand - putValue(Action.ACCELERATOR_KEY, accelerator); // KeyStroke - // putValue(Action.MNEMONIC_KEY, Integer.valueOf(0)); // Mnemonic - // putValue(Action.DEFAULT, text); // Not Used - - // Create Button - if (toggle) - { - m_button = new CToggleButton(this); - m_button.setSelectedIcon(largePressed); - } - else - m_button = new CButton(this); - m_button.setName(action); - // Correcting Action items - if (large != null) - { - m_button.setIcon(large); - m_button.setText(null); - } - m_button.setActionCommand(m_action); - m_button.setMargin(BUTTON_INSETS); - m_button.setSize(BUTTON_SIZE); - // - if (accelerator != null) - { - m_button.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(accelerator, action); - m_button.getActionMap().put(action, this); - } - } // Action - - /** Button Size */ - public static final Dimension BUTTON_SIZE = new Dimension(28,28); - /** Button Insets */ - public static final Insets BUTTON_INSETS = new Insets(0, 0, 0, 0); - /** CButton or CToggelButton */ - private AbstractButton m_button; - /** Menu */ - private JMenuItem m_menu; - - private String m_action = null; - private KeyStroke m_accelerator = null; - private Icon m_smallPressed = null; - private ActionListener m_delegate = null; - private boolean m_toggle = false; - private boolean m_pressed = false; - - /** - * Get Icon with name action - * @param name name - * @param small small - * @return Icon - */ - private ImageIcon getIcon(String name, boolean small) - { - String fullName = name + (small ? "16" : "24"); - return Env.getImageIcon2(fullName); - } // getIcon - - /** - * Get Name/ActionCommand - * @return ActionName - */ - public String getName() - { - return m_action; - } // getName - - /** - * Return Button - * @return Button - */ - public AbstractButton getButton() - { - return m_button; - } // getButton - - /** - * Return MenuItem - * @return MenuItem - */ - public JMenuItem getMenuItem() - { - if (m_menu == null) - { - if (m_toggle) - { - m_menu = new CCheckBoxMenuItem(this); - m_menu.setSelectedIcon(m_smallPressed); - } - else - m_menu = new CMenuItem(this); - m_menu.setAccelerator(m_accelerator); - m_menu.setActionCommand(m_action); - } - return m_menu; - } // getMenuItem - - /** - * Set Delegate to receive the actionPerformed calls - * @param al listener - */ - public void setDelegate(ActionListener al) - { - m_delegate = al; - } // setDelegate - - /** - * Toggle - * @param pressed pressed - */ - public void setPressed (boolean pressed) - { - if (!m_toggle) - return; - m_pressed = pressed; - - // Set Button - if (m_button != null) - m_button.setSelected(pressed); - - // Set Menu - if (m_menu != null) - m_menu.setSelected(pressed); - } // setPressed - - /** - * IsPressed - * @return true if pressed - */ - public boolean isPressed() - { - return m_pressed; - } // isPressed - - /** - * Get Mnemonic character - * @return character - */ - public Character getMnemonic() - { - Object oo = getValue(Action.MNEMONIC_KEY); - if (oo instanceof Integer) - return (char)((Integer)oo).intValue(); - return null; - } // getMnemonic - - /** - * ActionListener - * @param e Event - */ - public void actionPerformed(ActionEvent e) - { - // log.info( "AppsAction.actionPerformed", e.getActionCommand()); - // Toggle Items - if (m_toggle) - setPressed(!m_pressed); - // Inform - if (m_delegate != null) - m_delegate.actionPerformed(e); - } // actionPerformed - - /** - * Dispose - */ - public void dispose() - { - m_button = null; - m_menu = null; - } // dispose - - /** - * String Info - * @return String Representation - */ - public String toString() - { - StringBuilder sb = new StringBuilder("AppsAction["); - sb.append(m_action); - Object oo = getValue(Action.ACCELERATOR_KEY); - if (oo != null) - sb.append(",Accelerator=").append(oo); - oo = getMnemonic(); - if (oo != null) - sb.append(",MnemonicKey=").append(oo); - sb.append("]"); - return sb.toString(); - } // toString - -} // AppsAction diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/Attachment.java b/org.adempiere.ui.swing/src/org/compiere/apps/Attachment.java deleted file mode 100644 index 4d51941f3a..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/Attachment.java +++ /dev/null @@ -1,669 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Desktop; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Frame; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.Insets; -import java.awt.MediaTracker; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; -import java.io.IOException; -import java.util.logging.Level; - -import javax.swing.JFileChooser; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JSplitPane; - -import org.adempiere.pdf.viewer.PDFViewerBean; -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.model.MAttachment; -import org.compiere.model.MAttachmentEntry; -import org.compiere.swing.CButton; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextArea; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Attachment Viewer - * - * @author Jorg Janke - * @version $Id: Attachment.java,v 1.4 2006/08/10 01:00:27 jjanke Exp $ - */ -public final class Attachment extends CDialog - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 2497487523050526742L; - - /** - * Save the last path selected - */ - private static String lastPath = null; - - /** - * Constructor. - * loads Attachment, if ID <> 0 - * @param frame frame - * @param WindowNo window no - * @param AD_Attachment_ID attachment - * @param AD_Table_ID table - * @param Record_ID record key - * @param trxName transaction - */ - public Attachment(Frame frame, int WindowNo, int AD_Attachment_ID, - int AD_Table_ID, int Record_ID, String trxName) - { - super (frame, Msg.getMsg(Env.getCtx(), "Attachment"), true); - // needs to be modal otherwise APanel does not recognize change. - if (log.isLoggable(Level.CONFIG)) log.config("ID=" + AD_Attachment_ID - + ", Table=" + AD_Table_ID + ", Record=" + Record_ID); - // - m_WindowNo = WindowNo; - // - try - { - staticInit(); - } - catch (Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - // Create Model - if (AD_Attachment_ID > 0) - m_attachment = new MAttachment (Env.getCtx(), AD_Attachment_ID, trxName); - else - m_attachment = new MAttachment (Env.getCtx(), AD_Table_ID, Record_ID, trxName); - loadAttachments(); - // - try - { - AEnv.showCenterWindow(frame, this); - } - catch (Exception e) - { - } - text.requestFocus(); - } // Attachment - - /** Window No */ - private int m_WindowNo; - /** Attachment */ - private MAttachment m_attachment = null; - /** Change */ - private boolean m_change = false; - /** Logger */ - private static CLogger log = CLogger.getCLogger(Attachment.class); - - // - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CTextArea text = new CTextArea(); - private CButton bOpen = new CButton(); - private CButton bSave = new CButton(); - private CPanel northPanel = new CPanel(); - private CButton bLoad = new CButton(); - private BorderLayout northLayout = new BorderLayout(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - private CPanel toolBar = new CPanel(new FlowLayout(FlowLayout.LEADING, 5,5)); - private CButton bDelete = new CButton(); - private CButton bDeleteAll = null; - private CComboBox cbContent = new CComboBox(); - private JSplitPane centerPane = new JSplitPane(); - // - private CPanel graphPanel = new CPanel(new BorderLayout()); - private GImage gifPanel = new GImage(); - private JScrollPane gifScroll = new JScrollPane (gifPanel); - private PDFViewerBean pdfViewer = new PDFViewerBean(); - private CTextArea info = new CTextArea(); - - /** - * Static setup. - *
    -	 *  - northPanel
    -	 *      - toolBar
    -	 *      - title
    -	 *  - centerPane [split]
    -	 * 		- graphPanel (left)
    -	 *		  	- gifScroll - gifPanel
    -	 *			- pdfViewer
    -	 *  	- text (right)
    -	 *  - confirmPanel
    -	 *  
    - * @throws Exception - */ - void staticInit() throws Exception - { - mainPanel.setLayout(mainLayout); - mainLayout.setHgap(5); - mainLayout.setVgap(5); - this.getContentPane().add(mainPanel); - - northPanel.setLayout(northLayout); - northPanel.add(toolBar, BorderLayout.CENTER); - toolBar.add(bLoad); - toolBar.add(bDelete); - toolBar.add(bSave); - toolBar.add(bOpen); - toolBar.add(cbContent); - mainPanel.add(northPanel, BorderLayout.NORTH); - - // - bOpen.setEnabled(false); - bOpen.setIcon(Env.getImageIcon("Editor24.gif")); - bOpen.setMargin(new Insets(0, 2, 0, 2)); - bOpen.setToolTipText(Msg.getMsg(Env.getCtx(), "Open")); - bOpen.addActionListener(this); - // - bSave.setEnabled(false); - bSave.setIcon(Env.getImageIcon("Export24.gif")); - bSave.setMargin(new Insets(0, 2, 0, 2)); - bSave.setToolTipText(Msg.getMsg(Env.getCtx(), "AttachmentSave")); - bSave.addActionListener(this); - // - bLoad.setIcon(Env.getImageIcon("Import24.gif")); - bLoad.setMargin(new Insets(0, 2, 0, 2)); - bLoad.setToolTipText(Msg.getMsg(Env.getCtx(), "Load")); - bLoad.addActionListener(this); - // - bDelete.setIcon(Env.getImageIcon("Delete24.gif")); - bDelete.setMargin(new Insets(0, 2, 0, 2)); - bDelete.setToolTipText(Msg.getMsg(Env.getCtx(), "Delete")); - bDelete.addActionListener(this); - // - Dimension size = cbContent.getPreferredSize(); - size.width = 200; - cbContent.setPreferredSize(size); - // cbContent.setToolTipText(text); - cbContent.addActionListener(this); - cbContent.setLightWeightPopupEnabled(false); // Acrobat Panel is heavy - // - text.setBackground(AdempierePLAF.getInfoBackground()); - text.setPreferredSize(new Dimension(200, 200)); - // - mainPanel.add(confirmPanel, BorderLayout.SOUTH); - confirmPanel.addActionListener(this); - bDeleteAll = ConfirmPanel.createDeleteButton(true); - confirmPanel.addButton(bDeleteAll); - bDeleteAll.addActionListener(this); - // - info.setText("-"); - info.setReadWrite(false); - graphPanel.add(info, BorderLayout.CENTER); - // - mainPanel.add(centerPane, BorderLayout.CENTER); - centerPane.add(graphPanel, JSplitPane.LEFT); - centerPane.add(text, JSplitPane.RIGHT); - centerPane.setResizeWeight(.75); // more to graph - } // jbInit - - - /** - * Dispose - */ - public void dispose () - { - pdfViewer = null; - super.dispose (); - } // dispose - - /** - * Load Attachments - */ - private void loadAttachments() - { - log.config(""); - // Set Text/Description - String sText = m_attachment.getTextMsg(); - if (sText == null) - text.setText(""); - else - text.setText(sText); - - // Set Combo - int size = m_attachment.getEntryCount(); - for (int i = 0; i < size; i++) - cbContent.addItem(m_attachment.getEntryName(i)); - if (size > 0) - cbContent.setSelectedIndex(0); - else - displayData(0); - } // loadAttachment - - /** - * Display gif or jpg in gifPanel - * @param index index - */ - private void displayData (int index) - { - MAttachmentEntry entry = m_attachment.getEntry(index); - if (log.isLoggable(Level.CONFIG)) log.config("Index=" + index + " - " + entry); - - // Reset UI - gifPanel.setImage(null); - graphPanel.removeAll(); - // - bDelete.setEnabled(false); - bOpen.setEnabled(false); - bSave.setEnabled(false); - - Dimension size = null; - // no attachment - if (entry == null || entry.getData() == null) - { - info.setText("-"); - } - else - { - bOpen.setEnabled(true); - bSave.setEnabled(true); - bDelete.setEnabled(true); - if (log.isLoggable(Level.CONFIG)) log.config(entry.toStringX()); - // - info.setText(entry.toStringX()); - if (entry.isPDF() && pdfViewer != null) - { - try - { - pdfViewer.loadPDF(entry.getInputStream()); - pdfViewer.setScale(50); - size = pdfViewer.getPreferredSize(); - // size.width = Math.min(size.width, 400); - // size.height = Math.min(size.height, 400); - // - graphPanel.add(pdfViewer, BorderLayout.CENTER); - } - catch (Exception e) - { - log.log(Level.SEVERE, "(pdf)", e); - } - } - else if (entry.isGraphic()) - { - // Can we display it - Image image = Toolkit.getDefaultToolkit().createImage(entry.getData()); - if (image != null) - { - gifPanel.setImage(image); - size = gifPanel.getPreferredSize(); - if (size.width == -1 && size.height == -1) - { - log.log(Level.SEVERE, "Invalid Image"); - } - else - { - // size.width += 40; - // size.height += 40; - graphPanel.add(gifScroll, BorderLayout.CENTER); - } - } - else - log.log(Level.SEVERE, "Could not create image"); - } - } - if (graphPanel.getComponentCount() == 0) - { - graphPanel.add(info, BorderLayout.CENTER); - } - - if (log.isLoggable(Level.CONFIG)) log.config("Size=" + size); - // graphPanel.setPreferredSize(size); - // centerPane.setDividerLocation(size.width+30); - // size.width += 100; - // size.height += 100; - // centerPane.setPreferredSize(size); - pack(); - } // displayData - - - /** - * Get File Name with index - * @param index index - * @return file name or null - */ - private String getFileName (int index) - { - String fileName = null; - if (cbContent.getItemCount() > index) - fileName = (String)cbContent.getItemAt(index); - return fileName; - } // getFileName - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - // log.config(e.getActionCommand()); - // Save and Close - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - String newText = text.getText(); - if (newText == null) - newText = ""; - String oldText = m_attachment.getTextMsg(); - if (oldText == null) - oldText = ""; - if (!m_change) - m_change = !newText.equals(oldText); - if (newText.length() > 0 || m_attachment.getEntryCount() > 0) - { - if (m_change) - { - m_attachment.setBinaryData(new byte[0]); // ATTENTION! HEAVY HACK HERE... Else it will not save :( - m_attachment.setTextMsg(text.getText()); - m_attachment.saveEx(); - } - } - else - { - m_attachment.delete(true); - m_attachment = null; - } - dispose(); - } - // Cancel - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - dispose(); - } - // Delete Attachment - else if (e.getSource() == bDeleteAll) - { - deleteAttachment(); - dispose(); - } - // Delete individual entry and Return - else if (e.getSource() == bDelete) - deleteAttachmentEntry(); - // Show Data - else if (e.getSource() == cbContent) - displayData (cbContent.getSelectedIndex()); - // Load Attachment - else if (e.getSource() == bLoad) - loadFile(); - // Open Attachment - else if (e.getSource() == bSave) - saveAttachmentToFile(); - // Open Attachment - else if (e.getSource() == bOpen) - { - if (!openAttachment()) - saveAttachmentToFile(); - } - } // actionPerformed - - - /************************************************************************** - * Load file for attachment - */ - private void loadFile() - { - log.info(""); - JFileChooser chooser = new JFileChooser(lastPath); - - chooser.setDialogType(JFileChooser.OPEN_DIALOG); - chooser.setDialogTitle(Msg.getMsg(Env.getCtx(), "AttachmentNew")); - chooser.setMultiSelectionEnabled(true); - int returnVal = chooser.showOpenDialog(this); - if (returnVal != JFileChooser.APPROVE_OPTION) - return; - // - File[] files = chooser.getSelectedFiles(); - for (File file : files) { - int cnt = m_attachment.getEntryCount(); - - //update - boolean add = true; - for (int i = 0; i < cnt; i++) - { - if (m_attachment.getEntryName(i).equals(file.getName())) - { - if (m_attachment.updateEntry(i, file)) - { - cbContent.setSelectedItem(file.getName()); - m_change = true; - } - add = false; - break; - } - } - - if (add) - { - //new - if (m_attachment.addEntry(file)) - { - cbContent.addItem(file.getName()); - cbContent.setSelectedIndex(cbContent.getItemCount()-1); - m_change = true; - } - } - } - // Save path of file - if (files.length>0) { - lastPath = files[0].getParentFile().getAbsolutePath(); - } - } // getFileName - - /** - * Delete entire Attachment - */ - private void deleteAttachment() - { - log.info(""); - if (ADialog.ask(m_WindowNo, this, "AttachmentDelete?")) { - m_attachment.delete(true); - m_attachment = null; - } - } // deleteAttachment - - /** - * Delete Attachment Entry - */ - private void deleteAttachmentEntry() - { - log.info(""); - int index = cbContent.getSelectedIndex(); - String fileName = getFileName(index); - if (fileName == null) - return; - // - if (ADialog.ask(m_WindowNo, this, "AttachmentDeleteEntry?", fileName)) - { - if (m_attachment.deleteEntry(index)) - cbContent.removeItemAt(index); - m_change = true; - } - } // deleteAttachment - - - /** - * Save Attachment to File - */ - private void saveAttachmentToFile() - { - int index = cbContent.getSelectedIndex(); - if (log.isLoggable(Level.INFO)) log.info("index=" + index); - if (m_attachment.getEntryCount() < index) - return; - - String fileName = getFileName(index); - String ext = fileName.substring (fileName.lastIndexOf('.')); - if (log.isLoggable(Level.CONFIG)) log.config( "Ext=" + ext); - - JFileChooser chooser = new JFileChooser(); - chooser.setDialogType(JFileChooser.SAVE_DIALOG); - chooser.setDialogTitle(Msg.getMsg(Env.getCtx(), "AttachmentSave")); - File f = new File(fileName); - chooser.setSelectedFile(f); - // Show dialog - int returnVal = chooser.showSaveDialog(this); - if (returnVal != JFileChooser.APPROVE_OPTION) - return; - File saveFile = chooser.getSelectedFile(); - if (saveFile == null) - return; - - if (log.isLoggable(Level.CONFIG)) log.config("Save to " + saveFile.getAbsolutePath()); - m_attachment.getEntryFile(index, saveFile); - } // saveAttachmentToFile - - /** - * Open the temporary file with the application associated with the extension in the file name - * @return true if file was opened with third party application - */ - private boolean openAttachment () - { - int index = cbContent.getSelectedIndex(); - byte[] data = m_attachment.getEntryData(index); - if (data == null) - return false; - - try - { - String fileName = System.getProperty("java.io.tmpdir") + - System.getProperty("file.separator") + - m_attachment.getEntryName(index); - File tempFile = new File(fileName); - m_attachment.getEntryFile(index, tempFile); - - if (Env.isWindows()) - { - // Runtime.getRuntime().exec ("rundll32 url.dll,FileProtocolHandler " + url); - @SuppressWarnings("unused") - Process p = Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL \"" + tempFile + "\""); - // p.waitFor(); - return true; - } - else if (Env.isMac()) - { - String [] cmdArray = new String [] {"open", tempFile.getAbsolutePath()}; - @SuppressWarnings("unused") - Process p = Runtime.getRuntime ().exec (cmdArray); - // p.waitFor(); - return true; - } - else // other OS. originally nothing here. add the following codes - { - try { - Desktop desktop = null; - if (Desktop.isDesktopSupported()) { - desktop = Desktop.getDesktop(); - File file = new File(tempFile.getAbsolutePath()); - desktop.open(file); - return true; - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } - catch (Exception e) - { - log.log(Level.SEVERE, "", e); - } - return false; - } // openFile - - - /************************************************************************** - * Graphic Image Panel - */ - class GImage extends JPanel - { - /** - * - */ - private static final long serialVersionUID = 4991225210651641722L; - - /** - * Graphic Image - */ - public GImage() - { - super(); - } // GImage - - /** The Image */ - private Image m_image = null; - - /** - * Set Image - * @param image image - */ - public void setImage (Image image) - { - m_image = image; - if (m_image == null) - return; - - MediaTracker mt = new MediaTracker(this); - mt.addImage(m_image, 0); - try { - mt.waitForID(0); - } catch (Exception e) {} - Dimension dim = new Dimension(m_image.getWidth(this), m_image.getHeight(this)); - this.setPreferredSize(dim); - } // setImage - - /** - * Paint - * @param g graphics - */ - public void paint (Graphics g) - { - Insets in = getInsets(); - if (m_image != null) - g.drawImage(m_image, in.left, in.top, this); - } // paint - - /** - * Update - * @param g graphics - */ - public void update (Graphics g) - { - paint(g); - } // update - } // GImage - - - /** - * Test PDF Viewer - * @param args ignored - */ - public static void main (String[] args) - { - } // main - -} // Attachment diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/BeanShellEditor.java b/org.adempiere.ui.swing/src/org/compiere/apps/BeanShellEditor.java deleted file mode 100644 index 0884b2601f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/BeanShellEditor.java +++ /dev/null @@ -1,404 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.HashMap; -import java.util.logging.Level; - -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JScrollPane; -import javax.swing.JSplitPane; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.border.TitledBorder; - -import org.compiere.model.MUser; -import org.compiere.model.Scriptlet; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -import bsh.ParseException; - -/** - * Bean Shell Editor - * - * @author Jorg Janke - * @version $Id: ScriptEditor.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class BeanShellEditor extends CDialog implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -5134274235147001140L; - @SuppressWarnings("unused") - private Frame m_owner; - - /** - * Minimum Constructor - */ - public BeanShellEditor() - { - this (Msg.getMsg(Env.getCtx(), "Script"), null, 0); - } // ScriptEditor - - /** - * Minimum Constructor - */ - public BeanShellEditor(Frame owner) - { - this (owner, Msg.getMsg(Env.getCtx(), "Script"), null, 0); - } // ScriptEditor - - /** - * Constructor - * - * @param title Field Name - * @param script The Script - */ - public BeanShellEditor (String title, Scriptlet script, int WindowNo) - { - this(null, title, script, WindowNo); - } - - /** - * Constructor - * - * @param owner Owner frame - * @param title Field Name - * @param script The Script - */ - public BeanShellEditor (Frame owner, String title, Scriptlet script, int WindowNo) - { - super(owner); - setTitle(title); - if (owner != null) - { - setModal(true); - } - m_owner = owner; - m_WindowNo = WindowNo; - if (m_WindowNo == 0) - m_WindowNo = AEnv.createWindowNo(this); - if (log.isLoggable(Level.INFO)) log.info("Window=" + m_WindowNo); - try - { - jbInit(); - setScript (script); - dynInit(); - AEnv.showCenterScreen(this); - toFront(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - } // ScriptEditor - - /** The Script */ - private Scriptlet m_script; - /** WindowNo */ - private int m_WindowNo; - /** Original Script */ - private String m_origScript; - /** Logger */ - private static CLogger log = CLogger.getCLogger(BeanShellEditor.class); - // -- - - private CPanel mainPanel = new CPanel(); - private BorderLayout borderLayout1 = new BorderLayout(); - private JScrollPane editorPane = new JScrollPane(); - private JTextArea editor = new JTextArea(); - private JScrollPane variablesPane = new JScrollPane(); - private JTextPane variables = new JTextPane(); - private TitledBorder titledBorder1; - private TitledBorder titledBorder2; - private CPanel northPanel = new CPanel(); - private CPanel southPanel = new CPanel(); - private BorderLayout southLayout = new BorderLayout(); - private CPanel okPanel = new CPanel(); - private JButton bOK = ConfirmPanel.createOKButton(true); - private JButton bCancel = ConfirmPanel.createCancelButton(true); - private CPanel resultPanel = new CPanel(); - private JButton bProcess = ConfirmPanel.createProcessButton(true); - private JButton bValidate = ConfirmPanel.createCustomizeButton("Validate"); - private JLabel lResult = new JLabel(); - private JTextField fResult = new JTextField(); - private CPanel resultVariablePanel = new CPanel(); - private BorderLayout northLayout = new BorderLayout(); - private JLabel lResultVariable = new JLabel(); - private JTextField fResultVariable = new JTextField(); - private CPanel helpPanel = new CPanel(); - private JButton bHelp = ConfirmPanel.createHelpButton(true); - private GridBagLayout resultVariableLayout = new GridBagLayout(); - private FlowLayout okLayout = new FlowLayout(); - private GridBagLayout resultLayout = new GridBagLayout(); - private JSplitPane centerPane = new JSplitPane(); - - /** - * Static Layout - * @throws Exception - */ - void jbInit() throws Exception - { - this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - titledBorder1 = new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(148, 145, 140)), - Msg.getMsg(Env.getCtx(), "ScriptVariables")); - titledBorder2 = new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(148, 145, 140)), - Msg.getMsg(Env.getCtx(), "ScriptEditor")); - mainPanel.setLayout(borderLayout1); - editor.setLineWrap(true); - editor.setTabSize(4); - editor.setWrapStyleWord(true); - bOK.addActionListener(this); - bCancel.addActionListener(this); - bHelp.addActionListener(this); - bProcess.addActionListener(this); - bValidate.addActionListener(this); - variables.setBackground(Color.lightGray); - variables.setEditable(false); - variables.setContentType("text/html"); - variablesPane.setBorder(titledBorder1); - editorPane.setBorder(titledBorder2); - centerPane.setPreferredSize(new Dimension(500, 500)); - centerPane.setLeftComponent(editorPane); - centerPane.setRightComponent(variablesPane); - southPanel.setLayout(southLayout); - resultPanel.setLayout(resultLayout); - lResult.setText(Msg.getMsg(Env.getCtx(), "ScriptResult")); - fResult.setBackground(Color.lightGray); - fResult.setEditable(false); - fResult.setText(""); - northPanel.setLayout(northLayout); - lResultVariable.setText(Msg.getMsg(Env.getCtx(), "ScriptResultVariable")); - fResultVariable.setBackground(Color.lightGray); - fResultVariable.setEditable(false); - resultVariablePanel.setLayout(resultVariableLayout); - okPanel.setLayout(okLayout); - northPanel.add(resultVariablePanel, BorderLayout.CENTER); - getContentPane().add(mainPanel); - editorPane.getViewport().add(editor, null); - variablesPane.getViewport().add(variables, null); - mainPanel.add(northPanel, BorderLayout.NORTH); - mainPanel.add(southPanel, BorderLayout.SOUTH); - southPanel.add(okPanel, BorderLayout.EAST); - okPanel.add(bCancel, null); - okPanel.add(bOK, null); - southPanel.add(resultPanel, BorderLayout.CENTER); - resultPanel.add(bValidate, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - resultPanel.add(bProcess, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - resultPanel.add(lResult, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - resultPanel.add(fResult, new GridBagConstraints(3, 0, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - mainPanel.add(centerPane, BorderLayout.CENTER); - resultVariablePanel.add(lResultVariable, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - resultVariablePanel.add(fResultVariable, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(helpPanel, BorderLayout.EAST); - helpPanel.add(bHelp, null); - centerPane.setDividerLocation(350); - } // jbInit - - /** - * Set Script - * @param script The Script - */ - public void setScript (Scriptlet script) - { - if (script == null) - m_script = new Scriptlet (Scriptlet.VARIABLE, ";", Env.getCtx(), m_WindowNo); - else - m_script = script; - // - fResultVariable.setText(m_script.getVariable()); - m_origScript = m_script.getScript(); - editor.setText(m_script.getScript()); - // - StringBuilder sb = new StringBuilder(""); - HashMap ctx = m_script.getEnvironment(); - String[] pp = new String[ctx.size()]; - ctx.keySet().toArray(pp); - Arrays.sort(pp); - for (int i = 0; i < pp.length; i++) - { - String key = pp[i].toString(); - Object value = ctx.get(key); - sb.append("") - .append(key) - .append(" (") - .append(value) - .append(")
    "); - } - sb.append(""); - variables.setText(sb.toString()); - variables.setCaretPosition(0); - } // setScript - - /** - * Get Color Code - * @param value the object - * @return HTML color code - */ - private String getColor (Object value) - { - if (value instanceof String) - return "#009900"; // "green"; - else if (value instanceof Integer) - return "#0000FF"; // "blue"; - else if (value instanceof Double) - return "#00FFFF"; // "cyan"; - else if (value instanceof Timestamp) - return "#FF00FF"; // "magenta"; - else if (value instanceof Boolean) - return "#FF9900"; // "orange"; - return "#FF0000"; // "red"; - } // getColor - - /** - * Dynamic Init - */ - private void dynInit() - { - - } // dynInit - - - /** - * Action Listener - * @param e - */ - public void actionPerformed(ActionEvent e) - { - if (e.getSource() == bOK) - { - m_script.setScript(editor.getText()); - dispose(); - } - else if (e.getSource() == bCancel) - { - m_script.setScript(m_origScript); - dispose(); - } - - else if (e.getSource() == bProcess) - actionProcess(); - else if (e.getSource() == bValidate) - actionValidate(); - else if (e.getSource() == bHelp) - { - Help h = new Help (this , - Msg.getMsg(Env.getCtx(), "ScriptHelp"), - getClass().getResource("Script.html")); - h.setVisible(true); - } - } // actionPerformed - - /** - * Process Script - */ - private void actionProcess() - { - /** Example: - import org.compiere.util.DB; - import java.sql.*; - PreparedStatement pstmt =DB.prepareStatement("select Name, Password from AD_User where Name like 'Super%'"); - ResultSet rs = pstmt.executeQuery(); - if (rs.next()) - { - result = rs.getString("Name") + "; password= " + rs.getString("Password"); - } - **/ - - MUser user = MUser.get(Env.getCtx()); - if (!user.isAdministrator()) - { - fResult.setText("Not Administrator"); - return; - } - // - m_script.setScript(editor.getText()); - Exception e = m_script.execute(); - if (e != null) - ADialog.error(m_WindowNo, this, "ScriptError", e.toString()); - Object result = m_script.getResult(false); - fResult.setText(result == null ? "" : result.toString()); - } // actionProcess - - /** - * Validate Script - */ - private void actionValidate() - { - /** Example: - import org.compiere.util.DB; - import java.sql.*; - PreparedStatement pstmt =DB.prepareStatement("select Name, Password from AD_User where Name like 'Super%'"); - ResultSet rs = pstmt.executeQuery(); - if (rs.next()) - { - result = rs.getString("Name") + "; password= " + rs.getString("Password"); - } - **/ - - MUser user = MUser.get(Env.getCtx()); - if (!user.isAdministrator()) - { - fResult.setText("Not Administrator"); - return; - } - // - m_script.setScript(editor.getText()); - Exception e = null; - try { - m_script.validate(); - } catch (ParseException e1) { - e = e1; - } - if (e != null) - { - ADialog.error(m_WindowNo, this, "ScriptError", e.toString()); - fResult.setText("Syntax errors detected."); - } - else - fResult.setText("No syntax errors detected."); - } // actionValidate - - /*************************************************************************/ -} // ScriptEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ClientProcessCtrl.java b/org.adempiere.ui.swing/src/org/compiere/apps/ClientProcessCtrl.java deleted file mode 100644 index 79e925a324..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ClientProcessCtrl.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.compiere.apps; - -import java.awt.Container; -import java.util.logging.Level; - -import org.adempiere.util.IProcessUI; -import org.compiere.model.MPInstance; -import org.compiere.process.ProcessInfo; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Trx; - -public class ClientProcessCtrl { - - /** Static Logger */ - private static CLogger log = CLogger.getCLogger (ClientProcessCtrl.class); - - /** - * Process Control - * - * - Get Instance ID - * - Get Parameters - * - execute (lock - start process - unlock) - * - * Creates a ProcessCtl instance, which calls - * lockUI and unlockUI if parent is a ASyncProcess - *
    - * Called from APanel.cmd_print, APanel.actionButton and - * VPaySelect.cmd_generate - * - * @param parent ASyncProcess & Container - * @param WindowNo window no - * @param pi ProcessInfo process info - * @param trx Transaction - * @return worker started ProcessCtl instance or null for workflow - */ - public static ProcessCtl process (IProcessUI parent, int WindowNo, ProcessInfo pi, Trx trx) - { - if (log.isLoggable(Level.FINE)) log.fine("WindowNo=" + WindowNo + " - " + pi); - - MPInstance instance = null; - try - { - instance = new MPInstance(Env.getCtx(), pi.getAD_Process_ID(), pi.getRecord_ID()); - } - catch (Exception e) - { - pi.setSummary (e.getLocalizedMessage()); - pi.setError (true); - log.warning(pi.toString()); - return null; - } - catch (Error e) - { - pi.setSummary (e.getLocalizedMessage()); - pi.setError (true); - log.warning(pi.toString()); - return null; - } - if (!instance.save()) - { - pi.setSummary (Msg.getMsg(Env.getCtx(), "ProcessNoInstance")); - pi.setError (true); - return null; - } - pi.setAD_PInstance_ID (instance.getAD_PInstance_ID()); - - // Get Parameters (Dialog) - ProcessParameter para = new ProcessParameter (AEnv.getFrame((Container)parent), WindowNo, pi); - if (para.initDialog()) - { - para.setVisible(true); - if (!para.isOK()) - { - pi.setSummary (Msg.getMsg(Env.getCtx(), "ProcessCancelled")); - pi.setError (true); - return null; - } - } - - // execute - ProcessCtl worker = new ProcessCtl(parent, WindowNo, pi, trx); - if (parent != null) - { - //asynchrous - worker.start(); - } - else - { - //synchrous - worker.run(); - } - return worker; - } // execute -} diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ConfirmPanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/ConfirmPanel.java deleted file mode 100644 index d46a86b3b3..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ConfirmPanel.java +++ /dev/null @@ -1,741 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.FlowLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; - -import javax.swing.Icon; -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JFrame; -import javax.swing.JRootPane; -import javax.swing.KeyStroke; - -import org.compiere.swing.CButton; -import org.compiere.swing.CPanel; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Application Confirm Panel. - * - * if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - * - * @author Jorg Janke - * @version $Id: ConfirmPanel.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public final class ConfirmPanel extends CPanel -{ - /** - * - */ - private static final long serialVersionUID = 6041019802043360966L; - - - /** - * Create OK Button with label text and F4 Shortcut - * @param text text - * @return OK Button - */ - public static final CButton createOKButton (String text) - { - AppsAction aa = new AppsAction (A_OK, KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0), text); - CButton button = (CButton)aa.getButton(); - button.setMargin(s_insets); - button.setDefaultCapable(true); - return button; - } // createOKButton - - /** - * Create OK Button with Standard text - * @param withText with text - * @return OK Button - */ - public static final CButton createOKButton (boolean withText) - { - if (withText) - return createOKButton(Msg.getMsg(Env.getCtx(), A_OK)); - return createOKButton(""); - } // createOKButton - - /** - * Create Cancel Button wlth label text and register ESC as KeyStroke - * @param text text - * @return Cancel Button - */ - public static final CButton createCancelButton (String text) - { - AppsAction aa = new AppsAction (A_CANCEL, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), text); - CButton button = (CButton)aa.getButton(); - button.setMargin(s_insets); - return button; - } // createCancelButton - - /** - * Create Cancel Button wlth Standard text - * @param withText with text - * @return Button - */ - public static final CButton createCancelButton(boolean withText) - { - if (withText) - return createCancelButton(Msg.getMsg(Env.getCtx(), A_CANCEL)); - return createCancelButton(""); - } // createCancelButton - - - /************************ - * Create Refresh Button wlth label text and F5 - * @param text text - * @return button - */ - public static final CButton createRefreshButton (String text) - { - AppsAction aa = new AppsAction (A_REFRESH, KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0), text); - CButton button = (CButton)aa.getButton(); - button.setMargin(s_insets); - return button; - } // createRefreshButton - - /** - * Create Refresh Button wlth Standard text - * @param withText with text - * @return Button - */ - public static final CButton createRefreshButton (boolean withText) - { - if (withText) - return createRefreshButton(Msg.getMsg(Env.getCtx(), A_REFRESH)); - return createRefreshButton(""); - } // createRefreshButton - - - /************************ - * Create Reset Button wlth label text - * @param text text - * @return button - */ - public static final CButton createResetButton (String text) - { - AppsAction aa = new AppsAction (A_RESET, null, text); - CButton button = (CButton)aa.getButton(); - button.setMargin(s_insets); - return button; - } // createResetButton - - /** - * Create Reset Button wlth Standard text - * @param withText with text - * @return Button - */ - public static final CButton createResetButton (boolean withText) - { - if (withText) - return createResetButton(Msg.getMsg(Env.getCtx(), A_RESET)); - return createResetButton(null); - } // createRefreshButton - - /************************ - * Create Customize Button wlth label text - * @param text text - * @return button - */ - public static final CButton createCustomizeButton (String text) - { - AppsAction aa = new AppsAction (A_CUSTOMIZE, null, text); - CButton button = (CButton)aa.getButton(); - button.setMargin(s_insets); - return button; - // Env.getImageIcon("Preference24.gif")); - } // createCustomizeButton - - /** - * Create Customize Button wlth Standard text - * @param withText with text - * @return Button - */ - public static final CButton createCustomizeButton (boolean withText) - { - if (withText) - return createCustomizeButton(Msg.getMsg(Env.getCtx(), A_CUSTOMIZE)); - return createCustomizeButton(null); - } // createCustomizeButton - - - /************************ - * Create History Button wlth label text - * @param text text - * @return button - */ - public static final CButton createHistoryButton (String text) - { - AppsAction aa = new AppsAction (A_HISTORY, KeyStroke.getKeyStroke(KeyEvent.VK_F9, 0), text); - CButton button = (CButton)aa.getButton(); - button.setMargin(s_insets); - return button; - // Env.getImageIcon("HistoryX24.gif")); - } // createHistoryButton - - /** - * Create History Button wlth Standard text - * @param withText with text - * @return Button - */ - public static final CButton createHistoryButton (boolean withText) - { - if (withText) - return createHistoryButton(Msg.getMsg(Env.getCtx(), A_HISTORY)); - return createHistoryButton(null); - } // createHistoryButton - - - /************************ - * Create Zoom Button wlth label text - * @param text text - * @return button - */ - public static final CButton createZoomButton (String text) - { - AppsAction aa = new AppsAction (A_ZOOM, null, text); - CButton button = (CButton)aa.getButton(); - button.setMargin(s_insets); - return button; - } // createZoomButton - - /** - * Create Zoom Button wlth Standard text - * @param withText with text - * @return Button - */ - public static final CButton createZoomButton (boolean withText) - { - if (withText) - return createZoomButton(Msg.getMsg(Env.getCtx(), A_ZOOM)); - return createZoomButton(null); - } // createZoomButton - - - /************************ - * Create Process Button wlth label text Shift-F4 - * @param text text - * @return button - */ - public static final CButton createProcessButton (String text) - { - AppsAction aa = new AppsAction (A_PROCESS, - KeyStroke.getKeyStroke(KeyEvent.VK_F4, ActionEvent.SHIFT_MASK), text); - CButton button = (CButton)aa.getButton(); - button.setMargin(s_insets); - return button; - } // createProcessButton - - /** - * Create Process Button wlth Standard text - * @param withText with text - * @return Button - */ - public static final CButton createProcessButton (boolean withText) - { - if (withText) - return createProcessButton(Msg.getMsg(Env.getCtx(), A_PROCESS)); - return createProcessButton(null); - } // createProcessButton - - - /************************ - * Create Print Button wlth label text - * @param text text - * @return button - */ - public static final CButton createPrintButton (String text) - { - AppsAction aa = new AppsAction (A_PRINT, KeyStroke.getKeyStroke(KeyEvent.VK_F12, 0), text); - CButton button = (CButton)aa.getButton(); - button.setMargin(s_insets); - return button; - } // createPrintButton - - /** - * Create Print Button wlth Standard text - * @param withText with text - * @return Button - */ - public static final CButton createPrintButton (boolean withText) - { - if (withText) - return createPrintButton(Msg.getMsg(Env.getCtx(), A_PRINT)); - return createPrintButton(null); - } // createPrintButton - - - /************************ - * Create Help Button wlth label text - * @param text text - * @return Button - */ - public static final CButton createHelpButton (String text) - { - AppsAction aa = new AppsAction (A_HELP, KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0), text); - CButton button = (CButton)aa.getButton(); - button.setMargin(s_insets); - return button; - } // createHelpButton - - /** - * Create Help Button wlth Standard text - * @param withText with text - * @return Button - */ - public static final CButton createHelpButton (boolean withText) - { - if (withText) - return createHelpButton(Msg.getMsg(Env.getCtx(), A_HELP)); - return createHelpButton(null); - } // createHelpButton - - - /************************ - * Create Export Button wlth label text - * @param text text - * @return Button - */ - public static final CButton createExportButton (String text) - { - AppsAction aa = new AppsAction (A_EXPORT, null, text); - CButton button = (CButton)aa.getButton(); - button.setMargin(s_insets); - return button; - } // createExportButton - - /** - * Create Export Button wlth Standard text - * @param withText with text - * @return Button - */ - public static final CButton createExportButton (boolean withText) - { - if (withText) - return createExportButton(Msg.getMsg(Env.getCtx(), A_EXPORT)); - return createExportButton(null); - } // createExportButton - - - /************************ - * Create Delete Button with label text - F3 - * @param text text - * @return Delete Button - */ - public static final CButton createDeleteButton (String text) - { - AppsAction aa = new AppsAction (A_DELETE, KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0), text); - CButton button = (CButton)aa.getButton(); - button.setMargin(s_insets); - return button; - } // createDeleteButton - - /** - * Create Delete Button with Standard text - * @param withText with text - * @return Delete Button - */ - public static final CButton createDeleteButton (boolean withText) - { - if (withText) - return createDeleteButton(Msg.getMsg(Env.getCtx(), A_DELETE)); - return createDeleteButton(null); - } // createDeleteButton - - - /************************ - * Create Product Attribute Button with Standard text - * @param withText with text - * @return Product Attribute Button - */ - public static final CButton createPAttributeButton (boolean withText) - { - if (withText) - return createPAttributeButton(Msg.getMsg(Env.getCtx(), A_PATTRIBUTE)); - return createPAttributeButton(null); - } // createPAttributeButton - - /** - * Create Product Attribute Button with label text - * @param text text - * @return Product Attribute Button - */ - public static final CButton createPAttributeButton (String text) - { - AppsAction aa = new AppsAction (A_PATTRIBUTE, null, text); - CButton button = (CButton)aa.getButton(); - button.setMargin(s_insets); - return button; - } // createPAttributeButton - - - /************************ - * Create New Button with Standard text - * @param withText with text - * @return New Button - */ - public static final CButton createNewButton (boolean withText) - { - if (withText) - return createNewButton(Msg.getMsg(Env.getCtx(), A_NEW)); - return createNewButton(null); - } // createNewButton - - /** - * Create New Button with label text - F2 - * @param text text - * @return Product Attribute Button - */ - public static final CButton createNewButton (String text) - { - AppsAction aa = new AppsAction (A_NEW, KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0), text); - CButton button = (CButton)aa.getButton(); - button.setMargin(s_insets); - return button; - } // createNewButton - - - /*************************************************************************/ - - /** Action String OK */ - public static final String A_OK = "Ok"; - /** Action String Cancel */ - public static final String A_CANCEL = "Cancel"; - /** Action String Refresh */ - public static final String A_REFRESH = "Refresh"; - /** Action String Reset */ - public static final String A_RESET = "Reset"; - /** Action String Customize */ - public static final String A_CUSTOMIZE = "Customize"; - /** Action String History */ - public static final String A_HISTORY = "History"; - /** Action String Zoom */ - public static final String A_ZOOM = "Zoom"; - - /** Action String Process */ - public static final String A_PROCESS = "Process"; - /** Action String Print */ - public static final String A_PRINT = "Print"; - /** Action String Export */ - public static final String A_EXPORT = "Export"; - /** Action String Help */ - public static final String A_HELP = "Help"; - /** Action String Delete */ - public static final String A_DELETE = "Delete"; - /** Action String PAttribute */ - public static final String A_PATTRIBUTE = "PAttribute"; - /** Action String New */ - public static final String A_NEW = "New"; - - /** Standard Insets used */ - public static Insets s_insets = new Insets (0, 10, 0, 10); - - - /************************************************************************** - * Create Confirmation Panel with OK Button - */ - public ConfirmPanel() - { - this (false, false, false, false, false, false, true); - } // ConfirmPanel - - /** - * Create Confirmation Panel with OK and Cancel Button - * @param withCancelButton with cancel - */ - public ConfirmPanel(boolean withCancelButton) - { - this (withCancelButton, false, false, false, false, false, true); - } // ConfirmPanel - - /** - * Create Confirmation Panel with different buttons - * @param withCancelButton with cancel - * @param withRefreshButton with refresh - * @param withResetButton with reset - * @param withCustomizeButton with customize - * @param withHistoryButton with history - * @param withZoomButton with zoom - * @param withText with text - */ - public ConfirmPanel(boolean withCancelButton, - boolean withRefreshButton, - boolean withResetButton, - boolean withCustomizeButton, - boolean withHistoryButton, - boolean withZoomButton, - boolean withText) - { - super(); - BorderLayout mainLayout = new BorderLayout(); - this.setLayout(mainLayout); - this.setName("confirmPanel"); - // - CPanel okCancel = new CPanel(new FlowLayout(FlowLayout.RIGHT)); - okCancel.setOpaque(false); - bCancel = createCancelButton(withText); - okCancel.add(bCancel); - bOK = createOKButton(withText); - okCancel.add(bOK); - setCancelVisible(withCancelButton); - this.add(okCancel, BorderLayout.EAST); - // - if (withRefreshButton) - { - bRefresh = createRefreshButton(withText); - addComponent(bRefresh); - } - if (withResetButton) - { - bReset = createResetButton(withText); - addComponent(bReset); - } - if (withCustomizeButton) - { - bCustomize = createCustomizeButton(withText); - addComponent(bCustomize); - } - if (withHistoryButton) - { - bHistory = createHistoryButton(withText); - addComponent(bHistory); - } - if (withZoomButton) - { - bZoom = createZoomButton(withText); - addComponent(bZoom); - } - } // ConfirmPanel - - /** Additional Buttons Panel */ - private CPanel m_addlButtons = null; - - private CButton bOK; - private CButton bCancel; - // - private CButton bRefresh; - private CButton bReset; - private CButton bCustomize; - private CButton bHistory; - private CButton bZoom; - - /** - * Add Button to left side of confirmPanel - * @param button button - */ - public void addComponent (Component button) - { - if (m_addlButtons == null) - { - m_addlButtons = new CPanel(new FlowLayout(FlowLayout.LEFT)); - this.add(m_addlButtons, BorderLayout.WEST); - } - m_addlButtons.add(button); - } // addButton - - /** - * Add Button to left side of confirmPanel - * @param action action command - * @param toolTipText tool tip text - * @param icon icon - * @return JButton - */ - public CButton addButton (String action, String toolTipText, Icon icon) - { - AppsAction aa = new AppsAction(action, null, toolTipText); - CButton b = (CButton)aa.getButton(); -// new DialogButton (action, toolTipText, icon); - addComponent (b); - return b; - } // addButton - - /** - * Add Button to left side of confirmPanel - * @param button button - * @return JButton - */ - public JButton addButton (JButton button) - { - addComponent (button); - return button; - } // addButton - - /** - * Get OK Button - * @return OK Button - */ - public CButton getOKButton() - { - return bOK; - } // getOKButton - - /** - * Get Cancel Button - * @return Cancel Button - */ - public CButton getCancelButton() - { - return bCancel; - } // getCancelButton - - /** - * Show OK button - * @param value true for visible - */ - public void setOKVisible (boolean value) - { - bOK.setVisible(value); - bOK.setEnabled(value); - } // setOKVisible - - /** - * Is OK Visible - * @return true of OK visisble - */ - public boolean isOKVisible() - { - return bOK.isVisible(); - } // isOKVisible - - /** - * Show Cancel button - * @param value trie for visible - */ - public void setCancelVisible (boolean value) - { - bCancel.setVisible(value); - bCancel.setEnabled(value); - } // setCancelVisible - - /** - * Is Cancel Visible - * @return true if Canvel is visible - */ - public boolean isCancelVisible() - { - return bCancel.isVisible(); - } // isCancelVisible - - /** - * Get Reset Button - * @return Button - */ - public CButton getResetButton() - { - return bReset; - } // getResetButton - - /** - * Get Customize Button - * @return Button - */ - public CButton getCustomizeButton() - { - return bCustomize; - } // getCustomizeButton - - /** - * Get History Button - * @return Button - */ - public CButton getHistoryButton() - { - return bHistory; - } // getHistoryButton - - /** - * Get Zoom Button - * @return Button - */ - public CButton getZoomButton() - { - return bZoom; - } // getZoomyButton - - /** - * Get Refresh Button - * @return Button - */ - public CButton getRefreshButton() - { - return bRefresh; - } // getRefreshButton - - - /************************************************************************** - * Add Action Listener - * - * if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - * - * @param al listener - */ - public void addActionListener(ActionListener al) - { - ((AppsAction)bOK.getAction()).setDelegate(al); - ((AppsAction)bCancel.getAction()).setDelegate(al); - // - if (bRefresh != null) - ((AppsAction)bRefresh.getAction()).setDelegate(al); - if (bReset != null) - ((AppsAction)bReset.getAction()).setDelegate(al); - if (bCustomize != null) - ((AppsAction)bCustomize.getAction()).setDelegate(al); - if (bHistory != null) - ((AppsAction)bHistory.getAction()).setDelegate(al); - if (bZoom != null) - ((AppsAction)bZoom.getAction()).setDelegate(al); - - // Set OK as default Button - JRootPane rootpane = null; - if (al instanceof JDialog) - rootpane = ((JDialog)al).getRootPane(); - else if (al instanceof JFrame) - rootpane = ((JFrame)al).getRootPane(); - if (rootpane != null) - rootpane.setDefaultButton(bOK); - } // addActionListener - - /** - * Enable all components - * @param enabled trie if enabled - */ - public void setEnabled (boolean enabled) - { - super.setEnabled(enabled); - bOK.setEnabled(enabled); - bCancel.setEnabled(enabled); - // - if (bRefresh != null) - bRefresh.setEnabled(enabled); - if (bCustomize != null) - bCustomize.setEnabled(enabled); - if (bHistory != null) - bHistory.setEnabled(enabled); - if (bZoom != null) - bZoom.setEnabled(enabled); - } // setEnabled - -} // ConfirmPanel diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/EMailDialog.java b/org.adempiere.ui.swing/src/org/compiere/apps/EMailDialog.java deleted file mode 100644 index 0be289d9df..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/EMailDialog.java +++ /dev/null @@ -1,474 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - * Contributor(s): * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.Dialog; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.beans.VetoableChangeListener; -import java.io.File; -import java.util.StringTokenizer; -import java.util.logging.Level; - -import org.compiere.grid.ed.VLookup; -import org.compiere.model.Lookup; -import org.compiere.model.MClient; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MUser; -import org.compiere.model.MUserMail; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextArea; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.EMail; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * EMail Dialog - * - * @author Jorg Janke - * @version $Id: EMailDialog.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * - * globalqss: integrate phib fixing bug reported here - * http://sourceforge.net/tracker/index.php?func=detail&aid=1568765&group_id=176962&atid=879332 - * - * phib - fixing bug [ 1568765 ] Close email dialog button broken - * - * globalqss - Carlos Ruiz - implement CC - FR [ 1754879 ] Enhancements on sending e-mail - * - */ -public class EMailDialog extends CDialog - implements ActionListener, VetoableChangeListener -{ - /** - * - */ - private static final long serialVersionUID = -6850428309037475213L; - - /** - * EMail Dialog - * @param owner calling window - * @param title title - * @param from from - * @param to to - * @param subject subject - * @param message message - * @param attachment optional attachment - */ - public EMailDialog (Dialog owner, String title, MUser from, String to, - String subject, String message, File attachment) - { - super (owner, title, true); - commonInit(from, to, subject, message, attachment); - } // EmailDialog - - /** - * EMail Dialog - * @param owner calling window - * @param title title - * @param from from - * @param to to - * @param subject subject - * @param message message - * @param attachment optional attachment - */ - public EMailDialog (Frame owner, String title, MUser from, String to, - String subject, String message, File attachment) - { - super (owner, title, true); - commonInit(from, to, subject, message, attachment); - } // EmailDialog - - /** - * Common Init - * @param from from - * @param to to - * @param subject subject - * @param message message - * @param attachment optional attachment - */ - private void commonInit (MUser from, String to, - String subject, String message, File attachment) - { - m_client = MClient.get(Env.getCtx()); - try - { - int WindowNo = 0; - int AD_Column_ID = 0; - Lookup lookup = MLookupFactory.get (Env.getCtx(), WindowNo, - AD_Column_ID, DisplayType.Search, - Env.getLanguage(Env.getCtx()), "AD_User_ID", 0, false, - "EMail IS NOT NULL"); - fUser = new VLookup ("AD_User_ID", false, false, true, lookup); - fUser.addVetoableChangeListener(this); - fCcUser = new VLookup ("AD_User_ID", false, false, true, lookup); - fCcUser.addVetoableChangeListener(this); - jbInit(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "EMailDialog", ex); - } - set(from, to, subject, message); - setAttachment(attachment); - AEnv.showCenterScreen(this); - } // commonInit - - - /** Client */ - private MClient m_client = null; - /** Sender */ - private MUser m_from = null; - /** Primary Recipient */ - private MUser m_user = null; - /** Cc Recipient */ - private MUser m_ccuser = null; - // - private String m_to; - private String m_cc; - private String m_subject; - private String m_message; - /** File to be optionally attached */ - private File m_attachFile; - /** Logger */ - private static CLogger log = CLogger.getCLogger(EMailDialog.class); - - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel headerPanel = new CPanel(); - private GridBagLayout headerLayout = new GridBagLayout(); - private CTextField fFrom = new CTextField(20); - private CTextField fTo = new CTextField(20); - private CTextField fCc = new CTextField(20); - private VLookup fUser = null; - private VLookup fCcUser = null; - private CTextField fSubject = new CTextField(40); - private CLabel lFrom = new CLabel(); - private CLabel lTo = new CLabel(); - private CLabel lCc = new CLabel(); - private CLabel lSubject = new CLabel(); - private CLabel lAttachment = new CLabel(); - private CTextField fAttachment = new CTextField(40); - private CTextArea fMessage = new CTextArea(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - private StatusBar statusBar = new StatusBar(); - - /** - * Static Init - */ - void jbInit() throws Exception - { - lFrom.setText(Msg.getMsg(Env.getCtx(), "From") + ":"); - lTo.setText(Msg.getMsg(Env.getCtx(), "To") + ":"); - lCc.setText(Msg.getMsg(Env.getCtx(), "Cc") + ":"); - lSubject.setText(Msg.getMsg(Env.getCtx(), "Subject") + ":"); - lAttachment.setText(Msg.getMsg(Env.getCtx(), "Attachment") + ":"); - fFrom.setReadWrite(false); - // - mainPanel.setLayout(mainLayout); - headerPanel.setLayout(headerLayout); - mainLayout.setHgap(5); - mainLayout.setVgap(5); - fMessage.setPreferredSize(new Dimension(150, 150)); - getContentPane().add(mainPanel); - mainPanel.add(headerPanel, BorderLayout.NORTH); - - headerPanel.add(lFrom, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 10, 0, 5), 0, 0)); - headerPanel.add(fFrom, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 10), 0, 0)); - - headerPanel.add(lTo, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 10, 0, 5), 0, 0)); - headerPanel.add(fUser, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 10), 0, 0)); - headerPanel.add(fTo, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 10), 0, 0)); - headerPanel.add(lCc, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 10, 0, 5), 0, 0)); - headerPanel.add(fCcUser, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 10), 0, 0)); - headerPanel.add(fCc, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 10), 0, 0)); - - headerPanel.add(lSubject, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 10, 0, 5), 0, 0)); - headerPanel.add(fSubject, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 0, 10), 1, 0)); - - headerPanel.add(lAttachment, new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 10, 0, 5), 0, 0)); - headerPanel.add(fAttachment, new GridBagConstraints(1, 7, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 0, 10), 1, 0)); - - mainPanel.add(fMessage, BorderLayout.CENTER); - // - mainPanel.add (confirmPanel, BorderLayout.SOUTH); - this.getContentPane().add(statusBar, BorderLayout.SOUTH); - confirmPanel.addActionListener(this); - statusBar.setStatusDB(null); - } // jbInit - - /** - * Set all properties - */ - public void set (MUser from, String to, String subject, String message) - { - // Content - setFrom(from); - setTo(to); - setSubject(subject); - setMessage(message); - // - statusBar.setStatusLine(m_client.getSMTPHost()); - } // set - - /** - * Set Address - */ - public void setTo(String newTo) - { - m_to = newTo; - fTo.setText(m_to); - } // setTo - - /** - * Set CC Address - */ - public void setCc(String newCc) - { - m_cc = newCc; - fCc.setText(m_cc); - } // setCc - - /** - * Get Address - */ - public String getTo() - { - m_to = fTo.getText(); - return m_to; - } // getTo - - /** - * Get CC Address - */ - public String getCc() - { - m_cc = fCc.getText(); - return m_cc; - } // getCc - - /** - * Set Sender - */ - public void setFrom(MUser newFrom) - { - m_from = newFrom; - if (newFrom == null - || !newFrom.isEMailValid() - || !newFrom.isCanSendEMail()) - { - confirmPanel.getOKButton().setEnabled(false); - fFrom.setText("**Invalid**"); - } - else - fFrom.setText(m_from.getEMail()); - } // setFrom - - /** - * Get Sender - */ - public MUser getFrom() - { - return m_from; - } // getFrom - - /** - * Set Subject - */ - public void setSubject(String newSubject) - { - m_subject = newSubject; - fSubject.setText(m_subject); - } // setSubject - - /** - * Get Subject - */ - public String getSubject() - { - m_subject = fSubject.getText(); - return m_subject; - } // getSubject - - /** - * Set Message - */ - public void setMessage(String newMessage) - { - m_message = newMessage; - fMessage.setText(m_message); - fMessage.setCaretPosition(0); - } // setMessage - - /** - * Get Message - */ - public String getMessage() - { - m_message = fMessage.getText(); - return m_message; - } // getMessage - - /** - * Set Attachment - */ - public void setAttachment (File attachment) - { - m_attachFile = attachment; - if (attachment == null) - { - lAttachment.setVisible(false); - fAttachment.setVisible(false); - } - else - { - lAttachment.setVisible(true); - fAttachment.setVisible(true); - fAttachment.setText(attachment.getName()); - fAttachment.setReadWrite(false); - } - } // setAttachment - - /** - * Get Attachment - */ - public File getAttachment() - { - return m_attachFile; - } // getAttachment - - /************************************************************************** - * Action Listener - Send email - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - dispose(); - - if (getTo() == null || getTo().length() == 0) - { - return; - } - // Send - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - confirmPanel.getOKButton().setEnabled(false); - - StringTokenizer st = new StringTokenizer(getTo(), " ,;", false); - String to = st.nextToken(); - EMail email = m_client.createEMail(getFrom(), to, getSubject(), getMessage()); - String status = "Check Setup"; - if (email != null) - { - while (st.hasMoreTokens()) - email.addTo(st.nextToken()); - // cc - StringTokenizer stcc = new StringTokenizer(getCc(), " ,;", false); - while (stcc.hasMoreTokens()) - { - String cc = stcc.nextToken(); - if (cc != null && cc.length() > 0) - email.addCc(cc); - } - // Attachment - if (m_attachFile != null && m_attachFile.exists()) - email.addAttachment(m_attachFile); - status = email.send(); - // - if (m_user != null) - new MUserMail(m_user, m_user.getAD_User_ID(), email).saveEx(); - if (email.isSentOK()) - { - ADialog.info(0, this, "MessageSent"); - dispose(); - } - else - ADialog.error(0, this, "MessageNotSent", status); - } - else - ADialog.error(0, this, "MessageNotSent", status); - // - confirmPanel.getOKButton().setEnabled(false); - setCursor(Cursor.getDefaultCursor()); - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - dispose(); - - } // actionPerformed - - /** - * Vetoable Change - User selected - * @param evt - * @throws PropertyVetoException - */ - public void vetoableChange (PropertyChangeEvent evt) - throws PropertyVetoException - { - VLookup source = (VLookup) evt.getSource(); - Object value = evt.getNewValue(); - if (log.isLoggable(Level.INFO)) log.info("Value=" + value); - if (source.equals(fUser)) { - // fUser - if (value == null) - fTo.setText(""); - if (value instanceof Integer) - { - int AD_User_ID = ((Integer)value).intValue(); - m_user = MUser.get(Env.getCtx(), AD_User_ID); - fTo.setValue(m_user.getEMail()); - } - } else { - // fCcUser - if (value == null) - fCc.setText(""); - if (value instanceof Integer) - { - int AD_User_ID = ((Integer)value).intValue(); - m_ccuser = MUser.get(Env.getCtx(), AD_User_ID); - fCc.setValue(m_ccuser.getEMail()); - } - } - } // vetoableChange - -} // VEMailDialog \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/FieldRecordInfo.java b/org.adempiere.ui.swing/src/org/compiere/apps/FieldRecordInfo.java deleted file mode 100644 index d5723d555b..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/FieldRecordInfo.java +++ /dev/null @@ -1,362 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2009 Low Heng Sin * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * * - * @sponsor www.metas.de * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.Timestamp; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.Icon; -import javax.swing.ImageIcon; -import javax.swing.JPopupMenu; -import javax.swing.table.DefaultTableModel; - -import org.compiere.grid.VTable; -import org.compiere.model.GridField; -import org.compiere.model.MChangeLog; -import org.compiere.model.MColumn; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MRole; -import org.compiere.model.MTable; -import org.compiere.model.MUser; -import org.compiere.swing.CDialog; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CPanel; -import org.compiere.swing.CScrollPane; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.NamePair; - -/** - * Change History for field - * @author Heng Sin Low - */ -public class FieldRecordInfo extends CDialog -{ - private static final long serialVersionUID = -2860082302140462690L; - - public static final String CHANGE_LOG_COMMAND = "ChangeLog"; - /** The Menu Icon */ - private static Icon s_icon = new ImageIcon(org.compiere.Adempiere.getResource("images/ChangeLog16.png")); - - private int AD_Table_ID; - private int AD_Column_ID; - private int Record_ID; - - /** - * Record Info - * @param owner owner - * @param title title - * @param AD_Table_ID - * @param AD_Column_ID - * @param Record_ID - */ - public FieldRecordInfo (Frame owner, String title, int AD_Table_ID, int AD_Column_ID, int Record_ID) - { - super (owner, title, true); - - this.AD_Table_ID = AD_Table_ID; - this.AD_Column_ID = AD_Column_ID; - this.Record_ID = Record_ID; - - try - { - jbInit ( dynInit(title) ); - } - catch (Exception e) - { - log.log(Level.SEVERE, "", e); - } - this.setPreferredSize(new Dimension(640, 480)); - AEnv.positionCenterWindow (owner, this); - AEnv.showCenterScreen(this); - } // FieldRecordInfo - - - private CPanel mainPanel = new CPanel (new BorderLayout(0,0)); - private CScrollPane scrollPane = new CScrollPane (); - private VTable table = new VTable (); - private ConfirmPanel confirmPanel = new ConfirmPanel (false); - - /** Logger */ - protected CLogger log = CLogger.getCLogger(getClass()); - /** The Data */ - private Vector> m_data = new Vector>(); - - /** Date Time Format */ - private SimpleDateFormat m_dateTimeFormat = DisplayType.getDateFormat - (DisplayType.DateTime, Env.getLanguage(Env.getCtx())); - /** Date Format */ - private SimpleDateFormat m_dateFormat = DisplayType.getDateFormat - (DisplayType.DateTime, Env.getLanguage(Env.getCtx())); - /** Number Format */ - private DecimalFormat m_numberFormat = DisplayType.getNumberFormat - (DisplayType.Number, Env.getLanguage(Env.getCtx())); - /** Amount Format */ - private DecimalFormat m_amtFormat = DisplayType.getNumberFormat - (DisplayType.Amount, Env.getLanguage(Env.getCtx())); - /** Number Format */ - private DecimalFormat m_intFormat = DisplayType.getNumberFormat - (DisplayType.Integer, Env.getLanguage(Env.getCtx())); - - /** - * Static Layout - * @throws Exception - */ - private void jbInit (boolean showTable) throws Exception - { - getContentPane().add(mainPanel); - // - if (showTable) - { - mainPanel.add (scrollPane, BorderLayout.CENTER); - scrollPane.getViewport().add(table); - scrollPane.setPreferredSize(new Dimension(500,100)); - } - // - mainPanel.add (confirmPanel, BorderLayout.SOUTH); - confirmPanel.addActionListener(this); - } // jbInit - - - /** - * Dynamic Init - * @param title title - * @return true if table initialized - */ - private boolean dynInit(String title) - { - // Title - if (AD_Table_ID != 0) - { - MTable table1 = MTable.get (Env.getCtx(), AD_Table_ID); - setTitle(title + " - " + table1.getName()); - } - - // Only Client Preference can view Change Log - if (!MRole.PREFERENCETYPE_Client.equals(MRole.getDefault().getPreferenceType())) - return false; - - if (Record_ID == 0) - return false; - - // Data - String sql = "SELECT AD_Column_ID, Updated, UpdatedBy, OldValue, NewValue " - + "FROM AD_ChangeLog " - + "WHERE AD_Table_ID=? AND Record_ID=? AND AD_Column_ID=?" - + "ORDER BY Updated DESC"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement (sql, null); - pstmt.setInt (1, AD_Table_ID); - pstmt.setInt (2, Record_ID); - pstmt.setInt (3, AD_Column_ID); - rs = pstmt.executeQuery (); - while (rs.next ()) - { - addLine (rs.getInt(1), rs.getTimestamp(2), rs.getInt(3), - rs.getString(4), rs.getString(5)); - } - } - catch (Exception e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - } - - // - Vector columnNames = new Vector(); - columnNames.add(Msg.translate(Env.getCtx(), "NewValue")); - columnNames.add(Msg.translate(Env.getCtx(), "OldValue")); - columnNames.add(Msg.translate(Env.getCtx(), "UpdatedBy")); - columnNames.add(Msg.translate(Env.getCtx(), "Updated")); - DefaultTableModel model = new DefaultTableModel(m_data, columnNames); - table.setModel(model); - table.autoSize(false); - return true; - } // dynInit - - /** - * Add Line - * @param AD_Column_ID column - * @param Updated updated - * @param UpdatedBy user - * @param OldValue old - * @param NewValue new - */ - private void addLine (int AD_Column_ID, Timestamp Updated, int UpdatedBy, - String OldValue, String NewValue) - { - Vector line = new Vector(); - // Column - MColumn column = MColumn.get (Env.getCtx(), AD_Column_ID); - // - if (OldValue != null && OldValue.equals(MChangeLog.NULL)) - OldValue = null; - String showOldValue = OldValue; - if (NewValue != null && NewValue.equals(MChangeLog.NULL)) - NewValue = null; - String showNewValue = NewValue; - // - try - { - if (DisplayType.isText (column.getAD_Reference_ID ())) - ; - else if (column.getAD_Reference_ID() == DisplayType.YesNo) - { - if (OldValue != null) - { - boolean yes = OldValue.equals("true") || OldValue.equals("Y"); - showOldValue = Msg.getMsg(Env.getCtx(), yes ? "Y" : "N"); - } - if (NewValue != null) - { - boolean yes = NewValue.equals("true") || NewValue.equals("Y"); - showNewValue = Msg.getMsg(Env.getCtx(), yes ? "Y" : "N"); - } - } - else if (column.getAD_Reference_ID() == DisplayType.Amount) - { - if (OldValue != null) - showOldValue = m_amtFormat - .format (new BigDecimal (OldValue)); - if (NewValue != null) - showNewValue = m_amtFormat - .format (new BigDecimal (NewValue)); - } - else if (column.getAD_Reference_ID() == DisplayType.Integer) - { - if (OldValue != null) - showOldValue = m_intFormat.format (Integer.valueOf(OldValue)); - if (NewValue != null) - showNewValue = m_intFormat.format (Integer.valueOf(NewValue)); - } - else if (DisplayType.isNumeric (column.getAD_Reference_ID ())) - { - if (OldValue != null) - showOldValue = m_numberFormat.format (new BigDecimal (OldValue)); - if (NewValue != null) - showNewValue = m_numberFormat.format (new BigDecimal (NewValue)); - } - else if (column.getAD_Reference_ID() == DisplayType.Date) - { - if (OldValue != null) - showOldValue = m_dateFormat.format (Timestamp.valueOf (OldValue)); - if (NewValue != null) - showNewValue = m_dateFormat.format (Timestamp.valueOf (NewValue)); - } - else if (column.getAD_Reference_ID() == DisplayType.DateTime) - { - if (OldValue != null) - showOldValue = m_dateTimeFormat.format (Timestamp.valueOf (OldValue)); - if (NewValue != null) - showNewValue = m_dateTimeFormat.format (Timestamp.valueOf (NewValue)); - } - else if (DisplayType.isLookup(column.getAD_Reference_ID ())) - { - MLookup lookup = MLookupFactory.get (Env.getCtx(), 0, - AD_Column_ID, column.getAD_Reference_ID(), - Env.getLanguage(Env.getCtx()), column.getColumnName(), - column.getAD_Reference_Value_ID(), - column.isParent(), null); - if (OldValue != null) - { - Object key = OldValue; - NamePair pp = lookup.get(key); - if (pp != null) - showOldValue = pp.getName(); - } - if (NewValue != null) - { - Object key = NewValue; - NamePair pp = lookup.get(key); - if (pp != null) - showNewValue = pp.getName(); - } - } - else if (DisplayType.isLOB (column.getAD_Reference_ID ())) - ; - } - catch (Exception e) - { - log.log(Level.WARNING, OldValue + "->" + NewValue, e); - } - // - line.add(showNewValue); - line.add(showOldValue); - // UpdatedBy - MUser user = MUser.get(Env.getCtx(), UpdatedBy); - line.add(user.getName()); - // Updated - line.add(m_dateFormat.format(Updated)); - - m_data.add(line); - } // addLine - - - /** - * ActionListener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - dispose(); - } // actionPerformed - - /** - * Add change log menu item - * @param l - * @param popupMenu - * @return CMenuItem - */ - public static CMenuItem addMenu (ActionListener l, JPopupMenu popupMenu) - { - CMenuItem mi = new CMenuItem (Msg.getElement(Env.getCtx(), "AD_ChangeLog_ID"), s_icon); - mi.setActionCommand(CHANGE_LOG_COMMAND); - mi.addActionListener(l); - popupMenu.add(mi); - return mi; - } // addMenu - - /** - * Open field record info dialog - * @param mField - */ - public static void start(GridField mField) { - int WindowNo = mField.getWindowNo(); - Frame frame = AEnv.getWindow(WindowNo); - new FieldRecordInfo(frame, mField.getColumnName(), mField.getGridTab().getAD_Table_ID(), - mField.getAD_Column_ID(), mField.getGridTab().getRecord_ID()); - } -} // FieldRecordInfo diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/GroovyEditor.java b/org.adempiere.ui.swing/src/org/compiere/apps/GroovyEditor.java deleted file mode 100644 index d3c81c9a5c..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/GroovyEditor.java +++ /dev/null @@ -1,295 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2008 Low Heng Sin. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.apps; - -import groovy.lang.GroovyShell; -import groovy.ui.ConsoleTextEditor; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.logging.Level; - -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JScrollPane; -import javax.swing.JTextField; -import javax.swing.border.TitledBorder; - -import org.compiere.model.MUser; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Groovy script Editor - * - * @author Low Heng Sin - */ -public class GroovyEditor extends CDialog implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 2941209813417292930L; - @SuppressWarnings("unused") - private Frame m_owner; - - /** - * Minimum Constructor - */ - public GroovyEditor() - { - this (Msg.getMsg(Env.getCtx(), "Script"), null, 0); - } // ScriptEditor - - /** - * Minimum Constructor - */ - public GroovyEditor(Frame owner) - { - this (owner, Msg.getMsg(Env.getCtx(), "Script"), null, 0); - } // ScriptEditor - - /** - * Constructor - * - * @param title Field Name - * @param script The Script - */ - public GroovyEditor (String title, String script, int WindowNo) - { - this(null, title, script, WindowNo); - } - - /** - * Constructor - * - * @param owner Owner frame - * @param title Field Name - * @param script The Script - */ - public GroovyEditor (Frame owner, String title, String script, int WindowNo) - { - super(owner); - setTitle(title); - if (owner != null) - { - setModal(true); - } - m_owner = owner; - m_WindowNo = WindowNo; - if (m_WindowNo == 0) - m_WindowNo = AEnv.createWindowNo(this); - if (log.isLoggable(Level.INFO)) log.info("Window=" + m_WindowNo); - try - { - jbInit(); - setScript (script); - dynInit(); - AEnv.showCenterScreen(this); - toFront(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - } // ScriptEditor - - /** The Script */ - private String m_script; - /** WindowNo */ - private int m_WindowNo; - /** Original Script */ - private String m_origScript; - /** Logger */ - private static CLogger log = CLogger.getCLogger(GroovyEditor.class); - // -- - - private CPanel mainPanel = new CPanel(); - private BorderLayout borderLayout1 = new BorderLayout(); - private JScrollPane editorPane = new JScrollPane(); - private ConsoleTextEditor editor = new ConsoleTextEditor(); - private TitledBorder titledBorder2; - private CPanel southPanel = new CPanel(); - private BorderLayout southLayout = new BorderLayout(); - private CPanel okPanel = new CPanel(); - private JButton bOK = ConfirmPanel.createOKButton(true); - private JButton bCancel = ConfirmPanel.createCancelButton(true); - private CPanel resultPanel = new CPanel(); - private JButton bProcess = ConfirmPanel.createProcessButton(true); - private JButton bHelp = ConfirmPanel.createHelpButton(true); - private JLabel lResult = new JLabel(); - private JTextField fResult = new JTextField(); - private FlowLayout okLayout = new FlowLayout(); - private GridBagLayout resultLayout = new GridBagLayout(); - - /** - * Static Layout - * @throws Exception - */ - void jbInit() throws Exception - { - this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - titledBorder2 = new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(148, 145, 140)), - Msg.getMsg(Env.getCtx(), "ScriptEditor")); - mainPanel.setLayout(borderLayout1); - bOK.addActionListener(this); - bCancel.addActionListener(this); - bProcess.addActionListener(this); - bHelp.addActionListener(this); - editorPane.setBorder(titledBorder2); - editorPane.setPreferredSize(new Dimension(500, 500)); - southPanel.setLayout(southLayout); - resultPanel.setLayout(resultLayout); - lResult.setText(Msg.getMsg(Env.getCtx(), "ScriptResult")); - fResult.setBackground(Color.lightGray); - fResult.setEditable(false); - fResult.setText(""); - okPanel.setLayout(okLayout); - getContentPane().add(mainPanel); - editorPane.getViewport().add(editor, null); - mainPanel.add(southPanel, BorderLayout.SOUTH); - southPanel.add(okPanel, BorderLayout.EAST); - okPanel.add(bCancel, null); - okPanel.add(bOK, null); - southPanel.add(resultPanel, BorderLayout.CENTER); - resultPanel.add(bProcess, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - resultPanel.add(lResult, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - resultPanel.add(fResult, new GridBagConstraints(2, 0, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - resultPanel.add(bHelp, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - mainPanel.add(editorPane, BorderLayout.CENTER); - } // jbInit - - /** - * Set Script - * @param script The Script - */ - public void setScript (String script) - { - if (script == null) - m_script = ""; - else - m_script = script; - // - m_origScript = m_script; - editor.getTextEditor().setText(m_script); - } // setScript - - /** - * Dynamic Init - */ - private void dynInit() - { - - } // dynInit - - - /** - * Action Listener - * @param e - */ - public void actionPerformed(ActionEvent e) - { - if (e.getSource() == bOK) - { - m_script = editor.getTextEditor().getText(); - dispose(); - } - else if (e.getSource() == bCancel) - { - m_script = m_origScript; - dispose(); - } - - else if (e.getSource() == bProcess) - actionProcess(); - else if (e.getSource() == bHelp) - { - Help h = new Help (this , - Msg.getMsg(Env.getCtx(), "ScriptHelp"), - getClass().getResource("Script.html")); - h.setVisible(true); - } - } // actionPerformed - - /** - * Process Script - */ - private void actionProcess() - { - MUser user = MUser.get(Env.getCtx()); - if (!user.isAdministrator()) - { - fResult.setText("Not Administrator"); - return; - } - // - GroovyShell sh = new GroovyShell(); - Exception e = null; - try { - sh.parse(editor.getTextEditor().getText()); - } catch (Exception e1) { - e = e1; - } - if (e != null) - { - ADialog.error(m_WindowNo, this, "ScriptError", e.toString()); - fResult.setText("Syntax errors detected."); - } - else - fResult.setText("No syntax errors detected."); - } // actionProcess - - /*************************************************************************/ - - /** - * Start ScriptEditor - * - * @param owner - * @param header Title - * @param script ScriptCode - * @param editable - * @return updated Script - */ - public static String start (Frame owner, String header, String script, boolean editable, int WindowNo) - { - GroovyEditor se = new GroovyEditor (owner, header, script, WindowNo); - return se.getScript(); - } // start - - /*** - * - * @return string - */ - public String getScript() { - return m_script; - } - -} // ScriptEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/Help.java b/org.adempiere.ui.swing/src/org/compiere/apps/Help.java deleted file mode 100644 index 12d638de3b..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/Help.java +++ /dev/null @@ -1,200 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.net.URL; -import java.util.logging.Level; - -import javax.swing.BorderFactory; -import javax.swing.JDialog; -import javax.swing.JScrollPane; -import javax.swing.text.html.HTMLDocument; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.model.GridWindow; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.WebDoc; - -/** - * Help and HTML Window - * - * @author Jorg Janke - * @version $Id: Help.java,v 1.3 2006/07/30 00:51:27 jjanke Exp $ - * - * @author Teo Sarca - BF [ 1747741 ] - */ -public class Help extends CDialog - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 2840473201179240876L; - - /** - * Help System for Window Help - * - * @param frame Parent - * @param title Title - * @param mWindow Window Model - */ - public Help (Frame frame, String title, GridWindow mWindow) - { - super(frame, title, false); - try - { - jbInit(); - loadInfo(mWindow); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - AEnv.positionCenterWindow(frame, this); - } // Help - - /** - * Help System - * - * @param frame Parent - * @param title Window - * @param url URL to display - */ - public Help (Frame frame, String title, URL url) - { - super(frame, title, false); - try - { - jbInit(); - info.setPage(url); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - AEnv.positionCenterWindow(frame, this); - } // Help - - /** - * Help System - * - * @param dialog Parent - * @param title Window - * @param url URL to display - */ - public Help (JDialog dialog, String title, URL url) - { - super(dialog, title, false); - try - { - jbInit(); - info.setPage(url); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - AEnv.positionCenterWindow(dialog, this); - } // Help - - /** - * Help System - * - * @param frame Parent - * @param title Window - * @param helpHtml Helptext - */ - public Help (Frame frame, String title, String helpHtml) - { - super(frame, title, false); - try - { - jbInit(); - info.setContentType("text/html"); - info.setEditable(false); - info.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - info.setText(helpHtml); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "Help", ex); - } - AEnv.positionCenterWindow(frame, this); - } // Help - - /** Logger */ - private static CLogger log = CLogger.getCLogger(Help.class); - - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private OnlineHelp info = new OnlineHelp(); - private JScrollPane infoPane = new JScrollPane(); - private ConfirmPanel confirmPanel = new ConfirmPanel(); - - /** - * Static Init - * - * @throws Exception - */ - void jbInit() throws Exception - { - mainPanel.setLayout(mainLayout); - mainLayout.setHgap(2); - mainLayout.setVgap(2); - infoPane.setBorder(BorderFactory.createLoweredBevelBorder()); - infoPane.setPreferredSize(new Dimension(500, 400)); - getContentPane().add(mainPanel); - mainPanel.add(infoPane, BorderLayout.CENTER); - mainPanel.add(confirmPanel, BorderLayout.SOUTH); - infoPane.getViewport().add(info, null); - confirmPanel.addActionListener(this); - } // jbInit - - - /************************************************************************* - * Load Info - Windows Help - * @param mWindow window model - */ - private void loadInfo(GridWindow mWindow) - { - WebDoc doc = mWindow.getHelpDoc(true); - HTMLDocument htmlDoc = (HTMLDocument)info.getEditorKit().createDefaultDocument(); - htmlDoc.getDocumentProperties().put("IgnoreCharsetDirective", true); - info.setDocument(htmlDoc); - info.setText(doc.toString()); - } // loadInfo - - - /************************************************************************** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - dispose(); - } // actionPerformed - -} // Help - diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/OnlineHelp.java b/org.adempiere.ui.swing/src/org/compiere/apps/OnlineHelp.java deleted file mode 100644 index 7d25c265c7..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/OnlineHelp.java +++ /dev/null @@ -1,358 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - * Contributor: Carlos Ruiz - globalqss * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.Color; -import java.awt.Cursor; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.ConnectException; -import java.net.URL; -import java.net.URLConnection; -import java.net.UnknownHostException; -import java.util.Enumeration; -import java.util.HashMap; - -import javax.swing.JEditorPane; -import javax.swing.event.HyperlinkEvent; -import javax.swing.event.HyperlinkListener; -import javax.swing.text.AttributeSet; -import javax.swing.text.html.HTML; -import javax.swing.text.html.HTMLDocument; -import javax.swing.text.html.HTMLEditorKit; -import javax.swing.text.html.HTMLFrameHyperlinkEvent; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.util.Env; - -/** - * Online Help Browser & Link. - * - * @author Jorg Janke - * @version $Id: OnlineHelp.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * - * globalqss: fix error about null pointer in OnlineHelp.Worker.run - * change the URL for online help for connection - */ -public class OnlineHelp extends JEditorPane implements HyperlinkListener -{ - /** - * - */ - private static final long serialVersionUID = -7201158578463954623L; - - /** - * Default Constructor - */ - public OnlineHelp() - { - super (); - setEditable (false); - setContentType ("text/html"); - addHyperlinkListener (this); - } // OnlineHelp - - /** - * Constructor - * @param url URL to load - */ - public OnlineHelp (String url) - { - this(); - try - { - if (url != null && url.length() > 0) - setPage(url); - } - catch (Exception e) - { - System.err.println("OnlineHelp URL=" + url + " - " + e); - } - } // OnlineHelp - - /** - * Constructor - * @param loadOnline load online URL - */ - public OnlineHelp (boolean loadOnline) - { - this (loadOnline ? BASE_URL : null); - } // OnlineHelp - - /** Base of Online Help System */ - protected static final String BASE_URL = "http://www.adempiere.com/wiki/index.php/OnlineLoginHelp"; - - public static void openInDefaultBrowser() - { - Env.startBrowser(BASE_URL); - } - - /************************************************************************** - * Hyperlink Listener - * @param e event - */ - public void hyperlinkUpdate (HyperlinkEvent e) - { - // System.out.println("OnlineHelp.hyperlinkUpdate - " + e.getDescription() + " " + e.getURL()); - if (e.getEventType() != HyperlinkEvent.EventType.ACTIVATED) - return; - - this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - // - if (e instanceof HTMLFrameHyperlinkEvent) - { - HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent)e; - HTMLDocument doc = (HTMLDocument)getDocument(); - doc.processHTMLFrameHyperlinkEvent(evt); - } - else if (e.getURL() == null) - // remove # of the reference - scrollToReference(e.getDescription().substring(1)); - else - { - try - { - setPage(e.getURL()); - } - catch (Throwable t) - { - System.err.println("Help.hyperlinkUpdate - " + t.toString()); - displayError("Error", e.getURL(), t); - } - } - this.setCursor(Cursor.getDefaultCursor()); - } // hyperlinkUpdate - - /** - * Set Text - * @param text text - */ - public void setText (String text) - { - setBackground (AdempierePLAF.getInfoBackground()); - super.setText(text); - setCaretPosition(0); // scroll to top - } // setText - - /** - * Load URL async - * @param url url - */ - public void setPage (final URL url) - { - setBackground (Color.white); - Runnable pgm = new Runnable() - { - public void run() - { - loadPage(url); - } - }; - new Thread(pgm).start(); - } // setPage - - /** - * Load Page Async - * @param url url - */ - private void loadPage (URL url) - { - try - { - super.setPage(url); - } - catch (Exception e) - { - displayError("Error: URL not found", url, e); - } - } // loadPage - - /** - * Display Error message - * @param header header - * @param url url - * @param exception exception - */ - protected void displayError (String header, Object url, Object exception) - { - StringBuilder msg = new StringBuilder (""); - msg.append("

    ").append(header).append("

    ") - .append("

    URL=").append(url).append("

    ") - .append("

    Error=").append(exception).append("

    ") - .append("

    © Adempiere   ") - .append("Online Help

    ") - .append(""); - setText(msg.toString()); - } // displayError - - /*************************************************************************/ - - /** Online links. - * Key=AD_Window_ID (as String) - Value=URL - */ - private static HashMap s_links = new HashMap(); - static - { - new Worker (BASE_URL, s_links).start(); - } - - /** - * Is Online Help available. - * @return true if available - */ - public static boolean isAvailable() - { - return s_links.size() != 0; - } // isAvailable - -} // OnlineHelp - -/** - * Online Help Worker - */ -class Worker extends Thread -{ - /** - * Worker Constructor - * @param urlString url - * @param links links - */ - Worker (String urlString, HashMap links) - { - m_urlString = urlString; - m_links = links; - setPriority(Thread.MIN_PRIORITY); - } // Worker - - private String m_urlString = null; - private HashMap m_links = null; - - /** - * Worker: Read available Online Help Pages - */ - public void run() - { - if (m_links == null) - return; - URL url = null; - try - { - url = new URL (m_urlString); - } - catch (Exception e) - { - System.err.println("OnlineHelp.Worker.run (url) - " + e); - } - if (url == null) - return; - - // Read Reference Page - try - { - URLConnection conn = url.openConnection(); - InputStream is = conn.getInputStream(); - HTMLEditorKit kit = new HTMLEditorKit(); - HTMLDocument doc = (HTMLDocument)kit.createDefaultDocument(); - doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE); - kit.read (new InputStreamReader(is), doc, 0); - - // Get The Links to the Help Pages - HTMLDocument.Iterator it = doc.getIterator(HTML.Tag.A); - Object target = null; - Object href = null; - while (it != null && it.isValid()) - { - AttributeSet as = it.getAttributes(); - // ~ href=/help/100/index.html target=Online title=My Test - // System.out.println("~ " + as); - - // key keys - if (target == null || href == null) - { - Enumeration en = as.getAttributeNames(); - while (en.hasMoreElements()) - { - Object o = en.nextElement(); - if (target == null && o.toString().equals("target")) - target = o; // javax.swing.text.html.HTML$Attribute - else if (href == null && o.toString().equals("href")) - href = o; - } - } - - if (target != null && "Online".equals(as.getAttribute(target))) - { - // Format: /help//index.html - String hrefString = (String)as.getAttribute(href); - if (hrefString != null) - { - try - { - // System.err.println(hrefString); - String AD_Window_ID = hrefString.substring(hrefString.indexOf('/',1), hrefString.lastIndexOf('/')); - m_links.put(AD_Window_ID, hrefString); - } - catch (Exception e) - { - System.err.println("OnlineHelp.Worker.run (help) - " + e); - } - } - } - it.next(); - } - is.close(); - } - catch (ConnectException e) - { - // System.err.println("OnlineHelp.Worker.run URL=" + url + " - " + e); - } - catch (UnknownHostException uhe) - { - // System.err.println("OnlineHelp.Worker.run " + uhe); - } - catch (Exception e) - { - System.err.println("OnlineHelp.Worker.run (e) " + e); - // e.printStackTrace(); - } - catch (Throwable t) - { - System.err.println("OnlineHelp.Worker.run (t) " + t); - // t.printStackTrace(); - } - // System.out.println("OnlineHelp - Links=" + m_links.size()); - } // run - - /** - * Diagnostics - * @param doc html document - * @param tag html tag - */ - /*private void dumpTags (HTMLDocument doc, HTML.Tag tag) - { - System.out.println("Doc=" + doc.getBase() + ", Tag=" + tag); - HTMLDocument.Iterator it = doc.getIterator(tag); - while (it != null && it.isValid()) - { - AttributeSet as = it.getAttributes(); - System.out.println("~ " + as); - it.next(); - } - } // printTags*/ - -} // Worker diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/Preference.java b/org.adempiere.ui.swing/src/org/compiere/apps/Preference.java deleted file mode 100644 index 2c29ad7916..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/Preference.java +++ /dev/null @@ -1,701 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.GridLayout; -import java.awt.Insets; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; -import java.io.FileWriter; -import java.nio.charset.Charset; -import java.util.Arrays; -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.BorderFactory; -import javax.swing.JFileChooser; -import javax.swing.JList; -import javax.swing.JScrollPane; -import javax.swing.ListSelectionModel; -import javax.swing.UIManager; -import javax.swing.border.Border; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.plaf.metal.MetalLookAndFeel; -import javax.swing.plaf.metal.MetalTheme; -import javax.swing.table.DefaultTableModel; - -import org.adempiere.plaf.AdempierePLAF; -import org.adempiere.plaf.PLAFEditorPanel; -import org.compiere.grid.ed.VDate; -import org.compiere.minigrid.MiniTable; -import org.compiere.model.MRole; -import org.compiere.model.MSystem; -import org.compiere.model.MUser; -import org.compiere.print.CPrinter; -import org.compiere.swing.CButton; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTabbedPane; -import org.compiere.swing.CTextArea; -import org.compiere.swing.CToggleButton; -import org.compiere.util.CLogErrorBuffer; -import org.compiere.util.CLogMgt; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Ini; -import org.compiere.util.Msg; -import org.compiere.util.ValueNamePair; - -/** - * Customize settings like L&F, AutoCommit, etc. & Diagnostics - *

    - * Change log: - *

      - *
    • 2007-02-12 - teo_sarca - [ 1658127 ] Select charset encoding on import - *
    - * - * @author Jorg Janke - * @version $Id: Preference.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * - * @author Low Heng Sin - * @version 2006-11-27 - */ -public final class Preference extends CDialog - implements ActionListener, ListSelectionListener -{ - /** - * - */ - private static final long serialVersionUID = -4691368295400769754L; - - /** - * Standard Constructor - * @param frame frame - * @param WindowNo window - */ - public Preference(Frame frame, int WindowNo) - { - super(frame, Msg.getMsg(Env.getCtx(), "Preference"), true); - log.config("Preference"); - try - { - jbInit(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, ex.getMessage()); - } - load(); - // - StringBuilder sta = new StringBuilder("#"); - sta.append(Env.getCtx().size()).append(" - ") - .append(Msg.translate(Env.getCtx(), "AD_Window_ID")) - .append("=").append(WindowNo); - statusBar.setStatusLine(sta.toString()); - statusBar.setStatusDB(""); - AEnv.positionCenterWindow(frame, this); - } // Preference - - /** Logger */ - private static CLogger log = CLogger.getCLogger(Preference.class); - - private CPanel panel = new CPanel(); - private BorderLayout panelLayout = new BorderLayout(); - private CTabbedPane tabPane = new CTabbedPane(); - private CPanel customizePane = new CPanel(); - private CPanel contextPane = new CPanel(); - private GridBagLayout customizeLayout = new GridBagLayout(); - private CCheckBox autoCommit = new CCheckBox(); - private CCheckBox autoNew = new CCheckBox(); - private CCheckBox printPreview = new CCheckBox(); - private CCheckBox validateConnectionOnStartup = new CCheckBox(); - private CCheckBox singleInstancePerWindow = new CCheckBox(); - private CCheckBox openWindowMaximized = new CCheckBox(); - private CPanel southPanel = new CPanel(); - private BorderLayout southLayout = new BorderLayout(); - private BorderLayout icontextLayout = new BorderLayout(); - private JList infoList = new JList(); - private JScrollPane contextListScrollPane = new JScrollPane(infoList); - private CPanel contextSouthPanel = new CPanel(); - private CTextArea contextHeader = new CTextArea(4,15); - private CTextArea contextDetail = new CTextArea(4,35); - private CTextArea infoArea = new CTextArea(5, 30); - private BorderLayout contextSouthLayout = new BorderLayout(); - private StatusBar statusBar = new StatusBar(); - private ConfirmPanel confirm = new ConfirmPanel(true); - private CComboBoxtraceLevel = new CComboBox(CLogMgt.LEVELS); - private CLabel traceLabel = new CLabel(); - private CCheckBox traceFile = new CCheckBox(); - private CCheckBox autoLogin = new CCheckBox(); - private CCheckBox adempiereSys = new CCheckBox(); - private CCheckBox logMigrationScript = new CCheckBox(); - private CCheckBox storePassword = new CCheckBox(); - private CCheckBox showTrl = new CCheckBox(); - private CCheckBox showAcct = new CCheckBox(); - private CCheckBox cacheWindow = new CCheckBox(); - private CLabel lPrinter = new CLabel(); - private CPrinter fPrinter = new CPrinter(); - private CLabel lDate = new CLabel(); - private VDate fDate = new VDate(); - private CPanel errorPane = new CPanel(); - private BorderLayout errorLayout = new BorderLayout(); - private JScrollPane errorScrollPane = new JScrollPane(); - private MiniTable errorTable = new MiniTable(); - private CPanel errorPanel = new CPanel(new FlowLayout(FlowLayout.TRAILING)); - private CToggleButton bErrorsOnly = new CToggleButton(Msg.getMsg(Env.getCtx(), "ErrorsOnly")); - private CButton bErrorReset = new CButton(Msg.getMsg(Env.getCtx(), "Reset")); - private CButton bErrorEMail = new CButton(Msg.getMsg(Env.getCtx(), "SendEMail")); - private CButton bErrorSave = new CButton(Msg.getMsg(Env.getCtx(), "SaveFile")); - private CButton bRoleInfo = new CButton(Msg.translate(Env.getCtx(), "AD_Role_ID")); - // Charset: - private CLabel lCharset = new CLabel(); - private CComboBoxfCharset = new CComboBox(Ini.getAvailableCharsets()); - - private CPanel configPanel = new CPanel(); - - private PLAFEditorPanel plafEditor = new PLAFEditorPanel(); - - /** - * Static Init. - *
    -	 *  - panel
    -	 *      - tabPane
    -	 *          - customizePane
    -	 *              - infoArea
    -	 *              - fields ...
    -	 *          - contextPane
    -	 *              - contextList
    -	 *              - contextSouthPanel
    -	 *                  - contextHeader
    -	 *                  - contextDetail
    -	 * 			- errorPane
    -	 * 				- errorScollPane
    -	 * 					- errorTable
    -	 *      - southPanel
    -	 *  
    - * @throws Exception - */ - void jbInit() throws Exception - { - traceLabel.setRequestFocusEnabled(false); - traceLabel.setText(Msg.getMsg(Env.getCtx(), "TraceLevel", true)); - traceLabel.setToolTipText(Msg.getMsg(Env.getCtx(), "TraceLevel", false)); - traceFile.setText(Msg.getMsg(Env.getCtx(), "TraceFile", true)); - traceFile.setToolTipText(Msg.getMsg(Env.getCtx(), "TraceFile", false)); - - autoCommit.setText(Msg.getMsg(Env.getCtx(), "AutoCommit", true)); - autoCommit.setToolTipText(Msg.getMsg(Env.getCtx(), "AutoCommit", false)); - autoNew.setText(Msg.getMsg(Env.getCtx(), "AutoNew", true)); - autoNew.setToolTipText(Msg.getMsg(Env.getCtx(), "AutoNew", false)); - adempiereSys.setText(Msg.getMsg(Env.getCtx(), "AdempiereSys", true)); - adempiereSys.setToolTipText(Msg.getMsg(Env.getCtx(), "AdempiereSys", false)); - logMigrationScript.setText(Msg.getMsg(Env.getCtx(), "LogMigrationScript", true)); - logMigrationScript.setToolTipText(Msg.getMsg(Env.getCtx(), "LogMigrationScript", false)); - printPreview.setText(Msg.getMsg(Env.getCtx(), "AlwaysPrintPreview", true)); - printPreview.setToolTipText(Msg.getMsg(Env.getCtx(), "AlwaysPrintPreview", false)); - validateConnectionOnStartup.setText(Msg.getMsg(Env.getCtx(), "ValidateConnectionOnStartup", true)); - validateConnectionOnStartup.setToolTipText(Msg.getMsg(Env.getCtx(), "ValidateConnectionOnStartup", false)); - singleInstancePerWindow.setText(Msg.getMsg(Env.getCtx(), "SingleInstancePerWindow", true)); - singleInstancePerWindow.setToolTipText(Msg.getMsg(Env.getCtx(), "SingleInstancePerWindow", false)); - openWindowMaximized.setText(Msg.getMsg(Env.getCtx(), "OpenWindowMaximized", true)); - openWindowMaximized.setToolTipText(Msg.getMsg(Env.getCtx(), "OpenWindowMaximized", false)); - autoLogin.setText(Msg.getMsg(Env.getCtx(), "AutoLogin", true)); - autoLogin.setToolTipText(Msg.getMsg(Env.getCtx(), "AutoLogin", false)); - storePassword.setText(Msg.getMsg(Env.getCtx(), "StorePassword", true)); - storePassword.setToolTipText(Msg.getMsg(Env.getCtx(), "StorePassword", false)); - showTrl.setText(Msg.getMsg(Env.getCtx(), "ShowTrlTab", true)); - showTrl.setToolTipText(Msg.getMsg(Env.getCtx(), "ShowTrlTab", false)); - showAcct.setText(Msg.getMsg(Env.getCtx(), "ShowAcctTab", true)); - showAcct.setToolTipText(Msg.getMsg(Env.getCtx(), "ShowAcctTab", false)); - cacheWindow.setText(Msg.getMsg(Env.getCtx(), "CacheWindow", true)); - cacheWindow.setToolTipText(Msg.getMsg(Env.getCtx(), "CacheWindow", false)); - lPrinter.setText(Msg.getMsg(Env.getCtx(), "Printer")); - lDate.setText(Msg.getMsg(Env.getCtx(), "Date")); - infoArea.setReadWrite(false); - // Charset: - lCharset.setText(Msg.getMsg(Env.getCtx(), "Charset", true)); - lCharset.setToolTipText(Msg.getMsg(Env.getCtx(), "Charset", false)); - - getContentPane().add(panel); - panel.setLayout(panelLayout); - panel.add(tabPane, BorderLayout.CENTER); - // Customize - tabPane.add(customizePane, Msg.getMsg(Env.getCtx(), "Preference")); - customizePane.setLayout(customizeLayout); - customizePane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); - - Border insetBorder = BorderFactory.createEmptyBorder(2, 2, 2, 0); - if (MSystem.isSwingRememberPasswordAllowed()) { - CPanel loginPanel = new CPanel(); - loginPanel.setBorder(BorderFactory.createTitledBorder(Msg.getMsg(Env.getCtx(), "Login"))); - loginPanel.setLayout(new GridLayout(1, 2)); - autoLogin.setBorder(insetBorder); - storePassword.setBorder(insetBorder); - loginPanel.add(autoLogin); - loginPanel.add(storePassword); - - customizePane.add(loginPanel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 2, 0), 0, 0)); - } - - CPanel windowPanel = new CPanel(); - windowPanel.setBorder(BorderFactory.createTitledBorder(Msg.getMsg(Env.getCtx(), "Window"))); - windowPanel.setLayout(new GridLayout(4, 2)); - windowPanel.add(showAcct);showAcct.setBorder(insetBorder); - windowPanel.add(showTrl);showTrl.setBorder(insetBorder); - windowPanel.add(autoCommit);autoCommit.setBorder(insetBorder); - windowPanel.add(autoNew);autoNew.setBorder(insetBorder); - windowPanel.add(cacheWindow);cacheWindow.setBorder(insetBorder); - windowPanel.add(openWindowMaximized);openWindowMaximized.setBorder(insetBorder); - windowPanel.add(singleInstancePerWindow);singleInstancePerWindow.setBorder(insetBorder); - customizePane.add(windowPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 2, 0), 0, 0)); - - CPanel connPanel = new CPanel(); - connPanel.setBorder(BorderFactory.createTitledBorder(Msg.getMsg(Env.getCtx(), "Connection"))); - connPanel.setLayout(new GridBagLayout()); - connPanel.add(validateConnectionOnStartup, new GridBagConstraints(0, 1, 2, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0)); - customizePane.add(connPanel, new GridBagConstraints(0, 2, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 2, 0), 0, 0)); - - CPanel tracePanel = new CPanel(); - tracePanel.setBorder(BorderFactory.createTitledBorder(Msg.getMsg(Env.getCtx(), "TraceInfo"))); - tracePanel.setLayout(new GridBagLayout()); - tracePanel.add(traceLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0)); - tracePanel.add(traceLevel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0)); - tracePanel.add(traceFile, new GridBagConstraints(0, 1, 2, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0)); - customizePane.add(tracePanel, new GridBagConstraints(0, 3, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 2, 0), 0, 0)); - - CPanel printPanel = new CPanel(); - printPanel.setBorder(BorderFactory.createTitledBorder(Msg.getMsg(Env.getCtx(), "Printing"))); - printPanel.setLayout(new GridBagLayout()); - printPanel.add(lPrinter, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0)); - printPanel.add(fPrinter, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0)); - printPanel.add(printPreview, new GridBagConstraints(0, 1, 2, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0)); - customizePane.add(printPanel, new GridBagConstraints(0, 4, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 2, 0), 0, 0)); - - CPanel otherPanel = new CPanel(); - otherPanel.setBorder(BorderFactory.createEmptyBorder()); - otherPanel.setLayout(new GridLayout()); - CPanel datePanel = new CPanel(); - datePanel.setLayout(new FlowLayout()); - ((FlowLayout)datePanel.getLayout()).setAlignment(FlowLayout.LEFT); - datePanel.add(lDate); - datePanel.add(fDate); - otherPanel.add(datePanel);datePanel.setBorder(insetBorder); - otherPanel.add(adempiereSys);adempiereSys.setBorder(insetBorder); - otherPanel.add(logMigrationScript);logMigrationScript.setBorder(insetBorder); - customizePane.add(otherPanel, new GridBagConstraints(0, 5, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 2, 0), 0, 0)); - - // Charset: - CPanel charsetPanel = new CPanel(); - charsetPanel.setBorder(BorderFactory.createEmptyBorder()); - charsetPanel.setLayout(new FlowLayout()); - ((FlowLayout)charsetPanel.getLayout()).setAlignment(FlowLayout.LEFT); - charsetPanel.add(lCharset); - charsetPanel.add(fCharset); - customizePane.add(charsetPanel, new GridBagConstraints(0, 6, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 2, 0), 0, 0)); - - CPanel themePanel = new CPanel(); - themePanel.setLayout(new GridLayout(1, 1)); - - themePanel.add(plafEditor); - tabPane.add(themePanel, Msg.getMsg(Env.getCtx(), "UITheme", true)); - - configPanel.setLayout(new BorderLayout()); - configPanel.add(infoArea, BorderLayout.CENTER); - CPanel configSouth = new CPanel(); - configSouth.setLayout(new FlowLayout()); - ((FlowLayout)configSouth.getLayout()).setAlignment(FlowLayout.RIGHT); - configSouth.add(bRoleInfo); - configPanel.add(configSouth, BorderLayout.SOUTH); - tabPane.add(configPanel, Msg.getMsg(Env.getCtx(), "Info")); - - // Info - tabPane.add(contextPane, Msg.getMsg(Env.getCtx(), "Context")); - contextPane.setLayout(icontextLayout); - contextPane.add(contextListScrollPane, BorderLayout.CENTER); - contextListScrollPane.setPreferredSize(new Dimension(200, 300)); - infoList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); - infoList.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - infoList.addListSelectionListener(this); - infoList.setFixedCellWidth(30); - contextPane.add(contextSouthPanel, BorderLayout.SOUTH); - contextSouthPanel.setLayout(contextSouthLayout); - contextSouthPanel.add(contextHeader, BorderLayout.WEST); - contextHeader.setBackground(SystemColor.info); - contextHeader.setReadWrite(false); - contextHeader.setLineWrap(true); - contextHeader.setWrapStyleWord(true); - contextHeader.setBorder(BorderFactory.createLoweredBevelBorder()); - contextSouthPanel.add(contextDetail, BorderLayout.CENTER); - contextDetail.setBackground(SystemColor.info); - contextDetail.setReadWrite(false); - contextDetail.setLineWrap(true); - contextDetail.setWrapStyleWord(true); - contextDetail.setBorder(BorderFactory.createLoweredBevelBorder()); - // Error Pane - errorPane.setLayout(errorLayout); -// tabPane.add(errorPane, Msg.getMsg(Env.getCtx(), "Errors")); - tabPane.add(errorPane, "Errors"); - errorPane.add(errorScrollPane, BorderLayout.CENTER); - errorScrollPane.getViewport().add(errorTable, null); - // - errorPanel.add(bErrorsOnly); - errorPanel.add(bErrorReset); - errorPanel.add(bErrorEMail); - errorPanel.add(bErrorSave); - errorPane.add(errorPanel, BorderLayout.SOUTH); - // South - panel.add(southPanel, BorderLayout.SOUTH); - southPanel.setLayout(southLayout); - southPanel.add(statusBar, BorderLayout.SOUTH); - southPanel.add(confirm, BorderLayout.CENTER); - // - bRoleInfo.addActionListener(this); - confirm.addActionListener(this); - } // jbInit - - - /** - * List Selection Listener - show info in header/detail fields - * @param e evant - */ - public void valueChanged(ListSelectionEvent e) - { - if (e.getValueIsAdjusting()) - return; - - String value = (String)infoList.getSelectedValue(); - if (value == null) - return; - int pos = value.indexOf("=="); - if (pos == -1) - { - contextHeader.setText(""); - contextDetail.setText(value); - } - else - { - contextHeader.setText(value.substring(0, pos).replace('|','\n')); - contextDetail.setText(value.substring(pos+3)); - } - } // valueChanged - - - /** - * ActionListener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - dispose(); - else if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - cmd_save(); - // - else if (e.getSource() == bErrorsOnly) - cmd_displayErrors(); - else if (e.getSource() == bErrorReset) - cmd_errorReset(); - else if (e.getSource() == bErrorEMail) - cmd_errorEMail(); - else if (e.getSource() == bErrorSave) - cmd_errorSave(); - // - else if (e.getSource() == bRoleInfo) - ADialog.info(0, this, "RoleInfo", MRole.getDefault().toStringX(Env.getCtx())); - } // actionPerformed - - - /** - * Load Settings - and Context - */ - private void load() - { - log.config(""); - infoArea.setText(CLogMgt.getInfo(null).toString()); - infoArea.setCaretPosition(0); - - // -- Load Settings -- - // AutoCommit - autoCommit.setSelected(Env.isAutoCommit(Env.getCtx())); - autoNew.setSelected(Env.isAutoNew(Env.getCtx())); - // AdempiereSys - adempiereSys.setSelected(Ini.isPropertyBool(Ini.P_ADEMPIERESYS)); - // LogMigrationScript - logMigrationScript.setSelected(Ini.isPropertyBool(Ini.P_LOGMIGRATIONSCRIPT)); - if (Env.getAD_Client_ID(Env.getCtx()) > 20) - { - adempiereSys.setSelected(false); - adempiereSys.setEnabled(false); - if (Env.getAD_User_ID(Env.getCtx()) > 100) { - // disable log migration scripts on clients non-GW for non-SuperUser - logMigrationScript.setSelected(false); - logMigrationScript.setEnabled(false); - } - } - if (MSystem.isSwingRememberPasswordAllowed()) { - // AutoLogin - autoLogin.setSelected(Ini.isPropertyBool(Ini.P_A_LOGIN)); - // Save Password - storePassword.setSelected(Ini.isPropertyBool(Ini.P_STORE_PWD)); - } else { - autoLogin.setSelected(false); - storePassword.setSelected(false); - } - // Show Acct Tab - if (MRole.getDefault().isShowAcct()) - showAcct.setSelected(Ini.isPropertyBool(Ini.P_SHOW_ACCT)); - else - { - showAcct.setSelected(false); - showAcct.setReadWrite(false); - } - // Show Trl/Advanced Tab - showTrl.setSelected(Ini.isPropertyBool(Ini.P_SHOW_TRL)); - - cacheWindow.setSelected(Ini.isCacheWindow()); - - // Print Preview - printPreview.setSelected(Ini.isPropertyBool(Ini.P_PRINTPREVIEW)); - - // Validate Connection on Startup - validateConnectionOnStartup.setSelected(Ini.isPropertyBool(Ini.P_VALIDATE_CONNECTION_ON_STARTUP)); - - // Single Instance per Window - singleInstancePerWindow.setSelected(Ini.isPropertyBool(Ini.P_SINGLE_INSTANCE_PER_WINDOW)); - - // Open Window Maximized - openWindowMaximized.setSelected(Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED)); - - // TraceLevel - traceLevel.setSelectedItem(CLogMgt.getLevel()); - traceFile.setSelected(Ini.isPropertyBool(Ini.P_TRACEFILE)); - // Printer - fPrinter.setValue(Env.getContext(Env.getCtx(), "#Printer")); - // Date - fDate.setValue(Env.getContextAsDate(Env.getCtx(), "#Date")); - // Charset - fCharset.setSelectedItem(Ini.getCharset()); - - // -- Load and sort Context -- - String[] context = Env.getEntireContext(Env.getCtx()); - Arrays.sort(context); - infoList.setListData(context); - - // Load Errors - // CLogMgt mgt = new CLogMgt(); // creates test trace - bErrorsOnly.setSelected(true); - errorTable.setCellSelectionEnabled(true); - cmd_displayErrors(); - // for (int i = 2; i < 6; i++) - // errorTable.setColumnReadOnly(i, false); - // - bErrorsOnly.addActionListener(this); - bErrorReset.addActionListener(this); - bErrorSave.addActionListener(this); - bErrorEMail.addActionListener(this); - } // load - - /** - * Save Settings - */ - private void cmd_save() - { - log.config(""); - // UI - // AutoCommit - Ini.setProperty(Ini.P_A_COMMIT, (autoCommit.isSelected())); - Env.setAutoCommit(Env.getCtx(), autoCommit.isSelected()); - Ini.setProperty(Ini.P_A_NEW, (autoNew.isSelected())); - Env.setAutoNew(Env.getCtx(), autoNew.isSelected()); - // AdempiereSys - Ini.setProperty(Ini.P_ADEMPIERESYS, adempiereSys.isSelected()); - // LogMigrationScript - Ini.setProperty(Ini.P_LOGMIGRATIONSCRIPT, logMigrationScript.isSelected()); - if (MSystem.isSwingRememberPasswordAllowed()) { - // AutoLogin - Ini.setProperty(Ini.P_A_LOGIN, (autoLogin.isSelected())); - // Save Password - Ini.setProperty(Ini.P_STORE_PWD, (storePassword.isSelected())); - } else { - Ini.setProperty(Ini.P_A_LOGIN, false); - Ini.setProperty(Ini.P_STORE_PWD, false); - } - // Show Acct Tab - Ini.setProperty(Ini.P_SHOW_ACCT, (showAcct.isSelected())); - Env.setContext(Env.getCtx(), "#ShowAcct", (showAcct.isSelected())); - // Show Trl Tab - Ini.setProperty(Ini.P_SHOW_TRL, (showTrl.isSelected())); - Env.setContext(Env.getCtx(), "#ShowTrl", (showTrl.isSelected())); - - Ini.setProperty(Ini.P_CACHE_WINDOW, cacheWindow.isSelected()); - - // Print Preview - Ini.setProperty(Ini.P_PRINTPREVIEW, (printPreview.isSelected())); - // Validate Connection on Startup - Ini.setProperty(Ini.P_VALIDATE_CONNECTION_ON_STARTUP, (validateConnectionOnStartup.isSelected())); - // Single Instance per Window - Ini.setProperty(Ini.P_SINGLE_INSTANCE_PER_WINDOW, (singleInstancePerWindow.isSelected())); - // Open Window Maximized - Ini.setProperty(Ini.P_OPEN_WINDOW_MAXIMIZED, (openWindowMaximized.isSelected())); - // TraceLevel/File - Level level = (Level)traceLevel.getSelectedItem(); - CLogMgt.setLevel(level); - Ini.setProperty(Ini.P_TRACELEVEL, level.getName()); - Ini.setProperty(Ini.P_TRACEFILE, traceFile.isSelected()); - // Printer - String printer = (String)fPrinter.getSelectedItem(); - Env.setContext(Env.getCtx(), "#Printer", printer); - Ini.setProperty(Ini.P_PRINTER, printer); - // Date (remove seconds) - java.sql.Timestamp ts = (java.sql.Timestamp)fDate.getValue(); - if (ts != null) - Env.setContext(Env.getCtx(), "#Date", ts); - // Charset - Charset charset = (Charset)fCharset.getSelectedItem(); - Ini.setProperty(Ini.P_CHARSET, charset.name()); - - //UI - ValueNamePair laf = plafEditor.getSelectedLook(); - ValueNamePair theme = plafEditor.getSelectedTheme(); - if ( laf != null ) { - String clazz = laf.getValue(); - String currentLaf = UIManager.getLookAndFeel().getClass().getName(); - if (clazz != null && clazz.length() > 0 && !currentLaf.equals(clazz)) - { - //laf changed - AdempierePLAF.setPLAF(laf, theme, true); - AEnv.updateUI(); - } - else - { - if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) - { - MetalTheme currentTheme = MetalLookAndFeel.getCurrentTheme(); - String themeClass = currentTheme.getClass().getName(); - String sTheme = theme.getValue(); - if (sTheme != null && sTheme.length() > 0 && !sTheme.equals(themeClass)) - { - ValueNamePair plaf = new ValueNamePair( - UIManager.getLookAndFeel().getClass().getName(), - UIManager.getLookAndFeel().getName()); - AdempierePLAF.setPLAF(plaf, theme, true); - AEnv.updateUI(); - } - } - } - } - - Ini.saveProperties(Ini.isClient()); - dispose(); - } // cmd_save - - /** - * (Re)Display Errors - */ - private void cmd_displayErrors() - { - Vector> data = CLogErrorBuffer.get(true).getLogData(bErrorsOnly.isSelected()); - Vector columnNames = CLogErrorBuffer.get(true).getColumnNames(Env.getCtx()); - DefaultTableModel model = new DefaultTableModel(data, columnNames); - errorTable.setModel(model); - // - if (bErrorsOnly.isSelected()) - tabPane.setTitleAt(4, Msg.getMsg(Env.getCtx(), "Errors") + " (" + data.size() + ")"); - else - tabPane.setTitleAt(4, Msg.getMsg(Env.getCtx(), "TraceInfo") + " (" + data.size() + ")"); - errorTable.autoSize(); - } // cmd_errorsOnly - - /** - * Reset Errors - */ - private void cmd_errorReset() - { - CLogErrorBuffer.get(true).resetBuffer(bErrorsOnly.isSelected()); - cmd_displayErrors(); - } // cmd_errorReset - - /** - * EMail Errors - */ - private void cmd_errorEMail() - { - @SuppressWarnings("unused") - EMailDialog emd = new EMailDialog(this, - "EMail Trace", - MUser.get(Env.getCtx()), - "", // to - "Adempiere Trace Info", - CLogErrorBuffer.get(true).getErrorInfo(Env.getCtx(), bErrorsOnly.isSelected()), - null); - - } // cmd_errorEMail - - /** - * Save Error to File - */ - private void cmd_errorSave() - { - JFileChooser chooser = new JFileChooser(); - chooser.setDialogType(JFileChooser.SAVE_DIALOG); - chooser.setDialogTitle("Adempiere Trace File"); - chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); - chooser.setSelectedFile(new File ("traceInfo.log")); - int returnVal = chooser.showSaveDialog(this); - if(returnVal != JFileChooser.APPROVE_OPTION) - return; - try - { - File file = chooser.getSelectedFile(); - FileWriter writer = new FileWriter(file); - writer.write(CLogErrorBuffer.get(true).getErrorInfo(Env.getCtx(), bErrorsOnly.isSelected())); - writer.flush(); - writer.close(); - } - catch (Exception e) - { - log.log(Level.SEVERE, "", e); - } - } // cmd_errorSave - -} // Preference diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/PrintScreenPainter.java b/org.adempiere.ui.swing/src/org/compiere/apps/PrintScreenPainter.java deleted file mode 100644 index 609ff7ea5f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/PrintScreenPainter.java +++ /dev/null @@ -1,135 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Window; -import java.awt.print.PageFormat; -import java.awt.print.Pageable; -import java.awt.print.Printable; -import java.awt.print.PrinterException; -import java.util.Date; - -import org.compiere.print.CPaper; -import org.compiere.print.PrintUtil; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * PrintScreen Painter - * - * @author Jorg Janke - * @version $Id: PrintScreenPainter.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class PrintScreenPainter implements Pageable, Printable -{ - /** - * PrintScreen Painter - * @param element Window to print - */ - public PrintScreenPainter (Window element) - { - m_element = element; - } // PrintScreenPainter - - /** Element */ - private Window m_element; - - /** - * Get Number of pages - * @return 1 - */ - public int getNumberOfPages() - { - return 1; - } // getNumberOfPages - - /** - * Get Printable - * @param pageIndex page index - * @return this - * @throws java.lang.IndexOutOfBoundsException - */ - public Printable getPrintable(int pageIndex) throws java.lang.IndexOutOfBoundsException - { - return this; - } // getPrintable - - /** - * Get Page Format - * @param pageIndex page index - * @return Portrait - * @throws java.lang.IndexOutOfBoundsException - */ - public PageFormat getPageFormat(int pageIndex) throws java.lang.IndexOutOfBoundsException - { - CPaper paper = new CPaper(false); - return paper.getPageFormat(); - } // getPageFormat - - /** - * Print - * @param graphics graphics - * @param pageFormat page format - * @param pageIndex page index - * @return NO_SUCH_PAGE or PAGE_EXISTS - * @throws PrinterException - */ - public int print (Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException - { - // log.config( "PrintScreenPainter.print " + pageIndex, "ClipBounds=" + graphics.getClipBounds()); - if (pageIndex > 0) - return Printable.NO_SUCH_PAGE; - // - Graphics2D g2 = (Graphics2D) graphics; - - // Start position - top of page - g2.translate (pageFormat.getImageableX(), pageFormat.getImageableY()); - - // Print Header - String header = Msg.getMsg(Env.getCtx(), "PrintScreen") + " - " - + DisplayType.getDateFormat(DisplayType.DateTime).format(new Date()); - int y = g2.getFontMetrics().getHeight(); // leading + ascent + descent - g2.drawString(header, 0, y); - // Leave one row free - g2.translate (0, 2*y); - - double xRatio = pageFormat.getImageableWidth() / m_element.getSize().width; - double yRatio = (pageFormat.getImageableHeight() - 2*y) / m_element.getSize().height; - // Sacle evenly, but don't inflate - double ratio = Math.min(Math.min(xRatio, yRatio), 1.0); - g2.scale (ratio, ratio); - // Print Element - m_element.printAll (g2); - - return Printable.PAGE_EXISTS; - } // print - - /*************************************************************************/ - - /** - * Static print start - * @param element window - */ - public static void printScreen (Window element) - { - PrintUtil.print(new PrintScreenPainter(element), null, "PrintScreen", 1, false); - } // printScreen - -} // PrintScreenPainter diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessCtl.java b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessCtl.java deleted file mode 100644 index 35ead7f7e3..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessCtl.java +++ /dev/null @@ -1,339 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.Container; -import java.util.logging.Level; - -import javax.swing.JFrame; -import javax.swing.SwingUtilities; - -import org.adempiere.util.IProcessUI; -import org.compiere.model.MPInstance; -import org.compiere.process.ProcessInfo; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Trx; - -/** - * Process Interface Controller. - * - * @author Jorg Janke - * @version $Id: ProcessCtl.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * @author Low Heng Sin - * - Added support for having description and parameter in one dialog - * - Added support to run db process remotely on server - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *
  • BF [ 1757523 ] Server Processes are using Server's context - *
  • FR [ 1807922 ] Pocess threads should have a better name - *
  • BF [ 1960523 ] Server Process functionality not working - */ -public class ProcessCtl extends AbstractProcessCtl -{ - /** - * Process Control - * - * - Get Instance ID - * - Get Parameters - * - execute (lock - start process - unlock) - * - * Creates a ProcessCtl instance, which calls - * lockUI and unlockUI if parent is a ASyncProcess - *
    - * Called from APanel.cmd_print, APanel.actionButton and - * VPaySelect.cmd_generate - * - * @param parent ASyncProcess & Container - * @param WindowNo window no - * @param pi ProcessInfo process info - * @param trx Transaction - * @return worker started ProcessCtl instance or null for workflow - */ - public static ProcessCtl process (IProcessUI parent, int WindowNo, ProcessInfo pi, Trx trx) - { - if (log.isLoggable(Level.FINE)) log.fine("WindowNo=" + WindowNo + " - " + pi); - - MPInstance instance = null; - try - { - instance = new MPInstance(Env.getCtx(), pi.getAD_Process_ID(), pi.getRecord_ID()); - } - catch (Exception e) - { - pi.setSummary (e.getLocalizedMessage()); - pi.setError (true); - log.warning(pi.toString()); - return null; - } - catch (Error e) - { - pi.setSummary (e.getLocalizedMessage()); - pi.setError (true); - log.warning(pi.toString()); - return null; - } - if (!instance.save()) - { - pi.setSummary (Msg.getMsg(Env.getCtx(), "ProcessNoInstance")); - pi.setError (true); - return null; - } - pi.setAD_PInstance_ID (instance.getAD_PInstance_ID()); - - // Get Parameters (Dialog) - ProcessParameter para = new ProcessParameter (AEnv.getFrame((Container)parent), WindowNo, pi); - if (para.initDialog()) - { - para.setVisible(true); - if (!para.isOK()) - { - pi.setSummary (Msg.getMsg(Env.getCtx(), "ProcessCancelled")); - pi.setError (true); - return null; - } - } - - // execute - ProcessCtl worker = new ProcessCtl(parent, WindowNo, pi, trx); - if (parent != null) - { - //asynchrous - worker.start(); - } - else - { - //synchrous - worker.run(); - } - return worker; - } // execute - - /** - * Async Process - Do it all. - * - * - Get Instance ID - * - Get Parameters - * - execute (lock - start process - unlock) - * - * Creates a ProcessCtl instance, which calls - * lockUI and unlockUI if parent is a ASyncProcess - *
    - * Called from ProcessDialog.actionPerformed - * - * @param parent ASyncProcess & Container - * @param WindowNo window no - * @param paraPanel Process Parameter Panel - * @param pi ProcessInfo process info - * @param trx Transaction - * @return worker started ProcessCtl instance or null for workflow - */ - public static ProcessCtl process(IProcessUI parent, int WindowNo, IProcessParameter parameter, ProcessInfo pi, Trx trx) - { - if (log.isLoggable(Level.FINE)) log.fine("WindowNo=" + WindowNo + " - " + pi); - - MPInstance instance = null; - try - { - instance = new MPInstance(Env.getCtx(), pi.getAD_Process_ID(), pi.getRecord_ID()); - } - catch (Exception e) - { - pi.setSummary (e.getLocalizedMessage()); - pi.setError (true); - log.warning(pi.toString()); - return null; - } - catch (Error e) - { - pi.setSummary (e.getLocalizedMessage()); - pi.setError (true); - log.warning(pi.toString()); - return null; - } - if (!instance.save()) - { - pi.setSummary (Msg.getMsg(Env.getCtx(), "ProcessNoInstance")); - pi.setError (true); - return null; - } - pi.setAD_PInstance_ID (instance.getAD_PInstance_ID()); - - // Get Parameters - if (parameter != null) { - if (!parameter.saveParameters()) - { - pi.setSummary (Msg.getMsg(Env.getCtx(), "ProcessCancelled")); - pi.setError (true); - return null; - } - } - - if (pi.getRecord_IDs() != null && pi.getRecord_IDs().size() > 0) - { - DB.createT_Selection(pi.getAD_PInstance_ID(), pi.getRecord_IDs(), null); - } - - // execute - ProcessCtl worker = new ProcessCtl(parent, WindowNo, pi, trx); - if (parent != null) - { - worker.start(); - } - else - { - //synchrous - worker.run(); - } - return worker; - } // execute - - - - /************************************************************************** - * Constructor - * @param parent Container & ASyncProcess - * @param pi Process info - * @param trx Transaction - * Created in process(), VInvoiceGen.generateInvoices - */ - public ProcessCtl (IProcessUI parent, int WindowNo, ProcessInfo pi, Trx trx) - { - super(parent, WindowNo, pi, trx); - } // ProcessCtl - - private Waiting m_waiting; - - /** Static Logger */ - private static CLogger log = CLogger.getCLogger (ProcessCtl.class); - - /** - * Lock UI & show Waiting - */ - protected void lock () - { - // log.info("..."); - //m_parent is null for synchrous execution - if (getProcessMonitor() != null) - { - if (getProcessMonitor() instanceof Container) - { - //swing client - JFrame frame = AEnv.getFrame((Container)getProcessMonitor()); - if (frame instanceof AWindow) - ((AWindow)frame).setBusyTimer(getProcessInfo().getEstSeconds()); - else - m_waiting = new Waiting (frame, Msg.getMsg(Env.getCtx(), "Processing"), false, getProcessInfo().getEstSeconds()); - ProcessUpdateRunnable runnable = new ProcessUpdateRunnable() { - @Override - public void run() - { - if (m_waiting != null) - { - m_waiting.toFront(); - m_waiting.setVisible(true); - } - - log.finer("lock"); - parent.lockUI(pi); - } - }; - runnable.setParent(getProcessMonitor()); - runnable.setProcessInfo(getProcessInfo()); - SwingUtilities.invokeLater(runnable); - } - else - { - //other client - log.finer("lock"); - getProcessMonitor().lockUI(getProcessInfo()); - } - } - } // lock - - /** - * Unlock UI & dispose Waiting. - * Called from run() - */ - protected void unlock () - { - // log.info("..."); - if (getProcessInfo().isBatch()) - getProcessInfo().setIsTimeout(true); - if (getParent() != null) - { - if (getParent() instanceof Container) - { - ProcessUpdateRunnable runnable = new ProcessUpdateRunnable() - { - @Override - public void run() - { - // Remove Waiting/Processing Indicator - if (m_waiting != null) - m_waiting.dispose(); - m_waiting = null; - - String summary = pi.getSummary(); - if (log.isLoggable(Level.FINER)) log.finer("unlock - " + summary); - if (summary != null && summary.indexOf('@') != -1) - pi.setSummary(Msg.parseTranslation(Env.getCtx(), summary)); - parent.unlockUI(pi); - } - }; - runnable.setParent(getParent()); - runnable.setProcessInfo(getProcessInfo()); - SwingUtilities.invokeLater(runnable); - } - else - { - //other client - getParent().unlockUI(getProcessInfo()); - } - } - } // unlock - - @Override - protected void updateProgressWindowTimerEstimate(int estSeconds) { - if (m_waiting != null) - m_waiting.setTimerEstimate(getProcessInfo().getEstSeconds()); - } - - @Override - protected void updateProgressWindowTitle(String title) { - if (m_waiting != null) - m_waiting.setTitle(getProcessInfo().getTitle()); - } - - abstract class ProcessUpdateRunnable implements Runnable - { - protected ProcessInfo pi = null; - protected IProcessUI parent = null; - - public void setProcessInfo(ProcessInfo pi) - { - this.pi = pi; - } - - public void setParent(IProcessUI parent) - { - this.parent = parent; - } - } -} // ProcessCtl diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessDialog.java b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessDialog.java deleted file mode 100644 index 5216988bac..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessDialog.java +++ /dev/null @@ -1,688 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import static org.compiere.model.SystemIDs.PROCESS_C_INVOICE_GENERATE; -import static org.compiere.model.SystemIDs.PROCESS_M_INOUT_GENERATE; - -import java.awt.AWTEvent; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.GraphicsConfiguration; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.List; -import java.util.logging.Level; - -import javax.swing.DefaultComboBoxModel; -import javax.swing.ImageIcon; -import javax.swing.JEditorPane; -import javax.swing.JOptionPane; -import javax.swing.JScrollPane; -import javax.swing.JSeparator; - -import org.adempiere.exceptions.AdempiereException; -import org.adempiere.exceptions.DBException; -import org.adempiere.util.Callback; -import org.adempiere.util.IProcessUI; -import org.compiere.model.MPInstance; -import org.compiere.model.MPInstancePara; -import org.compiere.model.MProcess; -import org.compiere.print.ReportCtl; -import org.compiere.print.ReportEngine; -import org.compiere.process.ProcessInfo; -import org.compiere.process.ProcessInfoUtil; -import org.compiere.swing.CButton; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CFrame; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.AdempiereSystemError; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Util; - -/** - * Dialog to Start process. - * Displays information about the process - * and lets the user decide to start it - * and displays results (optionally print them). - * Calls ProcessCtl to execute. - * - * @author Jorg Janke - * @version $Id: ProcessDialog.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * @author Low Heng Sin - * - Merge process parameter dialog into process dialog. - * @author arboleda - globalqss - * - Implement ShowHelp option on processes and reports - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *
  • BF [ 1893525 ] ProcessDialog: Cannot select the text from text field - *
  • BF [ 1963128 ] Running a process w/o trl should display an error - */ -public class ProcessDialog extends CFrame - implements ActionListener, IProcessUI -{ - /** - * - */ - private static final long serialVersionUID = 2435351857958558386L; - - /** - * @deprecated - * Dialog to start Process - * - * @param AD_Process_ID process - * @param isSOTrx is sales trx - */ - public ProcessDialog (int AD_Process_ID, boolean isSOTrx) - { - this(null, AD_Process_ID, isSOTrx); - - } // ProcessDialog - - /** - * Dialog to start Process - * - * @param gc - * @param AD_Process_ID process - * @param isSOTrx is sales trx - */ - public ProcessDialog (GraphicsConfiguration gc, int AD_Process_ID, boolean isSOTrx) - { - super(gc); - if (log.isLoggable(Level.INFO)) log.info("Process=" + AD_Process_ID + "; SOTrx=" + isSOTrx); - enableEvents(AWTEvent.WINDOW_EVENT_MASK); - m_AD_Process_ID = AD_Process_ID; - m_WindowNo = AEnv.createWindowNo (this); - Env.setContext(Env.getCtx(), m_WindowNo, "IsSOTrx", isSOTrx ? "Y" : "N"); - try - { - jbInit(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - } // ProcessDialog - - private int m_AD_Process_ID; - private int m_WindowNo; - private String m_Name = null; - private boolean m_IsReport = false; - private int[] m_ids = null; - private boolean m_isLocked = false; - private StringBuffer m_messageText = new StringBuffer(); - private String m_ShowHelp = null; // Determine if a Help Process Window is shown - /** Logger */ - private static CLogger log = CLogger.getCLogger(ProcessDialog.class); - // - - private CPanel dialog = new CPanel() - { - /** - * - */ - private static final long serialVersionUID = 428410337428677817L; - - public Dimension getPreferredSize() { - Dimension d = super.getPreferredSize(); - Dimension m = getMinimumSize(); - if ( d.height < m.height || d.width < m.width ) { - Dimension d1 = new Dimension(); - d1.height = Math.max(d.height, m.height); - d1.width = Math.max(d.width, m.width); - return d1; - } else - return d; - } - }; - private BorderLayout mainLayout = new BorderLayout(); - private CPanel southPanel = new CPanel(); - private CButton bOK = ConfirmPanel.createOKButton(true); - private FlowLayout southLayout = new FlowLayout(); - private JEditorPane message = new JEditorPane() - { - /** - * - */ - private static final long serialVersionUID = -2271852928089812014L; - - public Dimension getPreferredSize() { - Dimension d = super.getPreferredSize(); - Dimension m = getMaximumSize(); - if ( d.height > m.height || d.width > m.width ) { - Dimension d1 = new Dimension(); - d1.height = Math.min(d.height, m.height); - d1.width = Math.min(d.width, m.width); - return d1; - } else - return d; - } - }; - private JScrollPane messagePane = new JScrollPane(message) - { - /** - * - */ - private static final long serialVersionUID = 3605316311642118445L; - - public Dimension getPreferredSize() { - Dimension d = super.getPreferredSize(); - Dimension m = getMaximumSize(); - if ( d.height > m.height || d.width > m.width ) { - Dimension d1 = new Dimension(); - d1.height = Math.min(d.height, m.height); - d1.width = Math.min(d.width, m.width); - return d1; - } else - return d; - } - }; - private CButton bPrint = ConfirmPanel.createPrintButton(true); - - private CPanel centerPanel = null; - private ProcessParameterPanel parameterPanel = null; - private JSeparator separator = new JSeparator(); - private ProcessInfo m_pi = null; - private CComboBoxfSavedName = new CComboBox(); - private CButton bSave = new CButton(); - private CButton bDelete = new CButton(); - private List savedParams; - private CLabel lSaved = new CLabel(Msg.getMsg(Env.getCtx(), "SavedParameter")); - - /** - * Static Layout - * @throws Exception - */ - private void jbInit() throws Exception - { - setIconImage(Env.getImage("mProcess.png")); - // - dialog.setLayout(mainLayout); - dialog.setMinimumSize(new Dimension(500, 200)); - bOK.addActionListener(this); - bPrint.addActionListener(this); - fSavedName.setToolTipText (Msg.getMsg(Env.getCtx(),"SavedParameter")); - fSavedName.setEditable(true); - fSavedName.addActionListener(this); - bSave.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Save24.gif"))); - bSave.setMargin(new Insets(2, 2, 2, 2)); - bSave.setToolTipText(Msg.getMsg(Env.getCtx(),"Save")); - bSave.addActionListener(this); - bSave.setEnabled(false); - bDelete.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Delete24.gif"))); - bDelete.setMargin(new Insets(2, 2, 2, 2)); - bDelete.setToolTipText(Msg.getMsg(Env.getCtx(),"Delete")); - bDelete.addActionListener(this); - bDelete.setEnabled(false); - // - southPanel.setLayout(southLayout); - southLayout.setAlignment(FlowLayout.RIGHT); - message.setContentType("text/html"); - message.setEditable(false); - message.setBackground(Color.white); - message.setFocusable(true); - getContentPane().add(dialog); - dialog.add(southPanel, BorderLayout.SOUTH); - - southPanel.add(lSaved,"wrap"); - southPanel.add(fSavedName, "w :200:"); - southPanel.add(bSave, null); - southPanel.add(bDelete, null); - southPanel.add(bPrint, "span, split 2, align right, pushx"); - southPanel.add(bOK, null); - dialog.add(messagePane, BorderLayout.NORTH); - messagePane.setBorder(null); - messagePane.setMaximumSize(new Dimension(600, 300)); - centerPanel = new CPanel(); - centerPanel.setBorder(null); - centerPanel.setLayout(new BorderLayout()); - dialog.add(centerPanel, BorderLayout.CENTER); - mainLayout.setVgap(2); - // - this.getRootPane().setDefaultButton(bOK); - } // jbInit - - /** - * Set Visible - * (set focus to OK if visible) - * @param visible true if visible - */ - public void setVisible (boolean visible) - { - super.setVisible(visible); - if (visible) { - bOK.requestFocus(); - } - } // setVisible - - /** - * Dispose - */ - public void dispose() - { - Env.clearWinContext(m_WindowNo); - super.dispose(); - } // dispose - - - /** - * Dynamic Init - * @return true, if there is something to process (start from menu) - */ - public boolean init() - { - log.config(""); - // - boolean trl = !Env.isBaseLanguage(Env.getCtx(), "AD_Process"); - String sql = "SELECT Name, Description, Help, IsReport, ShowHelp " - + "FROM AD_Process " - + "WHERE AD_Process_ID=?"; - if (trl) - sql = "SELECT t.Name, t.Description, t.Help, p.IsReport, p.ShowHelp " - + "FROM AD_Process p, AD_Process_Trl t " - + "WHERE p.AD_Process_ID=t.AD_Process_ID" - + " AND p.AD_Process_ID=? AND t.AD_Language=?"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_AD_Process_ID); - if (trl) - pstmt.setString(2, Env.getAD_Language(Env.getCtx())); - rs = pstmt.executeQuery(); - if (rs.next()) - { - m_Name = rs.getString(1); - m_IsReport = rs.getString(4).equals("Y"); - m_ShowHelp = rs.getString(5); - // - m_messageText.append(""); - String s = rs.getString(2); // Description - if (rs.wasNull()) - m_messageText.append(Msg.getMsg(Env.getCtx(), "StartProcess?")); - else - m_messageText.append(s); - m_messageText.append(""); - s = rs.getString(3); // Help - if (!rs.wasNull()) - m_messageText.append("

    ").append(s).append("

    "); - } - } - catch (SQLException e) - { - throw new DBException(e, sql); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - - if (m_Name == null) { - throw new AdempiereException("@NotFound@ @AD_Process_ID@="+m_AD_Process_ID+". @CheckMissingTrl@"); - } - // - this.setTitle(m_Name); - message.setText(m_messageText.toString()); - bOK.setText(Msg.getMsg(Env.getCtx(), "Start")); - - // Similar to APanel.actionButton - m_pi = new ProcessInfo(m_Name, m_AD_Process_ID); - m_pi.setAD_User_ID (Env.getAD_User_ID(Env.getCtx())); - m_pi.setAD_Client_ID(Env.getAD_Client_ID(Env.getCtx())); - parameterPanel = new ProcessParameterPanel(m_WindowNo, m_pi); - parameterPanel.setWindow(this); - centerPanel.removeAll(); - if (parameterPanel.init()) { - // hasfields - centerPanel.add(separator, BorderLayout.NORTH); - centerPanel.add(parameterPanel, BorderLayout.CENTER); - } else { - if (m_ShowHelp != null && MProcess.SHOWHELP_DonTShowHelp.equals(m_ShowHelp)) { - bOK.doClick(); // don't ask first click - // anyway show resulting window - } - } - - // Check if the process is a silent one - if(m_ShowHelp != null && MProcess.SHOWHELP_RunSilently_TakeDefaults.equals(m_ShowHelp)) - bOK.doClick(); - - querySaved(); - - dialog.revalidate(); - return true; - } // init - - private void querySaved() { - //user query - savedParams = MPInstance.get(Env.getCtx(), m_AD_Process_ID, Env.getContextAsInt(Env.getCtx(), "#AD_User_ID")); - String[] queries = new String[savedParams.size()+1]; - int i = 0; - queries[i++] = ""; - for (MPInstance instance : savedParams) - { - queries[i++] = instance.getName(); - } - fSavedName.setModel(new DefaultComboBoxModel(queries)); - fSavedName.setValue(""); - } - - /** - * ActionListener (Start) - * @param e ActionEvent - */ - public void actionPerformed (ActionEvent e) - { - - String saveName = null; - if (fSavedName.getSelectedItem() != null) - saveName = fSavedName.getSelectedItem().toString(); - - boolean lastRun = ("** " + Msg.getMsg(Env.getCtx(), "LastRun") + " **").equals(saveName); - - if (e.getSource() == bOK) - { - if (bOK.getText().length() == 0) - dispose(); - else - { - // Trx trx = Trx.get(Trx.createTrxName("ProcessDialog"), true); - ProcessCtl.process(this, m_WindowNo, parameterPanel, m_pi, null); - } - } - else if (e.getSource() == fSavedName) - { - if (savedParams != null && saveName != null) - { - for (int i = 0; i < savedParams.size(); i++) - { - if (savedParams.get(i).getName().equals(saveName)) - { - loadSavedParams(savedParams.get(i)); - } - } - } - boolean enabled = !Util.isEmpty(saveName); - bSave.setEnabled(enabled && !lastRun); - bDelete.setEnabled(enabled && fSavedName.getSelectedIndex() > -1 && !lastRun); - } - else if (e.getSource() == bSave && fSavedName != null && !lastRun) - { - // Update existing - if (fSavedName.getSelectedIndex() > -1 && savedParams != null) - { - for (int i = 0; i < savedParams.size(); i++) - { - if (savedParams.get(i).getName().equals(saveName)) - { - m_pi.setAD_PInstance_ID(savedParams.get(i).getAD_PInstance_ID()); - for (MPInstancePara para : savedParams.get(i).getParameters()) - { - para.deleteEx(true); - } - parameterPanel.saveParameters(); - } - } - } - // create new - else { - MPInstance instance = null; - try - { - instance = new MPInstance(Env.getCtx(), m_pi.getAD_Process_ID(), m_pi.getRecord_ID()); - instance.setName(saveName); - instance.saveEx(); - - m_pi.setAD_PInstance_ID(instance.getAD_PInstance_ID()); - // Get Parameters - if (parameterPanel != null) { - if (!parameterPanel.saveParameters()) - { - throw new AdempiereSystemError(Msg.getMsg(Env.getCtx(), "SaveParameterError")); - } - } - } - catch (Exception ex) - { - ADialog.warn(m_WindowNo, this, ex.getLocalizedMessage()); - } - } - querySaved(); - fSavedName.setSelectedItem(saveName); - } - else if (e.getSource() == bDelete && fSavedName != null && !lastRun ) - { - Object o = fSavedName.getSelectedItem(); - if (savedParams != null && o != null) - { - String selected = o.toString(); - for (int i = 0; i < savedParams.size(); i++) - { - if (savedParams.get(i).getName().equals(selected)) - { - savedParams.get(i).deleteEx(true); - } - } - } - querySaved(); - } - - else if (e.getSource() == bPrint) - printScreen(); - } // actionPerformed - - - private void loadSavedParams(MPInstance instance) { - parameterPanel.loadParameters(instance); - } - - /** - * Lock User Interface - * Called from the Worker before processing - * @param pi process info - */ - public void lockUI (ProcessInfo pi) - { - bOK.setText(""); - bOK.setEnabled(false); - this.setEnabled(false); - m_isLocked = true; - } // lockUI - - /** - * Unlock User Interface. - * Called from the Worker when processing is done - * @param pi process info - */ - public void unlockUI (ProcessInfo pi) - { - ProcessInfoUtil.setLogFromDB(pi); - m_messageText.append("

    ** ") - .append(pi.getSummary()) - .append("

    "); - m_messageText.append(pi.getLogInfo(true)); - message.setText(m_messageText.toString()); - message.setCaretPosition(message.getDocument().getLength()); // scroll down - m_ids = pi.getIDs(); - // - bOK.setEnabled(true); - this.setEnabled(true); - m_isLocked = false; - - //no longer needed, hide to give more space to display log - dialog.remove(centerPanel); - messagePane.setMaximumSize(null); - dialog.remove(messagePane); - dialog.add(messagePane, BorderLayout.CENTER); - - this.validate(); - AEnv.showCenterScreen(this); - // - afterProcessTask(); - // Close automatically - if (m_IsReport && !pi.isError()) - bOK.doClick(); - - // If the process is a silent one and no errors occurred, close the dialog - if(m_ShowHelp != null && MProcess.SHOWHELP_RunSilently_TakeDefaults.equals(m_ShowHelp)) - bOK.doClick(); - } // unlockUI - - /** - * Is the UI locked (Internal method) - * @return true, if UI is locked - */ - public boolean isUILocked() - { - return m_isLocked; - } // isUILocked - - /** - * Method to be executed async. - * Called from the ASyncProcess worker - * @param pi process info - */ - public void executeASync (ProcessInfo pi) - { - log.config("-"); - } // executeASync - - - /************************************************************************** - * Optional Processing Task - */ - private void afterProcessTask() - { - // something to do? - if (m_ids != null && m_ids.length > 0) - { - log.config(""); - // Print invoices - if (m_AD_Process_ID == PROCESS_C_INVOICE_GENERATE) - printInvoices(); - else if (m_AD_Process_ID == PROCESS_M_INOUT_GENERATE) - printShipments(); - } - - } // afterProcessTask - - - /************************************************************************** - * Print Shipments - */ - private void printShipments() - { - if (m_ids == null) - return; - if (!ADialog.ask(m_WindowNo, this, "PrintShipments")) - return; - m_messageText.append("

    ").append(Msg.getMsg(Env.getCtx(), "PrintShipments")).append("

    "); - message.setText(m_messageText.toString()); - int retValue = ADialogDialog.A_CANCEL; - do - { - // Loop through all items - for (int i = 0; i < m_ids.length; i++) - { - int M_InOut_ID = m_ids[i]; - ReportCtl.startDocumentPrint(ReportEngine.SHIPMENT, M_InOut_ID, this, AEnv.getWindowNo(this), true); - } - ADialogDialog d = new ADialogDialog (this, - Env.getHeader(Env.getCtx(), m_WindowNo), - Msg.getMsg(Env.getCtx(), "PrintoutOK?"), - JOptionPane.QUESTION_MESSAGE); - retValue = d.getReturnCode(); - } - while (retValue == ADialogDialog.A_CANCEL); - } // printInvoices - - /** - * Print Invoices - */ - private void printInvoices() - { - if (m_ids == null) - return; - if (!ADialog.ask(m_WindowNo, this, "PrintInvoices")) - return; - m_messageText.append("

    ").append(Msg.getMsg(Env.getCtx(), "PrintInvoices")).append("

    "); - message.setText(m_messageText.toString()); - int retValue = ADialogDialog.A_CANCEL; - do - { - // Loop through all items - for (int i = 0; i < m_ids.length; i++) - { - int AD_Invoice_ID = m_ids[i]; - ReportCtl.startDocumentPrint(ReportEngine.INVOICE, AD_Invoice_ID, this, AEnv.getWindowNo(this), true); - } - ADialogDialog d = new ADialogDialog (this, - Env.getHeader(Env.getCtx(), m_WindowNo), - Msg.getMsg(Env.getCtx(), "PrintoutOK?"), - JOptionPane.QUESTION_MESSAGE); - retValue = d.getReturnCode(); - } - while (retValue == ADialogDialog.A_CANCEL); - } // printInvoices - - /** - * Print Screen - */ - private void printScreen() - { - PrintScreenPainter.printScreen (this); - } // printScreen - - @Override - public void statusUpdate(String status) { - message.setText(status); - } - - @Override - public void ask(String message, Callback callback) { - boolean b = ADialog.ask(m_WindowNo, this, message); - if (callback != null) { - callback.onCallback(b); - } - } - - @Override - public void download(File file) { - // TODO Auto-generated method stub - - } - - @Override - public void askForInput(String message, Callback callback) { - String s = ADialog.askForInput(m_WindowNo, this, message); - if(callback != null) - callback.onCallback(s); - } - -} // ProcessDialog diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessModalDialog.java b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessModalDialog.java deleted file mode 100644 index d215a0c35e..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessModalDialog.java +++ /dev/null @@ -1,349 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2007 Low Heng Sin * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Properties; -import java.util.logging.Level; - -import javax.swing.JEditorPane; -import javax.swing.JScrollPane; -import javax.swing.JSeparator; - -import org.adempiere.exceptions.DBException; -import org.adempiere.util.IProcessUI; -import org.compiere.model.MProcess; -import org.compiere.process.ProcessInfo; -import org.compiere.swing.CButton; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * [ 1639242 ] Inconsistent appearance of Process/Report Dialog - * - * Modal Dialog to Start process. - * Displays information about the process - * and lets the user decide to start it - * and displays results (optionally print them). - * Calls ProcessCtl to execute. - * @author Low Heng Sin - * @author arboleda - globalqss - * - Implement ShowHelp option on processes and reports - */ -public class ProcessModalDialog extends CDialog - implements ActionListener -{ - - /** - * - */ - private static final long serialVersionUID = -1573751323319156081L; - - /** - * Dialog to start a process/report - * @param ctx - * @param parent - * @param title - * @param aProcess - * @param WindowNo - * @param AD_Process_ID - * @param tableId - * @param recordId - * @param autoStart - */ - public ProcessModalDialog (Properties ctx, Frame parent, String title, - IProcessUI aProcess, int WindowNo, int AD_Process_ID, - int tableId, int recordId, boolean autoStart) - { - super(parent, title, true); - if (log.isLoggable(Level.INFO)) log.info("Process=" + AD_Process_ID ); - m_ctx = ctx; - m_processUI = aProcess; - m_WindowNo = WindowNo; - m_AD_Process_ID = AD_Process_ID; - m_tableId = tableId; - m_recordId = recordId; - m_autoStart = autoStart; - try - { - jbInit(); - init(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - } // ProcessDialog - - private IProcessUI m_processUI; - private int m_WindowNo; - private Properties m_ctx; - private int m_tableId; - private int m_recordId; - private boolean m_autoStart; - private int m_AD_Process_ID; - private String m_Name = null; - private StringBuffer m_messageText = new StringBuffer(); - private String m_ShowHelp = null; // Determine if a Help Process Window is shown - private boolean m_valid = true; - private String m_AD_Process_UU; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(ProcessDialog.class); - // - - private CPanel dialog = new CPanel() - { - /** - * - */ - private static final long serialVersionUID = -8093428846912456722L; - - public Dimension getPreferredSize() { - Dimension d = super.getPreferredSize(); - Dimension m = getMinimumSize(); - if ( d.height < m.height || d.width < m.width ) { - Dimension d1 = new Dimension(); - d1.height = Math.max(d.height, m.height); - d1.width = Math.max(d.width, m.width); - return d1; - } else - return d; - } - }; - private BorderLayout mainLayout = new BorderLayout(); - private ConfirmPanel southPanel = new ConfirmPanel(true); - private CButton bOK = null; - private JEditorPane message = new JEditorPane() - { - /** - * - */ - private static final long serialVersionUID = 1218214722657165651L; - - public Dimension getPreferredSize() { - Dimension d = super.getPreferredSize(); - Dimension m = getMaximumSize(); - if ( d.height > m.height || d.width > m.width ) { - Dimension d1 = new Dimension(); - d1.height = Math.min(d.height, m.height); - d1.width = Math.min(d.width, m.width); - return d1; - } else - return d; - } - }; - private JScrollPane messagePane = new JScrollPane(message) - { - /** - * - */ - private static final long serialVersionUID = 8653555758412012675L; - - public Dimension getPreferredSize() { - Dimension d = super.getPreferredSize(); - Dimension m = getMaximumSize(); - if ( d.height > m.height || d.width > m.width ) { - Dimension d1 = new Dimension(); - d1.height = Math.min(d.height, m.height); - d1.width = Math.min(d.width, m.width); - return d1; - } else - return d; - } - }; - - private CPanel centerPanel = null; - private ProcessParameterPanel parameterPanel = null; - private JSeparator separator = new JSeparator(); - private ProcessInfo m_pi = null; - - /** - * Static Layout - * @throws Exception - */ - private void jbInit() throws Exception - { - dialog.setLayout(mainLayout); - dialog.setMinimumSize(new Dimension(500, 200)); - southPanel.addActionListener(this); - bOK = southPanel.getOKButton(); - // - message.setContentType("text/html"); - message.setEditable(false); - message.setBackground(Color.white); - message.setFocusable(false); - getContentPane().add(dialog); - dialog.add(southPanel, BorderLayout.SOUTH); - dialog.add(messagePane, BorderLayout.NORTH); - messagePane.setBorder(null); - messagePane.setMaximumSize(new Dimension(600, 300)); - centerPanel = new CPanel(); - centerPanel.setBorder(null); - centerPanel.setLayout(new BorderLayout()); - dialog.add(centerPanel, BorderLayout.CENTER); - // - this.getRootPane().setDefaultButton(bOK); - } // jbInit - - /** - * Set Visible - * (set focus to OK if visible) - * @param visible true if visible - */ - public void setVisible (boolean visible) - { - super.setVisible(visible); - if (visible) { - bOK.requestFocus(); - } - } // setVisible - - /** - * Dispose - */ - public void dispose() - { - m_valid = false; - parameterPanel.restoreContext(); // teo_sarca [ 1699826 ] - super.dispose(); - } // dispose - - public boolean isValidDialog() - { - return m_valid; - } - - /** - * Dynamic Init - * @return true, if there is something to process (start from menu) - */ - public boolean init() - { - log.config(""); - // - boolean trl = !Env.isBaseLanguage(m_ctx, "AD_Process"); - String sql = "SELECT Name, Description, Help, IsReport, ShowHelp, AD_Process_UU " - + "FROM AD_Process " - + "WHERE AD_Process_ID=?"; - if (trl) - sql = "SELECT t.Name, t.Description, t.Help, p.IsReport, p.ShowHelp, AD_Process_UU " - + "FROM AD_Process p, AD_Process_Trl t " - + "WHERE p.AD_Process_ID=t.AD_Process_ID" - + " AND p.AD_Process_ID=? AND t.AD_Language=?"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_AD_Process_ID); - if (trl) - pstmt.setString(2, Env.getAD_Language(m_ctx)); - rs = pstmt.executeQuery(); - if (rs.next()) - { - m_Name = rs.getString(1); - m_ShowHelp = rs.getString(5); - // - m_messageText.append(""); - String s = rs.getString(2); // Description - if (rs.wasNull()) - m_messageText.append(Msg.getMsg(m_ctx, "StartProcess?")); - else - m_messageText.append(s); - m_messageText.append(""); - - s = rs.getString(3); // Help - if (!rs.wasNull()) - m_messageText.append("

    ").append(s).append("

    "); - - m_AD_Process_UU = rs.getString(6); - } - } - catch (SQLException e) - { - throw new DBException(e, sql); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - - if (m_Name == null) - return false; - // - this.setTitle(m_Name); - message.setMargin(new Insets(10,10,10,10)); - message.setText(m_messageText.toString()); - - // Move from APanel.actionButton - m_pi = new ProcessInfo(m_Name, m_AD_Process_ID, m_tableId, m_recordId); - m_pi.setAD_Process_UU(m_AD_Process_UU); - m_pi.setAD_User_ID (Env.getAD_User_ID(Env.getCtx())); - m_pi.setAD_Client_ID(Env.getAD_Client_ID(Env.getCtx())); - parameterPanel = new ProcessParameterPanel(m_WindowNo, m_pi); - parameterPanel.setWindow(this); - centerPanel.removeAll(); - if (parameterPanel.init()) { - // hasfields - centerPanel.add(separator, BorderLayout.NORTH); - centerPanel.add(parameterPanel, BorderLayout.CENTER); - } else { - if (m_ShowHelp != null && MProcess.SHOWHELP_DonTShowHelp.equals(m_ShowHelp)) { - m_autoStart = true; - } - if (m_autoStart) - bOK.doClick(); // don't ask first click - } - - // Check if the process is a silent one - if(m_ShowHelp != null && MProcess.SHOWHELP_RunSilently_TakeDefaults.equals(m_ShowHelp)) - bOK.doClick(); - - dialog.revalidate(); - return true; - } // init - - /** - * ActionListener (Start) - * @param e ActionEvent - */ - public void actionPerformed (ActionEvent e) - { - if (e.getSource() == bOK) - { - ProcessCtl.process(m_processUI, m_WindowNo, parameterPanel, m_pi, null); - dispose(); - } - - else if (e.getSource() == southPanel.getCancelButton()) - dispose(); - } // actionPerformed - -} // ProcessDialog diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameter.java b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameter.java deleted file mode 100644 index d2ed7d0e9d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameter.java +++ /dev/null @@ -1,573 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.beans.VetoableChangeListener; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.Box; -import javax.swing.JLabel; - -import org.compiere.grid.ed.VEditor; -import org.compiere.grid.ed.VEditorFactory; -import org.compiere.model.GridField; -import org.compiere.model.GridFieldVO; -import org.compiere.model.MClient; -import org.compiere.model.MPInstancePara; -import org.compiere.model.MProcess; -import org.compiere.process.ProcessInfo; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; - -/** - * Parameter Dialog. - * - called from ProcessCtl - * - checks, if parameters exist and inquires and saves them - * - * @author Jorg Janke - * @version $Id: ProcessParameter.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class ProcessParameter extends CDialog - implements ActionListener, VetoableChangeListener -{ - /** - * - */ - private static final long serialVersionUID = 5813968036015697042L; - - /** - * Dynamic generated Parameter Dialog screen. - * Called from ProcessCtl.process - * - * @param frame frame - * @param WindowNo window - * @param pi process info - */ - public ProcessParameter (Frame frame, int WindowNo, ProcessInfo pi) - { - super(frame, pi.getTitle(), true); - m_frame = frame; - try - { - jbInit(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, ex.getMessage()); - } - // - m_WindowNo = WindowNo; - m_processInfo = pi; - - // TODO: set m_AD_Window_ID, is AD_Window_ID of window below this dialog - // - } // ProcessParameter - - private Frame m_frame; - private int m_WindowNo; - // AD_Window of window below this dialog in case show parameter dialog panel - private int m_AD_Window_ID; - private ProcessInfo m_processInfo; - private boolean m_isOK = false; - /** Logger */ - private static CLogger log = CLogger.getCLogger(ProcessParameter.class); - // - private GridBagConstraints gbc = new GridBagConstraints(); - private Insets nullInset = new Insets(0,0,0,0); - private Insets labelInset = new Insets(2,12,2,0); // top,left,bottom,right - private Insets fieldInset = new Insets(2,5,2,0); // top,left,bottom,right - private Insets fieldInsetRight = new Insets(2,5,2,12); // top,left,bottom,right - private int m_line = 0; - // - private ArrayList m_vEditors = new ArrayList(); - private ArrayList m_vEditors2 = new ArrayList(); // for ranges - private ArrayList m_mFields = new ArrayList(); - private ArrayList m_mFields2 = new ArrayList(); - // - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel centerPanel = new CPanel(); - private GridBagLayout centerLayout = new GridBagLayout(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - - /** - * Static Layout - * @throws Exception - */ - void jbInit() throws Exception - { - mainPanel.setLayout(mainLayout); - centerPanel.setLayout(centerLayout); - this.getContentPane().add(mainPanel); - mainPanel.add(centerPanel, BorderLayout.CENTER); - mainPanel.add(confirmPanel, BorderLayout.SOUTH); - confirmPanel.addActionListener(this); - } // jbInit - - /** - * Dispose - */ - public void dispose() - { - m_vEditors.clear(); - m_vEditors2.clear(); - m_mFields.clear(); - m_mFields2.clear(); - this.removeAll(); - super.dispose(); - } // dispose - - /** - * Read Fields to display - * @return true if loaded OK - */ - public boolean initDialog() - { - log.config(""); - - // Prepare panel - gbc.anchor = GridBagConstraints.NORTHWEST; - gbc.weightx = 0; - gbc.weighty = 0; - gbc.gridy = m_line++; - gbc.gridx = 0; - gbc.gridwidth = 1; - gbc.insets = nullInset; - gbc.fill = GridBagConstraints.HORIZONTAL; - centerPanel.add(Box.createVerticalStrut(10), gbc); // top gap 10+2=12 - - // ASP - MClient client = MClient.get(Env.getCtx()); - String ASPFilter = ""; - if (client.isUseASP()) - ASPFilter = - " AND ( p.AD_Process_Para_ID IN ( " - // Just ASP subscribed process parameters for client " - + " SELECT pp.AD_Process_Para_ID " - + " FROM ASP_Process_Para pp, ASP_Process p, ASP_Level l, ASP_ClientLevel cl " - + " WHERE p.ASP_Level_ID = l.ASP_Level_ID " - + " AND cl.AD_Client_ID = " + client.getAD_Client_ID() - + " AND cl.ASP_Level_ID = l.ASP_Level_ID " - + " AND pp.ASP_Process_ID = p.ASP_Process_ID " - + " AND pp.IsActive = 'Y' " - + " AND p.IsActive = 'Y' " - + " AND l.IsActive = 'Y' " - + " AND cl.IsActive = 'Y' " - + " AND pp.ASP_Status = 'S') " // Show - + " OR p.AD_Process_Para_ID IN ( " - // + show ASP exceptions for client - + " SELECT AD_Process_Para_ID " - + " FROM ASP_ClientException ce " - + " WHERE ce.AD_Client_ID = " + client.getAD_Client_ID() - + " AND ce.IsActive = 'Y' " - + " AND ce.AD_Process_Para_ID IS NOT NULL " - + " AND ce.AD_Tab_ID IS NULL " - + " AND ce.AD_Field_ID IS NULL " - + " AND ce.ASP_Status = 'S') " // Show - + " ) " - + " AND p.AD_Process_Para_ID NOT IN ( " - // minus hide ASP exceptions for client - + " SELECT AD_Process_Para_ID " - + " FROM ASP_ClientException ce " - + " WHERE ce.AD_Client_ID = " + client.getAD_Client_ID() - + " AND ce.IsActive = 'Y' " - + " AND ce.AD_Process_Para_ID IS NOT NULL " - + " AND ce.AD_Tab_ID IS NULL " - + " AND ce.AD_Field_ID IS NULL " - + " AND ce.ASP_Status = 'H')"; // Hide - // - String sql = null; - if (Env.isBaseLanguage(Env.getCtx(), "AD_Process_Para")) - sql = "SELECT p.Name, p.Description, p.Help, " - + "p.AD_Reference_ID, p.AD_Process_Para_ID, " - + "p.FieldLength, p.IsMandatory, p.IsRange, p.ColumnName, p.ReadOnlyLogic, p.DisplayLogic, p.IsEncrypted, " - + "p.DefaultValue, p.DefaultValue2, p.VFormat, p.ValueMin, p.ValueMax, " - + "p.SeqNo, p.AD_Reference_Value_ID, vr.Code AS ValidationCode " - + "FROM AD_Process_Para p" - + " LEFT OUTER JOIN AD_Val_Rule vr ON (p.AD_Val_Rule_ID=vr.AD_Val_Rule_ID) " - + "WHERE p.AD_Process_ID=?" // 1 - + " AND p.IsActive='Y' " - + ASPFilter + " ORDER BY SeqNo"; - else - sql = "SELECT t.Name, t.Description, t.Help, " - + "p.AD_Reference_ID, p.AD_Process_Para_ID, " - + "p.FieldLength, p.IsMandatory, p.IsRange, p.ColumnName, p.ReadOnlyLogic, p.DisplayLogic, p.IsEncrypted, " - + "p.DefaultValue, p.DefaultValue2, p.VFormat, p.ValueMin, p.ValueMax, " - + "p.SeqNo, p.AD_Reference_Value_ID, vr.Code AS ValidationCode " - + "FROM AD_Process_Para p" - + " INNER JOIN AD_Process_Para_Trl t ON (p.AD_Process_Para_ID=t.AD_Process_Para_ID)" - + " LEFT OUTER JOIN AD_Val_Rule vr ON (p.AD_Val_Rule_ID=vr.AD_Val_Rule_ID) " - + "WHERE p.AD_Process_ID=?" // 1 - + " AND t.AD_Language='" + Env.getAD_Language(Env.getCtx()) + "'" - + " AND p.IsActive='Y' " - + ASPFilter + " ORDER BY SeqNo"; - - // Create Fields - boolean hasFields = false; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_processInfo.getAD_Process_ID()); - rs = pstmt.executeQuery(); - while (rs.next()) - { - hasFields = true; - createField (rs); - } - } - catch(SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - // both vectors the same? - if (m_mFields.size() != m_mFields2.size() - || m_mFields.size() != m_vEditors.size() - || m_mFields2.size() != m_vEditors2.size()) - log.log(Level.SEVERE, "View & Model vector size is different"); - - // clean up - if (hasFields) - { - gbc.gridy = m_line++; - centerPanel.add(Box.createVerticalStrut(10), gbc); // bottom gap - gbc.gridx = 3; - centerPanel.add(Box.createHorizontalStrut(12), gbc); // right gap - AEnv.positionCenterWindow(m_frame, this); - } - else - dispose(); - return hasFields; - } // initDialog - - - /** - * Create Field. - * - creates Fields and adds it to m_mFields list - * - creates Editor and adds it to m_vEditors list - * Handeles Ranges by adding additional mField/vEditor. - *

    - * mFields are used for default value and mandatory checking; - * vEditors are used to retrieve the value (no data binding) - * - * @param rs result set - */ - private void createField (ResultSet rs) - { - // Create Field - GridFieldVO voF = GridFieldVO.createParameter(Env.getCtx(), m_WindowNo, m_processInfo.getAD_Process_ID(), m_AD_Window_ID, 0, rs); - GridField mField = new GridField (voF); - m_mFields.add(mField); // add to Fields - - // Label Preparation - gbc.gridy = m_line++; - gbc.gridwidth = 1; - gbc.fill = GridBagConstraints.HORIZONTAL; // required for right justified - gbc.gridx = 0; - gbc.weightx = 0; - JLabel label = VEditorFactory.getLabel(mField); - if (label == null) - { - gbc.insets = nullInset; - centerPanel.add(Box.createHorizontalStrut(12), gbc); // left gap - } - else - { - gbc.insets = labelInset; - centerPanel.add(label, gbc); - } - - // Field Preparation - gbc.insets = fieldInset; - gbc.fill = GridBagConstraints.HORIZONTAL; - gbc.gridwidth = 1; - gbc.gridx = 1; - gbc.weightx = 1; - - // The Editor - VEditor vEditor = VEditorFactory.getEditor(mField, false); - vEditor.addVetoableChangeListener(this); - // MField => VEditor - New Field value to be updated to editor - mField.addPropertyChangeListener(vEditor); - // Set Default - Object defaultObject = mField.getDefaultForPanel(); - mField.setValue (defaultObject, true); - // - centerPanel.add ((Component)vEditor, gbc); - m_vEditors.add (vEditor); // add to Editors - // - if (voF.isRange) - { - // To Label - gbc.gridx = 2; - gbc.weightx = 0; - gbc.fill = GridBagConstraints.NONE; - centerPanel.add (new JLabel(" - "), gbc); - // To Field - gbc.gridx = 3; - gbc.insets = fieldInsetRight; - gbc.weightx = 1; - gbc.fill = GridBagConstraints.HORIZONTAL; - gbc.anchor = GridBagConstraints.WEST; - - // - GridFieldVO voF2 = GridFieldVO.createParameter(voF); - GridField mField2 = new GridField (voF2); - m_mFields2.add (mField2); - // The Editor - VEditor vEditor2 = VEditorFactory.getEditor(mField2, false); - // New Field value to be updated to editor - mField2.addPropertyChangeListener(vEditor2); - // Set Default - Object defaultObject2 = mField2.getDefaultForPanel(); - mField2.setValue (defaultObject2, true); - // - centerPanel.add ((Component)vEditor2, gbc); - m_vEditors2.add (vEditor2); - } - else - { - m_mFields2.add (null); - m_vEditors2.add (null); - } - } // createField - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - m_isOK = false; - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - // check if saving parameters is complete - if (saveParameters()) - { - m_isOK = true; - dispose(); - } - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - dispose(); - } // actionPerformed - - /** - * Editor Listener - * @param evt Event - * @exception PropertyVetoException if the recipient wishes to roll back. - */ - public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException - { - // log.fine( "ProcessParameter.vetoableChange"); - String value = evt.getNewValue() == null ? "" : evt.getNewValue().toString(); - Env.setContext(Env.getCtx(), m_WindowNo, evt.getPropertyName(), value); - } // vetoableChange - - /** - * Save Parameter values - * @return true if parameters saved - */ - private boolean saveParameters() - { - log.config(""); - - /** - * Mandatory fields - * see - MTable.getMandatory - */ - StringBuilder sb = new StringBuilder(); - int size = m_mFields.size(); - for (int i = 0; i < size; i++) - { - GridField field = (GridField)m_mFields.get(i); - if (field.isMandatory(true)) // check context - { - VEditor vEditor = (VEditor)m_vEditors.get(i); - Object data = vEditor.getValue(); - if (data == null || data.toString().length() == 0) - { - field.setInserting (true); // set editable (i.e. updateable) otherwise deadlock - field.setError(true); - if (sb.length() > 0) - sb.append(", "); - sb.append(field.getHeader()); - } - else - field.setError(false); - // Check for Range - VEditor vEditor2 = (VEditor)m_vEditors2.get(i); - if (vEditor2 != null) - { - Object data2 = vEditor.getValue(); - GridField field2 = (GridField)m_mFields2.get(i); - if (data2 == null || data2.toString().length() == 0) - { - field.setInserting (true); // set editable (i.e. updateable) otherwise deadlock - field2.setError(true); - if (sb.length() > 0) - sb.append(", "); - sb.append(field.getHeader()); - } - else - field2.setError(false); - } // range field - } // mandatory - } // field loop - - - if (sb.length() != 0) - { - ADialog.error(m_WindowNo, this, "FillMandatory", sb.toString()); - return false; - } - - /********************************************************************** - * Save Now - */ - for (int i = 0; i < m_mFields.size(); i++) - { - // Get Values - VEditor editor = (VEditor)m_vEditors.get(i); - VEditor editor2 = (VEditor)m_vEditors2.get(i); - Object result = editor.getValue(); - Object result2 = null; - if (editor2 != null) - result2 = editor2.getValue(); - - // Don't save NULL values - if (result == null && result2 == null) - continue; - - // Create Parameter - MPInstancePara para = new MPInstancePara (Env.getCtx(), m_processInfo.getAD_PInstance_ID(), i); - GridField mField = (GridField)m_mFields.get(i); - para.setParameterName(mField.getColumnName()); - - // Date - if (result instanceof Timestamp || result2 instanceof Timestamp) - { - para.setP_Date((Timestamp)result); - if (editor2 != null && result2 != null) - para.setP_Date_To((Timestamp)result2); - } - // Integer - else if (result instanceof Integer || result2 instanceof Integer) - { - if (result != null) - { - Integer ii = (Integer)result; - para.setP_Number(ii.intValue()); - } - if (editor2 != null && result2 != null) - { - Integer ii = (Integer)result2; - para.setP_Number_To(ii.intValue()); - } - } - // BigDecimal - else if (result instanceof BigDecimal || result2 instanceof BigDecimal) - { - para.setP_Number ((BigDecimal)result); - if (editor2 != null && result2 != null) - para.setP_Number_To ((BigDecimal)result2); - } - // Boolean - else if (result instanceof Boolean) - { - Boolean bb = (Boolean)result; - String value = bb.booleanValue() ? "Y" : "N"; - para.setP_String (value); - // to does not make sense - } - // String - else - { - if (result != null) - para.setP_String (result.toString()); - if (editor2 != null && result2 != null) - para.setP_String_To (result2.toString()); - } - - // Info - para.setInfo (editor.getDisplay()); - if (editor2 != null) - para.setInfo_To (editor2.getDisplay()); - // - para.saveEx(); - if (log.isLoggable(Level.FINE)) log.fine(para.toString()); - } // for every parameter - - return true; - } // saveParameters - - /** - * Is everything OK? - * @return true if parameters saved correctly - */ - public boolean isOK() - { - return m_isOK; - } // isOK - - public void setVisible(boolean b) - { - MProcess m_process = new MProcess(Env.getCtx(), - m_processInfo.getAD_Process_ID(), null); - if(m_process.getShowHelp() != null && MProcess.SHOWHELP_RunSilently_TakeDefaults.equals(m_process.getShowHelp())) - { - // It is defined as a silent process - if(saveParameters()) - { - m_isOK = true; - dispose(); - } - } - else - { - // Not a silent process - super.setVisible(b); - } - } -} // ProcessParameter diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameterPanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameterPanel.java deleted file mode 100644 index f23308b744..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameterPanel.java +++ /dev/null @@ -1,723 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.Window; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.beans.VetoableChangeListener; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.Box; -import javax.swing.JLabel; - -import org.adempiere.exceptions.DBException; -import org.compiere.grid.ed.VEditor; -import org.compiere.grid.ed.VEditorFactory; -import org.compiere.model.GridField; -import org.compiere.model.GridFieldVO; -import org.compiere.model.MClient; -import org.compiere.model.MLookup; -import org.compiere.model.MPInstance; -import org.compiere.model.MPInstancePara; -import org.compiere.process.ProcessInfo; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Process Parameter Panel, based on existing ProcessParameter dialog. - * - Embedded in ProcessDialog - * - checks, if parameters exist and inquires and saves them - * - * @author Low Heng Sin - * @author Juan David Arboleda (arboleda), GlobalQSS, [ 1795398 ] Process - * Parameter: add display and readonly logic - * @author Teo Sarca, www.arhipac.ro - *

  • BF [ 2548216 ] Process Param Panel is not showing any parameter if error - * @version 2006-12-01 - */ -public class ProcessParameterPanel extends CPanel implements VetoableChangeListener, IProcessParameter { - - /** - * - */ - private static final long serialVersionUID = -8583999032745045111L; - - /** - * Dynamic generated Parameter panel. - * @param WindowNo window - * @param pi process info - */ - public ProcessParameterPanel(int WindowNo, ProcessInfo pi) - { - try - { - jbInit(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, ex.getMessage()); - } - // - m_WindowNo = WindowNo; - m_processInfo = pi; - // TODO: set m_AD_Window_ID, is AD_Window_ID of window below this dialog - // - } // ProcessParameterPanel - - private int m_WindowNo; - private ProcessInfo m_processInfo; - // AD_Window of window below this dialog in case show parameter dialog panel - private int m_AD_Window_ID; - /** Logger */ - private static CLogger log = CLogger.getCLogger(ProcessParameterPanel.class); - // - private GridBagConstraints gbc = new GridBagConstraints(); - private Insets nullInset = new Insets(0,0,0,0); - private Insets labelInset = new Insets(2,12,2,0); // top,left,bottom,right - private Insets fieldInset = new Insets(2,5,2,0); // top,left,bottom,right - private Insets fieldInsetRight = new Insets(2,5,2,12); // top,left,bottom,right - private int m_line = 0; - // - private ArrayList m_vEditors = new ArrayList(); - private ArrayList m_vEditors2 = new ArrayList(); // for ranges - private ArrayList m_mFields = new ArrayList(); - private ArrayList m_mFields2 = new ArrayList(); - private ArrayList m_separators = new ArrayList(); - private ArrayList m_labels = new ArrayList(); - // - private BorderLayout mainLayout = new BorderLayout(); - private CPanel centerPanel = new CPanel(); - private GridBagLayout centerLayout = new GridBagLayout(); - private Window m_win = null; - - /** - * Static Layout - * @throws Exception - */ - void jbInit() throws Exception - { - this.setLayout(mainLayout); - centerPanel.setLayout(centerLayout); - this.add(centerPanel, BorderLayout.CENTER); - } // jbInit - - /** - * Dispose - */ - public void dispose() - { - m_vEditors.clear(); - m_vEditors2.clear(); - m_mFields.clear(); - m_mFields2.clear(); - m_separators.clear(); - m_labels.clear(); - this.removeAll(); - } // dispose - - /** - * Read Fields to display - * @return true if loaded OK - */ - public boolean init() - { - log.config(""); - - // Prepare panel - gbc.anchor = GridBagConstraints.NORTHWEST; - gbc.weightx = 0; - gbc.weighty = 0; - gbc.gridy = m_line++; - gbc.gridx = 0; - gbc.gridwidth = 1; - gbc.insets = nullInset; - gbc.fill = GridBagConstraints.HORIZONTAL; - centerPanel.add(Box.createVerticalStrut(10), gbc); // top gap 10+2=12 - - // ASP - MClient client = MClient.get(Env.getCtx()); - String ASPFilter = ""; - if (client.isUseASP()) - ASPFilter = - " AND ( p.AD_Process_Para_ID IN ( " - // Just ASP subscribed process parameters for client " - + " SELECT pp.AD_Process_Para_ID " - + " FROM ASP_Process_Para pp, ASP_Process p, ASP_Level l, ASP_ClientLevel cl " - + " WHERE p.ASP_Level_ID = l.ASP_Level_ID " - + " AND cl.AD_Client_ID = " + client.getAD_Client_ID() - + " AND cl.ASP_Level_ID = l.ASP_Level_ID " - + " AND pp.ASP_Process_ID = p.ASP_Process_ID " - + " AND pp.IsActive = 'Y' " - + " AND p.IsActive = 'Y' " - + " AND l.IsActive = 'Y' " - + " AND cl.IsActive = 'Y' " - + " AND pp.ASP_Status = 'S') " // Show - + " OR p.AD_Process_Para_ID IN ( " - // + show ASP exceptions for client - + " SELECT AD_Process_Para_ID " - + " FROM ASP_ClientException ce " - + " WHERE ce.AD_Client_ID = " + client.getAD_Client_ID() - + " AND ce.IsActive = 'Y' " - + " AND ce.AD_Process_Para_ID IS NOT NULL " - + " AND ce.AD_Tab_ID IS NULL " - + " AND ce.AD_Field_ID IS NULL " - + " AND ce.ASP_Status = 'S') " // Show - + " ) " - + " AND p.AD_Process_Para_ID NOT IN ( " - // minus hide ASP exceptions for client - + " SELECT AD_Process_Para_ID " - + " FROM ASP_ClientException ce " - + " WHERE ce.AD_Client_ID = " + client.getAD_Client_ID() - + " AND ce.IsActive = 'Y' " - + " AND ce.AD_Process_Para_ID IS NOT NULL " - + " AND ce.AD_Tab_ID IS NULL " - + " AND ce.AD_Field_ID IS NULL " - + " AND ce.ASP_Status = 'H')"; // Hide - // - String sql = null; - if (Env.isBaseLanguage(Env.getCtx(), "AD_Process_Para")) - sql = "SELECT p.Name, p.Description, p.Help, " - + "p.AD_Reference_ID, p.AD_Process_Para_ID, " - + "p.FieldLength, p.IsMandatory, p.IsRange, p.ColumnName, " - + "p.DefaultValue, p.DefaultValue2, p.VFormat, p.ValueMin, p.ValueMax, " - + "p.SeqNo, p.AD_Reference_Value_ID, vr.Code AS ValidationCode, p.ReadOnlyLogic, p.DisplayLogic, p.IsEncrypted, NULL AS FormatPattern, p.MandatoryLogic, p.Placeholder, p.Placeholder2 " - + "FROM AD_Process_Para p" - + " LEFT OUTER JOIN AD_Val_Rule vr ON (p.AD_Val_Rule_ID=vr.AD_Val_Rule_ID) " - + "WHERE p.AD_Process_ID=?" // 1 - + " AND p.IsActive='Y' " - + ASPFilter + " ORDER BY SeqNo"; - else - sql = "SELECT t.Name, t.Description, t.Help, " - + "p.AD_Reference_ID, p.AD_Process_Para_ID, " - + "p.FieldLength, p.IsMandatory, p.IsRange, p.ColumnName, " - + "p.DefaultValue, p.DefaultValue2, p.VFormat, p.ValueMin, p.ValueMax, " - + "p.SeqNo, p.AD_Reference_Value_ID, vr.Code AS ValidationCode, p.ReadOnlyLogic, p.DisplayLogic, p.IsEncrypted, NULL AS FormatPattern, p.MandatoryLogic, t.Placeholder, p.Placeholder2 " - + "FROM AD_Process_Para p" - + " INNER JOIN AD_Process_Para_Trl t ON (p.AD_Process_Para_ID=t.AD_Process_Para_ID)" - + " LEFT OUTER JOIN AD_Val_Rule vr ON (p.AD_Val_Rule_ID=vr.AD_Val_Rule_ID) " - + "WHERE p.AD_Process_ID=?" // 1 - + " AND t.AD_Language='" + Env.getAD_Language(Env.getCtx()) + "'" - + " AND p.IsActive='Y' " - + ASPFilter + " ORDER BY SeqNo"; - - // Create Fields - boolean hasFields = false; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_processInfo.getAD_Process_ID()); - rs = pstmt.executeQuery(); - while (rs.next()) - { - hasFields = true; - createField (rs); - } - } - catch(SQLException e) - { - throw new DBException(e, sql); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - // both vectors the same? - if (m_mFields.size() != m_mFields2.size() - || m_mFields.size() != m_vEditors.size() - || m_mFields2.size() != m_vEditors2.size()) - log.log(Level.SEVERE, "View & Model vector size is different"); - - // clean up - if (hasFields) - { - gbc.gridy = m_line++; - centerPanel.add(Box.createVerticalStrut(10), gbc); // bottom gap - gbc.gridx = 3; - centerPanel.add(Box.createHorizontalStrut(12), gbc); // right gap - dynamicDisplay(); - } - else - dispose(); - return hasFields; - } // init - - /** - * Create Field. - * - creates Fields and adds it to m_mFields list - * - creates Editor and adds it to m_vEditors list - * Handles Ranges by adding additional mField/vEditor. - *

    - * mFields are used for default value and mandatory checking; - * vEditors are used to retrieve the value (no data binding) - * - * @param rs result set - */ - private void createField (ResultSet rs) - { - // Create Field - GridFieldVO voF = GridFieldVO.createParameter(Env.getCtx(), m_WindowNo, m_processInfo.getAD_Process_ID(), m_AD_Window_ID, m_processInfo.getAD_InfoWindow_ID(),rs); - GridField mField = new GridField (voF); - m_mFields.add(mField); // add to Fields - - // Label Preparation - gbc.gridy = m_line++; - gbc.gridwidth = 1; - gbc.fill = GridBagConstraints.HORIZONTAL; // required for right justified - gbc.gridx = 0; - gbc.weightx = 0; - JLabel label = VEditorFactory.getLabel(mField); - if (label == null) - { - gbc.insets = nullInset; - centerPanel.add(Box.createHorizontalStrut(12), gbc); // left gap - } - else - { - gbc.insets = labelInset; - centerPanel.add(label, gbc); - } - m_labels.add(label); - - // Field Preparation - gbc.insets = fieldInset; - gbc.fill = GridBagConstraints.HORIZONTAL; - gbc.gridwidth = 1; - gbc.gridx = 1; - gbc.weightx = 1; - - // The Editor - VEditor vEditor = VEditorFactory.getEditor(mField, false); - vEditor.addVetoableChangeListener(this); - // MField => VEditor - New Field value to be updated to editor - mField.addPropertyChangeListener(vEditor); - // - centerPanel.add ((Component)vEditor, gbc); - m_vEditors.add (vEditor); // add to Editors - // Set Default - Object defaultObject = mField.getDefaultForPanel(); - mField.setValue (defaultObject, true); - // - if (voF.isRange) - { - // To Label - gbc.gridx = 2; - gbc.weightx = 0; - gbc.fill = GridBagConstraints.NONE; - JLabel dash = new JLabel(" - "); - centerPanel.add (dash, gbc); - m_separators.add(dash); - // To Field - gbc.gridx = 3; - gbc.insets = fieldInsetRight; - gbc.weightx = 1; - gbc.fill = GridBagConstraints.HORIZONTAL; - gbc.anchor = GridBagConstraints.WEST; - // - GridFieldVO voF2 = GridFieldVO.createParameter(voF); - GridField mField2 = new GridField (voF2); - m_mFields2.add (mField2); - // The Editor - VEditor vEditor2 = VEditorFactory.getEditor(mField2, false); - // New Field value to be updated to editor - mField2.addPropertyChangeListener(vEditor2); - // - centerPanel.add ((Component)vEditor2, gbc); - m_vEditors2.add (vEditor2); - // Set Default - Object defaultObject2 = mField2.getDefaultForPanel(); - mField2.setValue (defaultObject2, true); - } - else - { - m_separators.add(null); - m_mFields2.add (null); - m_vEditors2.add (null); - } - } // createField - - /** - * Editor Listener - * @param evt Event - * @exception PropertyVetoException if the recipient wishes to roll back. - */ - public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException - { - // log.fine( "ProcessParameterPanel.vetoableChange"); - if (evt.getSource() instanceof VEditor) { - GridField changedField = ((VEditor) evt.getSource()).getField(); - if (changedField != null) { - processDependencies (changedField); - // future processCallout (changedField); - } - } - processNewValue(evt.getNewValue(), evt.getPropertyName()); - } // vetoableChange - - /** - * Evaluate Dependencies - * @param changedField changed field - */ - private void processDependencies (GridField changedField) - { - String columnName = changedField.getColumnName(); - - for (GridField field : m_mFields) { - if (field == null || field == changedField) - continue; - verifyChangedField(field, columnName); - } - for (GridField field : m_mFields2) { - if (field == null || field == changedField) - continue; - verifyChangedField(field, columnName); - } - } // processDependencies - - private void verifyChangedField(GridField field, String columnName) { - ArrayList list = field.getDependentOn(); - if (list.contains(columnName)) { - if (field.getLookup() instanceof MLookup) - { - MLookup mLookup = (MLookup)field.getLookup(); - // if the lookup is dynamic (i.e. contains this columnName as variable) - if (mLookup.getValidation().indexOf("@"+columnName+"@") != -1) - { - if (log.isLoggable(Level.FINE)) log.fine(columnName + " changed - " - + field.getColumnName() + " set to null"); - // invalidate current selection - field.setValue(null, true); - } - } - } - } - - private void processNewValue(Object value, String name) { - if (value == null) - value = new String(""); - - if (value instanceof String) - Env.setContext(Env.getCtx(), m_WindowNo, name, (String) value); - else if (value instanceof Integer) - Env.setContext(Env.getCtx(), m_WindowNo, name, ((Integer) value) - .intValue()); - else if (value instanceof Boolean) - Env.setContext(Env.getCtx(), m_WindowNo, name, ((Boolean) value) - .booleanValue()); - else if (value instanceof Timestamp) - Env.setContext(Env.getCtx(), m_WindowNo, name, (Timestamp) value); - else - Env.setContext(Env.getCtx(), m_WindowNo, name, value.toString()); - - dynamicDisplay(); - } - - /** - * Dynamic Display. - * - **/ - public void dynamicDisplay() { - Component[] comps = centerPanel.getComponents(); - boolean changedSize = false; - for (int i = 0; i < comps.length; i++) { - Component comp = comps[i]; - if (comp instanceof CLabel) - continue; - String columnName = comp.getName(); - - if (columnName != null && columnName.length() > 0) { - int index = getIndex(columnName); - if (m_mFields.get(index) != null) { - if (m_mFields.get(index).isDisplayed(true)) { // check - // context - if (!comp.isVisible()) { - changedSize = true; - comp.setVisible(true); // visibility - if (m_labels.get(index) != null) - m_labels.get(index).setVisible(true); - if (m_mFields.get(index).getVO().isRange) - m_separators.get(index).setText(" - "); - } - boolean rw = m_mFields.get(index).isEditablePara(true); // r/w - check if field is Editable - m_vEditors.get(index).setReadWrite(rw); - if (m_mFields.get(index).getVO().isRange) - m_vEditors2.get(index).setReadWrite(rw); - } else { - if (comp.isVisible()) { - changedSize = true; - comp.setVisible(false); - if (m_labels.get(index) != null) - m_labels.get(index).setVisible(false); - if (m_mFields.get(index).getVO().isRange) - m_separators.get(index).setText(""); - } - } - } - } - } - if (m_win != null && changedSize) { - m_win.pack(); - m_win.setLocationRelativeTo(null); - } - } // Dynamic Display. - - /** - * getIndex. Get m_mFields index from columnName - * - * @param columnName - * @return int - **/ - private int getIndex(String columnName) { - - for (int i = 0; i < m_mFields.size(); i++) { - if (m_mFields.get(i).getColumnName().equals(columnName)) { - return i; - } - } - return 0; - } // getIndex - - /* (non-Javadoc) - * @see org.compiere.apps.ProcessParameters#saveParameters() - */ - public boolean saveParameters() - { - log.config(""); - - /** - * Mandatory fields - * see - MTable.getMandatory - */ - StringBuilder sb = new StringBuilder(); - int size = m_mFields.size(); - for (int i = 0; i < size; i++) - { - GridField field = (GridField)m_mFields.get(i); - if (field.isMandatory(true)) // check context - { - VEditor vEditor = (VEditor)m_vEditors.get(i); - Object data = vEditor.getValue(); - if (data == null || data.toString().length() == 0) - { - field.setInserting (true); // set editable (i.e. updateable) otherwise deadlock - field.setError(true); - if (sb.length() > 0) - sb.append(", "); - sb.append(field.getHeader()); - if (m_vEditors2.get(i) != null) // is a range - sb.append(" (").append(Msg.getMsg(Env.getCtx(), "From")).append(")"); - } - else - field.setError(false); - // Check for Range - VEditor vEditor2 = (VEditor)m_vEditors2.get(i); - if (vEditor2 != null) - { - Object data2 = vEditor2.getValue(); - GridField field2 = (GridField)m_mFields2.get(i); - if (data2 == null || data2.toString().length() == 0) - { - field2.setInserting (true); // set editable (i.e. updateable) otherwise deadlock - field2.setError(true); - if (sb.length() > 0) - sb.append(", "); - sb.append(field2.getHeader()); - sb.append(" (").append(Msg.getMsg(Env.getCtx(), "To")).append(")"); - } - else - field2.setError(false); - } // range field - } // mandatory - } // field loop - - - if (sb.length() != 0) - { - ADialog.error(m_WindowNo, this, "FillMandatory", sb.toString()); - return false; - } - - /********************************************************************** - * Save Now - */ - for (int i = 0; i < m_mFields.size(); i++) - { - // Get Values - VEditor editor = (VEditor)m_vEditors.get(i); - VEditor editor2 = (VEditor)m_vEditors2.get(i); - Object result = editor.getValue(); - Object result2 = null; - if (editor2 != null) - result2 = editor2.getValue(); - - // Create Parameter - MPInstancePara para = new MPInstancePara (Env.getCtx(), m_processInfo.getAD_PInstance_ID(), i); - GridField mField = (GridField)m_mFields.get(i); - para.setParameterName(mField.getColumnName()); - - // Date - if (result instanceof Timestamp || result2 instanceof Timestamp) - { - para.setP_Date((Timestamp)result); - if (editor2 != null && result2 != null) - para.setP_Date_To((Timestamp)result2); - } - // Integer - else if (result instanceof Integer || result2 instanceof Integer) - { - if (result != null) - { - Integer ii = (Integer)result; - para.setP_Number(ii.intValue()); - } - if (editor2 != null && result2 != null) - { - Integer ii = (Integer)result2; - para.setP_Number_To(ii.intValue()); - } - } - // BigDecimal - else if (result instanceof BigDecimal || result2 instanceof BigDecimal) - { - para.setP_Number ((BigDecimal)result); - if (editor2 != null && result2 != null) - para.setP_Number_To ((BigDecimal)result2); - } - // Boolean - else if (result instanceof Boolean) - { - Boolean bb = (Boolean)result; - String value = bb.booleanValue() ? "Y" : "N"; - para.setP_String (value); - // to does not make sense - } - // String - else - { - if (result != null) - para.setP_String (result.toString()); - if (editor2 != null && result2 != null) - para.setP_String_To (result2.toString()); - } - - // Info - para.setInfo (editor.getDisplay()); - if (editor2 != null) - para.setInfo_To (editor2.getDisplay()); - // - para.saveEx(); - if (log.isLoggable(Level.FINE)) log.fine(para.toString()); - } // for every parameter - - return true; - } // saveParameters - - /* - * load parameters from saved instance - */ - public boolean loadParameters(MPInstance instance) - { - log.config(""); - - MPInstancePara[] params = instance.getParameters(); - for (int j = 0; j < m_mFields.size(); j++) - { - GridField mField = (GridField)m_mFields.get(j); - - // Get Values - VEditor editor = (VEditor)m_vEditors.get(j); - VEditor editor2 = (VEditor)m_vEditors2.get(j); - - editor.setValue(null); - if (editor2 != null) - editor2.setValue(null); - - for ( int i = 0; i - * Change log: - *

      - *
    • 2007-02-26 - teo_sarca - [ 1666598 ] RecordInfo shows ColumnName instead of name - *
    - * - * @author Jorg Janke - * @version $Id: RecordInfo.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class RecordInfo extends CDialog -{ - /** - * - */ - private static final long serialVersionUID = 8984246906639442417L; - - /** - * Record Info - * @param owner owner - * @param title title - * @param dse data status event - */ - public RecordInfo (Frame owner, String title, DataStatusEvent dse) - { - super (owner, title, true); - try - { - jbInit ( dynInit(dse, title) ); - } - catch (Exception e) - { - log.log(Level.SEVERE, "", e); - } - AEnv.positionCenterWindow (owner, this); - } // RecordInfo - - - private CPanel mainPanel = new CPanel (new BorderLayout(0,0)); - @SuppressWarnings("unused") - private CPanel northPanel = new CPanel (); - private CScrollPane scrollPane = new CScrollPane (); - private VTable table = new VTable (); - private ConfirmPanel confirmPanel = new ConfirmPanel (false); - - /** Logger */ - protected CLogger log = CLogger.getCLogger(getClass()); - /** The Data */ - private Vector> m_data = new Vector>(); - /** Info */ - private StringBuffer m_info = new StringBuffer(); - - - - /** Date Time Format */ - private SimpleDateFormat m_dateTimeFormat = DisplayType.getDateFormat - (DisplayType.DateTime, Env.getLanguage(Env.getCtx())); - /** Date Format */ - private SimpleDateFormat m_dateFormat = DisplayType.getDateFormat - (DisplayType.DateTime, Env.getLanguage(Env.getCtx())); - /** Number Format */ - private DecimalFormat m_numberFormat = DisplayType.getNumberFormat - (DisplayType.Number, Env.getLanguage(Env.getCtx())); - /** Amount Format */ - private DecimalFormat m_amtFormat = DisplayType.getNumberFormat - (DisplayType.Amount, Env.getLanguage(Env.getCtx())); - /** Number Format */ - private DecimalFormat m_intFormat = DisplayType.getNumberFormat - (DisplayType.Integer, Env.getLanguage(Env.getCtx())); - - /** - * Static Layout - * @throws Exception - */ - private void jbInit (boolean showTable) throws Exception - { - getContentPane().add(mainPanel); - CTextArea info = new CTextArea(m_info.toString()); - info.setReadWrite(false); - info.setOpaque(false); // transparent - info.setForeground(Color.blue); - info.setBorder(null); - // - if (showTable) - { - mainPanel.add (info, BorderLayout.NORTH); - mainPanel.add (scrollPane, BorderLayout.CENTER); - scrollPane.getViewport().add(table); - scrollPane.setPreferredSize(new Dimension(500,100)); - } - else - { - info.setPreferredSize(new Dimension(400,75)); - mainPanel.add (info, BorderLayout.CENTER); - } - // - mainPanel.add (confirmPanel, BorderLayout.SOUTH); - confirmPanel.addActionListener(this); - } // jbInit - - - /** - * Dynamic Init - * @param dse data status event - * @param title title - * @return true if table initialized - */ - private boolean dynInit(DataStatusEvent dse, String title) - { - if (dse.CreatedBy == null) - return false; - // Info - MUser user = MUser.get(Env.getCtx(), dse.CreatedBy.intValue()); - m_info.append(" ") - .append(Msg.translate(Env.getCtx(), "CreatedBy")) - .append(": ").append(user.getName()) - .append(" - ").append(m_dateTimeFormat.format(dse.Created)).append("\n"); - - if (!dse.Created.equals(dse.Updated) - || !dse.CreatedBy.equals(dse.UpdatedBy)) - { - if (!dse.CreatedBy.equals(dse.UpdatedBy)) - user = MUser.get(Env.getCtx(), dse.UpdatedBy.intValue()); - m_info.append(" ") - .append(Msg.translate(Env.getCtx(), "UpdatedBy")) - .append(": ").append(user.getName()) - .append(" - ").append(m_dateTimeFormat.format(dse.Updated)).append("\n"); - } - if (dse.Info != null && dse.Info.length() > 0) - m_info.append("\n ").append(dse.Info).append(""); - - //get uuid - GridTable gridTable = null; - if (dse.getSource() instanceof GridTab) - { - GridTab gridTab = (GridTab) dse.getSource(); - gridTable = gridTab.getTableModel(); - } - else if (dse.getSource() instanceof GridTable) - { - gridTable = (GridTable) dse.getSource(); - } - if (gridTable != null && dse.getCurrentRow() >= 0 && dse.getCurrentRow() < gridTable.getRowCount()) - { - PO po = gridTable.getPO(dse.getCurrentRow()); - if (po != null) { - String uuidcol = po.getUUIDColumnName(); - String uuid = po.get_ValueAsString(uuidcol); - if (!Util.isEmpty(uuid)) - m_info.append("\n ").append(uuidcol).append("=").append(uuid); - } - } - - // Title - if (dse.AD_Table_ID != 0) - { - MTable table1 = MTable.get (Env.getCtx(), dse.AD_Table_ID); - setTitle(title + " - " + table1.getName()); - } - - // Only Client Preference can view Change Log - if (!MRole.PREFERENCETYPE_Client.equals(MRole.getDefault().getPreferenceType())) - return false; - - int Record_ID = 0; - if (dse.Record_ID instanceof Integer) - Record_ID = ((Integer)dse.Record_ID).intValue(); - else - if (log.isLoggable(Level.INFO)) log.info("dynInit - Invalid Record_ID=" + dse.Record_ID); - if (Record_ID == 0) - return false; - - // Data - String sql = "SELECT AD_Column_ID, Updated, UpdatedBy, OldValue, NewValue " - + "FROM AD_ChangeLog " - + "WHERE AD_Table_ID=? AND Record_ID=? " - + "ORDER BY Updated DESC"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement (sql, null); - pstmt.setInt (1, dse.AD_Table_ID); - pstmt.setInt (2, Record_ID); - rs = pstmt.executeQuery (); - while (rs.next ()) - { - addLine (rs.getInt(1), rs.getTimestamp(2), rs.getInt(3), - rs.getString(4), rs.getString(5)); - } - } - catch (Exception e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - // - Vector columnNames = new Vector(); - columnNames.add(Msg.translate(Env.getCtx(), "Name")); - columnNames.add(Msg.translate(Env.getCtx(), "NewValue")); - columnNames.add(Msg.translate(Env.getCtx(), "OldValue")); - columnNames.add(Msg.translate(Env.getCtx(), "UpdatedBy")); - columnNames.add(Msg.translate(Env.getCtx(), "Updated")); - columnNames.add(Msg.translate(Env.getCtx(), "AD_Column_ID")); - DefaultTableModel model = new DefaultTableModel(m_data, columnNames); - table.setModel(model); - table.autoSize(false); - return true; - } // dynInit - - /** - * Add Line - * @param AD_Column_ID column - * @param Updated updated - * @param UpdatedBy user - * @param OldValue old - * @param NewValue new - */ - private void addLine (int AD_Column_ID, Timestamp Updated, int UpdatedBy, - String OldValue, String NewValue) - { - Vector line = new Vector(); - // Column - MColumn column = MColumn.get (Env.getCtx(), AD_Column_ID); - line.add(Msg.translate(Env.getCtx(), column.getColumnName())); - // - if (OldValue != null && OldValue.equals(MChangeLog.NULL)) - OldValue = null; - String showOldValue = OldValue; - if (NewValue != null && NewValue.equals(MChangeLog.NULL)) - NewValue = null; - String showNewValue = NewValue; - // - try - { - if (DisplayType.isText (column.getAD_Reference_ID ())) - ; - else if (column.getAD_Reference_ID() == DisplayType.YesNo) - { - if (OldValue != null) - { - boolean yes = OldValue.equals("true") || OldValue.equals("Y"); - showOldValue = Msg.getMsg(Env.getCtx(), yes ? "Y" : "N"); - } - if (NewValue != null) - { - boolean yes = NewValue.equals("true") || NewValue.equals("Y"); - showNewValue = Msg.getMsg(Env.getCtx(), yes ? "Y" : "N"); - } - } - else if (column.getAD_Reference_ID() == DisplayType.Amount) - { - if (OldValue != null) - showOldValue = m_amtFormat - .format (new BigDecimal (OldValue)); - if (NewValue != null) - showNewValue = m_amtFormat - .format (new BigDecimal (NewValue)); - } - else if (column.getAD_Reference_ID() == DisplayType.Integer) - { - if (OldValue != null) - showOldValue = m_intFormat.format (Integer.valueOf(OldValue)); - if (NewValue != null) - showNewValue = m_intFormat.format (Integer.valueOf(NewValue)); - } - else if (DisplayType.isNumeric (column.getAD_Reference_ID ())) - { - if (OldValue != null) - showOldValue = m_numberFormat.format (new BigDecimal (OldValue)); - if (NewValue != null) - showNewValue = m_numberFormat.format (new BigDecimal (NewValue)); - } - else if (column.getAD_Reference_ID() == DisplayType.Date) - { - if (OldValue != null) - showOldValue = m_dateFormat.format (Timestamp.valueOf (OldValue)); - if (NewValue != null) - showNewValue = m_dateFormat.format (Timestamp.valueOf (NewValue)); - } - else if (column.getAD_Reference_ID() == DisplayType.DateTime) - { - if (OldValue != null) - showOldValue = m_dateTimeFormat.format (Timestamp.valueOf (OldValue)); - if (NewValue != null) - showNewValue = m_dateTimeFormat.format (Timestamp.valueOf (NewValue)); - } - else if (DisplayType.isLookup(column.getAD_Reference_ID ())) - { - MLookup lookup = MLookupFactory.get (Env.getCtx(), 0, - AD_Column_ID, column.getAD_Reference_ID(), - Env.getLanguage(Env.getCtx()), column.getColumnName(), - column.getAD_Reference_Value_ID(), - column.isParent(), null); - if (OldValue != null) - { - Object key = OldValue; - NamePair pp = lookup.get(key); - if (pp != null) - showOldValue = pp.getName(); - } - if (NewValue != null) - { - Object key = NewValue; - NamePair pp = lookup.get(key); - if (pp != null) - showNewValue = pp.getName(); - } - } - else if (DisplayType.isLOB (column.getAD_Reference_ID ())) - ; - } - catch (Exception e) - { - log.log(Level.WARNING, OldValue + "->" + NewValue, e); - } - // - line.add(showNewValue); - line.add(showOldValue); - // UpdatedBy - MUser user = MUser.get(Env.getCtx(), UpdatedBy); - line.add(user.getName()); - // Updated - line.add(m_dateFormat.format(Updated)); - // Column Name - line.add(column.getColumnName()); - - m_data.add(line); - } // addLine - - - /** - * ActionListener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - dispose(); - } // actionPerformed - -} // RecordInfo diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ScreenShot.java b/org.adempiere.ui.swing/src/org/compiere/apps/ScreenShot.java deleted file mode 100644 index 4d26553f0c..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ScreenShot.java +++ /dev/null @@ -1,145 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.apps; - -import javax.imageio.ImageIO; -import javax.imageio.ImageWriter; -import javax.imageio.stream.ImageOutputStream; -import javax.swing.JFileChooser; - -import java.awt.AWTException; -import java.awt.Component; -import java.awt.Robot; -import java.awt.Window; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import java.util.Iterator; -import java.util.logging.Level; - -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.ExtensionFileFilter; -import org.compiere.util.Msg; - -/** - * JPEG File Utility - * - * @author Jorg Janke - * @version $Id: ScreenShot.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * - * @author jmpiloq, evenos GmbH - * @version $Id - * @see BF [ 3073316 ] - */ -public class ScreenShot -{ - /** - * Create JPEG file from window - * @param window window - * @param fileName optional file name - * @return true if created - */ - public static boolean createJPEG (Window window, String fileName) - { - BufferedImage bi = null; - - if (window == null || fileName == null) - new IllegalArgumentException("ScreenShot.createJPEG Window os NULL"); - - // Get File - File file = getJPGFile (window); - if (file == null) - return false; - if (log.isLoggable(Level.CONFIG)) log.config("File=" + file); - if (file.exists()) - file.delete(); - - // Get Writer - Iterator writers = ImageIO.getImageWritersByFormatName("jpg"); - ImageWriter writer = writers.next(); - if (writer == null) - { - log.log(Level.SEVERE, "no ImageWriter"); - return false; - } - - // Get Image - try { - Thread.sleep(1000); - bi = getImage(window); - } catch (InterruptedException ex) { - log.log(Level.SEVERE, "ex", ex); - } - - // Write Image - try - { - ImageOutputStream ios = ImageIO.createImageOutputStream (file); - writer.setOutput(ios); - writer.write(bi); - ios.flush(); - ios.close(); - - } - catch (IOException ex) - { - log.log(Level.SEVERE, "ex", ex); - return false; - } - return true; - } // createJPEG - - - /** - * Get JPEG File - * @param parent parent - * @return file - */ - protected static File getJPGFile (Component parent) - { - JFileChooser fc = new JFileChooser(); - fc.addChoosableFileFilter(new ExtensionFileFilter("jpg", Msg.getMsg(Env.getCtx(), "FileJPEG"))); - if (fc.showSaveDialog(parent) != JFileChooser.APPROVE_OPTION) - return null; - File file = fc.getSelectedFile(); - if (file == null) - return null; - String fileName = file.getAbsolutePath(); - if (!(fileName.toUpperCase().equals(".JPG") || fileName.toUpperCase().equals(".JPEG"))) - fileName += ".jpg"; - fc.setVisible(false); - return new File (fileName); - } // getFile - - /** - * Get Image of Window - * @param window window - * @return image - */ - protected static BufferedImage getImage (Window window) - { - BufferedImage bi = null; - try { - bi = new Robot().createScreenCapture(window.getBounds()); - window.paintAll(bi.createGraphics()); - } catch (AWTException ex) { - log.log(Level.SEVERE, "ex", ex); - } - return bi; - } // getImage - - /** Logger */ - private static CLogger log = CLogger.getCLogger(ScreenShot.class); -} // ScreenShot diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/Script.html b/org.adempiere.ui.swing/src/org/compiere/apps/Script.html deleted file mode 100644 index ec27d9afe3..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/Script.html +++ /dev/null @@ -1,69 +0,0 @@ - - -Adempiere Scripting Help - - - -

    Adempiere Scripting Help

    -

    Context Variables

    -

    Window context variables start with a W_ prefix.
    -Login context variables start with G_ prefix.

    - -

    Event Variables

    -
    -

    Callout:

    -
    -
      -
    • A_WindowNo
    • -
    • A_Tab
    • -
    • A_Field
    • -
    • A_Value
    • -
    • A_OldValue
    • -
    • A_Ctx
    • -
    -
    -

    Process:

    -
    -
      -
    • Process Parameters for the process start with P_ prefix, for example P_Name. If the parameter is a range then the - parameters will be P_Name1 and P_Name2
    • -
    • A_Ctx - the context
    • -
    • A_Trx - the transaction
    • -
    • A_TrxName
    • -
    • A_Record_ID
    • -
    • A_AD_Client_ID
    • -
    • A_AD_User_ID
    • -
    • A_AD_PInstance_ID
    • -
    • A_Table_ID
    • -
    -
    -

    Login validator:

    -
    -
      -
    • A_Ctx
    • -
    • A_AD_Client_ID
    • -
    • A_AD_Org_ID
    • -
    • A_AD_Role_ID
    • -
    • A_AD_User_ID
    • -
    -
    -

    Table and document model validator:

    -
    -
      -
    • A_Ctx
    • -
    • A_PO
    • -
    • A_Type
    • -
    • A_Event
    • -
    -
    -
    - -Wiki Reference: - - - diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ScriptEditor.java b/org.adempiere.ui.swing/src/org/compiere/apps/ScriptEditor.java deleted file mode 100644 index 6bc964757f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ScriptEditor.java +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.Frame; - -import org.compiere.model.Scriptlet; -import org.compiere.util.Env; - -/** - * ScriptEditor - */ -public class ScriptEditor -{ - /** - * Start ScriptEditor - * - * @param header Title - * @param script ScriptCode - * @param editable - * @return updated Script - * - * @deprecated since 3.3.1 - */ - public static String start (String header, String script, boolean editable, int WindowNo) - { - return start(null, header, script, editable, WindowNo); - } - - /** - * Start ScriptEditor - * - * @param owner - * @param header Title - * @param script ScriptCode - * @param editable - * @return updated Script - */ - public static String start (Frame owner, String header, String script, boolean editable, int WindowNo) - { - Scriptlet scr = new Scriptlet (Scriptlet.VARIABLE, script, Env.getCtx(), WindowNo); - String value = Env.getContext(Env.getCtx(), WindowNo, "Value"); - //TODO: generic editor for jsr223 script - if (value != null && value.startsWith("groovy:")) - { - GroovyEditor gv = new GroovyEditor (owner, header, script, WindowNo); - return gv.getScript(); - } - else - { - @SuppressWarnings("unused") - BeanShellEditor se = new BeanShellEditor (owner, header, scr, WindowNo); - return scr.getScript(); - } - } // start - -} // ScriptEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/StatusBar.java b/org.adempiere.ui.swing/src/org/compiere/apps/StatusBar.java deleted file mode 100644 index 725ed7b007..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/StatusBar.java +++ /dev/null @@ -1,269 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.event.MouseEvent; - -import javax.swing.BorderFactory; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.SwingConstants; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.model.DataStatusEvent; -import org.compiere.model.MRole; -import org.compiere.swing.CPanel; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Status Bar - * - * @author Jorg Janke - * @version $Id: StatusBar.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class StatusBar extends CPanel implements IStatusBar -{ - - /****************************************************************************** - * Mouse Adapter for Status Bar (statusDB) - */ - static class StatusBar_mouseAdapter extends java.awt.event.MouseAdapter - { - private StatusBar adaptee; - - /** - * Constructor - * @param adaptee adaptee - */ - StatusBar_mouseAdapter(StatusBar adaptee) - { - this.adaptee = adaptee; - } - - /** - * Click - * @param e event - */ - public void mouseClicked(MouseEvent e) - { - adaptee.mouseClicked(e); - } - } // StatusBar_mouseAdapter - - /** - * - */ - private static final long serialVersionUID = 1465783013058042860L; - - /** - * Standard Status Bar - */ - public StatusBar() - { - this(false); - } // StatusBar - - /** - * Status Bar with additional info - * @param withInfo with info - */ - public StatusBar (boolean withInfo) - { - super(); - try - { - jbInit(); - } - catch (Exception e) - {} - this.setName("statusBar"); - if (!withInfo) - infoLine.setVisible(false); - } // StatusBar - - private BorderLayout mainLayout = new BorderLayout(); - private JLabel statusLine = new JLabel(); - private JLabel statusDB = new JLabel(); - private JLabel infoLine = new JLabel(); - // - private boolean mt_error; - private String mt_text; - // - private String m_text; - private DataStatusEvent m_dse = null; - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - statusLine.setBorder(BorderFactory.createEtchedBorder()); - statusLine.setText("statusLine"); - statusLine.setOpaque(false); - statusDB.setForeground(Color.blue); - statusDB.setBorder(BorderFactory.createEtchedBorder()); - statusDB.setText("#"); - statusDB.setOpaque(false); - statusDB.addMouseListener(new StatusBar_mouseAdapter(this)); - this.setLayout(mainLayout); - infoLine.setFont(AdempierePLAF.getFont_Label()); - infoLine.setBorder(BorderFactory.createLineBorder(AdempierePLAF.getSecondary2())); - infoLine.setHorizontalAlignment(SwingConstants.CENTER); - infoLine.setHorizontalTextPosition(SwingConstants.CENTER); - infoLine.setText("info"); - mainLayout.setHgap(2); - mainLayout.setVgap(2); - this.add(statusLine, BorderLayout.CENTER); - this.add(statusDB, BorderLayout.EAST); - this.add(infoLine, BorderLayout.NORTH); - } // jbInit - - - /************************************************************************** - * Set Standard Status Line (non error) - * @param text text - */ - public void setStatusLine (String text) - { - if (text == null) - setStatusLine("", false); - else - setStatusLine(text, false); - } // setStatusLine - - /** - * Set Status Line - * @param text text - * @param error error - */ - public void setStatusLine (String text, boolean error) - { - mt_error = error; - mt_text = text; - if (mt_error) - statusLine.setForeground(AdempierePLAF.getTextColor_Issue()); - else - statusLine.setForeground(AdempierePLAF.getTextColor_OK()); - statusLine.setText(" " + mt_text); - // - Thread.yield(); - } // setStatusLine - - /** - * Get Status Line text - * @return StatusLine text - */ - public String getStatusLine () - { - return statusLine.getText().trim(); - } // setStatusLine - - /** - * Set ToolTip of StatusLine - * @param tip tip - */ - public void setStatusToolTip (String tip) - { - statusLine.setToolTipText(tip); - } // setStatusToolTip - - /** - * Set Status DB Info - * @param text text - * @param dse data status event - */ - public void setStatusDB (String text, DataStatusEvent dse) - { - // log.config( "StatusBar.setStatusDB - " + text + " - " + created + "/" + createdBy); - if (text == null || text.length() == 0) - { - statusDB.setText(""); - statusDB.setVisible(false); - } - else - { - StringBuilder sb = new StringBuilder (" "); - sb.append(text).append(" "); - statusDB.setText(sb.toString()); - if (!statusDB.isVisible()) - statusDB.setVisible(true); - } - - // Save - m_text = text; - m_dse = dse; - } // setStatusDB - - /** - * Set Status DB Info - * @param text text - */ - public void setStatusDB (String text) - { - setStatusDB (text, null); - } // setStatusDB - - /** - * Set Status DB Info - * @param no no - */ - public void setStatusDB (int no) - { - setStatusDB (String.valueOf(no), null); - } // setStatusDB - - /** - * Set Info Line - * @param text text - */ - public void setInfo (String text) - { - if (!infoLine.isVisible()) - infoLine.setVisible(true); - infoLine.setText(text); - } // setInfo - - /** - * Add Component to East of StatusBar - * @param component component - */ - public void addStatusComponent (JComponent component) - { - this.add(component, BorderLayout.EAST); - } // addStatusComponent - - /** - * Show WHO - * @param e event - */ - void mouseClicked(MouseEvent e) - { - if (m_dse == null - || m_dse.CreatedBy == null - || !MRole.getDefault().isShowPreference()) - return; - // - String title = Msg.getMsg(Env.getCtx(), "Who") + m_text; - RecordInfo info = new RecordInfo (AEnv.getFrame(this), title, m_dse); - AEnv.showCenterScreen(info); - } // addStatusComponent - -} // StatusBar diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/SwingWorker.java b/org.adempiere.ui.swing/src/org/compiere/apps/SwingWorker.java deleted file mode 100644 index 057ab4cfde..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/SwingWorker.java +++ /dev/null @@ -1,221 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import javax.swing.SwingUtilities; - -/** - * SwingWorker (based on SwingWorker 3). - * To use the SwingWorker class, you create a subclass of it. - * In the subclass, you must implement the construct() method contains - * the code to perform your lengthy operation. - * You invoke start() on your SwingWorker object to start the thread, - * which then calls your construct() method. - * When you need the object returned by the construct() method, - * you call the SwingWorker's get() method. - *
    - *      SwingWorker worker = new SwingWorker()
    - *      {
    - *          public Object construct()
    - *          {
    - *              return new expensiveOperation();
    - *          }
    - *      };
    - *      worker.start();
    - *      //  do something
    - *      //  when you need the result:
    - *      x = worker.get();   //  this blocks the UI !!
    - *  
    - */ -public abstract class SwingWorker -{ - /** - * Start a thread that will call the construct method - * and then exit. - */ - public SwingWorker() - { - /** Finish Runnable */ - final Runnable doFinished = new Runnable() - { - public void run() - { - finished(); - } - }; - - /** Worker Runnable */ - Runnable doConstruct = new Runnable() - { - public void run() - { - try - { - setValue(construct()); - } - finally - { - m_threadVar.clear(); - } - SwingUtilities.invokeLater(doFinished); - } - }; - - Thread t = new Thread (doConstruct); - m_threadVar = new ThreadVar(t); - } // SwingWorker - - /** Worker Thread */ - private ThreadVar m_threadVar; - /** Return value */ - private Object m_value; // see getValue(), setValue() - - /** - * Compute the value to be returned by the get method. - * @return value - */ - public abstract Object construct(); - - /** - * Called on the event dispatching thread (not on the worker thread) - * after the construct method has returned. - */ - public void finished() - { - } // finished - - /** - * Get the value produced by the worker thread, - * or null if it hasn't been constructed yet. - * @return value of worker - */ - protected synchronized Object getValue() - { - return m_value; - } // getValue - - /** - * Set the value produced by worker thread - * @param x worker value - */ - private synchronized void setValue(Object x) - { - m_value = x; - } // setValue - - - /************************************************************************* - * Start the worker thread. - */ - public void start() - { - Thread t = m_threadVar.get(); - if (t != null) - t.start(); - } // start - - /** - * Return the value created by the construct method. - * Returns null if either the constructing thread or the current - * thread was interrupted before a value was produced. - * (Blocks UI) - * @return the value created by the construct method - */ - public Object get() - { - while (true) - { - Thread t = m_threadVar.get(); - if (t == null) - { - return getValue(); - } - try - { - t.join(); - } - catch (InterruptedException e) - { - Thread.currentThread().interrupt(); // propagate - return null; - } - } - } // get - - /** - * A new method that interrupts the worker thread. Call this method - * to force the worker to stop what it's doing. - */ - public void interrupt() - { - Thread t = m_threadVar.get(); - if (t != null) - { - t.interrupt(); - } - m_threadVar.clear(); - } // interrupt - - /** - * Is worker Alive - * @return true if alive - */ - public boolean isAlive() - { - Thread t = m_threadVar.get(); - if (t == null) - return false; - return t.isAlive(); - } // isAlive - - - /************************************************************************** - * Class to maintain reference to current worker thread - * under separate synchronization control. - */ - private static class ThreadVar - { - /** - * Constructor - * @param t sync thread - */ - ThreadVar(Thread t) - { - thread = t; - } - /** The Sync Thread */ - private Thread thread; - - /** - * Get Sync Thread - * @return thread - */ - synchronized Thread get() - { - return thread; - } // get - - /** - * Clear Sync thread - */ - synchronized void clear() - { - thread = null; - } // clear - } // ThreadVar - -} // SwingWorker diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/TabSwitcher.java b/org.adempiere.ui.swing/src/org/compiere/apps/TabSwitcher.java deleted file mode 100644 index bcb7f6bb7a..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/TabSwitcher.java +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * Copyright (C) 2003-2007 e-Evolution,SC. All Rights Reserved. * - * @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ] * - *****************************************************************************/ - - -package org.compiere.apps; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusAdapter; -import java.awt.event.FocusEvent; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; - -import javax.swing.AbstractButton; -import javax.swing.JComponent; -import javax.swing.JTable; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.text.JTextComponent; - -import org.compiere.grid.GridController; - -/** - * - * @author Gunther Hoppe, 21.08.2005 - * - */ -public class TabSwitcher extends FocusAdapter implements ActionListener, ListSelectionListener{ - - @SuppressWarnings("unused") - private APanel panel; - private GridController gc; - - public TabSwitcher(GridController g, APanel p) { - - panel = p; - gc = g; - } - - public void valueChanged(ListSelectionEvent e) { - if(!e.getValueIsAdjusting()) { - - performSwitch(); - } - }; - - public void actionPerformed(ActionEvent e) { - if(!(e.getSource() instanceof JTextComponent)) { - if(gc.getMTab().getRecord_ID() != -1) - performSwitch(); - } - } - - public void focusGained(FocusEvent e) { - performSwitch(); - } - - private void performSwitch() { - //gc.transferFocus(); - //panel.dispatchTabSwitch(gc); - } - - public void addTabSwitchingSupport(JComponent c) { - - if(c instanceof JTable) { - - ((JTable)c).getSelectionModel().addListSelectionListener(this); - return; - } - else if( //c instanceof org.compiere.grid.ed.VEditor || - c instanceof JTextComponent || - //c instanceof ItemSelectable || - c instanceof org.compiere.grid.ed.VCheckBox || - //c instanceof org.compiere.grid.ed.VLookup || - //c instanceof org.compiere.swing.CLabel || - c instanceof AbstractButton) - { - c.addFocusListener(this); - //c.addKeyListener(new MovementAdapter()); - return; - } - else if(c instanceof org.compiere.grid.ed.VDate) - { - org.compiere.grid.ed.VDate d = ((org.compiere.grid.ed.VDate)c); - //d.addFocusListener(this); - d.addActionListener(this); - //d.addKeyListener(new MovementAdapter()); - return; - } - else if(c instanceof org.compiere.grid.ed.VLookup) - { - org.compiere.grid.ed.VLookup l = ((org.compiere.grid.ed.VLookup)c); - //l.addFocusListener(this); - l.addActionListener(this); - //l.addKeyListener(new MovementAdapter()); - return; - } - } - - class MovementAdapter extends KeyAdapter - { - public void keyPressed(KeyEvent event) - { - // look for tab keys - if(event.getKeyCode() == KeyEvent.VK_TAB - || event.getKeyCode() == KeyEvent.VK_ENTER) - { - ((JComponent)event.getSource()).transferFocus(); - } - } - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/Waiting.java b/org.adempiere.ui.swing/src/org/compiere/apps/Waiting.java deleted file mode 100644 index 28c390c6b0..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/Waiting.java +++ /dev/null @@ -1,215 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.Dialog; -import java.awt.Frame; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.logging.Level; - -import javax.swing.Box; -import javax.swing.JProgressBar; -import javax.swing.SwingConstants; -import javax.swing.Timer; -import javax.swing.WindowConstants; - -import org.compiere.swing.CButton; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Waiting Dialog - * - * @author Jorg Janke - * @version $Id: Waiting.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class Waiting extends CDialog - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -2078889004176093095L; - - /** - * Constructor - non nodal as otherwise process is blocked - * @param owner - * @param text Message to be displayed - * @param canNotWait user can continue with other work - * @param timer timer ticks (seconds) - if 0 then 10 - */ - public Waiting (Frame owner, String text, boolean canNotWait, int timer) - { - super(owner, Msg.getMsg(Env.getCtx(), "Processing")); - init (text, canNotWait, timer); - } // Waiting - - /** - * Constructor - non modal as otherwise process is blocked - * @param owner - * @param text Message to be displayed - * @param canNotWait user can continue with other work - * @param timer timer ticks (seconds) - if 0 then 10 - */ - public Waiting (Dialog owner, String text, boolean canNotWait, int timer) - { - super(owner, Msg.getMsg(Env.getCtx(), "Processing")); - init (text, canNotWait, timer); - } // Waiting - - /** - * Common Initialize routine - does not create if timer == 1 - * @param text Message to be displayed - * @param canNotWait user can continue with other work - * @param timer timer ticks (seconds) - if less than 5 then 10 - */ - private void init (String text, boolean canNotWait, int timer) - { - if (log.isLoggable(Level.FINE)) log.fine(text + " - Sec=" + timer); - // don't show if 1 sec average - if (timer == 1) - return; - - try - { - jbInit(); - setText (text); - if (!canNotWait) - bDoNotWait.setVisible(false); - } - catch(Exception e) - { - log.log(Level.SEVERE, "Waiting", e); - } - // set progress Bar - progressBar.setMinimum(0); - progressBar.setMaximum(timer < 5 ? 10 : timer); // min 2 seconds - - // Timer - m_timer = new Timer (1000, this); // every second - m_timer.start(); - AEnv.showCenterWindow(getOwner(), this); - } // init - - private int m_timervalue = 0; - private Timer m_timer; - /** Logger */ - private static CLogger log = CLogger.getCLogger(Waiting.class); - - @SuppressWarnings("unused") - private CPanel southPanel = new CPanel(); - private CButton bDoNotWait = new CButton(); - private CLabel infoLabel = new CLabel(); - //private FlowLayout southLayout = new FlowLayout(); - private CPanel mainPanel = new CPanel(); - private JProgressBar progressBar = new JProgressBar(); - - /** - * Static Layout - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); - this.setResizable(false); - this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - - this.getContentPane().add(Box.createVerticalStrut(8), BorderLayout.NORTH); - this.getContentPane().add(Box.createHorizontalStrut(8), BorderLayout.WEST); - this.getContentPane().add(Box.createVerticalStrut(8), BorderLayout.SOUTH); - this.getContentPane().add(Box.createHorizontalStrut(8), BorderLayout.EAST); - mainPanel.setLayout(new BorderLayout(5,5)); - this.getContentPane().add(mainPanel, BorderLayout.CENTER); - // - infoLabel.setFont(new java.awt.Font("Dialog", 3, 14)); - infoLabel.setHorizontalAlignment(SwingConstants.CENTER); - infoLabel.setHorizontalTextPosition(SwingConstants.RIGHT); - infoLabel.setIcon(Env.getImageIcon("iD10030.png")); - infoLabel.setIconTextGap(10); - mainPanel.add(infoLabel, BorderLayout.NORTH); - mainPanel.add(progressBar, BorderLayout.CENTER); - // -// bDoNotWait.setText(Msg.getMsg(Env.getCtx(), "DoNotWait")); -// bDoNotWait.setToolTipText(Msg.getMsg(Env.getCtx(), "DoNotWaitInfo")); -// bDoNotWait.addActionListener(this); -// southPanel.setLayout(southLayout); -// southPanel.add(bDoNotWait, null); -// mainPanel.add(southPanel, BorderLayout.SOUTH); - } // jbInit - - /** - * Set Info Text - * @param text - */ - public void setText (String text) - { - infoLabel.setText(text); - } // setText - - /** - * ActionListener - * @param e - */ - public void actionPerformed (ActionEvent e) - { - if (e.getSource() == bDoNotWait) - doNotWait(); - // - progressBar.setValue(m_timervalue++); - if (m_timervalue > progressBar.getMaximum()) - m_timervalue = progressBar.getMinimum(); - // progressBar.setString(progressBar.getPercentComplete()); - } // actionPerformed - - /** - * Set Timer Estimate - * @param max Seconds - */ - public void setTimerEstimate (int max) - { - progressBar.setMaximum(max); - } // setMaximum - - /** - * User does not want to wait for result and continue with other worg - * Callback & dispose - */ - public void doNotWait() - { - /** @todo callback */ - dispose(); - } // doNotWait - - /** - * Dispose - */ - public void dispose() - { - if (m_timer != null) - m_timer.stop(); - m_timer = null; - super.dispose(); - } // dispose - -} // Waiting diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/WindowManager.java b/org.adempiere.ui.swing/src/org/compiere/apps/WindowManager.java deleted file mode 100644 index 7e524cb4c1..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/WindowManager.java +++ /dev/null @@ -1,182 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.Component; -import java.awt.Window; -import java.awt.event.ComponentEvent; -import java.awt.event.ComponentListener; -import java.awt.event.WindowEvent; -import java.awt.event.WindowListener; -import java.util.ArrayList; -import java.util.List; - -import org.compiere.apps.form.FormFrame; -import org.compiere.swing.CFrame; - -/** - * Managed a list of window. - * @author Low Heng Sin - * @version 2006/11/20 - */ -public class WindowManager { - public WindowManager() {} - private List windows = new ArrayList(); - private WindowEventListener eventListener = new WindowEventListener(this); - - /** - * Add window - * @param window - */ - public void add(CFrame window) { - windows.add(window); - window.addComponentListener(eventListener); - window.addWindowListener(eventListener); - } - - /** - * Close all windows managed by this window manager. - */ - public void close() { - for ( CFrame w : windows ) { - w.removeComponentListener(eventListener); - w.removeWindowListener(eventListener); - w.dispose(); - } - windows = new ArrayList(); - } - - /** - * Close all except one window. - * @param window - */ - public void closeOthers(CFrame window) { - for ( CFrame w : windows ) { - w.removeComponentListener(eventListener); - w.removeWindowListener(eventListener); - if ( !w.equals(window)) { - w.dispose(); - } - } - windows = new ArrayList(); - add(window); - } - - /** - * Remove window - * @param window - */ - public void remove(CFrame window) { - if ( windows.remove(window) ) { - window.removeComponentListener(eventListener); - window.removeWindowListener(eventListener); - } - } - - /** - * Get list of windows managed by this window manager - * @return Array of windows - */ - public CFrame[] getWindows() { - CFrame[] a = new CFrame[windows.size()]; - return windows.toArray(a); - } - - /** - * @return Number of windows managed by this window manager - */ - public int getWindowCount() { - return windows.size(); - } - - /** - * Find window by ID - * @param AD_Window_ID - * @return AWindow reference, null if not found - */ - public AWindow find(int AD_Window_ID) { - for ( CFrame w : windows ) { - if ( w instanceof AWindow ) { - AWindow a = (AWindow)w; - if ( a.getAD_Window_ID() == AD_Window_ID ) - return a; - } - } - return null; - } - - public FormFrame findForm(int AD_FORM_ID) { - for ( CFrame w : windows ) { - if ( w instanceof FormFrame ) { - FormFrame ff = (FormFrame)w; - if ( ff.getAD_Form_ID() == AD_FORM_ID ) - return ff; - } - } - return null; - } -} - -class WindowEventListener implements ComponentListener, WindowListener { - WindowManager windowManager; - - protected WindowEventListener(WindowManager windowManager) { - this.windowManager = windowManager; - } - - public void componentHidden(ComponentEvent e) { - Component c = e.getComponent(); - if ( c instanceof CFrame ) { - c.removeComponentListener(this); - ((CFrame)c).removeWindowListener(this); - windowManager.remove((CFrame)c); - } - } - - public void componentMoved(ComponentEvent e) { - } - - public void componentResized(ComponentEvent e) { - } - - public void componentShown(ComponentEvent e) { - } - - public void windowActivated(WindowEvent e) { - } - - public void windowClosed(WindowEvent e) { - Window w = e.getWindow(); - if ( w instanceof CFrame ) { - w.removeComponentListener(this); - w.removeWindowListener(this); - windowManager.remove((CFrame)w); - } - } - - public void windowClosing(WindowEvent e) { - } - - public void windowDeactivated(WindowEvent e) { - } - - public void windowDeiconified(WindowEvent e) { - } - - public void windowIconified(WindowEvent e) { - } - - public void windowOpened(WindowEvent e) { - } -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/WindowMenu.java b/org.adempiere.ui.swing/src/org/compiere/apps/WindowMenu.java deleted file mode 100644 index 2134a701a7..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/WindowMenu.java +++ /dev/null @@ -1,424 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.apps; - -import java.awt.BorderLayout; -import java.awt.CardLayout; -import java.awt.Container; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.GridLayout; -import java.awt.Image; -import java.awt.Toolkit; -import java.awt.Window; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusAdapter; -import java.awt.event.FocusEvent; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowEvent; -import java.awt.event.WindowFocusListener; -import java.awt.image.BufferedImage; - -import javax.swing.Box; -import javax.swing.JCheckBoxMenuItem; -import javax.swing.JComponent; -import javax.swing.JDialog; -import javax.swing.JFrame; -import javax.swing.JMenu; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JRootPane; -import javax.swing.KeyStroke; -import javax.swing.SwingUtilities; -import javax.swing.event.MenuEvent; -import javax.swing.event.MenuListener; - -import org.compiere.swing.CFrame; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.jdesktop.swingx.JXButton; -import org.jdesktop.swingx.JXImageView; -import org.jdesktop.swingx.JXPanel; -import org.jdesktop.swingx.JXTitledPanel; -import org.jdesktop.swingx.painter.Painter; - -/** - * Menu component that handles the functionality expected of a standard - * "Windows" menu for MDI or MDI-like applications. - * - * @author Low Heng Sin - * @version 2006/11/20 - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *
  • BF [ 1808617 ] Close Windows from "Viewer" (report) is not working - */ -public class WindowMenu extends JMenu { - /** - * - */ - private static final long serialVersionUID = 381665816099431316L; - private WindowManager windowManager; - private JFrame frame; - private JMenuItem closeAll=new JMenuItem("Close All Windows"); - private JMenuItem closeOthers = new JMenuItem("Close Other Windows"); - private JMenuItem expose = new JMenuItem("Show All"); - private JXTitledPanel firstBox; - - private void setEnvText(JMenu menu, String msg) { - String text = Msg.getMsg(Env.getCtx(), msg); - int pos = text.indexOf('&'); - if (pos != -1 && text.length() > pos) // We have a nemonic - { - char ch = text.toUpperCase().charAt(pos+1); - if (ch != ' ') - { - text = text.substring(0, pos) + text.substring(pos+1); - menu.setMnemonic(ch); - } - } - menu.setText(text); - } - - private void setEnvText(JMenuItem menu, String msg) { - String text = Msg.getMsg(Env.getCtx(), msg); - int pos = text.indexOf('&'); - if (pos != -1 && text.length() > pos) // We have a nemonic - { - char ch = text.toUpperCase().charAt(pos+1); - if (ch != ' ') - { - text = text.substring(0, pos) + text.substring(pos+1); - menu.setMnemonic(ch); - } - } - menu.setText(text); - } - - public WindowMenu(WindowManager windowManager, JFrame frame) { - this.windowManager = windowManager; - this.frame = frame; - setEnvText(this, "Window"); - closeAll.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent ae) { - WindowMenu.this.windowManager.close(); - } - }); - setEnvText(closeAll, "CloseAllWindows"); - closeOthers.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent ae) { - WindowMenu.this.windowManager.closeOthers((CFrame)WindowMenu.this.frame); - } - }); - expose.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent ae) { - SwingUtilities.invokeLater(new Runnable() { - - public void run() { - expose(); - } - }); - } - }); - setEnvText(expose, "ShowAllWindow"); - expose.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, ActionEvent.CTRL_MASK)); - setEnvText(closeOthers, "CloseOtherWindows"); - addMenuListener(new MenuListener() { - public void menuCanceled (MenuEvent e) {} - - public void menuDeselected (MenuEvent e) { - removeAll(); - } - - public void menuSelected (MenuEvent e) { - buildChildMenus(); - } - }); - } - - private JXPanel createSelectionPanel() { - - GridLayout l = new GridLayout(3, 3); - l.setHgap(5); - l.setVgap(5); - - JXPanel p = new JXPanel(); - p.setLayout(l); - - return p; - } - - public void expose() { - - final JDialog dialog = new JDialog(); - dialog.setSize(Toolkit.getDefaultToolkit().getScreenSize()); - dialog.setUndecorated(true); - dialog.setModal(true); - - //add escape to close - ActionListener actionListener = new ActionListener() { - public void actionPerformed(ActionEvent actionEvent) { - dialog.setVisible(false); - } - }; - JRootPane jr = dialog.getRootPane(); - KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0); - jr.registerKeyboardAction(actionListener, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); - - //new Thread(new Loader(dialog)).start(); - SwingUtilities.invokeLater(new Loader(dialog)); - - dialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - dialog.setVisible(true); - } - - private JXTitledPanel createImageBox(JPanel p, JDialog dialog, - int width, int height, CFrame window) { - BufferedImage bi = new BufferedImage (window.getWidth(), window.getHeight(), - BufferedImage.TYPE_INT_RGB); // TYPE_INT_ARGB is tinted red - window.paintAll(bi.createGraphics()); - - Image image = bi.getScaledInstance(width, height, Image.SCALE_SMOOTH); - - final JXTitledPanel box = new JXTitledPanel(); - final Painter painter = box.getTitlePainter(); - box.setTitlePainter(null); - box.setFocusable(true); - box.setTitle(window.getTitle()); - final JXImageView imageView = new JXImageView(); - imageView.setImage(image); - imageView.setEditable(false); - box.setContentContainer(imageView); - box.setPreferredSize(new Dimension(width,height)); - box.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - box.addMouseListener(new MouseAdapter() { - @Override - public void mouseEntered(MouseEvent e) { - box.requestFocus(); - } - }); - imageView.addMouseListener(new MouseAdapter() { - @Override - public void mouseEntered(MouseEvent e) { - box.requestFocus(); - } - }); - - PreviewMouseAdapter adapter = new PreviewMouseAdapter(dialog, window); - box.addMouseListener(adapter); - imageView.addMouseListener(adapter); - - imageView.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - box.addFocusListener(new FocusAdapter(){ - - @Override - public void focusGained(FocusEvent e) { - box.setTitlePainter(painter); - } - - @Override - public void focusLost(FocusEvent e) { - box.setTitlePainter(null); - } - - }); - return box; - } - - /* Sets up the children menus depending on the current desktop state */ - private void buildChildMenus() { - this.removeAll(); - int i; - ChildMenuItem menu; - CFrame[] array = windowManager.getWindows(); - - add(expose); - - if ( !(frame instanceof AMenu) ) - add(closeOthers); - add(closeAll); - - if (array.length > 0) { - expose.setEnabled(true); - closeAll.setEnabled(true); - if ( array.length > 1 ) - closeOthers.setEnabled(true); - else - closeOthers.setEnabled(false); - addSeparator(); - } else { - closeAll.setEnabled(false); - closeOthers.setEnabled(false); - expose.setEnabled(false); - } - - if ( !(frame instanceof AMenu) ) { - JFrame frame = AEnv.getWindow(0); - if (frame != null && frame instanceof AMenu) { - menu = new ChildMenuItem((AMenu)frame); - menu.setState(false); - menu.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent ae) { - CFrame frame = ((ChildMenuItem)ae.getSource()).getWindow(); - AEnv.showWindow(frame); - } - }); - add(menu); - addSeparator(); - } - } - - for (i = 0; i < array.length; i++) { - menu = new ChildMenuItem(array[i]); - menu.setState(array[i].equals(frame)); - menu.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent ae) { - CFrame frame = ((ChildMenuItem)ae.getSource()).getWindow(); - AEnv.showWindow(frame); - } - }); - //menu.setIcon(array[i].getIconImage()); - add(menu); - } - } - - /* This JCheckBoxMenuItem descendant is used to track the child frame that corresponds - to a give menu. */ - class ChildMenuItem extends JCheckBoxMenuItem { - /** - * - */ - private static final long serialVersionUID = 2258141282389818588L; - private CFrame window; - - public ChildMenuItem(CFrame window) { - super(window.getTitle()); - this.window=window; - } - - public CFrame getWindow() { - return window; - } - } - - class Loader implements Runnable { - private JDialog dialog; - - Loader(JDialog d) { - dialog = d; - } - - public void run() { - CFrame[] w = windowManager.getWindows(); - Container dialogContent = dialog.getContentPane(); - dialogContent.setLayout(new BorderLayout()); - - final CardLayout card = new CardLayout(); - final JXPanel cardContainer = new JXPanel(card); - - dialogContent.add(cardContainer, BorderLayout.CENTER); - - JXPanel p = createSelectionPanel(); - cardContainer.add(p, "page1"); - - Dimension s = Toolkit.getDefaultToolkit().getScreenSize(); - int width = ( s.width - 30 ) / 3; - int height = ( s.height - 30 ) / 3; - int count = 0; - JFrame frame = AEnv.getWindow(0); - if (frame != null && frame instanceof AMenu) { - JXTitledPanel box = createImageBox(p, dialog, width, height, - (CFrame)frame); - p.add(box); - count ++; - firstBox = box; - } - int page = 1; - for(int i = 0; i < w.length; i++) { - count ++; - CFrame window = w[i]; - JXTitledPanel box = createImageBox(p, dialog, width, height, - window); - p.add(box); - if (i == 0 && firstBox == null) firstBox = box; - if ( count == 9) { - count = 0; - page++; - p = createSelectionPanel(); - cardContainer.add(p, "page" + page); - } - } - for ( int i = count; i < 9; i++ ) { - p.add(Box.createGlue()); - } - dialog.addWindowFocusListener(new WindowFocusListener() { - - public void windowGainedFocus(WindowEvent e) { - if (firstBox != null) - firstBox.requestFocus(); - } - - public void windowLostFocus(WindowEvent e) { - } - - }); - card.first(cardContainer); - if (page > 1) { - JXPanel ctrl = new JXPanel(); - JXButton previous = new JXButton("<"); - JXButton next = new JXButton(">"); - previous.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - card.previous(cardContainer); - } - - }); - next.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - card.next(cardContainer); - } - }); - ctrl.add(previous); - ctrl.add(next); - dialogContent.add(ctrl, BorderLayout.NORTH); - } - dialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - } - - } - - class PreviewMouseAdapter extends MouseAdapter { - private JDialog dialog; - private Window window; - - PreviewMouseAdapter(JDialog d, Window w) { - dialog = d; - window = w; - } - - @Override - public void mouseClicked(MouseEvent e) { - dialog.dispose(); - SwingUtilities.invokeLater(new Runnable() { - public void run() { - AEnv.showWindow(window); - } - }); - } - } -} - - \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/ArchiveViewer.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/ArchiveViewer.java deleted file mode 100644 index ad42a05bdd..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/ArchiveViewer.java +++ /dev/null @@ -1,456 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.beans.VetoableChangeListener; -import java.io.InputStream; -import java.sql.Timestamp; -import java.util.logging.Level; - -import javax.swing.JSplitPane; - -import org.adempiere.pdf.viewer.PDFViewerBean; -import org.compiere.apps.ConfirmPanel; -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VLookup; -import org.compiere.grid.ed.VString; -import org.compiere.grid.ed.VText; -import org.compiere.model.MArchive; -import org.compiere.swing.CButton; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTabbedPane; -import org.compiere.swing.CTextField; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - - -/** - * Arvhive Viewer - *

    Change log - *

      - *
    • 2007-03-01 - teo_sarca - [ 1671899 ] Archive Viewer: table, process are not translated - *
    • 2007-03-01 - teo_sarca - [ 1671900 ] Archive Viewer: second tab has no split pane - *
    - * - * @author Jorg Janke - * @version $Id: ArchiveViewer.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class ArchiveViewer extends Archive - implements FormPanel, ActionListener, VetoableChangeListener -{ - private CTabbedPane panel = new CTabbedPane(); - - - /** - * Initialize Panel - * @param WindowNo window - * @param frame parent frame - */ - public void init (int WindowNo, FormFrame frame) - { - log.info(""); - m_WindowNo = WindowNo; - m_frame = frame; - try - { - dynInit(); - jbInit(); - frame.getContentPane().add(panel, BorderLayout.CENTER); - frame.getContentPane().add(confirmPanel, BorderLayout.SOUTH); - // - m_frame.setIconImage(Env.getImage("Archive16.gif")); - } - catch(Exception e) - { - log.log(Level.SEVERE, "init", e); - } - } // init - - /** FormFrame */ - private FormFrame m_frame; - - private CPanel queryPanel = new CPanel(new GridBagLayout()); - private CCheckBox reportField = new CCheckBox(Msg.translate(Env.getCtx(), "IsReport")); - private CLabel processLabel = new CLabel(Msg.translate(Env.getCtx(), "AD_Process_ID")); - private CComboBox processField = null; - private CLabel tableLabel = new CLabel(Msg.translate(Env.getCtx(), "AD_Table_ID")); - private CComboBox tableField = null; - private CLabel bPartnerLabel = new CLabel(Msg.translate(Env.getCtx(), "C_BPartner_ID")); - private VLookup bPartnerField = null; - private CLabel nameQLabel = new CLabel(Msg.translate(Env.getCtx(), "Name")); - private CTextField nameQField = new CTextField(15); - private CLabel descriptionQLabel = new CLabel(Msg.translate(Env.getCtx(), "Description")); - private CTextField descriptionQField = new CTextField(15); - private CLabel helpQLabel = new CLabel(Msg.translate(Env.getCtx(), "Help")); - private CTextField helpQField = new CTextField(15); - private CLabel createdByQLabel = new CLabel(Msg.translate(Env.getCtx(), "CreatedBy")); - private CComboBox createdByQField = null; - private CLabel createdQLabel = new CLabel(Msg.translate(Env.getCtx(), "Created")); - private VDate createdQFrom = new VDate(); - private VDate createdQTo = new VDate(); - // - private CPanel viewPanel = new CPanel(new BorderLayout(5,5)); - private JSplitPane viewPanelSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); - private PDFViewerBean pdfViewer = new PDFViewerBean(); - private CPanel viewEnterPanel = new CPanel(new GridBagLayout()); - private CButton bBack = new CButton(Env.getImageIcon("wfBack24.gif")); - private CButton bNext = new CButton(Env.getImageIcon("wfNext24.gif")); - private CLabel positionInfo = new CLabel("."); - private CLabel createdByLabel = new CLabel(Msg.translate(Env.getCtx(), "CreatedBy")); - private CTextField createdByField = new CTextField(20); -// private CLabel createdLabel = new CLabel(Msg.translate(Env.getCtx(), "Created")); - private VDate createdField = new VDate(); - // - private CLabel nameLabel = new CLabel(Msg.translate(Env.getCtx(), "Name")); - private VString nameField = new VString("Name", true, false, true, 20, 60, null, null); - private CLabel descriptionLabel = new CLabel(Msg.translate(Env.getCtx(), "Description")); - private VText descriptionField = new VText("Description", false, false, true, 20, 255); - private CLabel helpLabel = new CLabel(Msg.translate(Env.getCtx(), "Help")); - private VText helpField = new VText("Help", false, false, true, 20, 2000); - private CButton updateArchive = ConfirmPanel.createOKButton(Msg.getMsg(Env.getCtx(), "Update")); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - - - /** - * Dynamic Init - */ - private void dynInit() - { - processField = new CComboBox(getProcessData()); - tableField = new CComboBox(getTableData()); - createdByQField = new CComboBox(getUserData()); - // - bPartnerField = VLookup.createBPartner(m_WindowNo); - } // dynInit - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - int line = 0; - queryPanel.add(reportField, new GridBagConstraints(0, line, - 3, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0,0,0,0), 0, 0)); - reportField.addActionListener(this); - // - queryPanel.add(processLabel, new GridBagConstraints(0, ++line, - 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5,0,0,5), 0, 0)); - queryPanel.add(processField, new GridBagConstraints(1, line, - 2, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5,0,0,0), 0, 0)); - queryPanel.add(bPartnerLabel, new GridBagConstraints(0, ++line, - 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5,0,0,5), 0, 0)); - queryPanel.add(bPartnerField, new GridBagConstraints(1, line, - 2, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5,0,0,0), 0, 0)); - queryPanel.add(tableLabel, new GridBagConstraints(0, ++line, - 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5,0,0,5), 0, 0)); - queryPanel.add(tableField,new GridBagConstraints(1, line, - 2, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5,0,0,0), 0, 0)); - // - queryPanel.add(nameQLabel, new GridBagConstraints(0, ++line, - 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(10,0,0,5), 0, 0)); - queryPanel.add(nameQField, new GridBagConstraints(1, line, - 2, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(10,0,0,0), 0, 0)); - queryPanel.add(descriptionQLabel, new GridBagConstraints(0, ++line, - 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5,0,0,5), 0, 0)); - queryPanel.add(descriptionQField, new GridBagConstraints(1, line, - 2, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5,0,0,0), 0, 0)); - queryPanel.add(helpQLabel, new GridBagConstraints(0, ++line, - 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5,0,0,5), 0, 0)); - queryPanel.add(helpQField, new GridBagConstraints(1, line, - 2, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5,0,0,0), 0, 0)); - // - queryPanel.add(createdByQLabel, new GridBagConstraints(0, ++line, - 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(10,0,0,5), 0, 0)); - queryPanel.add(createdByQField, new GridBagConstraints(1, line, - 2, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(10,0,0,0), 0, 0)); - queryPanel.add(createdQLabel, new GridBagConstraints(0, ++line, - 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5,0,0,5), 0, 0)); - queryPanel.add(createdQFrom, new GridBagConstraints(1, line, - 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5,0,0,0), 0, 0)); - queryPanel.add(createdQTo, new GridBagConstraints(2, line, - 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5,0,0,0), 0, 0)); - panel.add(queryPanel, Msg.getMsg(Env.getCtx(), "ViewerQuery")); - // - // - line = 0; - viewPanel.add(viewPanelSplit, BorderLayout.CENTER); - viewPanelSplit.setLeftComponent(pdfViewer); - // - bBack.addActionListener(this); - bNext.addActionListener(this); - positionInfo.setFontBold(true); - positionInfo.setHorizontalAlignment(CLabel.CENTER); - viewEnterPanel.add(bBack, new GridBagConstraints(0, line, - 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,0,0,0), 0, 0)); - viewEnterPanel.add(positionInfo, new GridBagConstraints(1, line, - 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0,5,0,5), 0, 0)); - viewEnterPanel.add(bNext, new GridBagConstraints(2, line, - 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0,0,0,5), 0, 0)); - // - createdByField.setReadWrite(false); - createdField.setReadWrite(false); - nameField.addVetoableChangeListener(this); - descriptionField.addVetoableChangeListener(this); - helpField.addVetoableChangeListener(this); - viewEnterPanel.add(createdByLabel, new GridBagConstraints(0, ++line, - 3, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5,0,0,5), 0, 0)); - viewEnterPanel.add(createdByField, new GridBagConstraints(0, ++line, - 3, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,0,0,5), 0, 0)); - // viewEnterPanel.add(createdLabel, new ALayoutConstraint(line++,0)); - viewEnterPanel.add(createdField, new GridBagConstraints(0, ++line, - 3, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2,0,0,5), 0, 0)); - // - viewEnterPanel.add(nameLabel, new GridBagConstraints(0, ++line, - 3, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5,0,0,5), 0, 0)); - viewEnterPanel.add(nameField, new GridBagConstraints(0, ++line, - 3, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,0,0,5), 0, 0)); - // - viewEnterPanel.add(descriptionLabel, new GridBagConstraints(0, ++line, - 3, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5,0,0,5), 0, 0)); - viewEnterPanel.add(descriptionField,new GridBagConstraints(0, ++line, - 3, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,0,0,5), 0, 0)); - // - viewEnterPanel.add(helpLabel, new GridBagConstraints(0, ++line, - 3, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5,0,0,5), 0, 0)); - viewEnterPanel.add(helpField, new GridBagConstraints(0, ++line, - 3, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,0,0,5), 0, 0)); - // - viewEnterPanel.add(updateArchive, new GridBagConstraints(0, ++line, - 3, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5,0,0,5), 0, 0)); - // - viewEnterPanel.setPreferredSize(new Dimension(220,500)); - updateArchive.addActionListener(this); - viewPanelSplit.setRightComponent(viewEnterPanel); - panel.add(viewPanel, Msg.getMsg(Env.getCtx(), "ViewerResult")); - // - confirmPanel.addActionListener(this); - updateQDisplay(); - // - panel.setPreferredSize(new Dimension (720,500)); - } // jbInit - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (log.isLoggable(Level.INFO)) log.info(e.getActionCommand()); - // - if (e.getSource() == updateArchive) - cmd_updateArchive(); - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - dispose(); - else if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - if (panel.getSelectedIndex() == 1) - dispose(); - else - cmd_query(); - } - else if (e.getSource() == reportField) - updateQDisplay(); - else if (e.getSource() == bBack) - updateVDisplay(false); - else if (e.getSource() == bNext) - updateVDisplay(true); - } // actionPerformed - - /** - * Field Listener - * @param evt event - * @throws PropertyVetoException - */ - public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException - { - if (m_archives.length > 0) - updateArchive.setEnabled(true); - } // vetableChange - - /** - * Update Query Display - */ - private void updateQDisplay() - { - boolean reports = reportField.isSelected(); - if (log.isLoggable(Level.CONFIG)) log.config("Reports=" + reports); - // Show - processLabel.setVisible(reports); - processField.setVisible(reports); - // Hide - bPartnerLabel.setVisible(!reports); - bPartnerField.setVisible(!reports); - } // updateQDisplay - - /** - * Update View Display - * @param next show next Archive - */ - private void updateVDisplay (boolean next) - { - if (m_archives == null) - m_archives = new MArchive[0]; - if (next) - m_index++; - else - m_index--; - if (m_index >= m_archives.length-1) - m_index = m_archives.length-1; - if (m_index < 0) - m_index = 0; - bBack.setEnabled(m_index > 0); - bNext.setEnabled(m_index < m_archives.length-1); - updateArchive.setEnabled(false); - // - if (log.isLoggable(Level.INFO)) log.info("Index=" + m_index + ", Length=" + m_archives.length); - if (m_archives.length == 0) - { - positionInfo.setText("No Record Found"); - createdByField.setText(""); - createdField.setValue(null); - nameField.setText(""); - descriptionField.setText(""); - helpField.setText(""); - pdfViewer.clearDocument(); - return; - } - // - positionInfo.setText(m_index+1 + " " + Msg.getMsg(Env.getCtx(), "of") + " " + m_archives.length); - MArchive ar = m_archives[m_index]; - createdByField.setText(ar.getCreatedByName()); - createdField.setValue(ar.getCreated()); - nameField.setText(ar.getName()); - descriptionField.setText(ar.getDescription()); - helpField.setText(ar.getHelp()); - // - try - { - InputStream in = ar.getInputStream(); - pdfViewer.setScale(reportField.isSelected() ? 50 : 75); - if (in != null) - pdfViewer.loadPDF(in); - else - pdfViewer.clearDocument(); - } - catch (Exception e) - { - log.log(Level.SEVERE, "pdf", e); - pdfViewer.clearDocument(); - } - } // updateVDisplay - - /** - * Update Archive Info - */ - private void cmd_updateArchive() - { - MArchive ar = m_archives[m_index]; - boolean update = false; - if (!isSame(nameField.getText(), ar.getName())) - { - String newText = nameField.getText(); - if (newText != null && newText.length() > 0) - { - ar.setName(newText); - update = true; - } - } - if (!isSame(descriptionField.getText(), ar.getDescription())) - { - ar.setDescription(descriptionField.getText()); - update = true; - } - if (!isSame(helpField.getText(), ar.getHelp())) - { - ar.setHelp(helpField.getText()); - update = true; - } - if (log.isLoggable(Level.INFO)) log.info("Update=" + update); - if (update) - ar.saveEx(); - // - m_index++; - updateVDisplay(false); - } // cmd_updateArchive - - /** - * Query Directly - * @param isReport report - * @param AD_Table_ID table - * @param Record_ID tecord - */ - public void query (boolean isReport, int AD_Table_ID, int Record_ID) - { - if (log.isLoggable(Level.CONFIG)) log.config("Report=" + isReport + ", AD_Table_ID=" + AD_Table_ID + ",Record_ID=" + Record_ID); - reportField.setSelected(isReport); - m_AD_Table_ID = AD_Table_ID; - m_Record_ID = Record_ID; - cmd_query(); - } // query - - - /************************************************************************** - * Create Query - */ - private void cmd_query() - { - boolean reports = reportField.isSelected(); - KeyNamePair process = (KeyNamePair)processField.getSelectedItem(); - KeyNamePair table = (KeyNamePair)tableField.getSelectedItem(); - Integer C_BPartner_ID = (Integer)bPartnerField.getValue(); - String name = nameQField.getText(); - String description = descriptionQField.getText(); - String help = helpQField.getText(); - KeyNamePair createdBy = (KeyNamePair)createdByQField.getSelectedItem(); - Timestamp createdFrom = createdQFrom.getTimestamp(); - Timestamp createdTo = createdQTo.getTimestamp(); - - cmd_query(reports, process, table, C_BPartner_ID, name, description, help, - createdBy, createdFrom, createdTo); - - // Display - panel.setSelectedIndex(1); - m_index = 1; - updateVDisplay(false); - } // cmd_query - - -} // ArchiveViewer diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/FormFrame.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/FormFrame.java deleted file mode 100644 index dd880d8502..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/FormFrame.java +++ /dev/null @@ -1,500 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.Cursor; -import java.awt.GraphicsConfiguration; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Properties; -import java.util.logging.Level; - -import javax.swing.JFrame; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.KeyStroke; - -import org.adempiere.client.Client; -import org.compiere.apps.AEnv; -import org.compiere.apps.AGlassPane; -import org.compiere.apps.AMenu; -import org.compiere.apps.Help; -import org.compiere.apps.WindowMenu; -import org.compiere.model.GridTab; -import org.compiere.model.MRole; -import org.compiere.model.MUser; -import org.compiere.process.ProcessInfo; -import org.compiere.swing.CFrame; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Trace; - - -/** - * Form Framework - * - * @author Jorg Janke - * @version $Id: FormFrame.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - * - * Colin Rooney 2007/03/20 RFE#1670185 & BUG#1684142 - * Extend security to Info Queries - */ -public class FormFrame extends CFrame - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 2559005548469735515L; - - /** - * @deprecated - * Create Form. - * Need to call openForm - */ - public FormFrame () - { - this(null); - } // FormFrame - - /** - * Create Form. - * Need to call openForm - * @param gc - */ - public FormFrame (GraphicsConfiguration gc) - { - super(gc); - addWindowListener(new java.awt.event.WindowAdapter() - { - public void windowOpened(java.awt.event.WindowEvent evt) - { - formWindowOpened(evt); - } - }); - - m_WindowNo = AEnv.createWindowNo (this); - setGlassPane(m_glassPane); - try - { - jbInit(); - createMenu(); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - } - } // FormFrame - - private ProcessInfo m_pi; - - /** WindowNo */ - private int m_WindowNo; - /** The GlassPane */ - private AGlassPane m_glassPane = new AGlassPane(); - /** Description */ - private String m_Description = null; - /** Help */ - private String m_Help = null; - /** Menu Bar */ - private JMenuBar menuBar = new JMenuBar(); - /** The Panel to be displayed */ - private FormPanel m_panel = null; - /** Maximize Window */ - public boolean m_maximize = false; - /** Logger */ - private static CLogger log = CLogger.getCLogger(FormFrame.class); - - /** Form ID */ - private int p_AD_Form_ID = 0; - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setIconImage(org.compiere.Adempiere.getImage16()); - this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - this.setJMenuBar(menuBar); - } // jbInit - - /** - * Create Menu - */ - private void createMenu() - { - // File - JMenu mFile = AEnv.getMenu("File"); - menuBar.add(mFile); - AEnv.addMenuItem("PrintScreen", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, 0), mFile, this); - AEnv.addMenuItem("ScreenShot", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, ActionEvent.SHIFT_MASK), mFile, this); - AEnv.addMenuItem("Report", null, KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.ALT_MASK), mFile, this); - mFile.addSeparator(); - AEnv.addMenuItem("End", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK), mFile, this); - AEnv.addMenuItem("Exit", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.SHIFT_MASK+ActionEvent.ALT_MASK), mFile, this); - - // View - JMenu mView = AEnv.getMenu("View"); - menuBar.add(mView); - - if (MRole.getDefault().isAllow_Info_Product()) - { - AEnv.addMenuItem("InfoProduct", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK), mView, this); - } - if (MRole.getDefault().isAllow_Info_BPartner()) - { - AEnv.addMenuItem("InfoBPartner", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK+ActionEvent.CTRL_MASK), mView, this); - } - if (MRole.getDefault().isShowAcct() && MRole.getDefault().isAllow_Info_Account()) - { - AEnv.addMenuItem("InfoAccount", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK+ActionEvent.CTRL_MASK), mView, this); - } - if (MRole.getDefault().isAllow_Info_Schedule()) - { - AEnv.addMenuItem("InfoSchedule", null, null, mView, this); - } - mView.addSeparator(); - if (MRole.getDefault().isAllow_Info_Order()) - { - AEnv.addMenuItem("InfoOrder", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_Invoice()) - { - AEnv.addMenuItem("InfoInvoice", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_InOut()) - { - AEnv.addMenuItem("InfoInOut", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_Payment()) - { - AEnv.addMenuItem("InfoPayment", "Info", null, mView, this); - } -// if (MRole.getDefault().isAllow_Info_CashJournal()) -// { -// AEnv.addMenuItem("InfoCashLine", "Info", null, mView, this); -// } - if (MRole.getDefault().isAllow_Info_Resource()) - { - AEnv.addMenuItem("InfoAssignment", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_Asset()) - { - AEnv.addMenuItem("InfoAsset", "Info", null, mView, this); - } - // Tools - JMenu mTools = AEnv.getMenu("Tools"); - menuBar.add(mTools); - AEnv.addMenuItem("Calculator", null, null, mTools, this); - AEnv.addMenuItem("Calendar", null, null, mTools, this); - AEnv.addMenuItem("Editor", null, null, mTools, this); - MUser user = MUser.get(Env.getCtx()); - if (user.isAdministrator()) - AEnv.addMenuItem("Script", null, null, mTools, this); - if (MRole.getDefault().isShowPreference()) - { - mTools.addSeparator(); - AEnv.addMenuItem("Preference", null, null, mTools, this); - } - - // Window - AMenu aMenu = (AMenu)AEnv.getWindow(0); - JMenu mWindow = new WindowMenu(aMenu.getWindowManager(), this); - menuBar.add(mWindow); - - // Help - JMenu mHelp = AEnv.getMenu("Help"); - menuBar.add(mHelp); - AEnv.addMenuItem("Help", "Help", KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0), mHelp, this); - AEnv.addMenuItem("Online", null, null, mHelp, this); - AEnv.addMenuItem("EMailSupport", null, null, mHelp, this); - AEnv.addMenuItem("About", null, null, mHelp, this); - } // createMenu - - /** - * Dispose - */ - public void dispose() - { - log.config(""); - // recursive calls - if (Trace.isCalledFrom("JFrame") && m_panel != null) // [x] close window pressed - m_panel.dispose(); - m_panel = null; - Env.clearWinContext(m_WindowNo); - super.dispose(); - } // dispose - - /** - * Open Form - * @param AD_Form_ID form - * @return true if form opened - */ - public boolean openForm (int AD_Form_ID) - { - return openForm(AD_Form_ID, null); - } - - public boolean openForm (int AD_Form_ID, GridTab gridTab) - { - Properties ctx = Env.getCtx(); - // - String name = null; - String className = null; - String sql = "SELECT Name, Description, ClassName, Help FROM AD_Form WHERE AD_Form_ID=?"; - boolean trl = !Env.isBaseLanguage(ctx, "AD_Form"); - if (trl) - sql = "SELECT t.Name, t.Description, f.ClassName, t.Help " - + "FROM AD_Form f INNER JOIN AD_Form_Trl t" - + " ON (f.AD_Form_ID=t.AD_Form_ID AND AD_Language=?)" - + "WHERE f.AD_Form_ID=?"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement (sql, null); - if (trl) - { - pstmt.setString(1, Env.getAD_Language(ctx)); - pstmt.setInt(2, AD_Form_ID); - } - else - pstmt.setInt(1, AD_Form_ID); - rs = pstmt.executeQuery(); - if (rs.next()) - { - name = rs.getString(1); - m_Description = rs.getString(2); - className = rs.getString(3); - m_Help = rs.getString(4); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - if (className == null) - return false; - // - return openForm(AD_Form_ID, className, name, gridTab); - } // openForm - - /** - * Open Form - * @param AD_Form_ID Form - * @param className class name - * @param name title - * @return true if started - */ - protected boolean openForm (int AD_Form_ID, String className, String name) - { - return openForm(AD_Form_ID, className, name, null); - } - - protected boolean openForm (int AD_Form_ID, String className, String name, GridTab gridTab) - { - if (log.isLoggable(Level.INFO)) log.info("AD_Form_ID=" + AD_Form_ID + " - Class=" + className); - Properties ctx = Env.getCtx(); - Env.setContext(ctx, m_WindowNo, "_WinInfo_WindowName", name); - setTitle(Env.getHeader(ctx, m_WindowNo)); - this.gridTab = gridTab; - - try - { - // Create instance w/o parameters - // Try equinox extension then java classpath - m_panel = Client.getFormPanel(className); - } - catch (Exception e) - { - log.log(Level.SEVERE, "Class=" + className + ", AD_Form_ID=" + AD_Form_ID, e); - return false; - } - // - m_panel.init(m_WindowNo, this); - p_AD_Form_ID = AD_Form_ID; - return true; - } // openForm - - /** - * Get Form Panel - * @return form panel - */ - public FormPanel getFormPanel() - { - return m_panel; - } // getFormPanel - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - String cmd = e.getActionCommand(); - if (cmd.equals("End")) - dispose(); - else if (cmd.equals("Help")) - actionHelp(); - else if (!AEnv.actionPerformed(cmd, m_WindowNo, this)) - log.log(Level.SEVERE, "Not handeled=" + cmd); - } // actionPerformed - - /** - * Show Help - */ - private void actionHelp() - { - StringBuilder sb = new StringBuilder(); - if (m_Description != null && m_Description.length() > 0) - sb.append("

    ").append(m_Description).append("

    "); - if (m_Help != null && m_Help.length() > 0) - sb.append("

    ").append(m_Help); - Help hlp = new Help (AEnv.getFrame(this), this.getTitle(), sb.toString()); - hlp.setVisible(true); - } // actionHelp - - - /************************************************************************* - * Set Window Busy - * @param busy busy - */ - public void setBusy (boolean busy) - { - if (busy == m_glassPane.isVisible()) - return; - if (log.isLoggable(Level.INFO)) log.info("Busy=" + busy); - if (busy) - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - else - setCursor(Cursor.getDefaultCursor()); - m_glassPane.setMessage(null); - m_glassPane.setVisible(busy); - m_glassPane.requestFocus(); - } // setBusy - - /** - * Set Busy Message - * @param AD_Message message - */ - public void setBusyMessage (String AD_Message) - { - m_glassPane.setMessage(AD_Message); - } // setBusyMessage - - /** - * Set and start Busy Counter - * @param time in seconds - */ - public void setBusyTimer (int time) - { - m_glassPane.setBusyTimer (time); - } // setBusyTimer - - - /** - * Set Maximize Window - * @param max maximize - */ - public void setMaximize (boolean max) - { - m_maximize = max; - } // setMaximize - - - /** - * Form Window Opened. - * Maximize window if required - * @param evt event - */ - private void formWindowOpened(java.awt.event.WindowEvent evt) - { - if (m_maximize == true) - { - super.setVisible(true); - super.setExtendedState(JFrame.MAXIMIZED_BOTH); - } - } // formWindowOpened - -// Add window and tab no called from - - public void setProcessInfo(ProcessInfo pi) - { - m_pi = pi; - - } - - public ProcessInfo getProcessInfo() - { - return m_pi; - } - - // End - - /** - * Start Batch - * @param process - * @return running thread - */ - public Thread startBatch (final Runnable process) - { - Thread worker = new Thread() - { - public void run() - { - setBusy(true); - process.run(); - setBusy(false); - } - }; - worker.start(); - return worker; - } // startBatch - - /** - * @return Returns the AD_Form_ID. - */ - public int getAD_Form_ID () - { - return p_AD_Form_ID; - } // getAD_Window_ID - /** - * @return Returns the manuBar - */ - public JMenuBar getMenu() - { - return menuBar; - } - - private GridTab gridTab; - - public GridTab getGridTab() - { - return gridTab; - } -} // FormFrame diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/FormPanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/FormPanel.java deleted file mode 100644 index dae1ca1b5d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/FormPanel.java +++ /dev/null @@ -1,40 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.form; - - -/** - * Form Panel Interface. - * for communicating between FormFrame and JPanel - * @author Jorg Janke - * @version $Id: FormPanel.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public interface FormPanel -{ - /** - * Initialize Panel - * @param WindowNo window - * @param frame parent frame - */ - public void init (int WindowNo, FormFrame frame); - - /** - * Dispose - Free Resources - */ - public void dispose(); - -} // FormPanel diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VAllocation.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VAllocation.java deleted file mode 100644 index 514b1cfe41..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VAllocation.java +++ /dev/null @@ -1,499 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2009 Low Heng Sin * - * Copyright (C) 2009 Idalica Corporation * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.apps.form; - -import static org.compiere.model.SystemIDs.COLUMN_C_INVOICE_C_BPARTNER_ID; -import static org.compiere.model.SystemIDs.COLUMN_C_INVOICE_C_CURRENCY_ID; -import static org.compiere.model.SystemIDs.COLUMN_C_PERIOD_AD_ORG_ID; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.VetoableChangeListener; -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JScrollPane; -import javax.swing.JSplitPane; -import javax.swing.SwingConstants; -import javax.swing.event.TableModelEvent; -import javax.swing.event.TableModelListener; -import javax.swing.table.DefaultTableModel; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ADialog; -import org.compiere.apps.StatusBar; -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VLookup; -import org.compiere.minigrid.MiniTable; -import org.compiere.model.MAllocationHdr; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.plaf.CompiereColor; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextField; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Trx; -import org.compiere.util.TrxRunnable; - -public class VAllocation extends Allocation - implements FormPanel, ActionListener, TableModelListener, VetoableChangeListener -{ - private CPanel panel = new CPanel(); - - /** - * Initialize Panel - * @param WindowNo window - * @param frame frame - */ - public void init (int WindowNo, FormFrame frame) - { - m_WindowNo = WindowNo; - m_frame = frame; - Env.setContext(Env.getCtx(), m_WindowNo, "IsSOTrx", "Y"); // defaults to no - try - { - super.dynInit(); - dynInit(); - jbInit(); - calculate(); - frame.getContentPane().add(mainPanel, BorderLayout.CENTER); - frame.getContentPane().add(statusBar, BorderLayout.SOUTH); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - } - } // init - - /** Window No */ - private int m_WindowNo = 0; - /** FormFrame */ - private FormFrame m_frame; - - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel parameterPanel = new CPanel(); - private CPanel allocationPanel = new CPanel(); - private GridBagLayout parameterLayout = new GridBagLayout(); - private JLabel bpartnerLabel = new JLabel(); - private VLookup bpartnerSearch = null; - private MiniTable invoiceTable = new MiniTable(); - private MiniTable paymentTable = new MiniTable(); - private JSplitPane infoPanel = new JSplitPane(); - private CPanel paymentPanel = new CPanel(); - private CPanel invoicePanel = new CPanel(); - private JLabel paymentLabel = new JLabel(); - private JLabel invoiceLabel = new JLabel(); - private BorderLayout paymentLayout = new BorderLayout(); - private BorderLayout invoiceLayout = new BorderLayout(); - private JLabel paymentInfo = new JLabel(); - private JLabel invoiceInfo = new JLabel(); - private JScrollPane paymentScrollPane = new JScrollPane(); - private JScrollPane invoiceScrollPane = new JScrollPane(); - private GridBagLayout allocationLayout = new GridBagLayout(); - private JLabel differenceLabel = new JLabel(); - private CTextField differenceField = new CTextField(); - private JButton allocateButton = new JButton(); - private JLabel currencyLabel = new JLabel(); - private VLookup currencyPick = null; - private JLabel chargeLabel = new JLabel(); - private VLookup chargePick = null; - private JCheckBox multiCurrency = new JCheckBox(); - private JLabel allocCurrencyLabel = new JLabel(); - private StatusBar statusBar = new StatusBar(); - private JLabel dateLabel = new JLabel(); - private VDate dateField = new VDate(); - private JCheckBox autoWriteOff = new JCheckBox(); - private JLabel organizationLabel = new JLabel(); - private VLookup organizationPick = null; - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - CompiereColor.setBackground(panel); - // - mainPanel.setLayout(mainLayout); - dateLabel.setText(Msg.getMsg(Env.getCtx(), "Date")); - dateLabel.setToolTipText(Msg.getMsg(Env.getCtx(), "AllocDate", false)); - autoWriteOff.setSelected(false); - autoWriteOff.setText(Msg.getMsg(Env.getCtx(), "AutoWriteOff", true)); - autoWriteOff.setToolTipText(Msg.getMsg(Env.getCtx(), "AutoWriteOff", false)); - // - parameterPanel.setLayout(parameterLayout); - allocationPanel.setLayout(allocationLayout); - bpartnerLabel.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID")); - paymentLabel.setRequestFocusEnabled(false); - paymentLabel.setText(" " + Msg.translate(Env.getCtx(), "C_Payment_ID")); - invoiceLabel.setRequestFocusEnabled(false); - invoiceLabel.setText(" " + Msg.translate(Env.getCtx(), "C_Invoice_ID")); - paymentPanel.setLayout(paymentLayout); - invoicePanel.setLayout(invoiceLayout); - invoiceInfo.setHorizontalAlignment(SwingConstants.RIGHT); - invoiceInfo.setHorizontalTextPosition(SwingConstants.RIGHT); - invoiceInfo.setText("."); - paymentInfo.setHorizontalAlignment(SwingConstants.RIGHT); - paymentInfo.setHorizontalTextPosition(SwingConstants.RIGHT); - paymentInfo.setText("."); - chargeLabel.setText(Msg.translate(Env.getCtx(), "C_Charge_ID")); - chargeLabel.setToolTipText(Msg.getMsg(Env.getCtx(), "ChargeDifference", false)); - differenceLabel.setText(Msg.getMsg(Env.getCtx(), "Difference")); - differenceField.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - differenceField.setEditable(false); - differenceField.setText("0"); - differenceField.setColumns(8); - differenceField.setHorizontalAlignment(SwingConstants.RIGHT); - allocateButton.setText(Msg.getMsg(Env.getCtx(), "Process")); - allocateButton.addActionListener(this); - currencyLabel.setText(Msg.translate(Env.getCtx(), "C_Currency_ID")); - multiCurrency.setText(Msg.getMsg(Env.getCtx(), "MultiCurrency")); - multiCurrency.addActionListener(this); - allocCurrencyLabel.setText("."); - invoiceScrollPane.setPreferredSize(new Dimension(200, 200)); - paymentScrollPane.setPreferredSize(new Dimension(200, 200)); - mainPanel.add(parameterPanel, BorderLayout.NORTH); - - //org filter - organizationLabel.setText(Msg.translate(Env.getCtx(), "AD_Org_ID")); - parameterPanel.add(organizationLabel, new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5,5,5,5), 0, 0)); - parameterPanel.add(organizationPick, new GridBagConstraints(5, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5,5,5,5), 0, 0)); - - parameterPanel.add(bpartnerLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterPanel.add(bpartnerSearch, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0)); - parameterPanel.add(dateLabel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterPanel.add(dateField, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0)); - parameterPanel.add(currencyLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterPanel.add(currencyPick, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0)); - parameterPanel.add(multiCurrency, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0)); - parameterPanel.add(autoWriteOff, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - mainPanel.add(allocationPanel, BorderLayout.SOUTH); - allocationPanel.add(differenceLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 0), 0, 0)); - allocationPanel.add(differenceField, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0)); - allocationPanel.add(chargeLabel, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - allocationPanel.add(chargePick, new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - allocationPanel.add(allocateButton, new GridBagConstraints(5, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0)); - allocationPanel.add(allocCurrencyLabel, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - paymentPanel.add(paymentLabel, BorderLayout.NORTH); - paymentPanel.add(paymentInfo, BorderLayout.SOUTH); - paymentPanel.add(paymentScrollPane, BorderLayout.CENTER); - paymentScrollPane.getViewport().add(paymentTable, null); - invoicePanel.add(invoiceLabel, BorderLayout.NORTH); - invoicePanel.add(invoiceInfo, BorderLayout.SOUTH); - invoicePanel.add(invoiceScrollPane, BorderLayout.CENTER); - invoiceScrollPane.getViewport().add(invoiceTable, null); - // - mainPanel.add(infoPanel, BorderLayout.CENTER); - infoPanel.setOrientation(JSplitPane.VERTICAL_SPLIT); - infoPanel.setBorder(BorderFactory.createEtchedBorder()); - infoPanel.setTopComponent(paymentPanel); - infoPanel.setBottomComponent(invoicePanel); - infoPanel.add(paymentPanel, JSplitPane.TOP); - infoPanel.add(invoicePanel, JSplitPane.BOTTOM); - infoPanel.setContinuousLayout(true); - infoPanel.setPreferredSize(new Dimension(800,250)); - infoPanel.setDividerLocation(110); - } // jbInit - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** - * Dynamic Init (prepare dynamic fields) - * @throws Exception if Lookups cannot be initialized - */ - public void dynInit() throws Exception - { - // Currency - int AD_Column_ID = COLUMN_C_INVOICE_C_CURRENCY_ID; // C_Invoice.C_Currency_ID - MLookup lookupCur = MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, AD_Column_ID, DisplayType.TableDir); - currencyPick = new VLookup("C_Currency_ID", true, false, true, lookupCur); - currencyPick.setValue(Integer.valueOf(m_C_Currency_ID)); - currencyPick.addVetoableChangeListener(this); - - // Organization filter selection - AD_Column_ID = COLUMN_C_PERIOD_AD_ORG_ID; //C_Period.AD_Org_ID (needed to allow org 0) - MLookup lookupOrg = MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, AD_Column_ID, DisplayType.TableDir); - organizationPick = new VLookup("AD_Org_ID", true, false, true, lookupOrg); - organizationPick.setValue(Env.getAD_Org_ID(Env.getCtx())); - organizationPick.addVetoableChangeListener(this); - - // BPartner - AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID - MLookup lookupBP = MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, AD_Column_ID, DisplayType.Search); - bpartnerSearch = new VLookup("C_BPartner_ID", true, false, true, lookupBP); - bpartnerSearch.addVetoableChangeListener(this); - - // Translation - statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), "AllocateStatus")); - statusBar.setStatusDB(""); - - // Date set to Login Date - dateField.setValue(Env.getContextAsDate(Env.getCtx(), "#Date")); - dateField.addVetoableChangeListener(this); - - // Charge - AD_Column_ID = 61804; // C_AllocationLine.C_Charge_ID - MLookup lookupCharge = MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, AD_Column_ID, DisplayType.TableDir); - chargePick = new VLookup("C_Charge_ID", false, false, true, lookupCharge); - chargePick.setValue(Integer.valueOf(m_C_Charge_ID)); - chargePick.addVetoableChangeListener(this); - } // dynInit - - /************************************************************************** - * Action Listener. - * - MultiCurrency - * - Allocate - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - log.config(""); - if (e.getSource().equals(multiCurrency)) - loadBPartner(); - // Allocate - else if (e.getSource().equals(allocateButton)) - { - allocateButton.setEnabled(false); - saveData(); - loadBPartner(); - allocateButton.setEnabled(true); - } - } // actionPerformed - - /** - * Table Model Listener. - * - Recalculate Totals - * @param e event - */ - public void tableChanged(TableModelEvent e) - { - boolean isUpdate = (e.getType() == TableModelEvent.UPDATE); - // Not a table update - if (!isUpdate) - { - calculate(); - return; - } - - int row = e.getFirstRow(); - int col = e.getColumn(); - - if (row < 0) - return; - - boolean isInvoice = (e.getSource().equals(invoiceTable.getModel())); - boolean isAutoWriteOff = autoWriteOff.isSelected(); - - String msg = writeOff(row, col, isInvoice, paymentTable, invoiceTable, isAutoWriteOff); - - //render row - @SuppressWarnings("unused") - DefaultTableModel model = (DefaultTableModel) (isInvoice ? invoiceTable.getModel() : paymentTable.getModel()); - //model.fireTableRowsUpdated(row, row); - - if(msg != null && msg.length() > 0) - ADialog.warn(m_WindowNo, panel, "AllocationWriteOffWarn"); - - calculate(); - } // tableChanged - - /** - * Vetoable Change Listener. - * - Business Partner - * - Currency - * - Date - * @param e event - */ - public void vetoableChange (PropertyChangeEvent e) - { - String name = e.getPropertyName(); - Object value = e.getNewValue(); - if (log.isLoggable(Level.CONFIG)) log.config(name + "=" + value); - - if (value == null) - return; - - // Organization - if (name.equals("AD_Org_ID")) - { - m_AD_Org_ID = ((Integer) value).intValue(); - - loadBPartner(); - } -// Charge - else if (name.equals("C_Charge_ID") ) - { - m_C_Charge_ID = ((Integer) value).intValue(); - - setAllocateButton(); - } - - // BPartner - if (name.equals("C_BPartner_ID")) - { - bpartnerSearch.setValue(value); - m_C_BPartner_ID = ((Integer)value).intValue(); - loadBPartner(); - } - // Currency - else if (name.equals("C_Currency_ID")) - { - m_C_Currency_ID = ((Integer)value).intValue(); - loadBPartner(); - } - // Date for Multi-Currency - else if (name.equals("Date") && multiCurrency.isSelected()) - loadBPartner(); - } // vetoableChange - - - private void setAllocateButton() { - if (totalDiff.signum() == 0 ^ m_C_Charge_ID > 0 ) - { - allocateButton.setEnabled(true); - // chargePick.setValue(m_C_Charge_ID); - } - else - { - allocateButton.setEnabled(false); - } - - if ( totalDiff.signum() == 0 ) - { - chargePick.setValue(null); - m_C_Charge_ID = 0; - } - } - - public void loadBPartner() - { - checkBPartner(); - - Vector> data = getPaymentData(multiCurrency.isSelected(), dateField.getValue(), paymentTable); - Vector columnNames = getPaymentColumnNames(multiCurrency.isSelected()); - - // Remove previous listeners - paymentTable.getModel().removeTableModelListener(this); - - // Set Model - DefaultTableModel modelP = new DefaultTableModel(data, columnNames); - modelP.addTableModelListener(this); - paymentTable.setModel(modelP); - setPaymentColumnClass(paymentTable, multiCurrency.isSelected()); - // - - data = getInvoiceData(multiCurrency.isSelected(), dateField.getValue(), invoiceTable); - columnNames = getInvoiceColumnNames(multiCurrency.isSelected()); - - // Remove previous listeners - invoiceTable.getModel().removeTableModelListener(this); - - // Set Model - DefaultTableModel modelI = new DefaultTableModel(data, columnNames); - modelI.addTableModelListener(this); - invoiceTable.setModel(modelI); - setInvoiceColumnClass(invoiceTable, multiCurrency.isSelected()); - // - - calculate(multiCurrency.isSelected()); - - // Calculate Totals - calculate(); - } - - public void calculate() - { - allocDate = null; - - paymentInfo.setText(calculatePayment(paymentTable, multiCurrency.isSelected())); - invoiceInfo.setText(calculateInvoice(invoiceTable, multiCurrency.isSelected())); - - // Set AllocationDate - if (allocDate != null) - dateField.setValue(allocDate); - // Set Allocation Currency - allocCurrencyLabel.setText(currencyPick.getDisplay()); - // Difference - totalDiff = totalPay.subtract(totalInv); - differenceField.setText(format.format(totalDiff)); - - setAllocateButton(); - - } - - /************************************************************************** - * Save Data - */ - public void saveData() - { - if (m_AD_Org_ID > 0) - Env.setContext(Env.getCtx(), m_WindowNo, "AD_Org_ID", m_AD_Org_ID); - else - Env.setContext(Env.getCtx(), m_WindowNo, "AD_Org_ID", ""); - try - { - Trx.run(new TrxRunnable() - { - public void run(String trxName) - { - MAllocationHdr allocation = saveData(m_WindowNo, dateField.getValue(), paymentTable, invoiceTable, trxName); - if (allocation != null) - statusBar.setStatusLine(allocation.getDocumentNo()); - } - }); - } - catch (Exception e) - { - ADialog.error(m_WindowNo, panel, "Error", e.getLocalizedMessage()); - return; - } - } // saveData -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VAttributeGrid.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VAttributeGrid.java deleted file mode 100644 index 2e9f6d364e..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VAttributeGrid.java +++ /dev/null @@ -1,550 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.GridLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.text.DecimalFormat; -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.BorderFactory; -import javax.swing.BoxLayout; -import javax.swing.JLabel; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import org.compiere.Adempiere; -import org.compiere.apps.AEnv; -import org.compiere.apps.ALayout; -import org.compiere.apps.ALayoutConstraint; -import org.compiere.apps.ConfirmPanel; -import org.compiere.grid.ed.VComboBox; -import org.compiere.model.MAttribute; -import org.compiere.model.MAttributeValue; -import org.compiere.model.MProduct; -import org.compiere.model.MProductPrice; -import org.compiere.model.MRole; -import org.compiere.model.MStorageReservation; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CScrollPane; -import org.compiere.swing.CTabbedPane; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - - -/** - * Product Attribute Table. - * Select one or two attributes for view/etc. - * - * @author Jorg Janke - * @version $Id: VAttributeGrid.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VAttributeGrid extends CPanel - implements FormPanel, ChangeListener, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 3207678550566202041L; - - /** - * Init - * @param WindowNo - * @param frame - */ - public void init (int WindowNo, FormFrame frame) - { - m_WindowNo = WindowNo; - m_frame = frame; - // Layout - frame.getContentPane().add(this, BorderLayout.CENTER); - this.setLayout(new BorderLayout()); - this.add(tabbedPane, BorderLayout.CENTER); - this.add(confirmPanel, BorderLayout.SOUTH); - tabbedPane.addChangeListener(this); - confirmPanel.addActionListener(this); - // - tabbedPane.add(selectPanel, Msg.getMsg(Env.getCtx(), "Selection")); - selectPanel.add(attributeLabel1, new ALayoutConstraint(0,0)); - m_attributes = MAttribute.getOfClient(Env.getCtx(), true, true); - Vector vector = new Vector(); - vector.add(new KeyNamePair(0,"")); - for (int i = 0; i < m_attributes.length; i++) - vector.add(m_attributes[i].getKeyNamePair()); - attributeCombo1 = new CComboBox(vector); - selectPanel.add(attributeCombo1, null); - selectPanel.add(attributeLabel2, new ALayoutConstraint(1,0)); - attributeCombo2 = new CComboBox(vector); - selectPanel.add(attributeCombo2, null); - // - fillPicks(); - selectPanel.add(labelPriceList, new ALayoutConstraint(2,0)); - selectPanel.add(pickPriceList); - selectPanel.add(labelWarehouse, new ALayoutConstraint(3,0)); - selectPanel.add(pickWarehouse); - // - selectPanel.setPreferredSize(new Dimension (300,200)); - // - // Grid - tabbedPane.add(gridPanel, "AttributeGrid"); - modePanel.add(modeLabel); - modePanel.add(modeCombo); - modeCombo.addActionListener(this); - } // init - - /** Window No */ - @SuppressWarnings("unused") - private int m_WindowNo = 0; - /** FormFrame */ - private FormFrame m_frame; - /** Product Attributes */ - private MAttribute[] m_attributes = null; - /** Setting Grid */ - private boolean m_setting = false; - /** Logger */ - private static CLogger log = CLogger.getCLogger (VAttributeGrid.class); - - /** Modes */ - private static String[] MODES = new String[]{ - Msg.getMsg(Env.getCtx(), "ModeView") - // ,Msg.getMsg(Env.getCtx(), "ModePO") - // ,Msg.getMsg(Env.getCtx(), "ModePrice") - }; - private static final int MODE_VIEW = 0; - private static final int MODE_PO = 0; - private static final int MODE_PRICE = 0; - - /** Price List Version */ - private int m_M_PriceList_Version_ID = 0; - private DecimalFormat m_price = DisplayType.getNumberFormat(DisplayType.CostPrice); - /** Warehouse */ - private int m_M_Warehouse_ID = 0; - private DecimalFormat m_qty = DisplayType.getNumberFormat(DisplayType.Quantity); - - /** UI **/ - private CTabbedPane tabbedPane = new CTabbedPane(); - private CPanel selectPanel = new CPanel(new ALayout()); - private CLabel attributeLabel1 = new CLabel(Msg.getElement(Env.getCtx(), "M_Attribute_ID") + " 1"); - private CComboBox attributeCombo1 = null; - private CLabel attributeLabel2 = new CLabel(Msg.getElement(Env.getCtx(), "M_Attribute_ID") + " 2"); - private CComboBox attributeCombo2 = null; - private CLabel labelPriceList = new CLabel(Msg.getElement(Env.getCtx(), "M_PriceList_ID")); - private VComboBox pickPriceList = new VComboBox(); - private CLabel labelWarehouse = new CLabel(Msg.getElement(Env.getCtx(), "M_Warehouse_ID")); - private VComboBox pickWarehouse = new VComboBox(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - // - private CPanel gridPanel = new CPanel(new BorderLayout()); - private CPanel modePanel = new CPanel(); - private CLabel modeLabel = new CLabel(Msg.getMsg(Env.getCtx(), "Mode")); - private CComboBox modeCombo = new CComboBox(MODES); - - /** - * Dispose - */ - public void dispose () - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** - * Fill Picks with values - */ - private void fillPicks () - { - // Price List - String sql = "SELECT M_PriceList_Version.M_PriceList_Version_ID," - + " M_PriceList_Version.Name || ' (' || c.Iso_Code || ')' AS ValueName " - + "FROM M_PriceList_Version, M_PriceList pl, C_Currency c " - + "WHERE M_PriceList_Version.M_PriceList_ID=pl.M_PriceList_ID" - + " AND pl.C_Currency_ID=c.C_Currency_ID" - + " AND M_PriceList_Version.IsActive='Y' AND pl.IsActive='Y'"; - // Add Access & Order - sql = MRole.getDefault().addAccessSQL (sql, "M_PriceList_Version", true, false) // fully qualidfied - RO - + " ORDER BY M_PriceList_Version.Name"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pickPriceList.addItem(new KeyNamePair (0, "")); - pstmt = DB.prepareStatement(sql, null); - rs = pstmt.executeQuery(); - while (rs.next()) - { - KeyNamePair kn = new KeyNamePair (rs.getInt(1), rs.getString(2)); - pickPriceList.addItem(kn); - } - DB.close(rs, pstmt); - rs = null;pstmt = null; - - // Warehouse - sql = "SELECT M_Warehouse_ID, Value || ' - ' || Name AS ValueName " - + "FROM M_Warehouse " - + "WHERE IsActive='Y'"; - sql = MRole.getDefault().addAccessSQL (sql, - "M_Warehouse", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO) - + " ORDER BY Value"; - pickWarehouse.addItem(new KeyNamePair (0, "")); - pstmt = DB.prepareStatement(sql, null); - rs = pstmt.executeQuery(); - while (rs.next()) - { - KeyNamePair kn = new KeyNamePair - (rs.getInt("M_Warehouse_ID"), rs.getString("ValueName")); - pickWarehouse.addItem(kn); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - } // fillPicks - - - /** - * Change Listener - * @param e event - */ - public void stateChanged (ChangeEvent e) - { - if (e.getSource() != tabbedPane) - return; - if (tabbedPane.getSelectedIndex() == 1) - createGrid(); - } // stateChanged - - /** - * Action Performed - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - // log.fine(e.toString()); - if (e.getSource() == modeCombo) - createGrid(); - else if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - if (tabbedPane.getSelectedIndex() == 0) - createGrid(); - else - gridOK(); - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - m_frame.dispose(); - } // actionPerformed - - - private void gridOK() - { - int mode = modeCombo.getSelectedIndex(); - // Create PO - if (mode == MODE_PO) - { - createPO(); - modeCombo.setSelectedIndex(MODE_VIEW); - return; - } - // Update Prices - else if (mode == MODE_PRICE) - { - updatePrices(); - modeCombo.setSelectedIndex(MODE_VIEW); - return; - } - else if (mode == MODE_VIEW) - ; - m_frame.dispose(); - } // gridOK - - private void createPO() - { - - } - private void updatePrices() - { - - } - /** - * Create Grid - */ - private void createGrid() - { - if (attributeCombo1 == null || m_setting) - return; // init - int indexAttr1 = attributeCombo1.getSelectedIndex(); - int indexAttr2 = attributeCombo2.getSelectedIndex(); - if (indexAttr1 == indexAttr2) - { - log.warning("Same Attribute Selected"); - tabbedPane.setSelectedIndex(0); - return; - } - m_setting = true; - m_M_PriceList_Version_ID = 0; - KeyNamePair pl = (KeyNamePair)pickPriceList.getSelectedItem(); - if (pl != null) - m_M_PriceList_Version_ID = pl.getKey(); - m_M_Warehouse_ID = 0; - KeyNamePair wh = (KeyNamePair)pickWarehouse.getSelectedItem(); - if (wh != null) - m_M_Warehouse_ID = wh.getKey(); - - // x dimension - int cols = 2; - MAttributeValue[] xValues = null; - if (indexAttr1 > 0) - xValues = m_attributes[indexAttr1-1].getMAttributeValues(); - if (xValues != null) - { - cols = xValues.length + 1; - if (log.isLoggable(Level.INFO)) log.info("X - " + m_attributes[indexAttr1-1].getName() + " #" + xValues.length); - } - - // y dimension - int rows = 2; - MAttributeValue[] yValues = null; - if (indexAttr2 > 0) - yValues = m_attributes[indexAttr2-1].getMAttributeValues(); - if (yValues != null) - { - rows = yValues.length + 1; - if (log.isLoggable(Level.INFO)) log.info("Y - " + m_attributes[indexAttr2-1].getName() + " #" + yValues.length); - } - - // - gridPanel.removeAll(); - CPanel grid = new CPanel(new GridLayout(rows, cols, 5,5)); - gridPanel.add(modePanel, BorderLayout.NORTH); - gridPanel.add(new CScrollPane(grid), BorderLayout.CENTER); - // - if (log.isLoggable(Level.INFO)) log.info("Rows=" + rows + " - Cols=" + cols); - for (int row = 0; row < rows; row++) - { - for (int col = 0; col < cols; col++) - { - MAttributeValue xValue = null; - if (xValues != null && col > 0) - xValue = xValues[col - 1]; - MAttributeValue yValue = null; - if (yValues != null && row > 0) - yValue = yValues[row - 1]; - // log.fine("Row=" + row + " - Col=" + col); - // - if (row == 0 && col == 0) - { - CPanel descr = new CPanel(new GridLayout(2,1,0,0)); - if (xValues != null) - descr.add(new JLabel(m_attributes[indexAttr1-1].getName(),JLabel.TRAILING)); - if (yValues != null) - descr.add(new JLabel(m_attributes[indexAttr2-1].getName())); - grid.add(descr); - } - else if (row == 0) // column labels - { - if (xValue != null) - { - grid.add(new JLabel(xValue.getName(), JLabel.TRAILING)); - } - else - grid.add(new JLabel()); - } - else if (col == 0) // row labels - { - if (yValue != null) - grid.add(new JLabel(yValue.getName())); - else - grid.add(new JLabel()); - } - else - { - grid.add(getGridElement (xValue, yValue)); - } - } - } - // - tabbedPane.setSelectedIndex(1); - m_setting = false; - m_frame.pack(); - } // createGrid - - /** - * Get Grid Element - * @param xValue X value - * @param yValue Y value - * @return Panel with Info - */ - private CPanel getGridElement (MAttributeValue xValue, MAttributeValue yValue) - { - CPanel element = new CPanel(); - element.setBorder(BorderFactory.createLineBorder(Color.BLACK, 2)); - element.setLayout(new BoxLayout(element, BoxLayout.Y_AXIS)); - - String sql = "SELECT * FROM M_Product WHERE IsActive='Y'"; - // Product Attributes - if (xValue != null) - sql += " AND M_AttributeSetInstance_ID IN " - + "(SELECT M_AttributeSetInstance_ID " - + "FROM M_AttributeInstance " - + "WHERE M_Attribute_ID=" + xValue.getM_Attribute_ID() - + " AND M_AttributeValue_ID=" + xValue.getM_AttributeValue_ID() + ")"; - if (yValue != null) - sql += " AND M_AttributeSetInstance_ID IN " - + "(SELECT M_AttributeSetInstance_ID " - + "FROM M_AttributeInstance " - + "WHERE M_Attribute_ID=" + yValue.getM_Attribute_ID() - + " AND M_AttributeValue_ID=" + yValue.getM_AttributeValue_ID() + ")"; - sql = MRole.getDefault().addAccessSQL(sql, "M_Product", - MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - PreparedStatement pstmt = null; - ResultSet rs = null; - int noProducts = 0; - try - { - pstmt = DB.prepareStatement (sql, null); - rs = pstmt.executeQuery (); - while (rs.next ()) - { - MProduct product = new MProduct(Env.getCtx(), rs, null); - addProduct (element, product); - noProducts++; - } - } - catch (Exception e) - { - log.log (Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - int mode = modeCombo.getSelectedIndex(); - // No Products - if (noProducts == 0 && mode == MODE_VIEW) - { - // CButton button = ConfirmPanel.createNewButton(true); - // button.addActionListener(this); - // element.add(button); - } - else // Additional Elements - { - if (mode == MODE_PRICE) - { - // Price Field - } - else if (mode == MODE_PO) - { - // Qty Field - } - } - return element; - } // getGridElement - - /** - * Add Product - * @param element panel - * @param product product - */ - private void addProduct(CPanel element, MProduct product) - { - Insets ii = new Insets(2,4,2,4); - int M_Product_ID = product.getM_Product_ID(); - CPanel pe = new CPanel(); - pe.setBorder(BorderFactory.createLineBorder(Color.BLUE, 1)); - pe.setLayout(new GridBagLayout()); - - // Product Value - Price - pe.add(new JLabel(product.getValue()), new GridBagConstraints(0,0, 1,1, 0,0, - GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, ii, 0,0)); - String formatted = ""; - if (m_M_PriceList_Version_ID != 0) - { - MProductPrice pp = MProductPrice.get(Env.getCtx(), m_M_PriceList_Version_ID, M_Product_ID, null); - if (pp != null) - { - BigDecimal price = pp.getPriceStd(); - formatted = m_price.format(price); - } - else - formatted = "-"; - } - pe.add(new JLabel(formatted, JLabel.RIGHT), new GridBagConstraints(1,0, 1,1, .5,0, - GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, ii, 0,0)); - - // Product Name - Qty - pe.add(new JLabel(product.getName()), new GridBagConstraints(0,1, 1,1, 0,0, - GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, ii, 0,0)); - formatted = ""; - if (m_M_Warehouse_ID != 0) - { - BigDecimal qty = MStorageReservation.getQtyAvailable(m_M_Warehouse_ID, M_Product_ID, 0, null); - if (qty == null) - formatted = "-"; - else - formatted = m_qty.format(qty); - } - pe.add(new JLabel(formatted, JLabel.RIGHT), new GridBagConstraints(1,1, 1,1, .5,0, - GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, ii, 0,0)); - // - element.add(pe); - } // addProduct - - - /************************************************************************* - * Test - * @param args ignored - */ - public static void main (String[] args) - { - Adempiere.startup(true); - Env.setContext(Env.getCtx(), "#AD_Client_ID", 11); - FormFrame ff = new FormFrame(null); - ff.openForm(1111, "org.compiere.apps.form.VAttributeGrid", "Attribute Table"); - ff.pack(); - AEnv.showCenterScreen(ff); - } // main - - -} // VAttributeTable diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VBOMDrop.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VBOMDrop.java deleted file mode 100644 index 7da35141d1..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VBOMDrop.java +++ /dev/null @@ -1,738 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Iterator; -import java.util.logging.Level; - -import javax.swing.AbstractButton; -import javax.swing.ButtonGroup; -import javax.swing.JCheckBox; -import javax.swing.JRadioButton; -import javax.swing.JToggleButton; -import javax.swing.border.TitledBorder; - -import org.compiere.apps.ALayout; -import org.compiere.apps.ALayoutConstraint; -import org.compiere.apps.ConfirmPanel; -import org.compiere.grid.ed.VNumber; -import org.compiere.model.MInvoice; -import org.compiere.model.MInvoiceLine; -import org.compiere.model.MOrder; -import org.compiere.model.MOrderLine; -import org.compiere.model.MProduct; -import org.compiere.model.MProject; -import org.compiere.model.MProjectLine; -import org.compiere.model.MRole; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CScrollPane; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; -import org.eevolution.model.MPPProductBOM; -import org.eevolution.model.MPPProductBOMLine; - -/** - * Drop BOM - * - * @author Jorg Janke - * @version $Id: VBOMDrop.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VBOMDrop extends CPanel - implements FormPanel, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 3135475369002895149L; - - - /** - * Initialize Panel - * @param WindowNo window - * @param frame parent frame - */ - public void init (int WindowNo, FormFrame frame) - { - log.info(""); - m_WindowNo = WindowNo; - m_frame = frame; - try - { - // Top Selection Panel - createSelectionPanel(true, true, true); - m_frame.getContentPane().add(selectionPanel, BorderLayout.NORTH); - // Center - createMainPanel(); - CScrollPane scroll = new CScrollPane (this); - m_frame.getContentPane().add(scroll, BorderLayout.CENTER); - confirmPanel.addActionListener(this); - // South - m_frame.getContentPane().add(confirmPanel, BorderLayout.SOUTH); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - } - sizeIt(); - } // init - - /** - * Size Window - */ - private void sizeIt() - { - // Frame - m_frame.pack(); - Dimension size = m_frame.getPreferredSize(); - size.width = WINDOW_WIDTH; - m_frame.setSize(size); - } // size - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - removeAll(); - if (selectionPanel != null) - selectionPanel.removeAll(); - selectionPanel = null; - if (m_selectionList != null) - m_selectionList.clear(); - m_selectionList = null; - if (m_productList != null) - m_productList.clear(); - m_productList = null; - if (m_qtyList != null) - m_qtyList.clear(); - m_qtyList = null; - if (m_buttonGroups != null) - m_buttonGroups.clear(); - m_buttonGroups = null; - } // dispose - - /** Window No */ - @SuppressWarnings("unused") - private int m_WindowNo = 0; - /** FormFrame */ - private FormFrame m_frame; - /** Product to create BOMs from */ - private MProduct m_product; - /** BOM Qty */ - private BigDecimal m_qty = Env.ONE; - /** Line Counter */ - private int m_bomLine = 0; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VBOMDrop.class); - - /** List of all selectors */ - private ArrayList m_selectionList = new ArrayList(); - /** List of all quantities */ - private ArrayList m_qtyList = new ArrayList(); - /** List of all products */ - private ArrayList m_productList = new ArrayList(); - /** Alternative Group Lists */ - private HashMap m_buttonGroups = new HashMap(); - - private static final int WINDOW_WIDTH = 600; // width of the window - // - private ConfirmPanel confirmPanel = new ConfirmPanel (true); - private CPanel selectionPanel = new CPanel(new ALayout()); - private CComboBoxproductField; - private VNumber productQty = new VNumber("Qty", true, false, true, DisplayType.Quantity, Msg.translate(Env.getCtx(), "Qty")); - private CComboBoxorderField; - private CComboBoxinvoiceField; - private CComboBoxprojectField; - - - /************************************************************************** - * Create Selection Panel - * @param order - * @param invoice - * @param project - */ - private void createSelectionPanel (boolean order, boolean invoice, boolean project) - { - int row = 0; - selectionPanel.setBorder(new TitledBorder(Msg.translate(Env.getCtx(), "Selection"))); - productField = new CComboBox(getProducts()); - CLabel label = new CLabel(Msg.translate(Env.getCtx(), "M_Product_ID")); - label.setLabelFor(productField); - selectionPanel.add(label, new ALayoutConstraint(row++, 0)); - selectionPanel.add(productField); - productField.addActionListener(this); - // Qty - label = new CLabel (productQty.getTitle()); - label.setLabelFor(productQty); - selectionPanel.add(label); - selectionPanel.add(productQty); - productQty.setValue(Env.ONE); - productQty.addActionListener(this); - - if (order) - { - orderField = new CComboBox(getOrders()); - label = new CLabel (Msg.translate(Env.getCtx(), "C_Order_ID")); - label.setLabelFor(orderField); - selectionPanel.add(label, new ALayoutConstraint(row++, 0)); - selectionPanel.add(orderField); - orderField.addActionListener(this); - } - if (invoice) - { - invoiceField = new CComboBox(getInvoices()); - label = new CLabel (Msg.translate(Env.getCtx(), "C_Invoice_ID")); - label.setLabelFor(invoiceField); - selectionPanel.add(label, new ALayoutConstraint(row++, 0)); - selectionPanel.add(invoiceField); - invoiceField.addActionListener(this); - } - if (project) - { - projectField = new CComboBox(getProjects()); - label = new CLabel (Msg.translate(Env.getCtx(), "C_Project_ID")); - label.setLabelFor(projectField); - selectionPanel.add(label, new ALayoutConstraint(row++, 0)); - selectionPanel.add(projectField); - projectField.addActionListener(this); - } - // Enabled in ActionPerformed - confirmPanel.getOKButton().setEnabled(false); - // Size - Dimension size = selectionPanel.getPreferredSize(); - size.width = WINDOW_WIDTH; - selectionPanel.setPreferredSize(size); - } // createSelectionPanel - - /** - * Get Array of BOM Products - * @return products - */ - private KeyNamePair[] getProducts() - { - String sql = "SELECT M_Product_ID, Name " - + "FROM M_Product " - + "WHERE IsBOM='Y' AND IsVerified='Y' AND IsActive='Y' " - + "ORDER BY Name"; - return DB.getKeyNamePairs(MRole.getDefault().addAccessSQL( - sql, "M_Product", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO), true); - } // getProducts - - /** - * Get Array of open Orders - * @return orders - */ - private KeyNamePair[] getOrders() - { - String sql = "SELECT C_Order_ID, DocumentNo || '_' || GrandTotal " - + "FROM C_Order " - + "WHERE Processed='N' AND DocStatus='DR' " - + "ORDER BY DocumentNo"; - return DB.getKeyNamePairs(MRole.getDefault().addAccessSQL( - sql, "C_Order", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO), true); - } // getOrders - - /** - * Get Array of open non service Projects - * @return orders - */ - private KeyNamePair[] getProjects() - { - String sql = "SELECT C_Project_ID, Name " - + "FROM C_Project " - + "WHERE Processed='N' AND IsSummary='N' AND IsActive='Y'" - + " AND ProjectCategory<>'S' " - + "ORDER BY Name"; - return DB.getKeyNamePairs(MRole.getDefault().addAccessSQL( - sql, "C_Project", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO), true); - } // getProjects - - /** - * Get Array of open Invoices - * @return invoices - */ - private KeyNamePair[] getInvoices() - { - String sql = "SELECT C_Invoice_ID, DocumentNo || '_' || GrandTotal " - + "FROM C_Invoice " - + "WHERE Processed='N' AND DocStatus='DR' " - + "ORDER BY DocumentNo"; - return DB.getKeyNamePairs(MRole.getDefault().addAccessSQL( - sql, "C_Invoice", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO), true); - } // getInvoices - - - /************************************************************************** - * Create Main Panel. - * Called when changing Product - */ - private void createMainPanel () - { - if (log.isLoggable(Level.CONFIG)) log.config(": " + m_product); - this.removeAll(); - this.setPreferredSize(null); - this.invalidate(); - this.setBorder(null); - // - m_selectionList.clear(); - m_productList.clear(); - m_qtyList.clear(); - m_buttonGroups.clear(); - // - this.setLayout (new ALayout()); - String title = Msg.getMsg(Env.getCtx(), "SelectProduct"); - if (m_product != null && m_product.get_ID() > 0) - { - title = m_product.getName(); - if (m_product.getDescription() != null && m_product.getDescription().length() > 0) - this.setToolTipText(m_product.getDescription()); - m_bomLine = 0; - addBOMLines(m_product, m_qty); - } - this.setBorder (new TitledBorder(title)); - } // createMainPanel - - /** - * Add BOM Lines to this. - * Called recursively - * @param product product - * @param qty quantity - */ - private void addBOMLines (MProduct product, BigDecimal qty) - { - MPPProductBOM bom = MPPProductBOM.getDefault(product, null); - MPPProductBOMLine[] bomLines = bom.getLines(true); - for (int i = 0; i < bomLines.length; i++) - addBOMLine (bomLines[i], qty); - if (log.isLoggable(Level.FINE)) log.fine("#" + bomLines.length); - } - - /** - * Add BOM Line to this. - * Calls addBOMLines if added product is a BOM - * @param line BOM Line - * @param qty quantity - */ - private void addBOMLine (MPPProductBOMLine line, BigDecimal qty) - { - if (log.isLoggable(Level.FINE)) log.fine(line.toString()); - String bomType = line.getComponentType(); - if (bomType == null) - bomType = MPPProductBOMLine.COMPONENTTYPE_Component; - // - BigDecimal lineQty = line.getQty(); - MProduct product = line.getProduct(); - if (product == null) - return; - if (product.isBOM() && product.isVerified()) - addBOMLines (product, lineQty); // recursive - else - addDisplay (line.getM_Product_ID(), - product.getM_Product_ID(), bomType, product.getName(), line.getFeature(), lineQty); - } // addBOMLine - - - /** - * Add Line to Display - * @param parentM_Product_ID parent product - * @param M_Product_ID product - * @param bomType bom type - * @param name name - * @param lineQty qty - */ - private void addDisplay (int parentM_Product_ID, - int M_Product_ID, String bomType, String name, String feature , BigDecimal lineQty) - { - if (log.isLoggable(Level.FINE)) log.fine("M_Product_ID=" + M_Product_ID + ",Type=" + bomType + ",Name=" + name + ",feature=" + feature + ",Qty=" + lineQty); - // - boolean selected = true; - if (MPPProductBOMLine.COMPONENTTYPE_Component.equals(bomType)) - { - String title = ""; - JCheckBox cb = new JCheckBox(title); - cb.setSelected(true); - cb.setEnabled(false); - // cb.addActionListener(this); // will not change - m_selectionList.add(cb); - this.add(cb, new ALayoutConstraint(m_bomLine++, 0)); - } - else if (MPPProductBOMLine.COMPONENTTYPE_Option.equals(bomType)) - { - //String title = Msg.getMsg(Env.getCtx(), "Optional"); - JCheckBox cb = new JCheckBox(feature); - cb.setSelected(false); - selected = false; - cb.addActionListener(this); - m_selectionList.add(cb); - this.add(cb, new ALayoutConstraint(m_bomLine++, 0)); - } - else if (MPPProductBOMLine.COMPONENTTYPE_Variant.equals(bomType)) - { - //String title = Msg.getMsg(Env.getCtx(), "Variant") + " " + bomType; - JRadioButton b = new JRadioButton(feature); - String groupName = feature + "_" + String.valueOf(parentM_Product_ID) + "_" + bomType; - ButtonGroup group = (ButtonGroup)m_buttonGroups.get(groupName); - if (group == null) - { - if (log.isLoggable(Level.FINE)) log.fine("ButtonGroup=" + groupName); - group = new ButtonGroup(); - m_buttonGroups.put(groupName, group); - group.add(b); - b.setSelected(true); // select first one - } - else - { - group.add(b); - b.setSelected(false); - selected = false; - } - b.addActionListener(this); - m_selectionList.add(b); - this.add(b, new ALayoutConstraint(m_bomLine++, 0)); - } - // Add to List & display - m_productList.add (Integer.valueOf(M_Product_ID)); - VNumber qty = new VNumber ("Qty", true, false, true, DisplayType.Quantity, name); - qty.setValue(lineQty); - qty.setReadWrite(selected); - m_qtyList.add(qty); - CLabel label = new CLabel (name); - label.setLabelFor(qty); - this.add(label); - this.add(qty); - } // addDisplay - - - /** - * Get Preferred Size - * @return size - */ - public Dimension getPreferredSize () - { - Dimension size = super.getPreferredSize (); - if (size.width > WINDOW_WIDTH) - size.width = WINDOW_WIDTH - 30; - return size; - } // getPreferredSize - - - /************************************************************************** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (log.isLoggable(Level.CONFIG)) log.config(e.getActionCommand()); - - Object source = e.getSource(); - - // Toggle Qty Enabled - if (source instanceof JCheckBox || source instanceof JRadioButton) - { - cmd_selection (source); - // need to de-select the others in group - if (source instanceof JRadioButton) - { - // find Button Group - Iterator it = m_buttonGroups.values().iterator(); - while (it.hasNext()) - { - ButtonGroup group = it.next(); - Enumeration en = group.getElements(); - while (en.hasMoreElements()) - { - // We found the group - if (source == en.nextElement()) - { - Enumeration info = group.getElements(); - while (info.hasMoreElements()) - { - Object infoObj = info.nextElement(); - if (source != infoObj) - cmd_selection(infoObj); - } - } - } - } - } - } // JCheckBox or JRadioButton - - // Product / Qty - else if (source == productField || source == productQty) - { - m_qty = (BigDecimal)productQty.getValue(); - KeyNamePair pp = (KeyNamePair)productField.getSelectedItem(); - m_product = MProduct.get (Env.getCtx(), pp.getKey()); - createMainPanel(); - sizeIt(); - } - - // Order - else if (source == orderField) - { - KeyNamePair pp = (KeyNamePair)orderField.getSelectedItem(); - boolean valid = (pp != null && pp.getKey() > 0); - // - if (invoiceField != null) - invoiceField.setReadWrite(!valid); - if (projectField != null) - projectField.setReadWrite(!valid); - } - // Invoice - else if (source == invoiceField) - { - KeyNamePair pp = (KeyNamePair)invoiceField.getSelectedItem(); - boolean valid = (pp != null && pp.getKey() > 0); - // - if (orderField != null) - orderField.setReadWrite(!valid); - if (projectField != null) - projectField.setReadWrite(!valid); - } - // Project - else if (source == projectField) - { - KeyNamePair pp = (KeyNamePair)projectField.getSelectedItem(); - boolean valid = (pp != null && pp.getKey() > 0); - // - if (orderField != null) - orderField.setReadWrite(!valid); - if (invoiceField != null) - invoiceField.setReadWrite(!valid); - } - - // OK - else if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - if (cmd_save()) - dispose(); - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - dispose(); - - // Enable OK - boolean OK = m_product != null; - if (OK) - { - KeyNamePair pp = null; - if (orderField != null) - pp = (KeyNamePair)orderField.getSelectedItem(); - if ((pp == null || pp.getKey() <= 0) && invoiceField != null) - pp = (KeyNamePair)invoiceField.getSelectedItem(); - if ((pp == null || pp.getKey() <= 0) && projectField != null) - pp = (KeyNamePair)projectField.getSelectedItem(); - OK = (pp != null && pp.getKey() > 0); - } - confirmPanel.getOKButton().setEnabled(OK); - } // actionPerformed - - /** - * Enable/disable qty based on selection - * @param source JCheckBox or JRadioButton - */ - private void cmd_selection (Object source) - { - for (int i = 0; i < m_selectionList.size(); i++) - { - if (source == m_selectionList.get(i)) - { - boolean selected = isSelectionSelected(source); - VNumber qty = (VNumber)m_qtyList.get(i); - qty.setReadWrite(selected); - return; - } - } - log.log(Level.SEVERE, "not found - " + source); - } // cmd_selection - - /** - * Is Selection Selected - * @param source CheckBox or RadioButton - * @return true if selected - */ - private boolean isSelectionSelected (Object source) - { - boolean retValue = false; - if (source instanceof JCheckBox) - retValue = ((JCheckBox)source).isSelected(); - else if (source instanceof JRadioButton) - retValue = ((JRadioButton)source).isSelected(); - else - log.log(Level.SEVERE, "Not valid - " + source); - return retValue; - } // isSelected - - - /************************************************************************** - * Save Selection - * @return true if saved - */ - private boolean cmd_save() - { - KeyNamePair pp = (KeyNamePair)orderField.getSelectedItem(); - if (pp != null && pp.getKey() > 0) - return cmd_saveOrder (pp.getKey()); - // - pp = (KeyNamePair)invoiceField.getSelectedItem(); - if (pp != null && pp.getKey() > 0) - return cmd_saveInvoice (pp.getKey()); - // - pp = (KeyNamePair)projectField.getSelectedItem(); - if (pp != null && pp.getKey() > 0) - return cmd_saveProject (pp.getKey()); - // - log.log(Level.SEVERE, "Nothing selected"); - return false; - } // cmd_save - - /** - * Save to Order - * @param C_Order_ID id - * @return true if saved - */ - private boolean cmd_saveOrder (int C_Order_ID) - { - if (log.isLoggable(Level.CONFIG)) log.config("C_Order_ID=" + C_Order_ID); - MOrder order = new MOrder (Env.getCtx(), C_Order_ID, null); - if (order.get_ID() == 0) - { - log.log(Level.SEVERE, "Not found - C_Order_ID=" + C_Order_ID); - return false; - } - int lineCount = 0; - - // for all bom lines - for (int i = 0; i < m_selectionList.size(); i++) - { - if (isSelectionSelected(m_selectionList.get(i))) - { - BigDecimal qty = (BigDecimal)((VNumber)m_qtyList.get(i)).getValue(); - int M_Product_ID = ((Integer)m_productList.get(i)).intValue(); - // Create Line - MOrderLine ol = new MOrderLine (order); - ol.setM_Product_ID(M_Product_ID, true); - ol.setQty(qty); - ol.setPrice(); - ol.setTax(); - if (ol.save()) - lineCount++; - else - log.log(Level.SEVERE, "Line not saved"); - } // line selected - } // for all bom lines - - if (log.isLoggable(Level.CONFIG)) log.config("#" + lineCount); - return true; - } // cmd_saveOrder - - /** - * Save to Invoice - * @param C_Invoice_ID id - * @return true if saved - */ - private boolean cmd_saveInvoice (int C_Invoice_ID) - { - if (log.isLoggable(Level.CONFIG)) log.config("C_Invoice_ID=" + C_Invoice_ID); - MInvoice invoice = new MInvoice (Env.getCtx(), C_Invoice_ID, null); - if (invoice.get_ID() == 0) - { - log.log(Level.SEVERE, "Not found - C_Invoice_ID=" + C_Invoice_ID); - return false; - } - int lineCount = 0; - - // for all bom lines - for (int i = 0; i < m_selectionList.size(); i++) - { - if (isSelectionSelected(m_selectionList.get(i))) - { - BigDecimal qty = (BigDecimal)((VNumber)m_qtyList.get(i)).getValue(); - int M_Product_ID = ((Integer)m_productList.get(i)).intValue(); - // Create Line - MInvoiceLine il = new MInvoiceLine (invoice); - il.setM_Product_ID(M_Product_ID, true); - il.setQty(qty); - il.setPrice(); - il.setTax(); - if (il.save()) - lineCount++; - else - log.log(Level.SEVERE, "Line not saved"); - } // line selected - } // for all bom lines - - if (log.isLoggable(Level.CONFIG)) log.config("#" + lineCount); - return true; - } // cmd_saveInvoice - - /** - * Save to Project - * @param C_Project_ID id - * @return true if saved - */ - private boolean cmd_saveProject (int C_Project_ID) - { - if (log.isLoggable(Level.CONFIG)) log.config("C_Project_ID=" + C_Project_ID); - MProject project = new MProject (Env.getCtx(), C_Project_ID, null); - if (project.get_ID() == 0) - { - log.log(Level.SEVERE, "Not found - C_Project_ID=" + C_Project_ID); - return false; - } - int lineCount = 0; - - // for all bom lines - for (int i = 0; i < m_selectionList.size(); i++) - { - if (isSelectionSelected(m_selectionList.get(i))) - { - BigDecimal qty = (BigDecimal)((VNumber)m_qtyList.get(i)).getValue(); - int M_Product_ID = ((Integer)m_productList.get(i)).intValue(); - // Create Line - MProjectLine pl = new MProjectLine (project); - pl.setM_Product_ID(M_Product_ID); - pl.setPlannedQty(qty); - // pl.setPlannedPrice(); - if (pl.save()) - lineCount++; - else - log.log(Level.SEVERE, "Line not saved"); - } // line selected - } // for all bom lines - - if (log.isLoggable(Level.CONFIG)) log.config("#" + lineCount); - return true; - } // cmd_saveProject - -} // VBOMDrop diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VCharge.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VCharge.java deleted file mode 100644 index 2d0237a842..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VCharge.java +++ /dev/null @@ -1,245 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.FlowLayout; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.logging.Level; - -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JScrollPane; -import javax.swing.JTextField; -import javax.swing.border.TitledBorder; -import javax.swing.table.DefaultTableModel; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ADialog; -import org.compiere.apps.ConfirmPanel; -import org.compiere.minigrid.MiniTable; -import org.compiere.plaf.CompiereColor; -import org.compiere.swing.CPanel; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Util; - -/** - * Create Charge from Accounts - * - * @author Jorg Janke - * @version $Id: VCharge.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VCharge extends Charge - implements FormPanel, ActionListener -{ - private CPanel panel = new CPanel(); - /** - * Initialize Panel - * @param WindowNo window - * @param frame parent frame - */ - public void init (int WindowNo, FormFrame frame) - { - log.info(""); - m_WindowNo = WindowNo; - m_frame = frame; - try - { - jbInit(); - dynInit(); - - frame.getContentPane().add(mainPanel, BorderLayout.CENTER); - frame.getContentPane().add(confirmPanel, BorderLayout.SOUTH); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - } - } // init - - /** FormFrame */ - private FormFrame m_frame; - - // - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel newPanel = new CPanel(); - private TitledBorder newBorder; - private GridBagLayout newLayout = new GridBagLayout(); - private JLabel valueLabel = new JLabel(); - private JTextField valueField = new JTextField(); - private JCheckBox isExpense = new JCheckBox(); - private JLabel nameLabel = new JLabel(); - private JTextField nameField = new JTextField(); - private JButton newButton = new JButton(); - private CPanel accountPanel = new CPanel(); - private TitledBorder accountBorder; - private BorderLayout accountLayout = new BorderLayout(); - private CPanel accountOKPanel = new CPanel(); - private JButton accountButton = new JButton(); - private FlowLayout accountOKLayout = new FlowLayout(); - private JScrollPane dataPane = new JScrollPane(); - private MiniTable dataTable = new MiniTable(); - private ConfirmPanel confirmPanel = new ConfirmPanel(); - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - CompiereColor.setBackground(panel); - newBorder = new TitledBorder(""); - accountBorder = new TitledBorder(""); - mainPanel.setLayout(mainLayout); - newPanel.setBorder(newBorder); - newPanel.setLayout(newLayout); - newBorder.setTitle(Msg.getMsg(Env.getCtx(), "ChargeNewAccount")); - valueLabel.setText(Msg.translate(Env.getCtx(), "Value")); - isExpense.setSelected(true); - isExpense.setText(Msg.getMsg(Env.getCtx(), "Expense")); - nameLabel.setText(Msg.translate(Env.getCtx(), "Name")); - nameField.setColumns(20); - valueField.setColumns(10); - newButton.setText(Msg.getMsg(Env.getCtx(), "Create") + " " + Util.cleanAmp(Msg.getMsg(Env.getCtx(), "New"))); - newButton.addActionListener(this); - accountPanel.setBorder(accountBorder); - accountPanel.setLayout(accountLayout); - accountBorder.setTitle(Msg.getMsg(Env.getCtx(), "ChargeFromAccount")); - accountButton.setText(Msg.getMsg(Env.getCtx(), "Create") + " " + Msg.getMsg(Env.getCtx(), "From") + " " + Msg.getElement(Env.getCtx(), "Account_ID")); - accountButton.addActionListener(this); - accountOKPanel.setLayout(accountOKLayout); - accountOKLayout.setAlignment(FlowLayout.RIGHT); - confirmPanel.addActionListener(this); - // - mainPanel.add(newPanel, BorderLayout.NORTH); - newPanel.add(valueLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - newPanel.add(valueField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0)); - newPanel.add(nameLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - newPanel.add(nameField, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0)); - newPanel.add(isExpense, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - newPanel.add(newButton, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - mainPanel.add(accountPanel, BorderLayout.CENTER); - accountPanel.add(accountOKPanel, BorderLayout.SOUTH); - accountOKPanel.add(accountButton, null); - accountPanel.add(dataPane, BorderLayout.CENTER); - dataPane.getViewport().add(dataTable, null); - } // jbInit - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (log.isLoggable(Level.INFO)) log.info(e.getActionCommand()); - // - if (e.getActionCommand().equals(ConfirmPanel.A_OK) || m_C_Element_ID == 0) - dispose(); - // new Account - else if (e.getSource().equals(newButton)) - createNew(); - else if (e.getSource().equals(accountButton)) - createAccount(); - } // actionPerformed - - /** - * Create new Account and Charge - */ - private void createNew() - { - log.config(""); - // Get Input - String value = valueField.getText(); - if (value.length() == 0) - { - valueField.setBackground(AdempierePLAF.getFieldBackground_Error()); - return; - } - String name = nameField.getText(); - if (name.length() == 0) - { - nameField.setBackground(AdempierePLAF.getFieldBackground_Error()); - return; - } - // Create Element - int C_ElementValue_ID = createElementValue (value, name, isExpense.isSelected()); - if (C_ElementValue_ID == 0) - { - ADialog.error(m_WindowNo, panel, "ChargeNotCreated", name); - return; - } - // Create Charge - int C_Charge_ID = createCharge(name, C_ElementValue_ID); - if (C_Charge_ID == 0) - { - ADialog.error(m_WindowNo, panel, "ChargeNotCreated", name); - return; - } - ADialog.info(m_WindowNo, panel, "ChargeCreated", name); - } // createNew - - /** - * Create Charges from Accounts - */ - private void createAccount() - { - createAccount(dataTable); - - if (listCreated.length() > 0) - ADialog.info(m_WindowNo, panel, "ChargeCreated", listCreated.toString()); - if (listRejected.length() > 0) - ADialog.error(m_WindowNo, panel, "ChargeNotCreated", listRejected.toString()); - } // createAccount - - /** - * Dynamic Init - * - Get defaults for primary AcctSchema - * - Create Table with Accounts - */ - private void dynInit() - { - findChargeElementID(); - DefaultTableModel model = new DefaultTableModel(getData(), getColumnNames()); - dataTable.setModel(model); - setColumnClass(dataTable); - findTaxCategoryID(); - } - -} // VCharge diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VCreateFromForm.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VCreateFromForm.java deleted file mode 100644 index 426c54e778..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VCreateFromForm.java +++ /dev/null @@ -1,237 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2013 Elaine Tan * - * Copyright (C) 2013 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.JScrollPane; -import javax.swing.event.TableModelEvent; -import javax.swing.event.TableModelListener; -import javax.swing.table.TableModel; - -import org.compiere.apps.ADialog; -import org.compiere.apps.AppsAction; -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.StatusBar; -import org.compiere.minigrid.MiniTable; -import org.compiere.swing.CPanel; -import org.compiere.swing.CToggleButton; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Trx; -import org.compiere.util.TrxRunnable; - -/** - * - * @author Elaine - * - */ -public class VCreateFromForm extends CPanel implements ActionListener, TableModelListener -{ - - /** - * - */ - private static final long serialVersionUID = -8242250391030501785L; - private CreateFromForm form; - private int windowNo; - /** FormFrame */ - private FormFrame m_frame; - - private CPanel parameterPanel = new CPanel(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - private StatusBar statusBar = new StatusBar(); - private MiniTable dataTable = new MiniTable(); - - private static final String SELECT_DESELECT_ALL = "SelectAll"; - protected AppsAction selectDeselectAllAction = new AppsAction (SELECT_DESELECT_ALL, null, Msg.getMsg(Env.getCtx(), SELECT_DESELECT_ALL), true); - - public VCreateFromForm(CreateFromForm createFrom, FormFrame frame) - { - super(); - this.form = createFrom; - this.m_frame = frame; - - try - { - jbInit(); - confirmPanel.addActionListener(this); - - statusBar.setStatusDB(""); - tableChanged(null); - } - catch(Exception e) - { - - } - } - - protected void jbInit() throws Exception - { - m_frame.getContentPane().add(parameterPanel, BorderLayout.NORTH); - - JScrollPane dataPane = new JScrollPane(); - m_frame.getContentPane().add(dataPane, BorderLayout.CENTER); - dataPane.getViewport().add(dataTable, null); - - CToggleButton selectAllButton = (CToggleButton)selectDeselectAllAction.getButton(); - selectAllButton.setMargin(ConfirmPanel.s_insets); - selectAllButton.addActionListener(this); - confirmPanel.addComponent(selectAllButton); - - CPanel southPanel = new CPanel(); - m_frame.getContentPane().add(southPanel, BorderLayout.SOUTH); - BorderLayout southLayout = new BorderLayout(); - southPanel.setLayout(southLayout); - southPanel.add(confirmPanel, BorderLayout.CENTER); - southPanel.add(statusBar, BorderLayout.SOUTH); - } - - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - try - { - Trx.run(new TrxRunnable() - { - public void run(String trxName) - { - if (save(trxName)) - { - dispose(); - } - } - }); - } - catch (Exception ex) - { - ADialog.error(windowNo, this, "Error", ex.getLocalizedMessage()); - } - } - // Cancel - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - dispose(); - } - // Select All - // Trifon - else if (e.getActionCommand().equals(SELECT_DESELECT_ALL)) - { - TableModel model = dataTable.getModel(); - model.removeTableModelListener(this); - - // select or deselect all as required - int rows = model.getRowCount(); - Boolean selectAll = selectDeselectAllAction.isPressed() ? Boolean.FALSE : Boolean.TRUE; - for (int i = 0; i < rows; i++) - model.setValueAt(selectAll, i, 0); - - model.addTableModelListener(this); - - info(); - } - } - - public boolean save(String trxName) - { - dataTable.stopEditor(true); - - TableModel model = dataTable.getModel(); - int rows = model.getRowCount(); - if (rows == 0) - return false; - - return form.save(dataTable, trxName, m_frame.getGridTab()); - } - - public void tableChanged (TableModelEvent e) - { - int type = -1; - if (e != null) - { - type = e.getType(); - if (type != TableModelEvent.UPDATE) - return; - - if (e.getColumn() == 0) - { - TableModel model = dataTable.getModel(); - Boolean isPressed = (Boolean)model.getValueAt(0, 0); - int rows = model.getRowCount(); - boolean equals = true; - for (int i = 1; equals && i < rows; i++) - { - equals = isPressed.equals(model.getValueAt(i, 0)); - } - - if (equals) { - selectDeselectAllAction.setPressed(isPressed); - } - } - } - info(); - dataTable.repaint(); - } - - public void info() - { - TableModel model = dataTable.getModel(); - int rows = model.getRowCount(); - int count = 0; - for (int i = 0; i < rows; i++) - { - if (((Boolean)model.getValueAt(i, 0)).booleanValue()) - count++; - } - setStatusLine(count, null); - - form.info(dataTable, statusBar); - } - - public void setStatusLine(int selectedRowCount, String text) - { - StringBuilder sb = new StringBuilder(String.valueOf(selectedRowCount)); - if (text != null && text.trim().length() > 0) { - sb.append(" - ").append(text); - } - statusBar.setStatusLine(sb.toString()); - // - confirmPanel.getOKButton().setEnabled(selectedRowCount > 0); - } - - public MiniTable getMiniTable() - { - return dataTable; - } - - public CPanel getParameterPanel() - { - return parameterPanel; - } - - public ConfirmPanel getConfirmPanel() - { - return confirmPanel; - } - - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VFactReconcile.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VFactReconcile.java deleted file mode 100644 index bd4cd398d1..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VFactReconcile.java +++ /dev/null @@ -1,481 +0,0 @@ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.beans.VetoableChangeListener; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Properties; -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JScrollPane; -import javax.swing.SwingConstants; -import javax.swing.event.TableModelEvent; -import javax.swing.event.TableModelListener; -import javax.swing.table.DefaultTableModel; - -import net.miginfocom.swing.MigLayout; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.grid.ed.AutoCompletion; -import org.compiere.grid.ed.VCheckBox; -import org.compiere.grid.ed.VComboBox; -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VLookup; -import org.compiere.minigrid.MiniTable; -import org.compiere.model.MClient; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -public class VFactReconcile extends FactReconcile -implements FormPanel, ActionListener, TableModelListener, VetoableChangeListener { - - /** Window No */ - private int m_WindowNo = 0; - /** FormFrame */ - private FormFrame m_frame; - - /** Format */ - private DecimalFormat m_format = DisplayType.getNumberFormat(DisplayType.Amount); - /** Number of selected rows */ - private int m_noSelected = 0; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VFactReconcile.class); - - /** - * Initialize Panel - * @param WindowNo window - * @param frame frame - */ - public void init (int WindowNo, FormFrame frame) - { - log.info(""); - m_WindowNo = WindowNo; - m_frame = frame; - try - { - dynInit(); - jbInit(); - - frame.getContentPane().add(commandPanel, BorderLayout.SOUTH); - frame.getContentPane().add(mainPanel, BorderLayout.CENTER); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - } - } // init - - // - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel parameterPanel = new CPanel(); - private CLabel labelAcctSchema = new CLabel(); - private VLookup fieldAcctSchema = null; - private MigLayout parameterLayout = null; - private CLabel labelOrg = new CLabel(); - private VLookup fieldOrg = null; - private VCheckBox isReconciled = new VCheckBox(); - private CLabel labelAccount = new CLabel(); - private VComboBox fieldAccount = new VComboBox(); - private CLabel labelBPartner = new CLabel(); - private VLookup fieldBPartner = null; - - private JLabel dataStatus = new JLabel(); - private JScrollPane dataPane = new JScrollPane(); - private MiniTable miniTable = new MiniTable(); - private CPanel commandPanel = new CPanel(); - private JButton bCancel = ConfirmPanel.createCancelButton(true); - private JButton bGenerate = ConfirmPanel.createProcessButton(true); - private JButton bReset = ConfirmPanel.createResetButton(true); - private JButton bZoom = ConfirmPanel.createZoomButton(true); - private FlowLayout commandLayout = new FlowLayout(); - private JButton bRefresh = ConfirmPanel.createRefreshButton(true); - private CLabel labelDateAcct = new CLabel(); - private VDate fieldDateAcct = new VDate(); - private CLabel labelDateAcct2 = new CLabel(); - private VDate fieldDateAcct2 = new VDate(); - - private CLabel labelProduct = new CLabel(); - private VLookup fieldProduct = null; - private boolean loading = false; - private CLabel differenceLabel = new CLabel(); - private CTextField differenceField = new CTextField(); - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - //CompiereColor.setBackground(this); - // - mainPanel.setLayout(mainLayout); - parameterLayout = new MigLayout("fillx, wrap 4, hidemode 0", " [150:150][250:250][100:100][200:200]"); - parameterPanel.setLayout(parameterLayout); - bRefresh.addActionListener(this); - bReset.addActionListener(this); - bZoom.addActionListener(this); - bGenerate.setEnabled(false); - bReset.setEnabled(false); - //bRefresh.setText(Msg.getMsg(Env.getCtx(), "Query")); - bGenerate.setText(Msg.getMsg(Env.getCtx(),"Process")); - bReset.setText(Msg.getMsg(Env.getCtx(),"Reset")); - bZoom.setText(Msg.translate(Env.getCtx(), "Fact_Acct_ID")); - - // - labelAcctSchema.setText(Msg.translate(Env.getCtx(), "C_AcctSchema_ID")); - labelAccount.setText(Msg.translate(Env.getCtx(), "Account_ID")); - labelBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID")); - labelDateAcct.setText(Msg.translate(Env.getCtx(), "DateAcct")); - labelDateAcct2.setText("-"); - labelProduct.setText(Msg.translate(Env.getCtx(), "M_Product_ID")); - // - labelOrg.setText(Msg.translate(Env.getCtx(), "AD_Org_ID")); - isReconciled.setText(Msg.translate(Env.getCtx(), "IsReconciled")); - dataStatus.setText(" "); - - - differenceLabel.setText(Msg.getMsg(Env.getCtx(), "Difference")); - differenceField.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - differenceField.setEditable(false); - differenceField.setText("0"); - differenceField.setColumns(8); - differenceField.setHorizontalAlignment(SwingConstants.RIGHT); - // - bGenerate.addActionListener(this); - bCancel.addActionListener(this); - // - mainPanel.add(parameterPanel, BorderLayout.NORTH); - parameterPanel.add(labelAcctSchema, ""); - parameterPanel.add(fieldAcctSchema, "growx"); - - parameterPanel.add(labelOrg, ""); - parameterPanel.add(fieldOrg, "growx"); - - parameterPanel.add(labelAccount, ""); - parameterPanel.add(fieldAccount, "wmax 250"); - - parameterPanel.add(isReconciled, "skip 1"); - - parameterPanel.add(labelBPartner, ""); - parameterPanel.add(fieldBPartner, "growx"); - - parameterPanel.add(labelProduct, ""); - parameterPanel.add(fieldProduct, "growx"); - - parameterPanel.add(labelDateAcct, ""); - parameterPanel.add(fieldDateAcct, "growx"); - - parameterPanel.add(labelDateAcct2, ""); - parameterPanel.add(fieldDateAcct2, "growx"); - - parameterPanel.add(bRefresh, "growx"); - - - mainPanel.add(dataStatus, BorderLayout.SOUTH); - mainPanel.add(dataPane, BorderLayout.CENTER); - dataPane.getViewport().add(miniTable, null); - // - commandPanel.setLayout(commandLayout); - commandLayout.setAlignment(FlowLayout.RIGHT); - commandLayout.setHgap(10); - commandPanel.add(bZoom, null); - commandPanel.add(differenceLabel, null); - commandPanel.add(differenceField, null); - commandPanel.add(bGenerate, null); - commandPanel.add(bReset, null); - commandPanel.add(bCancel, null); - } // jbInit - - /** - * Dynamic Init. - * - Load Bank Info - * - Load BPartner - * - Load Document Type - * - Init Table - */ - public void dynInit() - { - Properties ctx = Env.getCtx(); - // - m_AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); - - - int AD_Column_ID = FactReconcile.col_C_AcctSchema_ID; // Fact_Acct.C_AcctSchema_ID - MLookup lookupAS = MLookupFactory.get (ctx, m_WindowNo, 0, AD_Column_ID, DisplayType.TableDir); - fieldAcctSchema = new VLookup("C_AcctSchema_ID", true, false, true, lookupAS); - fieldAcctSchema.addActionListener(this); - - fieldAcctSchema.setValue(MClient.get(ctx).getAcctSchema().getC_AcctSchema_ID()); - - Dimension dim = fieldAcctSchema.getPreferredSize(); - dim.width = 300; - fieldAcctSchema.setPreferredSize(dim); - - // Organization filter selection - AD_Column_ID = FactReconcile.col_AD_Org_ID; //C_Period.AD_Org_ID (needed to allow org 0) - MLookup lookupOrg = MLookupFactory.get(ctx, m_WindowNo, 0, AD_Column_ID, DisplayType.TableDir); - fieldOrg = new VLookup("AD_Org_ID", true, false, true, lookupOrg); - if (lookupOrg.containsKey(0)) - fieldOrg.setValue(0); - else - fieldOrg.setValue(Env.getAD_Org_ID(ctx)); - - - dim = fieldOrg.getPreferredSize(); - dim.width = 300; - fieldOrg.setPreferredSize(dim); - - // BPartner - AD_Column_ID = FactReconcile.col_C_BPartner_ID; // C_Invoice.C_BPartner_ID - MLookup lookupBP = MLookupFactory.get (ctx, m_WindowNo, 0, AD_Column_ID, DisplayType.Search); - fieldBPartner = new VLookup("C_BPartner_ID", false, false, true, lookupBP); - - // Product - AD_Column_ID = FactReconcile.col_M_Product_ID; // Fact_Acct.M_Product_ID - MLookup lookupProduct = MLookupFactory.get (ctx, m_WindowNo, 0, AD_Column_ID, DisplayType.Search); - fieldProduct = new VLookup("M_Product_ID", false, false, true, lookupProduct); - - - // Account - Vector vector = getAccount(); - for(int i=0;i> data = getData(); - Vector columnNames = getColumnNames(); - - // Remove Previous Listeners - miniTable.getModel().removeTableModelListener(this); - - DefaultTableModel modelI = new DefaultTableModel(data, columnNames); - modelI.addTableModelListener(this); - miniTable.setModel(modelI); - setColumnClass(miniTable); - //miniTable.setColumnVisibility(miniTable.getColumnModel().getColumn(1), false); - miniTable.setColorColumn(amtColIndex); - } - - /** - * Calculate selected rows. - * - add up selected rows - */ - public void calculateSelection() - { - m_noSelected = 0; - BigDecimal selectedAmt = Env.ZERO; - - int rows = miniTable.getRowCount(); - for (int i = 0; i < rows; i++) - { - boolean isSelected = (Boolean)miniTable.getModel().getValueAt(i, selectedColIndex); - if (isSelected) - { - BigDecimal amt = (BigDecimal)miniTable.getModel().getValueAt(i, amtColIndex); - if (amt != null) - selectedAmt = selectedAmt.add(amt); - m_noSelected++; - } - } - - // Information - StringBuilder info = new StringBuilder(); - info.append(m_noSelected).append(" ").append(Msg.getMsg(Env.getCtx(), "Selected")).append(" / ").append(miniTable.getRowCount()); - - differenceField.setText(m_format.format(selectedAmt)); - dataStatus.setText(info.toString()); - // - bGenerate.setEnabled(m_noSelected != 0 && Env.ZERO.compareTo(selectedAmt) == 0 && !isReconciled.isSelected()); - bReset.setEnabled(m_noSelected > 0 && isReconciled.isSelected()); - } // calculateSelection - - @Override - public void vetoableChange(PropertyChangeEvent evt) - throws PropertyVetoException { - // TODO Auto-generated method stub - - } - - @Override - public void tableChanged(TableModelEvent e) { - if (! loading ) - calculateSelection(); - } // valueChanged - - @Override - public void actionPerformed(ActionEvent e) { - // Generate Reconciliation - if (e.getSource() == bGenerate) - { - generateReconciliation(); - } - - else if (e.getSource() == bReset) - { - resetReconciliation(); - } - else if (e.getSource() == bZoom) - { - zoom(); - } - - else if (e.getSource() == bCancel) - dispose(); - - // Update - else if (e.getSource() == bRefresh) - loadData(); - } - - private void generateReconciliation() { - log.info(""); - // - miniTable.stopEditor(true); - if (miniTable.getRowCount() == 0) - return; - miniTable.setRowSelectionInterval(0,0); - calculateSelection(); - if (m_noSelected == 0) - return; - - - String format = "yyyy-MM-dd HH:mm:ss.SSS"; - Calendar cal = Calendar.getInstance(); - SimpleDateFormat sdf = new SimpleDateFormat(format); - String time = sdf.format(cal.getTime()); - - for ( int r = 0; r < miniTable.getModel().getRowCount(); r++ ) - { - boolean isSelected = (Boolean)miniTable.getModel().getValueAt(r, selectedColIndex); - - if (isSelected) - { - KeyNamePair pp = (KeyNamePair)miniTable.getModel().getValueAt(r, idColIndex); - - int factId = pp.getKey(); - - boolean result = generate(factId, time); - if(!result) - continue; - - ((DefaultTableModel) miniTable.getModel()).removeRow(r--); - } - } - } - - /** - * Zoom to target - * @param AD_Window_ID window id - * @param zoomQuery zoom query - */ - protected void zoom () - { - log.info(""); - - int selected = miniTable.getSelectedRow(); - - if ( selected == -1 ) - return; - - KeyNamePair pp = (KeyNamePair)miniTable.getModel().getValueAt(selected, idColIndex); - - int factId = pp.getKey(); - - AEnv.zoom(270, factId); - } // zoom - - private void resetReconciliation() { - log.info(""); - // - miniTable.stopEditor(true); - if (miniTable.getRowCount() == 0) - return; - miniTable.setRowSelectionInterval(0,0); - calculateSelection(); - if (m_noSelected == 0) - return; - - for ( int r = 0; r < miniTable.getModel().getRowCount(); r++ ) - { - boolean isSelected = (Boolean)miniTable.getModel().getValueAt(r, selectedColIndex); - - if (isSelected) - { - KeyNamePair pp = (KeyNamePair)miniTable.getModel().getValueAt(r, idColIndex); - - int factId = pp.getKey(); - - boolean result = reset(factId); - if(!result) - continue; - - ((DefaultTableModel) miniTable.getModel()).removeRow(r--); - } - } - } - - @Override - public void dispose() { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VFileImport.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VFileImport.java deleted file mode 100644 index 7f889b10fa..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VFileImport.java +++ /dev/null @@ -1,473 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStreamReader; -import java.nio.charset.Charset; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JFileChooser; -import javax.swing.JLabel; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; -import javax.swing.JTextField; - -import org.compiere.apps.ADialog; -import org.compiere.apps.ConfirmPanel; -import org.compiere.impexp.ImpFormat; -import org.compiere.impexp.ImpFormatRow; -import org.compiere.model.MRole; -import org.compiere.plaf.CompiereColor; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Ini; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; -import org.compiere.util.Util; - - -/** - * Fixed length file import - * - * @author Jorg Janke - * @version $Id: VFileImport.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *
  • FR [ 1658127 ] Select charset encoding on import - *
  • BF [ 1619158 ] Import is not working with UTF-8 - *
  • BF [ 1738641 ] Import Formats are accessible for all tenants - *
  • BF [ 1778356 ] VFileImport: IndexOfBound exp if the file is not loaded - */ -public class VFileImport extends CPanel - implements FormPanel, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 3996535986364873964L; - private static final int MAX_LOADED_LINES = 100; - private static final int MAX_SHOWN_LINES = 10; - private static String lastPath = null; - - /** - * Initialize Panel - * @param WindowNo window - * @param frame frame - */ - public void init (int WindowNo, FormFrame frame) - { - log.info(""); - m_WindowNo = WindowNo; - m_frame = frame; - try - { - jbInit(); - dynInit(); - frame.getContentPane().add(northPanel, BorderLayout.NORTH); - frame.getContentPane().add(centerPanel, BorderLayout.CENTER); - frame.getContentPane().add(confirmPanel, BorderLayout.SOUTH); - } - catch(Exception e) - { - log.log(Level.SEVERE, "init", e); - } - } // init - - /** Window No */ - private int m_WindowNo = 0; - /** FormFrame */ - private FormFrame m_frame; - - private ArrayList m_data = new ArrayList(); - private ImpFormat m_format; - private JLabel[] m_labels; - private JTextField[] m_fields; - private int m_record = -1; - /** Current selected file */ - private File m_file = null; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VFileImport.class); - // - private static final String s_none = "----"; // no format indicator - // - private CPanel northPanel = new CPanel(); - private JButton bFile = new JButton(); - private JComboBox pickFormat = new JComboBox(); - private CPanel centerPanel = new CPanel(); - private BorderLayout centerLayout = new BorderLayout(); - private JScrollPane rawDataPane = new JScrollPane(); - private JTextArea rawData = new JTextArea(); - private JScrollPane previewPane = new JScrollPane(); - private CPanel previewPanel = new CPanel(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - private JLabel info = new JLabel(); - private JLabel labelFormat = new JLabel(); - private GridBagLayout previewLayout = new GridBagLayout(); - private JButton bNext = new JButton(); - private JButton bPrevious = new JButton(); - private JLabel record = new JLabel(); - private CComboBoxfCharset = new CComboBox(Ini.getAvailableCharsets()); - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - CompiereColor.setBackground(this); - bFile.setText(Msg.getMsg(Env.getCtx(), "FileImportFile")); - bFile.setToolTipText(Msg.getMsg(Env.getCtx(), "FileImportFileInfo")); - bFile.addActionListener(this); - fCharset.setToolTipText(Msg.getMsg(Env.getCtx(), "Charset", false)); - info.setText(" "); - labelFormat.setText(Msg.translate(Env.getCtx(), "AD_ImpFormat_ID")); - // - bNext.setToolTipText(Msg.getMsg(Env.getCtx(), "Next")); - bNext.setMargin(new Insets(2, 2, 2, 2)); - bNext.setText(">"); - bNext.addActionListener(this); - record.setText("------"); - bPrevious.setToolTipText(Msg.getMsg(Env.getCtx(), "Previous")); - bPrevious.setMargin(new Insets(2, 2, 2, 2)); - bPrevious.setText("<"); - bPrevious.addActionListener(this); - // - northPanel.setBorder(BorderFactory.createEtchedBorder()); - northPanel.add(bFile, null); - northPanel.add(fCharset); - northPanel.add(info, null); - northPanel.add(labelFormat, null); - northPanel.add(pickFormat, null); - northPanel.add(bPrevious, null); - northPanel.add(record, null); - northPanel.add(bNext, null); - // - centerPanel.setLayout(centerLayout); - rawData.setFont(new java.awt.Font("Monospaced", 0, 10)); - rawData.setColumns(80); - rawData.setRows(MAX_SHOWN_LINES); - rawDataPane.getViewport().add(rawData, null); - centerPanel.add(rawDataPane, BorderLayout.CENTER); - centerPanel.add(previewPane, BorderLayout.SOUTH); - // - previewPanel.setLayout(previewLayout); - previewPane.getViewport().add(previewPanel, null); - previewPane.setPreferredSize(new Dimension(700,80)); - // - confirmPanel.addActionListener(this); - } // jbInit - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** - * Dynamic Init - */ - private void dynInit() - { - // Load Formats - pickFormat.addItem(new KeyNamePair(-1,s_none)); - String sql = MRole.getDefault().addAccessSQL("SELECT AD_Impformat_ID,Name FROM AD_ImpFormat WHERE isactive='Y'", "AD_ImpFormat", - MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - rs = pstmt.executeQuery(); - while (rs.next()) - pickFormat.addItem(new KeyNamePair(rs.getInt(1),rs.getString(2))); - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - pickFormat.setSelectedIndex(0); - pickFormat.addActionListener(this); - // - fCharset.setSelectedItem(Ini.getCharset()); - fCharset.addActionListener(this); - // - confirmPanel.getOKButton().setEnabled(false); - } // dynInit - - - /************************************************************************** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (e.getSource() == bFile) - { - cmd_loadFile(); - invalidate(); - m_frame.pack(); - } - else if (e.getSource() == fCharset) { - int record = m_record; - cmd_reloadFile(); - m_record = record - 1; - cmd_applyFormat(true); - } - else if (e.getSource() == pickFormat) - { - cmd_loadFormat(); - invalidate(); - m_frame.pack(); - } - else if (e.getSource() == bNext) - cmd_applyFormat(true); - else if (e.getSource() == bPrevious) - cmd_applyFormat(false); - - else if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - m_frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - confirmPanel.setEnabled(false); - m_frame.setBusy(true); - // - org.compiere.apps.SwingWorker worker = new org.compiere.apps.SwingWorker() - { - public Object construct() - { - cmd_process(); - return Boolean.TRUE; - } - }; - worker.start(); - // when you need the result: - // x = worker.get(); // this blocks the UI !! - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - dispose(); - - if (m_data != null && m_data.size() > 0 // file loaded - && m_format != null && m_format.getRowCount() > 0) // format loaded - confirmPanel.getOKButton().setEnabled(true); - else - confirmPanel.getOKButton().setEnabled(false); - } // actionPerformed - - - /************************************************************************** - * Load File - */ - private void cmd_loadFile() - { - String directory = org.compiere.Adempiere.getAdempiereHome() - + File.separator + "data" - + File.separator + "import"; - if (!Util.isEmpty(lastPath)) - directory = lastPath; - log.config(directory); - // - JFileChooser chooser = new JFileChooser(directory); - chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); - chooser.setMultiSelectionEnabled(false); - chooser.setDialogTitle(Msg.getMsg(Env.getCtx(), "FileImportFileInfo")); - if (chooser.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) - return; - m_file = chooser.getSelectedFile(); - if (log.isLoggable(Level.CONFIG)) log.config(m_file.getName()); - lastPath = m_file.getParentFile().getAbsolutePath(); - bFile.setText(m_file.getName()); - cmd_reloadFile(); - } - - /** - * Reload/Load file - */ - private void cmd_reloadFile() - { - if (m_file == null) - return; - - setCursor (Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - m_data.clear(); - rawData.setText(""); - try - { - // see NaturalAccountMap - Charset charset = (Charset)fCharset.getSelectedItem(); - BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(m_file), charset), 10240); - // not safe see p108 Network pgm - String s = null; - while ((s = in.readLine()) != null) - { - m_data.add(s); - if (m_data.size() <= MAX_LOADED_LINES) - { - rawData.append(s); - rawData.append("\n"); - } - } - in.close(); - rawData.setCaretPosition(0); - } - catch (Exception e) - { - log.log(Level.SEVERE, "", e); - bFile.setText(Msg.getMsg(Env.getCtx(), "FileImportFile")); - } - int index = 1; // second line as first may be heading - if (m_data.size() == 1) - index = 0; - int length = 0; - if (m_data.size() > 0) - length = m_data.get(index).toString().length(); - info.setText(Msg.getMsg(Env.getCtx(), "Records") + "=" + m_data.size() - + ", " + Msg.getMsg(Env.getCtx(), "Length") + "=" + length + " "); - setCursor (Cursor.getDefaultCursor()); - if (log.isLoggable(Level.CONFIG)) log.config("Records=" + m_data.size() - + ", Length=" + length); - } // cmd_loadFile - - /** - * Load Format - */ - private void cmd_loadFormat() - { - // clear panel - previewPanel.removeAll(); - // - KeyNamePair pickFormatKNPair = (KeyNamePair)pickFormat.getSelectedItem(); - if (pickFormatKNPair.getName().equals(s_none)) - return; - m_format = ImpFormat.load (pickFormatKNPair.getKey()); - if (m_format == null) - { - ADialog.error(m_WindowNo, this, "FileImportNoFormat", pickFormatKNPair.getName()); - return; - } - - // pointers - int size = m_format.getRowCount(); - m_labels = new JLabel[size]; - m_fields = new JTextField[size]; - for (int i = 0; i < size; i++) - { - ImpFormatRow row = m_format.getRow(i); - m_labels[i] = new JLabel (row.getName()); - previewPanel.add(m_labels[i], new GridBagConstraints(i, 0, 1, 1, 1.0, 1.0, - GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0)); - // - int length = row.getEndNo() - row.getStartNo(); - if (length <= 5) - length = 5; - else if (length > 20) - length = 20; - m_fields[i] = new JTextField (length); - previewPanel.add(m_fields[i], new GridBagConstraints(i, 1, 1, 1, 1.0, 1.0, - GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0)); - } - m_record = -1; - record.setText("------"); - previewPanel.invalidate(); - previewPanel.repaint(); - } // cmd_format - - /** - * Apply Current Pattern - * @param next next - */ - private void cmd_applyFormat (boolean next) - { - if (m_format == null || m_data.size() == 0) - return; - - // set position - if (next) - m_record++; - else - m_record--; - if (m_record < 0) - m_record = 0; - else if (m_record >= m_data.size()) - m_record = m_data.size() - 1; - record.setText(" " + String.valueOf(m_record+1) + " "); - // Line Info - String[] lInfo = m_format.parseLine(m_data.get(m_record).toString(), false, true, false); // no label, trace, no ignore - int size = m_format.getRowCount(); - if (lInfo.length != size) - log.log(Level.SEVERE, "FormatElements=" + size + " != Fields=" + lInfo.length); - for (int i = 0; i < size; i++) - { - m_fields[i].setText(lInfo[i]); - m_fields[i].setCaretPosition(0); - } - } // cmd_applyFormat - - - /************************************************************************** - * Process File - */ - private void cmd_process() - { - if (m_format == null) - { - ADialog.error(m_WindowNo, this, "FileImportNoFormat"); - return; - } - if (log.isLoggable(Level.CONFIG)) log.config(m_format.getName()); - - // For all rows - update/insert DB table - int row = 0; - int imported = 0; - for (row = 0; row < m_data.size(); row++) - if (m_format.updateDB(Env.getCtx(), m_data.get(row).toString(), null)) - imported++; - // - ADialog.info(m_WindowNo, this, "FileImportR/I", row + " / " + imported + "#"); - dispose(); - } // cmd_process - -} // FileImport diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VGenPanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VGenPanel.java deleted file mode 100644 index 281a7789c4..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VGenPanel.java +++ /dev/null @@ -1,411 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2009 Low Heng Sin * - * Copyright (C) 2009 Idalica Corporation * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; -import java.util.logging.Level; - -import javax.swing.JOptionPane; -import javax.swing.JScrollPane; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.event.TableModelEvent; -import javax.swing.event.TableModelListener; - -import org.adempiere.plaf.AdempierePLAF; -import org.adempiere.util.Callback; -import org.adempiere.util.IProcessUI; -import org.compiere.apps.ADialog; -import org.compiere.apps.ADialogDialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.ProcessCtl; -import org.compiere.apps.StatusBar; -import org.compiere.minigrid.IDColumn; -import org.compiere.minigrid.MiniTable; -import org.compiere.model.MQuery; -import org.compiere.model.MTable; -import org.compiere.model.PrintInfo; -import org.compiere.plaf.CompiereColor; -import org.compiere.print.MPrintFormat; -import org.compiere.print.ReportCtl; -import org.compiere.print.ReportEngine; -import org.compiere.print.Viewer; -import org.compiere.process.ProcessInfo; -import org.compiere.process.ProcessInfoUtil; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTabbedPane; -import org.compiere.swing.CTextPane; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Generate custom form panel - * - */ -public class VGenPanel extends CPanel implements ActionListener, ChangeListener, TableModelListener, IProcessUI -{ - /** - * - */ - private static final long serialVersionUID = 8154208229173738517L; - - private GenForm genForm; - - /** Window No */ - private int m_WindowNo = 0; - /** FormFrame */ - private FormFrame m_frame; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(VGenPanel.class); - // - - private CTabbedPane tabbedPane = new CTabbedPane(); - private CPanel selPanel = new CPanel(); - private CPanel selNorthPanel = new CPanel(); - private BorderLayout selPanelLayout = new BorderLayout(); - - private FlowLayout northPanelLayout = new FlowLayout(); - private ConfirmPanel confirmPanelSel = new ConfirmPanel(true); - private ConfirmPanel confirmPanelGen = new ConfirmPanel(false, true, false, false, false, false, true); - private StatusBar statusBar = new StatusBar(); - private CPanel genPanel = new CPanel(); - private BorderLayout genLayout = new BorderLayout(); - private CTextPane info = new CTextPane(); - private JScrollPane scrollPane = new JScrollPane(); - private MiniTable miniTable = new MiniTable(); - - public VGenPanel(GenForm genForm, int WindowNo, FormFrame frame) - { - log.info(""); - this.genForm = genForm; - m_WindowNo = WindowNo; - m_frame = frame; - - try - { - jbInit(); - dynInit(); - frame.getContentPane().add(tabbedPane, BorderLayout.CENTER); - frame.getContentPane().add(statusBar, BorderLayout.SOUTH); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "init", ex); - } - } // init - - /** - * Static Init. - *
    -	 *  selPanel (tabbed)
    -	 *      fOrg, fBPartner
    -	 *      scrollPane & miniTable
    -	 *  genPanel
    -	 *      info
    -	 *  
    - * @throws Exception - */ - void jbInit() throws Exception - { - CompiereColor.setBackground(this); - // - selPanel.setLayout(selPanelLayout); - - selNorthPanel.setLayout(northPanelLayout); - northPanelLayout.setAlignment(FlowLayout.LEFT); - tabbedPane.add(selPanel, Msg.getMsg(Env.getCtx(), "Select")); - selPanel.add(selNorthPanel, BorderLayout.NORTH); - selPanel.setName("selPanel"); - selPanel.add(confirmPanelSel, BorderLayout.SOUTH); - selPanel.add(scrollPane, BorderLayout.CENTER); - scrollPane.getViewport().add(miniTable, null); - confirmPanelSel.addActionListener(this); - // - tabbedPane.add(genPanel, Msg.getMsg(Env.getCtx(), "Generate")); - genPanel.setLayout(genLayout); - genPanel.add(info, BorderLayout.CENTER); - genPanel.setEnabled(false); - info.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - info.setEditable(false); - genPanel.add(confirmPanelGen, BorderLayout.SOUTH); - confirmPanelGen.addActionListener(this); - } // jbInit - - /** - * Dynamic Init. - * - Create GridController & Panel - * - AD_Column_ID from C_Order - */ - private void dynInit() - { - genForm.configureMiniTable(miniTable); - - miniTable.setRowSelectionAllowed(true); - - miniTable.getModel().addTableModelListener(this); - // Info - statusBar.setStatusDB(" "); - // Tabbed Pane Listener - tabbedPane.addChangeListener(this); - } // dynInit - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (log.isLoggable(Level.INFO)) log.info("Cmd=" + e.getActionCommand()); - // - if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - dispose(); - return; - } - - try - { - genForm.validate(); - } - catch (Exception ex) - { - ADialog.error(m_WindowNo, this, "Error", ex.getLocalizedMessage()); - } - } // actionPerformed - - /** - * Change Listener (Tab changed) - * @param e event - */ - public void stateChanged (ChangeEvent e) - { - int index = tabbedPane.getSelectedIndex(); - genForm.setSelectionActive(index == 0); - } // stateChanged - - /** - * Table Model Listener - * @param e event - */ - public void tableChanged(TableModelEvent e) - { - int rowsSelected = 0; - int rows = miniTable.getRowCount(); - for (int i = 0; i < rows; i++) - { - IDColumn id = (IDColumn)miniTable.getValueAt(i, 0); // ID in column 0 - if (id != null && id.isSelected()) - rowsSelected++; - } - statusBar.setStatusDB(" " + rowsSelected + " "); - } // tableChanged - - /** - * Save Selection & return selecion Query or "" - * @return where clause like C_Order_ID IN (...) - */ - public void saveSelection() - { - // ID selection may be pending - miniTable.editingStopped(new ChangeEvent(this)); - genForm.saveSelection(miniTable); - } // saveSelection - - /************************************************************************** - * Generate Shipments/Invoices - */ - public void generate() - { - info.setText(genForm.generate()); - ProcessCtl worker = new ProcessCtl(this, AEnv.getWindowNo(this), genForm.getProcessInfo(), genForm.getTrx()); - worker.start(); - // - } - - /** - * Complete generating shipments/invoices. - * Called from Unlock UI - * @param pi process info - */ - public void generateComplete(ProcessInfo pi) - { - // Switch Tabs - tabbedPane.setSelectedIndex(1); - // - ProcessInfoUtil.setLogFromDB(pi); - StringBuilder iText = new StringBuilder(); - iText.append("").append(pi.getSummary()) - .append("
    (") - .append(Msg.getMsg(Env.getCtx(), genForm.getTitle())) - // Shipments are generated depending on the Delivery Rule selection in the Order - .append(")
    ") - .append(pi.getLogInfo(true)); - info.setText(iText.toString()); - - // Reset Selection - /* - String sql = "UPDATE C_Order SET IsSelected='N' WHERE " + m_whereClause; - int no = DB.executeUpdate(sql, null); - log.config("Reset=" + no);*/ - - // Get results - int[] ids = pi.getIDs(); - if (ids == null || ids.length == 0) - return; - if (log.isLoggable(Level.CONFIG)) log.config("PrintItems=" + ids.length); - - confirmPanelGen.getOKButton().setEnabled(false); - // OK to print - if (ADialog.ask(m_WindowNo, this, genForm.getAskPrintMsg())) - { - this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - int retValue = ADialogDialog.A_CANCEL; // see also ProcessDialog.printShipments/Invoices - do - { - // Loop through all items - for (int i = 0; i < ids.length; i++) - { - int Record_ID = ids[i]; - - if(genForm.getPrintFormat() != null) - { - MPrintFormat format = genForm.getPrintFormat(); - MTable table = MTable.get(Env.getCtx(),format.getAD_Table_ID()); - MQuery query = new MQuery(table.getTableName()); - query.addRestriction(table.getTableName() + "_ID", MQuery.EQUAL, Record_ID); - // Engine - PrintInfo info = new PrintInfo(table.getTableName(),table.get_Table_ID(), Record_ID); - ReportEngine re = new ReportEngine(Env.getCtx(), format, query, info); - re.print(); - new Viewer(m_frame.getGraphicsConfiguration(), re); - } - else - ReportCtl.startDocumentPrint(genForm.getReportEngineType(), Record_ID, this, AEnv.getWindowNo(this), true); - - } - ADialogDialog d = new ADialogDialog (m_frame, - Env.getHeader(Env.getCtx(), m_WindowNo), - Msg.getMsg(Env.getCtx(), "PrintoutOK?"), - JOptionPane.QUESTION_MESSAGE); - retValue = d.getReturnCode(); - } - while (retValue == ADialogDialog.A_CANCEL); - this.setCursor(Cursor.getDefaultCursor()); - } // OK to print - - // - confirmPanelGen.getOKButton().setEnabled(true); - } - - /************************************************************************** - * Lock User Interface. - * Called from the Worker before processing - * @param pi process info - */ - public void lockUI (ProcessInfo pi) - { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - setEnabled(false); - } // lockUI - - /** - * Unlock User Interface. - * Called from the Worker when processing is done - * @param pi result of execute ASync call - */ - public void unlockUI (ProcessInfo pi) - { - setEnabled(true); - setCursor(Cursor.getDefaultCursor()); - // - generateComplete(pi); - } // unlockUI - - /** - * Is the UI locked (Internal method) - * @return true, if UI is locked - */ - public boolean isUILocked() - { - return isEnabled(); - } // isUILocked - - /** - * Method to be executed async. - * Called from the Worker - * @param pi ProcessInfo - */ - public void executeASync (ProcessInfo pi) - { - } // executeASync - - public CPanel getParameterPanel() - { - return selNorthPanel; - } - - public MiniTable getMiniTable() - { - return miniTable; - } - - public StatusBar getStatusBar() - { - return statusBar; - } - - @Override - public void statusUpdate(String message) { - statusBar.setStatusLine(message); - } - - @Override - public void ask(String message, Callback callback) { - boolean b = ADialog.ask(m_WindowNo, this, message); - if (callback != null) { - callback.onCallback(b); - } - } - - @Override - public void download(File file) { - // TODO Auto-generated method stub - - } - - @Override - public void askForInput(String message, Callback callback) { - String s = ADialog.askForInput(m_WindowNo, this, message); - if(callback != null) - callback.onCallback(s); - } -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VInOutGen.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VInOutGen.java deleted file mode 100644 index 5fbf1bb72f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VInOutGen.java +++ /dev/null @@ -1,239 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2009 Low Heng Sin * - * Copyright (C) 2009 Idalica Corporation * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.VetoableChangeListener; -import java.util.ArrayList; -import java.util.logging.Level; - -import org.adempiere.exceptions.FillMandatoryException; -import org.compiere.apps.ADialog; -import org.compiere.grid.ed.VComboBox; -import org.compiere.grid.ed.VLookup; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MOrder; -import org.compiere.model.MRMA; -import org.compiere.swing.CLabel; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -/** - * Generate Shipment (manual) view class - * - */ -public class VInOutGen extends InOutGen implements FormPanel, ActionListener, VetoableChangeListener -{ - private VGenPanel panel; - - /** Window No */ - private int m_WindowNo = 0; - /** FormFrame */ - private FormFrame m_frame; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(VInOutGen.class); - // - - private CLabel lWarehouse = new CLabel(); - private VLookup fWarehouse; - private CLabel lBPartner = new CLabel(); - private VLookup fBPartner; - private CLabel lDocType = new CLabel(); - private VComboBox cmbDocType = new VComboBox(); - private CLabel lDocAction = new CLabel(); - private VLookup docAction; - - /** - * Initialize Panel - * @param WindowNo window - * @param frame frame - */ - public void init (int WindowNo, FormFrame frame) - { - log.info(""); - m_WindowNo = WindowNo; - m_frame = frame; - Env.setContext(Env.getCtx(), m_WindowNo, "IsSOTrx", "Y"); - - panel = new VGenPanel(this, WindowNo, frame); - - try - { - super.dynInit(); - dynInit(); - jbInit(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "init", ex); - } - } // init - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** - * Static Init. - *
    -	 *  selPanel (tabbed)
    -	 *      fOrg, fBPartner
    -	 *      scrollPane & miniTable
    -	 *  genPanel
    -	 *      info
    -	 *  
    - * @throws Exception - */ - void jbInit() throws Exception - { - lWarehouse.setLabelFor(fWarehouse); - lBPartner.setLabelFor(fBPartner); - lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID")); - lDocAction.setLabelFor(docAction); - lDocAction.setText(Msg.translate(Env.getCtx(), "DocAction")); - lDocType.setLabelFor(cmbDocType); - - panel.getParameterPanel().add(lWarehouse, null); - panel.getParameterPanel().add(fWarehouse, null); - panel.getParameterPanel().add(lBPartner, null); - panel.getParameterPanel().add(fBPartner, null); - panel.getParameterPanel().add(lDocType, null); - panel.getParameterPanel().add(cmbDocType, null); - panel.getParameterPanel().add(lDocAction, null); - panel.getParameterPanel().add(docAction, null); - } // jbInit - - /** - * Fill Picks. - * Column_ID from C_Order - * @throws Exception if Lookups cannot be initialized - */ - public void dynInit() throws Exception - { - // C_OrderLine.M_Warehouse_ID - MLookup orgL = MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, 2223, DisplayType.TableDir); - fWarehouse = new VLookup ("M_Warehouse_ID", true, false, true, orgL); - lWarehouse.setText(Msg.translate(Env.getCtx(), "M_Warehouse_ID")); - fWarehouse.addVetoableChangeListener(this); - setM_Warehouse_ID(fWarehouse.getValue()); - // Document Action Prepared/ Completed - MLookup docActionL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 4324 /* M_InOut.DocStatus */, - DisplayType.List, Env.getLanguage(Env.getCtx()), "DocAction", 135 /* _Document Action */, - false, "AD_Ref_List.Value IN ('CO','PR','--')"); - docAction = new VLookup("DocAction", true, false, true,docActionL); - docAction.addVetoableChangeListener(this); - // C_Order.C_BPartner_ID - MLookup bpL = MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, 2762, DisplayType.Search); - fBPartner = new VLookup ("C_BPartner_ID", false, false, true, bpL); - lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID")); - fBPartner.addVetoableChangeListener(this); - //Document Type Sales Order/Vendor RMA - lDocType.setText(Msg.translate(Env.getCtx(), "C_DocType_ID")); - cmbDocType.addItem(new KeyNamePair(MOrder.Table_ID, Msg.translate(Env.getCtx(), "Order"))); - cmbDocType.addItem(new KeyNamePair(MRMA.Table_ID, Msg.translate(Env.getCtx(), "VendorRMA"))); - cmbDocType.addActionListener(this); - - panel.getStatusBar().setStatusLine(Msg.getMsg(Env.getCtx(), "InOutGenerateSel"));//@@ - } // fillPicks - - public void executeQuery() - { - KeyNamePair docTypeKNPair = (KeyNamePair)cmbDocType.getSelectedItem(); - executeQuery(docTypeKNPair, panel.getMiniTable()); - } // executeQuery - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (cmbDocType.equals(e.getSource())) - { - executeQuery(); - return; - } - - try - { - validate(); - } - catch(Exception ex) - { - ADialog.error(m_WindowNo, this.panel, "Error", ex.getLocalizedMessage()); - } - } // actionPerformed - - public void validate() - { - panel.saveSelection(); - - if (getM_Warehouse_ID() <= 0) - { - throw new FillMandatoryException("M_Warehouse_ID"); - } - - ArrayList selection = getSelection(); - if (selection != null - && selection.size() > 0 - && isSelectionActive()) // on selection tab - { - panel.generate(); - } - else - { - panel.dispose(); - } - } - - /** - * Vetoable Change Listener - requery - * @param e event - */ - public void vetoableChange(PropertyChangeEvent e) - { - if (log.isLoggable(Level.INFO)) log.info(e.getPropertyName() + "=" + e.getNewValue()); - if (e.getPropertyName().equals("M_Warehouse_ID")) - setM_Warehouse_ID(e.getNewValue()); - if (e.getPropertyName().equals("C_BPartner_ID")) - { - m_C_BPartner_ID = e.getNewValue(); - fBPartner.setValue(m_C_BPartner_ID); // display value - } - executeQuery(); - } // vetoableChange - - /************************************************************************** - * Generate Shipments - */ - public String generate() - { - KeyNamePair docTypeKNPair = (KeyNamePair)cmbDocType.getSelectedItem(); - String docActionSelected = (String)docAction.getValue(); - return generate(panel.getStatusBar(), docTypeKNPair, docActionSelected); - } // generateShipments -} diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VInvoiceGen.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VInvoiceGen.java deleted file mode 100644 index fbb40e0279..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VInvoiceGen.java +++ /dev/null @@ -1,221 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2009 Low Heng Sin * - * Copyright (C) 2009 Idalica Corporation * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.VetoableChangeListener; -import java.util.ArrayList; -import java.util.logging.Level; - -import org.compiere.grid.ed.VComboBox; -import org.compiere.grid.ed.VLookup; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MOrder; -import org.compiere.model.MRMA; -import org.compiere.swing.CLabel; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -/** - * Generate Invoice (manual) view class - * - */ -public class VInvoiceGen extends InvoiceGen implements FormPanel, ActionListener, VetoableChangeListener -{ - private VGenPanel panel; - - /** Window No */ - private int m_WindowNo = 0; - /** FormFrame */ - private FormFrame m_frame; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(VInvoiceGen.class); - // - - private CLabel lOrg = new CLabel(); - private VLookup fOrg; - private CLabel lBPartner = new CLabel(); - private VLookup fBPartner; - private CLabel lDocType = new CLabel(); - private VComboBox cmbDocType = new VComboBox(); - private CLabel lDocAction = new CLabel(); - private VLookup docAction; - - /** - * Initialize Panel - * @param WindowNo window - * @param frame frame - */ - public void init (int WindowNo, FormFrame frame) - { - log.info(""); - m_WindowNo = WindowNo; - m_frame = frame; - Env.setContext(Env.getCtx(), m_WindowNo, "IsSOTrx", "Y"); - - panel = new VGenPanel(this, WindowNo, frame); - - try - { - super.dynInit(); - dynInit(); - jbInit(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "init", ex); - } - } // init - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** - * Static Init. - *
    -	 *  selPanel (tabbed)
    -	 *      fOrg, fBPartner
    -	 *      scrollPane & miniTable
    -	 *  genPanel
    -	 *      info
    -	 *  
    - * @throws Exception - */ - void jbInit() throws Exception - { - lOrg.setLabelFor(fOrg); - lOrg.setText(Msg.translate(Env.getCtx(), "AD_Org_ID")); - lBPartner.setLabelFor(fBPartner); - lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID")); - lDocAction.setLabelFor(docAction); - lDocAction.setText(Msg.translate(Env.getCtx(), "DocAction")); - lDocType.setLabelFor(cmbDocType); - - panel.getParameterPanel().add(lOrg, null); - panel.getParameterPanel().add(fOrg, null); - panel.getParameterPanel().add(lBPartner, null); - panel.getParameterPanel().add(fBPartner, null); - panel.getParameterPanel().add(lDocType, null); - panel.getParameterPanel().add(cmbDocType, null); - panel.getParameterPanel().add(lDocAction, null); - panel.getParameterPanel().add(docAction, null); - } // jbInit - - /** - * Fill Picks. - * Column_ID from C_Order - * @throws Exception if Lookups cannot be initialized - */ - public void dynInit() throws Exception - { - MLookup orgL = MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, 2163, DisplayType.TableDir); - fOrg = new VLookup ("AD_Org_ID", false, false, true, orgL); - // lOrg.setText(Msg.translate(Env.getCtx(), "AD_Org_ID")); - fOrg.addVetoableChangeListener(this); - - MLookup docActionL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 3494 /* C_Invoice.DocStatus */, - DisplayType.List, Env.getLanguage(Env.getCtx()), "DocAction", 135 /* _Document Action */, - false, "AD_Ref_List.Value IN ('CO','PR')"); - docAction = new VLookup("DocAction", true, false, true,docActionL); - // lDcoACtion.setText((Msg.translate(Env.getCtx(), "DocAction"));); - docAction.addVetoableChangeListener(this); - - // - MLookup bpL = MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, 2762, DisplayType.Search); - fBPartner = new VLookup ("C_BPartner_ID", false, false, true, bpL); - // lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID")); - fBPartner.addVetoableChangeListener(this); - - //Document Type Sales Order/Vendor RMA - lDocType.setText(Msg.translate(Env.getCtx(), "C_DocType_ID")); - cmbDocType.addItem(new KeyNamePair(MOrder.Table_ID, Msg.translate(Env.getCtx(), "Order"))); - cmbDocType.addItem(new KeyNamePair(MRMA.Table_ID, Msg.translate(Env.getCtx(), "CustomerRMA"))); - cmbDocType.addActionListener(this); - - panel.getStatusBar().setStatusLine(Msg.getMsg(Env.getCtx(), "InvGenerateSel"));//@@ - } // fillPicks - - public void executeQuery() - { - KeyNamePair docTypeKNPair = (KeyNamePair)cmbDocType.getSelectedItem(); - executeQuery(docTypeKNPair, panel.getMiniTable()); - } // executeQuery - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (cmbDocType.equals(e.getSource())) - { - executeQuery(); - return; - } - - validate(); - } // actionPerformed - - public void validate() - { - panel.saveSelection(); - - ArrayList selection = getSelection(); - if (selection != null && selection.size() > 0 && isSelectionActive()) - panel.generate(); - else - panel.dispose(); - } - - /** - * Vetoable Change Listener - requery - * @param e event - */ - public void vetoableChange(PropertyChangeEvent e) - { - if (log.isLoggable(Level.INFO)) log.info(e.getPropertyName() + "=" + e.getNewValue()); - if (e.getPropertyName().equals("AD_Org_ID")) - m_AD_Org_ID = e.getNewValue(); - if (e.getPropertyName().equals("C_BPartner_ID")) - { - m_C_BPartner_ID = e.getNewValue(); - fBPartner.setValue(m_C_BPartner_ID); // display value - } - executeQuery(); - } // vetoableChange - - /************************************************************************** - * Generate Shipments - */ - public String generate() - { - KeyNamePair docTypeKNPair = (KeyNamePair)cmbDocType.getSelectedItem(); - String docActionSelected = (String)docAction.getValue(); - return generate(panel.getStatusBar(), docTypeKNPair, docActionSelected); - } // generateShipments -} diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VMatch.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VMatch.java deleted file mode 100644 index 91899439d1..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VMatch.java +++ /dev/null @@ -1,506 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.logging.Level; -import javax.swing.DefaultComboBoxModel; -import javax.swing.JCheckBox; -import javax.swing.JScrollPane; -import javax.swing.border.TitledBorder; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.event.TableModelEvent; -import javax.swing.event.TableModelListener; -import org.compiere.apps.StatusBar; -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VLookup; -import org.compiere.grid.ed.VNumber; -import org.compiere.minigrid.ColumnInfo; -import org.compiere.minigrid.IDColumn; -import org.compiere.minigrid.MiniTable; -import org.compiere.model.MMatchPO; -import org.compiere.plaf.CompiereColor; -import org.compiere.swing.CButton; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -/** - * Manual Matching - * - * @author Jorg Janke - * @version $Id: VMatch.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VMatch extends Match - implements FormPanel, ActionListener, TableModelListener, ListSelectionListener -{ - private CPanel panel = new CPanel(); - - /** - * Initialize Panel - * @param WindowNo window - * @param frame frame - */ - public void init (int WindowNo, FormFrame frame) - { - m_WindowNo = WindowNo; - m_frame = frame; - if (log.isLoggable(Level.INFO)) log.info("WinNo=" + m_WindowNo - + " - AD_Client_ID=" + m_AD_Client_ID + ", AD_Org_ID=" + m_AD_Org_ID + ", By=" + m_by); - Env.setContext(Env.getCtx(), m_WindowNo, "IsSOTrx", "N"); - - try - { - // UI - onlyVendor = VLookup.createBPartner(m_WindowNo); - onlyProduct = VLookup.createProduct(m_WindowNo); - jbInit(); - // - dynInit(); - frame.getContentPane().add(panel, BorderLayout.CENTER); - frame.getContentPane().add(statusBar, BorderLayout.SOUTH); - // - new Thread() - { - public void run() - { - log.info("Starting ..."); - MMatchPO.consolidate(Env.getCtx()); - log.info("... Done"); - } - }.start(); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - } - } // init - - /** Window No */ - private int m_WindowNo = 0; - /** FormFrame */ - private FormFrame m_frame; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VMatch.class); - - private int m_AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); - private int m_AD_Org_ID = Env.getAD_Org_ID(Env.getCtx()); - private int m_by = Env.getAD_User_ID(Env.getCtx()); - - /** Match Options */ - private String[] m_matchOptions = new String[] { - Msg.getElement(Env.getCtx(), "C_Invoice_ID", false), - Msg.getElement(Env.getCtx(), "M_InOut_ID", false), - Msg.getElement(Env.getCtx(), "C_Order_ID", false) }; - - /** Match Mode */ - private String[] m_matchMode = new String[] { - Msg.translate(Env.getCtx(), "NotMatched"), - Msg.translate(Env.getCtx(), "Matched")}; - private static final int MODE_NOTMATCHED = 0; - private static final int MODE_MATCHED = 1; - - /** Indexes in Table */ - private static final int I_QTY = 6; - private static final int I_MATCHED = 7; - - private BigDecimal m_xMatched = Env.ZERO; - private BigDecimal m_xMatchedTo = Env.ZERO; - - // - private StatusBar statusBar = new StatusBar(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel northPanel = new CPanel(); - private GridBagLayout northLayout = new GridBagLayout(); - private CLabel matchFromLabel = new CLabel(); - private CComboBoxmatchFrom = new CComboBox(m_matchOptions); - private CLabel matchToLabel = new CLabel(); - private CComboBoxmatchTo = new CComboBox(); - private CLabel matchModeLabel = new CLabel(); - private CComboBoxmatchMode = new CComboBox(m_matchMode); - private VLookup onlyVendor = null; - private VLookup onlyProduct = null; - private CLabel onlyVendorLabel = new CLabel(); - private CLabel onlyProductLabel = new CLabel(); - private CLabel dateFromLabel = new CLabel(); - private CLabel dateToLabel = new CLabel(); - private VDate dateFrom = new VDate("DateFrom", false, false, true, DisplayType.Date, "DateFrom"); - private VDate dateTo = new VDate("DateTo", false, false, true, DisplayType.Date, "DateTo"); - private CButton bSearch = new CButton(); - private CPanel southPanel = new CPanel(); - private GridBagLayout southLayout = new GridBagLayout(); - private CLabel xMatchedLabel = new CLabel(); - private CLabel xMatchedToLabel = new CLabel(); - private CLabel differenceLabel = new CLabel(); - private VNumber xMatched = new VNumber("xMatched", false, true, false, DisplayType.Quantity, "xMatched"); - private VNumber xMatchedTo = new VNumber("xMatchedTo", false, true, false, DisplayType.Quantity, "xMatchedTo"); - private VNumber difference = new VNumber("Difference", false, true, false, DisplayType.Quantity, "Difference"); - private CButton bProcess = new CButton(); - private CPanel centerPanel = new CPanel(); - private BorderLayout centerLayout = new BorderLayout(5,5); - private JScrollPane xMatchedScrollPane = new JScrollPane(); - private TitledBorder xMatchedBorder = new TitledBorder("xMatched"); - private MiniTable xMatchedTable = new MiniTable(); - private JScrollPane xMatchedToScrollPane = new JScrollPane(); - private TitledBorder xMatchedToBorder = new TitledBorder("xMatchedTo"); - private MiniTable xMatchedToTable = new MiniTable(); - private CPanel xPanel = new CPanel(); - private JCheckBox sameProduct = new JCheckBox(); - private JCheckBox sameBPartner = new JCheckBox(); - private JCheckBox sameQty = new JCheckBox(); - private FlowLayout xLayout = new FlowLayout(FlowLayout.CENTER, 10, 0); - - /** - * Static Init. - *
    -	 *  mainPanel
    -	 *      northPanel
    -	 *      centerPanel
    -	 *          xMatched
    -	 *          xPanel
    -	 *          xMathedTo
    -	 *      southPanel
    -	 *  
    - * @throws Exception - */ - private void jbInit() throws Exception - { - panel.setLayout(mainLayout); - northPanel.setLayout(northLayout); - matchFromLabel.setText(Msg.translate(Env.getCtx(), "MatchFrom")); - matchToLabel.setText(Msg.translate(Env.getCtx(), "MatchTo")); - matchModeLabel.setText(Msg.translate(Env.getCtx(), "MatchMode")); - onlyVendorLabel.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID")); - onlyProductLabel.setText(Msg.translate(Env.getCtx(), "M_Product_ID")); - dateFromLabel.setText(Msg.translate(Env.getCtx(), "DateFrom")); - dateToLabel.setText(Msg.translate(Env.getCtx(), "DateTo")); - bSearch.setText(Msg.translate(Env.getCtx(), "Search")); - southPanel.setLayout(southLayout); - xMatchedLabel.setText(Msg.translate(Env.getCtx(), "ToBeMatched")); - xMatchedToLabel.setText(Msg.translate(Env.getCtx(), "Matching")); - differenceLabel.setText(Msg.translate(Env.getCtx(), "Difference")); - bProcess.setText(Msg.translate(Env.getCtx(), "Process")); - centerPanel.setLayout(centerLayout); - xMatchedScrollPane.setBorder(xMatchedBorder); - xMatchedScrollPane.setPreferredSize(new Dimension(450, 200)); - xMatchedToScrollPane.setBorder(xMatchedToBorder); - xMatchedToScrollPane.setPreferredSize(new Dimension(450, 200)); - sameProduct.setSelected(true); - sameProduct.setText(Msg.translate(Env.getCtx(), "SameProduct")); - sameBPartner.setSelected(true); - sameBPartner.setText(Msg.translate(Env.getCtx(), "SameBPartner")); - sameQty.setSelected(false); - sameQty.setText(Msg.translate(Env.getCtx(), "SameQty")); - xPanel.setLayout(xLayout); - panel.add(northPanel, BorderLayout.NORTH); - northPanel.add(matchFromLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - northPanel.add(matchFrom, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 0), 0, 0)); - northPanel.add(matchToLabel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 5, 5, 5), 0, 0)); - northPanel.add(matchTo, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 0), 0, 0)); - northPanel.add(matchModeLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - northPanel.add(matchMode, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0)); - northPanel.add(onlyVendor, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 0), 0, 0)); - northPanel.add(onlyProduct, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 0), 0, 0)); - northPanel.add(onlyVendorLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); - northPanel.add(onlyProductLabel, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(dateFromLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - northPanel.add(dateToLabel, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0)); - northPanel.add(dateFrom, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0)); - northPanel.add(dateTo, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0)); - northPanel.add(bSearch, new GridBagConstraints(4, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 12), 0, 0)); - panel.add(southPanel, BorderLayout.SOUTH); - southPanel.add(xMatchedLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); - southPanel.add(xMatched, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 0), 0, 0)); - southPanel.add(xMatchedToLabel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 10, 5, 5), 0, 0)); - southPanel.add(bProcess, new GridBagConstraints(6, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 12), 0, 0)); - southPanel.add(differenceLabel, new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 10, 5, 5), 0, 0)); - panel.add(centerPanel, BorderLayout.CENTER); - centerPanel.add(xMatchedScrollPane, BorderLayout.NORTH); - xMatchedScrollPane.getViewport().add(xMatchedTable, null); - centerPanel.add(xMatchedToScrollPane, BorderLayout.SOUTH); - centerPanel.add(xPanel, BorderLayout.CENTER); - xPanel.add(sameBPartner, null); - xPanel.add(sameProduct, null); - xPanel.add(sameQty, null); - xMatchedToScrollPane.getViewport().add(xMatchedToTable, null); - southPanel.add(difference, new GridBagConstraints(5, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 0), 0, 0)); - southPanel.add(xMatchedTo, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 0), 0, 0)); - } // jbInit - - /** - * Dynamic Init. - * Table Layout, Visual, Listener - */ - private void dynInit() - { - ColumnInfo[] layout = new ColumnInfo[] { - new ColumnInfo(" ", ".", IDColumn.class, false, false, ""), - new ColumnInfo(Msg.translate(Env.getCtx(), "DocumentNo"), ".", String.class), // 1 - new ColumnInfo(Msg.translate(Env.getCtx(), "Date"), ".", Timestamp.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "C_BPartner_ID"),".", KeyNamePair.class, "."), // 3 - new ColumnInfo(Msg.translate(Env.getCtx(), "Line"), ".", KeyNamePair.class, "."), - new ColumnInfo(Msg.translate(Env.getCtx(), "M_Product_ID"), ".", KeyNamePair.class, "."), // 5 - new ColumnInfo(Msg.translate(Env.getCtx(), "Qty"), ".", Double.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "Matched"), ".", Double.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "AD_Org_ID"), ".", KeyNamePair.class, ".") //JAVIER - }; - - xMatchedTable.prepareTable(layout, "", "", false, ""); - xMatchedToTable.prepareTable(layout, "", "", true, ""); - - // Visual - CompiereColor.setBackground (panel); - - // Listener - matchFrom.addActionListener(this); - matchTo.addActionListener(this); - bSearch.addActionListener(this); - xMatchedTable.getSelectionModel().addListSelectionListener(this); - xMatchedToTable.getModel().addTableModelListener(this); - bProcess.addActionListener(this); - sameBPartner.addActionListener(this); - sameProduct.addActionListener(this); - sameQty.addActionListener(this); - // Init - matchTo.setModel(new DefaultComboBoxModel(cmd_matchFrom((String)matchFrom.getSelectedItem()))); - // Set Title - xMatchedBorder.setTitle((String)matchFrom.getSelectedItem()); - xMatchedScrollPane.repaint(); - // Reset Table - xMatchedTable.setRowCount(0); - - cmd_matchTo(); - statusBar.setStatusLine(""); - statusBar.setStatusDB(0); - } // dynInit - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - - /************************************************************************** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - panel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - Integer product = onlyProduct.getValue()!=null?(Integer)onlyProduct.getValue():null; - Integer vendor = onlyVendor.getValue()!=null?(Integer)onlyVendor.getValue():null; - Timestamp from = dateFrom.getValue()!=null?(Timestamp)dateFrom.getValue():null; - Timestamp to = dateTo.getValue()!=null?(Timestamp)dateTo.getValue():null; - if (e.getSource() == matchFrom) { - String selection = (String)matchFrom.getSelectedItem(); - matchTo.setModel(new DefaultComboBoxModel(cmd_matchFrom(selection))); - // Set Title - xMatchedBorder.setTitle(selection); - xMatchedScrollPane.repaint(); - // Reset Table - xMatchedTable.setRowCount(0); - // sync To - cmd_matchTo(); - - } - else if (e.getSource() == matchTo) - cmd_matchTo(); - else if (e.getSource() == bSearch) { - xMatchedTable = (MiniTable) cmd_search(xMatchedTable, matchFrom.getSelectedIndex(), (String)matchTo.getSelectedItem(), product, vendor, from, to, matchMode.getSelectedIndex() == MODE_MATCHED); - xMatched.setValue(Env.ZERO); - // Status Info - statusBar.setStatusLine(matchFrom.getSelectedItem().toString() - + "# = " + xMatchedTable.getRowCount(), - xMatchedTable.getRowCount() == 0); - statusBar.setStatusDB(0); - } - else if (e.getSource() == bProcess) { - cmd_process(xMatchedTable, xMatchedToTable, matchMode.getSelectedIndex(), matchFrom.getSelectedIndex(), matchTo.getSelectedItem(), m_xMatched); - xMatchedTable = (MiniTable) cmd_search(xMatchedTable, matchFrom.getSelectedIndex(), (String)matchTo.getSelectedItem(), product, vendor, from, to, matchMode.getSelectedIndex() == MODE_MATCHED); - xMatched.setValue(Env.ZERO); - // Status Info - statusBar.setStatusLine(matchFrom.getSelectedItem().toString() - + "# = " + xMatchedTable.getRowCount(), - xMatchedTable.getRowCount() == 0); - statusBar.setStatusDB(0); - } - else if (e.getSource() == sameBPartner - || e.getSource() == sameProduct - || e.getSource() == sameQty) - xMatchedTable = (MiniTable) cmd_search(xMatchedTable, matchFrom.getSelectedIndex(), (String)matchTo.getSelectedItem(), product, vendor, from, to, matchMode.getSelectedIndex() == MODE_MATCHED); - panel.setCursor(Cursor.getDefaultCursor()); - } // actionPerformed - - - /** - * Match To Changed - set Title - */ - private void cmd_matchTo() - { - // log.fine( "VMatch.cmd_matchTo"); - String selection = (String)matchTo.getSelectedItem(); - xMatchedToBorder.setTitle(selection); - xMatchedToScrollPane.repaint(); - // Reset Table - xMatchedToTable.setRowCount(0); - } // cmd_matchTo - - - /************************************************************************** - * List Selection Listener - get Info and fill xMatchedTo - * @param e event - */ - public void valueChanged (ListSelectionEvent e) - { - if (e.getValueIsAdjusting()) - return; - // log.config( "VMatch.valueChanged"); - panel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - cmd_searchTo(); - panel.setCursor(Cursor.getDefaultCursor()); - } // valueChanged - - /** - * Fill xMatchedTo - */ - private void cmd_searchTo() - { - int row = xMatchedTable.getSelectedRow(); - if (log.isLoggable(Level.CONFIG)) log.config("Row=" + row); - - double qty = 0.0; - if (row < 0) - { - xMatchedToTable.setRowCount(0); - } - else - { - // ** Create SQL ** - String displayString = (String)matchTo.getSelectedItem(); - int matchToType = matchFrom.getSelectedIndex(); - double docQty = ((Double)xMatchedTable.getValueAt(row, I_QTY)).doubleValue(); - double matchedQty = ((Double)xMatchedTable.getValueAt(row, I_MATCHED)).doubleValue(); - qty = docQty - matchedQty; - xMatchedToTable = (MiniTable)cmd_searchTo(xMatchedTable, xMatchedToTable, displayString, matchToType, sameBPartner.isSelected(), sameProduct.isSelected(), sameQty.isSelected(), matchMode.getSelectedIndex() == MODE_MATCHED); - - } - // Display To be Matched Qty - m_xMatched = BigDecimal.valueOf(qty); - xMatched.setValue(m_xMatched); - xMatchedTo.setValue(Env.ZERO); - difference.setValue(m_xMatched); - // Status Info - statusBar.setStatusLine(matchFrom.getSelectedItem().toString() - + "# = " + xMatchedTable.getRowCount() + " - " - + matchTo.getSelectedItem().toString() - + "# = " + xMatchedToTable.getRowCount(), - xMatchedToTable.getRowCount() == 0); - statusBar.setStatusDB(0); - } // cmd_searchTo - - /*************************************************************************** - * Table Model Listener - calculate matched Qty - * @param e event - */ - public void tableChanged (TableModelEvent e) - { - if (e.getColumn() != 0) - return; - if (log.isLoggable(Level.CONFIG)) log.config("Row=" + e.getFirstRow() + "-" + e.getLastRow() + ", Col=" + e.getColumn() - + ", Type=" + e.getType()); - panel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - - // Matched From - int matchedRow = xMatchedTable.getSelectedRow(); - KeyNamePair Product = (KeyNamePair)xMatchedTable.getValueAt(matchedRow, 5); - - // Matched To - double qty = 0.0; - int noRows = 0; - for (int row = 0; row < xMatchedToTable.getRowCount(); row++) - { - IDColumn id = (IDColumn)xMatchedToTable.getValueAt(row, 0); - if (id != null && id.isSelected()) - { - KeyNamePair ProductCompare = (KeyNamePair)xMatchedToTable.getValueAt(row, 5); - if (Product.getKey() != ProductCompare.getKey()) - { - id.setSelected(false); - } - else - { - if (matchMode.getSelectedIndex() == MODE_NOTMATCHED) - qty += ((Double)xMatchedToTable.getValueAt(row, I_QTY)).doubleValue(); // doc - qty -= ((Double)xMatchedToTable.getValueAt(row, I_MATCHED)).doubleValue(); // matched - noRows++; - } - } - } - // update quantities - m_xMatchedTo = BigDecimal.valueOf(qty); - xMatchedTo.setValue(m_xMatchedTo); - difference.setValue(m_xMatched.subtract(m_xMatchedTo)); - bProcess.setEnabled(noRows != 0); - panel.setCursor(Cursor.getDefaultCursor()); - // Status - statusBar.setStatusDB(noRows); - } // tableChanged - -} // VMatch diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VMerge.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VMerge.java deleted file mode 100644 index 83f4b6592f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VMerge.java +++ /dev/null @@ -1,245 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.Font; -import java.awt.GridLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.logging.Level; - -import org.compiere.apps.ADialog; -import org.compiere.apps.ConfirmPanel; -import org.compiere.grid.ed.VLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Merge Dialog. - * Restriction - fails for Accounting - * - * @author Jorg Janke - * @version $Id: VMerge.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VMerge extends Merge implements FormPanel, ActionListener -{ - private CPanel panel = new CPanel(); - - /** FormFrame */ - private FormFrame m_frame; - - private CLabel[] m_label = null; - private VLookup[] m_from = null; - private VLookup[] m_to = null; - - private BorderLayout mainLayout = new BorderLayout(); - private CPanel CenterPanel = new CPanel(); - private GridLayout centerLayout = new GridLayout(); - private CLabel mergeFromLabel = new CLabel(); - private CLabel mergeToLabel = new CLabel(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - - /** - * Initialize Panel - * @param WindowNo window - * @param frame frame - */ - public void init (int WindowNo, FormFrame frame) - { - m_WindowNo = WindowNo; - m_frame = frame; - if (log.isLoggable(Level.INFO)) log.info( "VMerge.init - WinNo=" + m_WindowNo); - try - { - preInit(); - jbInit (); - frame.getContentPane().add(panel, BorderLayout.CENTER); - // frame.getContentPane().add(statusBar, BorderLayout.SOUTH); - } - catch (Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - } // init - - /** - * Pre Init - */ - public void preInit() - { - int count = 4; // ** Update ** - m_columnName = new String[count]; - m_label = new CLabel[count]; - m_from = new VLookup[count]; - m_to = new VLookup[count]; - - // ** Update ** - preInit (0, 2163, DisplayType.TableDir, AD_ORG_ID); // C_Order.AD_Org_ID - preInit (1, 2762, DisplayType.Search, C_BPARTNER_ID); // C_Order.C_BPartner_ID - preInit (2, 971, DisplayType.Search, AD_USER_ID); // AD_User_Roles.AD_User_ID - preInit (3, 2221, DisplayType.Search, M_PRODUCT_ID); // C_OrderLine.M_Product_ID - } // preInit - - /** - * Pre Init Line - * @param index index - * @param AD_Column_ID id - * @param displayType display type - * @param ColumnName column name - */ - private void preInit (int index, int AD_Column_ID, int displayType, String ColumnName) - { - m_columnName[index] = ColumnName; - String what = Msg.translate(Env.getCtx(), ColumnName); - m_label[index] = new CLabel(what); - m_from[index] = new VLookup (ColumnName, false, false, true, - MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, AD_Column_ID, displayType)); - m_to[index] = new VLookup (ColumnName, false, false, true, - MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, AD_Column_ID, displayType)); - } // preInit - - /** - * Static init - * @throws java.lang.Exception - */ - void jbInit () throws Exception - { - panel.setLayout (mainLayout); - mainLayout.setHgap (5); - mainLayout.setVgap (5); - // - panel.add (confirmPanel, BorderLayout.SOUTH); - confirmPanel.addActionListener(this); - // - centerLayout.setHgap (5); - centerLayout.setVgap (5); - centerLayout.setColumns (3); - centerLayout.setRows (m_label.length+1); - // - CenterPanel.setLayout (centerLayout); - panel.add (CenterPanel, BorderLayout.CENTER); - CenterPanel.add (new CLabel(), null); - CenterPanel.add (mergeFromLabel, null); - CenterPanel.add (mergeToLabel, null); - // - Font heading = mergeFromLabel.getFont(); - heading = new Font(heading.getName(), Font.BOLD, heading.getSize()); - mergeFromLabel.setFont (heading); - mergeFromLabel.setRequestFocusEnabled (false); - mergeFromLabel.setText (Msg.getMsg(Env.getCtx(), "MergeFrom")); - mergeToLabel.setFont (heading); - mergeToLabel.setText (Msg.getMsg(Env.getCtx(), "MergeTo")); - // - for (int i = 0; i < m_label.length; i++) - { - CenterPanel.add (m_label[i], null); - CenterPanel.add (m_from[i], null); - CenterPanel.add (m_to[i], null); - } - } // jbInit - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - dispose(); - return; - } - - String columnName = null; - String from_Info = null; - String to_Info = null; - int from_ID = 0; - int to_ID = 0; - - // get first merge pair - for (int i = 0; (i < m_columnName.length && from_ID == 0 && to_ID == 0); i++) - { - Object value = m_from[i].getValue(); - if (value != null) - { - if (value instanceof Integer) - from_ID = ((Integer)value).intValue(); - else - continue; - value = m_to[i].getValue(); - if (value != null && value instanceof Integer) - to_ID = ((Integer)value).intValue(); - else - from_ID = 0; - if (from_ID != 0) - { - columnName = m_columnName[i]; - from_Info = m_from[i].getDisplay (); - to_Info = m_to[i].getDisplay (); - } - } - } // get first merge pair - - if (from_ID == 0 || from_ID == to_ID) - return; - - String msg = Msg.getMsg(Env.getCtx(), "MergeFrom") + " = " + from_Info - + "\n" + Msg.getMsg(Env.getCtx(), "MergeTo") + " = " + to_Info; - if (!ADialog.ask(m_WindowNo, panel, "MergeQuestion", msg)) - return; - - updateDeleteTable(columnName); - - panel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - confirmPanel.getOKButton().setEnabled(false); - // - boolean success = merge (columnName, from_ID, to_ID); - postMerge(columnName, to_ID); - // - confirmPanel.getOKButton().setEnabled(true); - panel.setCursor(Cursor.getDefaultCursor()); - // - if (success) - { - ADialog.info (m_WindowNo, panel, "MergeSuccess", - msg + " #" + m_totalCount); - } - else - { - ADialog.error(m_WindowNo, panel, "MergeError", - m_errorLog.toString()); - return; - } - dispose(); - } // actionPerformed -} // VMerge diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VPayPrint.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VPayPrint.java deleted file mode 100644 index 8c3535ceb5..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VPayPrint.java +++ /dev/null @@ -1,567 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.FlowLayout; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.beans.VetoableChangeListener; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.JButton; -import javax.swing.JFileChooser; - -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.grid.ed.VLookup; -import org.compiere.grid.ed.VNumber; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MPaySelectionCheck; -import org.compiere.model.MPaymentBatch; -import static org.compiere.model.SystemIDs.*; -import org.compiere.plaf.CompiereColor; -import org.compiere.print.ReportCtl; -import org.compiere.print.ReportEngine; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Ini; -import org.compiere.util.Msg; -import org.compiere.util.ValueNamePair; - -/** - * Payment Print & Export - * - * @author Jorg Janke - * @version $Id: VPayPrint.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - * - * Contributors: - * Carlos Ruiz - GlobalQSS - FR 3132033 - Make payment export class configurable per bank - * Markus Bozem: IDEMPIERE-1546 / IDEMPIERE-3286 - */ -public class VPayPrint extends PayPrint implements FormPanel, ActionListener, VetoableChangeListener -{ - private CPanel panel = new CPanel(); - - /** - * Initialize Panel - * @param WindowNo window - * @param frame frame - */ - public void init (int WindowNo, FormFrame frame) - { - log.info(""); - m_WindowNo = WindowNo; - m_frame = frame; - try - { - dynInit(); - jbInit(); - frame.getContentPane().add(centerPanel, BorderLayout.CENTER); - frame.getContentPane().add(southPanel, BorderLayout.SOUTH); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - } - } // init - - - /** FormFrame */ - private FormFrame m_frame; - - // Static Variables - private CPanel centerPanel = new CPanel(); - private CPanel southPanel = new CPanel(); - private FlowLayout southLayout = new FlowLayout(); - private GridBagLayout centerLayout = new GridBagLayout(); - private JButton bPrint = ConfirmPanel.createPrintButton(true); - private JButton bExport = ConfirmPanel.createExportButton(true); - private JButton bCancel = ConfirmPanel.createCancelButton(true); - private JButton bProcess = ConfirmPanel.createProcessButton(Msg.getMsg(Env.getCtx(), "VPayPrintProcess")); - private CLabel lPaySelect = new CLabel(); - private VLookup paySelectSearch = null; - private CLabel lBank = new CLabel(); - private CLabel fBank = new CLabel(); - private CLabel lPaymentRule = new CLabel(); - private CComboBoxfPaymentRule = new CComboBox(); - private CLabel lDocumentNo = new CLabel(); - private VNumber fDocumentNo = new VNumber(); - private CLabel lNoPayments = new CLabel(); - private CLabel fNoPayments = new CLabel(); - private CLabel lBalance = new CLabel(); - private VNumber fBalance = new VNumber(); - private CLabel lCurrency = new CLabel(); - private CLabel fCurrency = new CLabel(); - private CLabel lDepositBatch = new CLabel(); - private CCheckBox fDepositBatch = new CCheckBox(); - private CLabel lSumPayments = new CLabel(); - private VNumber fSumPayments = new VNumber(); - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - CompiereColor.setBackground(panel); - // - southPanel.setLayout(southLayout); - southLayout.setAlignment(FlowLayout.RIGHT); - centerPanel.setLayout(centerLayout); - // - bPrint.setEnabled(false); - bExport.setEnabled(false); - bPrint.addActionListener(this); - bExport.addActionListener(this); - bCancel.addActionListener(this); - // - bProcess.setText(Msg.getMsg(Env.getCtx(), "EFT")); - bProcess.setEnabled(false); - bProcess.addActionListener(this); - // - lPaySelect.setText(Msg.translate(Env.getCtx(), "C_PaySelection_ID")); - // - lBank.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID")); - // - lPaymentRule.setText(Msg.translate(Env.getCtx(), "PaymentRule")); - fPaymentRule.addActionListener(this); - // - lDocumentNo.setText(Msg.translate(Env.getCtx(), "DocumentNo")); - fDocumentNo.setDisplayType(DisplayType.Integer); - lNoPayments.setText(Msg.getMsg(Env.getCtx(), "NoOfPayments")); - fNoPayments.setText("0"); - lBalance.setText(Msg.translate(Env.getCtx(), "CurrentBalance")); - fBalance.setReadWrite(false); - fBalance.setDisplayType(DisplayType.Amount); - lCurrency.setText(Msg.translate(Env.getCtx(), "C_Currency_ID")); - lDepositBatch.setText(Msg.translate(Env.getCtx(), "C_DepositBatch_ID")); - lSumPayments.setText(Msg.getMsg(Env.getCtx(), "Sum")); - fSumPayments.setReadWrite(false); - fSumPayments.setDisplayType(DisplayType.Amount); - // - southPanel.add(bCancel, null); - southPanel.add(bExport, null); - southPanel.add(bPrint, null); - southPanel.add(bProcess, null); - // - centerPanel.add(lPaySelect, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - centerPanel.add(paySelectSearch, new GridBagConstraints(1, 0, 3, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - centerPanel.add(lBank, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - centerPanel.add(fBank, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0)); - centerPanel.add(lPaymentRule, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - centerPanel.add(fPaymentRule, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0)); - centerPanel.add(lDocumentNo, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - centerPanel.add(fDocumentNo, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0)); - centerPanel.add(lNoPayments, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - centerPanel.add(fNoPayments, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0)); - centerPanel.add(lBalance, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - centerPanel.add(fBalance, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0)); - centerPanel.add(lCurrency, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 12, 5), 0, 0)); - centerPanel.add(fCurrency, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 12, 12), 0, 0)); - - centerPanel.add(lDepositBatch, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - centerPanel.add(fDepositBatch, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0)); - centerPanel.add(lSumPayments, new GridBagConstraints(2, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - centerPanel.add(fSumPayments, new GridBagConstraints(3, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0)); - } // VPayPrint - - /** - * Dynamic Init - */ - private void dynInit() - { - - // C_PaySelection_ID - int AD_Column_ID = COLUMN_C_PAYSELECTIONCHECK_C_PAYSELECTION_ID; // C_PaySelectionCheck.C_PaySelection_ID - MLookup lookupPS = MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, AD_Column_ID, DisplayType.Search); - paySelectSearch = new VLookup("C_PaySelection_ID", true, false, true, lookupPS); - paySelectSearch.addVetoableChangeListener(this); - - } // dynInit - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** - * Set Payment Selection - * @param C_PaySelection_ID id - */ - public void setPaySelection (int C_PaySelection_ID) - { - if (C_PaySelection_ID == 0) - return; - - m_C_PaySelection_ID = C_PaySelection_ID; - paySelectSearch.setValue(Integer.valueOf(m_C_PaySelection_ID)); - loadPaySelectInfo(); - } // setsetPaySelection - - /************************************************************************** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - // log.config( "VPayPrint.actionPerformed" + e.toString()); - if (e.getSource() == bCancel) - dispose(); - else if (m_C_PaySelection_ID <= 0) - return; - else if (e.getSource() == fPaymentRule) - loadPaymentRuleInfo(); - else if (e.getSource() == bExport) - cmd_export(); - else if (e.getSource() == bProcess) - cmd_EFT(); - else if (e.getSource() == bPrint) - cmd_print(); - } // actionPerformed - - /** - * PaySelect changed - load Bank - */ - private void loadPaySelectInfo() - { - log.info( "VPayPrint.loadPaySelectInfo"); - if (m_C_PaySelection_ID <= 0) - return; - - loadPaySelectInfo(m_C_PaySelection_ID); - - fBank.setText(bank); - fCurrency.setText(currency); - fBalance.setValue(balance); - - m_frame.pack(); - - loadPaymentRule(); - } // loadPaySelectInfo - - /** - * Bank changed - load PaymentRule - */ - private void loadPaymentRule() - { - log.info(""); - if (m_C_BankAccount_ID == -1) - return; - - fPaymentRule.removeAllItems(); - - ArrayList data = loadPaymentRule(m_C_PaySelection_ID); - for(ValueNamePair pp : data) - fPaymentRule.addItem(pp); - - if (fPaymentRule.getItemCount() > 0) - fPaymentRule.setSelectedIndex(0); - - loadPaymentRuleInfo(); - } // loadPaymentRule - - /** - * PaymentRule changed - load DocumentNo, NoPayments, - * enable/disable EFT, Print - */ - private void loadPaymentRuleInfo() - { - ValueNamePair pp = (ValueNamePair)fPaymentRule.getSelectedItem(); - if (pp == null) - return; - String PaymentRule = pp.getValue(); - - if (log.isLoggable(Level.INFO)) log.info("PaymentRule=" + PaymentRule); - fNoPayments.setText(" "); - - String msg = loadPaymentRuleInfo(m_C_PaySelection_ID, PaymentRule); - - if(noPayments != null) - fNoPayments.setText(noPayments); - - if(sumPayments != null) - fSumPayments.setValue(sumPayments); - - bProcess.setEnabled(PaymentRule.equals("T")); - - if(documentNo != null) - fDocumentNo.setValue(documentNo); - - if(msg != null && msg.length() > 0) - ADialog.error(m_WindowNo, panel, msg); - - getPluginFeatures(); - } // loadPaymentRuleInfo - - protected void getPluginFeatures() - { - if (m_C_PaySelection_ID!=0) - { - if (loadPaymentExportClass (null)>=0) - { - bExport.setEnabled(true); - - fDepositBatch.setValue(m_PaymentExport.getDefaultDepositBatch()); - if (m_PaymentExport.supportsDepositBatch() && m_PaymentExport.supportsSeparateBooking()) - { - fDepositBatch.setReadWrite(true); - } - else - { - fDepositBatch.setReadWrite(false); - } - } - else - { - bExport.setEnabled(false); - } - if (printFormatId!=null && printFormatId!=0) - { - bPrint.setEnabled(true); - } - else - { - bPrint.setEnabled(false); - } - } - - } // getPluginFeatures - - /************************************************************************** - * Export payments to file - */ - private void cmd_export() - { - ValueNamePair pp = (ValueNamePair)fPaymentRule.getSelectedItem(); - if (pp == null) - return; - String PaymentRule = pp.getValue(); - log.info(PaymentRule); - if (!getChecks(PaymentRule)) - return; - - // Get File Info - JFileChooser fc = new JFileChooser(); - fc.setDialogTitle(Msg.getMsg(Env.getCtx(), "Export")); - fc.setFileSelectionMode(JFileChooser.FILES_ONLY); - fc.setMultiSelectionEnabled(false); - String filename = m_PaymentExport.getFilenamePrefix() + m_PaymentExport.getFilenameSuffix(); - fc.setSelectedFile(new java.io.File(filename)); - if (fc.showSaveDialog(panel) != JFileChooser.APPROVE_OPTION) - return; - - // Create File - int no = 0; - StringBuffer err = new StringBuffer(""); - if (m_PaymentExportClass == null || m_PaymentExportClass.trim().length() == 0) { - m_PaymentExportClass = "org.compiere.util.GenericPaymentExport"; - } - - no = loadPaymentExportClass(err) ; - - if (no >= 0) - { - no = m_PaymentExport.exportToFile(m_checks,(Boolean) fDepositBatch.getValue(),PaymentRule, fc.getSelectedFile(), err); - } - - if (no >= 0) { - ADialog.info(m_WindowNo, panel, "Saved", - fc.getSelectedFile().getAbsolutePath() + "\n" - + Msg.getMsg(Env.getCtx(), "NoOfLines") + "=" + no); - - if (ADialog.ask(m_WindowNo, panel, "VPayPrintSuccess?")) - { - // int lastDocumentNo = - MPaySelectionCheck.confirmPrint (m_checks, m_batch, (Boolean) fDepositBatch.getValue()); - // document No not updated - } - } else { - ADialog.error(m_WindowNo, panel, "Error", err.toString()); - } - dispose(); - } // cmd_export - - /** - * Create EFT payment - */ - private void cmd_EFT() - { - ValueNamePair pp = (ValueNamePair)fPaymentRule.getSelectedItem(); - if (pp == null) - return; - String PaymentRule = pp.getValue(); - log.info(PaymentRule); - if (!getChecks(PaymentRule)) - return; - dispose(); - } // cmd_EFT - - /** - * Print Checks and/or Remittance - */ - private void cmd_print() - { - ValueNamePair pp = (ValueNamePair)fPaymentRule.getSelectedItem(); - if (pp == null) - return; - String PaymentRule = pp.getValue(); - log.info(PaymentRule); - if (!getChecks(PaymentRule)) - return; - - panel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - - boolean somethingPrinted = false; - boolean directPrint = !Ini.isPropertyBool(Ini.P_PRINTPREVIEW); - // for all checks - for (int i = 0; i < m_checks.length; i++) - { - MPaySelectionCheck check = m_checks[i]; - // ReportCtrl will check BankAccountDoc for PrintFormat - boolean ok = ReportCtl.startDocumentPrint(ReportEngine.CHECK, check.get_ID(), null, AEnv.getWindowNo(panel), directPrint); - if (!somethingPrinted && ok) - somethingPrinted = true; - } - - // Confirm Print and Update BankAccountDoc - if (somethingPrinted && ADialog.ask(m_WindowNo, panel, "VPayPrintSuccess?")) - { - int lastDocumentNo = MPaySelectionCheck.confirmPrint (m_checks, m_batch); - if (lastDocumentNo != 0) - { - StringBuilder sb = new StringBuilder(); - sb.append("UPDATE C_BankAccountDoc SET CurrentNext=").append(++lastDocumentNo) - .append(" WHERE C_BankAccount_ID=").append(m_C_BankAccount_ID) - .append(" AND PaymentRule='").append(PaymentRule).append("'"); - DB.executeUpdate(sb.toString(), null); - } - } // confirm - - if (ADialog.ask(m_WindowNo, panel, "VPayPrintPrintRemittance")) - { - for (int i = 0; i < m_checks.length; i++) - { - MPaySelectionCheck check = m_checks[i]; - ReportCtl.startDocumentPrint(ReportEngine.REMITTANCE, check.get_ID(), null, AEnv.getWindowNo(panel), directPrint); - } - } // remittance - - panel.setCursor(Cursor.getDefaultCursor()); - dispose(); - } // cmd_print - - - /************************************************************************** - * Get Checks - * @param PaymentRule Payment Rule - * @return true if payments were created - */ - private boolean getChecks(String PaymentRule) - { - // do we have values - if (m_C_PaySelection_ID <= 0 || m_C_BankAccount_ID == -1 - || fPaymentRule.getSelectedIndex() == -1 || fDocumentNo.getValue() == null) - { - ADialog.error(m_WindowNo, panel, "VPayPrintNoRecords", - "(" + Msg.translate(Env.getCtx(), "C_PaySelectionLine_ID") + "=0)"); - return false; - } - - // get data - int startDocumentNo = ((Number)fDocumentNo.getValue()).intValue(); - - if (log.isLoggable(Level.CONFIG)) log.config("C_PaySelection_ID=" + m_C_PaySelection_ID + ", PaymentRule=" + PaymentRule + ", DocumentNo=" + startDocumentNo); - // - panel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - - // get Selections - m_checks = MPaySelectionCheck.get(m_C_PaySelection_ID, PaymentRule, startDocumentNo, null); - - panel.setCursor(Cursor.getDefaultCursor()); - // - if (m_checks == null || m_checks.length == 0) - { - ADialog.error(m_WindowNo, panel, "VPayPrintNoRecords", - "(" + Msg.translate(Env.getCtx(), "C_PaySelectionLine_ID") + " #0"); - return false; - } - m_batch = MPaymentBatch.getForPaySelection (Env.getCtx(), m_C_PaySelection_ID, null); - return true; - } // getChecks - - /** - * Vetoable Change Listener. - * - Payment Selection - * @param evt event - */ - @Override - public void vetoableChange(PropertyChangeEvent e) - throws PropertyVetoException { - String name = e.getPropertyName(); - Object value = e.getNewValue(); - if (log.isLoggable(Level.CONFIG)) log.config(name + "=" + value); - - if (value == null) - return; - - // Payment Selection - if (name.equals("C_PaySelection_ID")) - { - paySelectSearch.setValue(value); - m_C_PaySelection_ID = ((Integer)value).intValue(); - loadPaySelectInfo(); - } - } - -} // PayPrint diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VPaySelect.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VPaySelect.java deleted file mode 100644 index 3ab400e066..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VPaySelect.java +++ /dev/null @@ -1,473 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - * Contributors: * - * Colin Rooney (croo) Patch 1605368 Fixed Payment Terms & Only due * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.FlowLayout; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JScrollPane; -import javax.swing.event.TableModelEvent; -import javax.swing.event.TableModelListener; - -import org.adempiere.util.Callback; -import org.adempiere.util.IProcessUI; -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.IProcessParameter; -import org.compiere.apps.ProcessCtl; -import org.compiere.apps.ProcessParameterPanel; -import org.compiere.grid.ed.VCheckBox; -import org.compiere.grid.ed.VComboBox; -import org.compiere.grid.ed.VDate; -import org.compiere.minigrid.MiniTable; -import static org.compiere.model.SystemIDs.*; - -import org.compiere.model.MProcess; -import org.compiere.model.X_C_PaySelection; -import org.compiere.plaf.CompiereColor; -import org.compiere.process.ProcessInfo; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; -import org.compiere.util.ValueNamePair; - -/** - * Create Manual Payments From (AP) Invoices or (AR) Credit Memos. - * Allows user to select Invoices for payment. - * When Processed, PaySelection is created - * and optionally posted/generated and printed - * - * @author Jorg Janke - * @version $Id: VPaySelect.java,v 1.2 2008/07/11 08:20:12 cruiz Exp $ - */ -public class VPaySelect extends PaySelect implements FormPanel, ActionListener, TableModelListener, IProcessUI -{ - /** @todo withholding */ - private CPanel panel = new CPanel(); - - /** - * Initialize Panel - * @param WindowNo window - * @param frame frame - */ - public void init (int WindowNo, FormFrame frame) - { - log.info(""); - m_WindowNo = WindowNo; - m_frame = frame; - try - { - jbInit(); - dynInit(); - frame.getContentPane().add(commandPanel, BorderLayout.SOUTH); - frame.getContentPane().add(mainPanel, BorderLayout.CENTER); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - } - } // init - - /** FormFrame */ - private FormFrame m_frame; - - // - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel parameterPanel = new CPanel(); - private CLabel labelBankAccount = new CLabel(); - private VComboBox fieldBankAccount = new VComboBox(); - private GridBagLayout parameterLayout = new GridBagLayout(); - private CLabel labelBankBalance = new CLabel(); - private CLabel labelCurrency = new CLabel(); - private CLabel labelBalance = new CLabel(); - private VCheckBox onlyDue = new VCheckBox(); - private CLabel labelBPartner = new CLabel(); - private VComboBox fieldBPartner = new VComboBox(); - private CLabel labelDtype = new CLabel(); - private VComboBox fieldDtype = new VComboBox(); - - private JLabel dataStatus = new JLabel(); - private JScrollPane dataPane = new JScrollPane(); - private MiniTable miniTable = new MiniTable(); - private CPanel commandPanel = new CPanel(); - private JButton bCancel = ConfirmPanel.createCancelButton(true); - private JButton bGenerate = ConfirmPanel.createProcessButton(true); - private FlowLayout commandLayout = new FlowLayout(); - private JButton bRefresh = ConfirmPanel.createRefreshButton(true); - private CLabel labelPayDate = new CLabel(); - private VDate fieldPayDate = new VDate(); - private CLabel labelPaymentRule = new CLabel(); - private VComboBox fieldPaymentRule = new VComboBox(); - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - CompiereColor.setBackground(panel); - // - mainPanel.setLayout(mainLayout); - parameterPanel.setLayout(parameterLayout); - // - labelBankAccount.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID")); - fieldBankAccount.addActionListener(this); - labelBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID")); - fieldBPartner.addActionListener(this); - bRefresh.addActionListener(this); - labelDtype.setText(Msg.translate(Env.getCtx(), "C_DocType_ID")); - fieldDtype.addActionListener(this); - labelPayDate.setText(Msg.translate(Env.getCtx(), "PayDate")); - labelPaymentRule.setText(Msg.translate(Env.getCtx(), "PaymentRule")); - fieldPaymentRule.addActionListener(this); - // - labelBankBalance.setText(Msg.translate(Env.getCtx(), "CurrentBalance")); - labelBalance.setText("0"); - onlyDue.setText(Msg.getMsg(Env.getCtx(), "OnlyDue")); - dataStatus.setText(" "); - // - bGenerate.addActionListener(this); - bCancel.addActionListener(this); - // - mainPanel.add(parameterPanel, BorderLayout.NORTH); - parameterPanel.add(labelBankAccount, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterPanel.add(fieldBankAccount, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - - parameterPanel.add(labelBankBalance, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterPanel.add(labelCurrency, new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0)); - - parameterPanel.add(labelBalance, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - - parameterPanel.add(labelBPartner, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterPanel.add(fieldBPartner, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - - parameterPanel.add(labelDtype, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterPanel.add(fieldDtype, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - - parameterPanel.add(bRefresh, new GridBagConstraints(4, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - - parameterPanel.add(labelPayDate, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterPanel.add(fieldPayDate, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - - parameterPanel.add(labelPaymentRule, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterPanel.add(fieldPaymentRule, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - - parameterPanel.add(onlyDue, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - mainPanel.add(dataStatus, BorderLayout.SOUTH); - mainPanel.add(dataPane, BorderLayout.CENTER); - dataPane.getViewport().add(miniTable, null); - // - commandPanel.setLayout(commandLayout); - commandLayout.setAlignment(FlowLayout.RIGHT); - commandLayout.setHgap(10); - commandPanel.add(bCancel, null); - commandPanel.add(bGenerate, null); - } // jbInit - - /** - * Dynamic Init. - * - Load Bank Info - * - Load BPartner - * - Load Document Type - * - Init Table - */ - private void dynInit() - { - ArrayList bankAccountData = getBankAccountData(); - for(BankInfo bi : bankAccountData) - fieldBankAccount.addItem(bi); - - if (fieldBankAccount.getItemCount() == 0) - ADialog.error(m_WindowNo, panel, "VPaySelectNoBank"); - else - fieldBankAccount.setSelectedIndex(0); - - ArrayList bpartnerData = getBPartnerData(); - for(KeyNamePair pp : bpartnerData) - fieldBPartner.addItem(pp); - fieldBPartner.setSelectedIndex(0); - - ArrayList docTypeData = getDocTypeData(); - for(KeyNamePair pp : docTypeData) - fieldDtype.addItem(pp); - - prepareTable(miniTable); - - miniTable.getModel().addTableModelListener(this); - // - fieldPayDate.setMandatory(true); - fieldPayDate.setValue(new Timestamp(System.currentTimeMillis())); - } // dynInit - - /** - * Load Bank Info - Load Info from Bank Account and valid Documents (PaymentRule) - */ - private void loadBankInfo() - { - BankInfo bi = (BankInfo)fieldBankAccount.getSelectedItem(); - if (bi == null) - return; - labelCurrency.setText(bi.Currency); - labelBalance.setText(m_format.format(bi.Balance)); - - // PaymentRule - fieldPaymentRule.removeAllItems(); - - ArrayList paymentRuleData = getPaymentRuleData(bi); - for(ValueNamePair vp : paymentRuleData) - fieldPaymentRule.addItem(vp); - fieldPaymentRule.setSelectedIndex(0); - } // loadBankInfo - - /** - * Query and create TableInfo - */ - private void loadTableInfo() - { - Timestamp payDate = (Timestamp)fieldPayDate.getValue(); - miniTable.setColorCompare(payDate); - if (log.isLoggable(Level.CONFIG)) log.config("PayDate=" + payDate); - - BankInfo bi = (BankInfo)fieldBankAccount.getSelectedItem(); - - ValueNamePair paymentRule = (ValueNamePair)fieldPaymentRule.getSelectedItem(); - KeyNamePair bpartner = (KeyNamePair)fieldBPartner.getSelectedItem(); - KeyNamePair docType = (KeyNamePair)fieldDtype.getSelectedItem(); - - loadTableInfo(bi, payDate, paymentRule, onlyDue.isSelected(), false, bpartner, docType, miniTable); - - calculateSelection(); - } // loadTableInfo - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - - /************************************************************************** - * ActionListener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - // Update Bank Info - if (e.getSource() == fieldBankAccount) - loadBankInfo(); - - // Generate PaySelection - else if (e.getSource() == bGenerate) - { - generatePaySelect(); - dispose(); - } - - else if (e.getSource() == bCancel) - dispose(); - - // Update Open Invoices - else if (e.getSource() == fieldBPartner || e.getSource() == bRefresh || e.getSource() == fieldDtype) - loadTableInfo(); - - } // actionPerformed - - /** - * Table Model Listener - * @param e event - */ - public void tableChanged(TableModelEvent e) - { - if (e.getColumn() == 0) - calculateSelection(); - } // valueChanged - - /** - * Calculate selected rows. - * - add up selected rows - */ - public void calculateSelection() - { - dataStatus.setText(calculateSelection(miniTable)); - // - bGenerate.setEnabled(m_noSelected != 0); - } // calculateSelection - - /** - * Generate PaySelection - */ - private void generatePaySelect() - { - miniTable.stopEditor(true); - if (miniTable.getRowCount() == 0) - return; - miniTable.setRowSelectionInterval(0,0); - calculateSelection(); - if (m_noSelected == 0) - return; - - String msg = generatePaySelect(miniTable, (ValueNamePair) fieldPaymentRule.getSelectedItem(), - fieldPayDate.getTimestamp(), (BankInfo)fieldBankAccount.getSelectedItem()); - - if(msg != null && msg.length() > 0) - { - ADialog.error(m_WindowNo, panel, "SaveError", msg); - return; - } - - // Ask to Post it - if (!ADialog.ask(m_WindowNo, panel, "VPaySelectGenerate?", "(" + m_ps.getName() + ")")) - return; - - // Prepare Process - int AD_Proces_ID = PROCESS_C_PAYSELECTION_CREATEPAYMENT; // C_PaySelection_CreatePayment - ProcessInfo pi = new ProcessInfo (m_frame.getTitle(), AD_Proces_ID, - X_C_PaySelection.Table_ID, m_ps.getC_PaySelection_ID()); - pi.setAD_User_ID (Env.getAD_User_ID(Env.getCtx())); - pi.setAD_Client_ID(Env.getAD_Client_ID(Env.getCtx())); - pi.setAD_Process_UU(new MProcess(Env.getCtx(), AD_Proces_ID, null).getAD_Process_UU()); - - ProcessParameterPanel pp = new ProcessParameterPanel(m_WindowNo, pi); - // Execute Process - ProcessCtl.process(this, m_WindowNo, (IProcessParameter) pp, pi, trx); - // ProcessCtl worker = new ProcessCtl(this, pi, trx); - // worker.start(); // complete tasks in unlockUI - } // generatePaySelect - - /** - * Lock User Interface - * Called from the Worker before processing - * @param pi process info - */ - public void lockUI (ProcessInfo pi) - { - panel.setEnabled(false); - m_isLocked = true; - } // lockUI - - /** - * Unlock User Interface. - * Called from the Worker when processing is done - * @param pi process info - */ - public void unlockUI (ProcessInfo pi) - { - // this.setEnabled(true); - // m_isLocked = false; - // Ask to Print it // Window is disposed - if (!ADialog.ask(0, panel, "VPaySelectPrint?", "(" + pi.getSummary() + ")")) - return; - - // Start PayPrint - int AD_Form_ID = FORM_PAYMENT_PRINT_EXPORT; // Payment Print/Export - FormFrame ff = new FormFrame(null); - ff.openForm (AD_Form_ID); - // Set Parameter - if (m_ps != null) - { - VPayPrint pp = (VPayPrint)ff.getFormPanel(); - pp.setPaySelection(m_ps.getC_PaySelection_ID()); - } - // - ff.pack(); - panel.setVisible(false); - AEnv.addToWindowManager(ff); - AEnv.showCenterScreen(ff); - this.dispose(); - } // unlockUI - - /** - * Is the UI locked (Internal method) - * @return true, if UI is locked - */ - public boolean isUILocked() - { - return m_isLocked; - } // isLoacked - - /** - * Method to be executed async. - * Called from the ASyncProcess worker - * @param pi process info - */ - public void executeASync (ProcessInfo pi) - { - log.config("-"); - } // executeASync - - @Override - public void statusUpdate(String message) { - dataStatus.setText(message); - } - - @Override - public void ask(String message, Callback callback) { - boolean b = ADialog.ask(m_WindowNo, null, message); - if (callback != null) { - callback.onCallback(b); - } - } - - @Override - public void download(File file) { - // TODO Auto-generated method stub - - } - - @Override - public void askForInput(String message, Callback callback) { - String s = ADialog.askForInput(m_WindowNo, null, message); - if(callback != null) - callback.onCallback(s); - } -} // VPaySelect diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VResetPassword.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VResetPassword.java deleted file mode 100644 index 2348e37059..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VResetPassword.java +++ /dev/null @@ -1,344 +0,0 @@ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.beans.VetoableChangeListener; -import java.util.logging.Level; - -import javax.swing.JPasswordField; -import javax.swing.JTextField; -import javax.swing.SwingConstants; - -import org.compiere.apps.ADialog; -import org.compiere.apps.ConfirmPanel; -import org.compiere.grid.ed.VLookup; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MSysConfig; -import org.compiere.model.MUser; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Util; - -public class VResetPassword implements FormPanel, ActionListener, VetoableChangeListener { - - private static CLogger log = CLogger.getCLogger(VResetPassword.class); - - private FormFrame frame; - private CPanel mainPanel; - private ConfirmPanel confirmPanel; - - private CLabel lblUser; - private CLabel lblOldPassword; - private CLabel lblNewPassword; - private CLabel lblRetypeNewPassword; - private CLabel lblNewEMail; - private CLabel lblRetypeNewEMail; - private CLabel lblNewEMailUser; - private CLabel lblNewEMailUserPW; - - private VLookup fUser; - private JPasswordField txtOldPassword; - private JPasswordField txtNewPassword; - private JPasswordField txtRetypeNewPassword; - private JTextField txtNewEMail; - private JTextField txtRetypeNewEMail; - private JTextField txtNewEMailUser; - private JTextField txtNewEMailUserPW; - - public int windowNo = 0; - - @Override - public void init(int WindowNo, FormFrame frame) - { - this.windowNo = WindowNo; - this.frame = frame; - - try - { - dynInit(); - jbInit(); - - frame.getContentPane().add(mainPanel, BorderLayout.CENTER); - frame.getContentPane().add(confirmPanel, BorderLayout.SOUTH); - confirmPanel.addActionListener(this); - } - catch(Exception e) - { - log.log(Level.SEVERE, "init", e); - } - } - - private void jbInit() throws Exception - { - GridBagLayout panelLayout = new GridBagLayout(); - mainPanel.setLayout(panelLayout); - - mainPanel.add(lblUser, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - mainPanel.add(fUser, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - mainPanel.add(lblOldPassword, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - mainPanel.add(txtOldPassword, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - mainPanel.add(lblNewPassword, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - mainPanel.add(txtNewPassword, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - mainPanel.add(lblRetypeNewPassword, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - mainPanel.add(txtRetypeNewPassword, new GridBagConstraints(1, 3, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - mainPanel.add(lblNewEMail, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - mainPanel.add(txtNewEMail, new GridBagConstraints(1, 4, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - mainPanel.add(lblRetypeNewEMail, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - mainPanel.add(txtRetypeNewEMail, new GridBagConstraints(1, 5, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - mainPanel.add(lblNewEMailUser, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - mainPanel.add(txtNewEMailUser, new GridBagConstraints(1, 6, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - mainPanel.add(lblNewEMailUserPW, new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - mainPanel.add(txtNewEMailUserPW, new GridBagConstraints(1, 7, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - - fUser.addVetoableChangeListener(this); - } - - private void dynInit() - { - mainPanel = new CPanel(); - - // AD_User.AD_User_ID - MLookup userLkp = MLookupFactory.get (Env.getCtx(), windowNo, 0, 212, DisplayType.Search); - fUser = new VLookup("AD_User_ID", false, false, true, userLkp); - - txtOldPassword = new JPasswordField(); - txtOldPassword.setName("txtOldPassword"); - - txtNewPassword = new JPasswordField(); - txtNewPassword.setName("txtNewPassword"); - - txtRetypeNewPassword = new JPasswordField(); - txtRetypeNewPassword.setName("txtRetypeNewPassword"); - - txtNewEMail = new JTextField(); - txtNewEMail.setName("txtNewEMail"); - - txtRetypeNewEMail = new JTextField(); - txtRetypeNewEMail.setName("txtRetypeNewEMail"); - - txtNewEMailUser = new JTextField(); - txtNewEMailUser.setName("txtNewEMailUser"); - - txtNewEMailUserPW = new JTextField(); - txtNewEMailUserPW.setName("txtNewEMailUserPW"); - - lblUser = new CLabel(Msg.translate(Env.getCtx(), "AD_User_ID")); - lblUser.setRequestFocusEnabled(false); - lblUser.setLabelFor(fUser); - lblUser.setHorizontalAlignment(SwingConstants.RIGHT); - - lblOldPassword = new CLabel(Msg.getMsg(Env.getCtx(), "Old Password")); - lblOldPassword.setRequestFocusEnabled(false); - lblOldPassword.setLabelFor(txtOldPassword); - lblOldPassword.setHorizontalAlignment(SwingConstants.RIGHT); - - lblNewPassword = new CLabel(Msg.getMsg(Env.getCtx(), "New Password")); - lblNewPassword.setRequestFocusEnabled(false); - lblNewPassword.setLabelFor(txtNewPassword); - lblNewPassword.setHorizontalAlignment(SwingConstants.RIGHT); - - lblRetypeNewPassword = new CLabel(Msg.getMsg(Env.getCtx(), "New Password Confirm")); - lblRetypeNewPassword.setRequestFocusEnabled(false); - lblRetypeNewPassword.setLabelFor(txtRetypeNewPassword); - lblRetypeNewPassword.setHorizontalAlignment(SwingConstants.RIGHT); - - lblNewEMail = new CLabel(Msg.getMsg(Env.getCtx(), "New EMail")); - lblNewEMail.setRequestFocusEnabled(false); - lblNewEMail.setLabelFor(txtNewEMail); - lblNewEMail.setHorizontalAlignment(SwingConstants.RIGHT); - - lblRetypeNewEMail = new CLabel(Msg.getMsg(Env.getCtx(), "New EMail Confirm")); - lblRetypeNewEMail.setRequestFocusEnabled(false); - lblRetypeNewEMail.setLabelFor(txtRetypeNewEMail); - lblRetypeNewEMail.setHorizontalAlignment(SwingConstants.RIGHT); - - lblNewEMailUser = new CLabel(Msg.getMsg(Env.getCtx(), "New EMail User")); - lblNewEMailUser.setRequestFocusEnabled(false); - lblNewEMailUser.setLabelFor(txtNewEMailUser); - lblNewEMailUser.setHorizontalAlignment(SwingConstants.RIGHT); - - lblNewEMailUserPW = new CLabel(Msg.getMsg(Env.getCtx(), "New EMail User Password")); - lblNewEMailUserPW.setRequestFocusEnabled(false); - lblNewEMailUserPW.setLabelFor(txtNewEMailUserPW); - lblNewEMailUserPW.setHorizontalAlignment(SwingConstants.RIGHT); - - confirmPanel = new ConfirmPanel(); - } - - @Override - public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException - { - if (log.isLoggable(Level.INFO)) log.info(e.getPropertyName() + "=" + e.getNewValue()); - if (e.getPropertyName().equals("AD_User_ID")) - fUser.setValue(e.getNewValue()); - } - - @Override - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - dispose(); - return; - } - else if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - validateChangePassword(); - } - } - - private void validateChangePassword() - { - int p_AD_User_ID = -1; - if (fUser.getValue() != null) - p_AD_User_ID = Integer.parseInt(fUser.getValue().toString()); - if (p_AD_User_ID < 0) - { - ADialog.error(windowNo, frame, "UserMandatory"); - return; - } - - String p_OldPassword = new String(txtOldPassword.getPassword()); - String p_NewPassword = new String(txtNewPassword.getPassword()); - String p_NewPasswordConfirm = new String(txtRetypeNewPassword.getPassword()); - String p_NewEMail = txtNewEMail.getText(); - String p_NewEMailConfirm = txtRetypeNewEMail.getText(); - String p_NewEMailUser = txtNewEMailUser.getText(); - String p_NewEMailUserPW = txtNewEMailUserPW.getText(); - - MUser user = MUser.get(Env.getCtx(), p_AD_User_ID); - if (log.isLoggable(Level.FINE)) log.fine("User=" + user); - - // Do we need a password ? - if (Util.isEmpty(p_OldPassword)) // Password required - { - MUser operator = MUser.get(Env.getCtx(), Env.getAD_User_ID(Env.getCtx())); - if (log.isLoggable(Level.FINE)) log.fine("Operator=" + operator); - - if (p_AD_User_ID == 0 // change of System - || p_AD_User_ID == 100 // change of SuperUser - || !operator.isAdministrator()) - { - ADialog.error(windowNo, frame, "OldPasswordMandatory"); - return; - } - } else { - // is entered Password correct ? - boolean hash_password = MSysConfig.getBooleanValue(MSysConfig.USER_PASSWORD_HASH, false); - if (hash_password) { - if (!user.authenticateHash(p_OldPassword)) - { - ADialog.error(windowNo, frame, "OldPasswordNoMatch"); - return; - } - } else { - if (!p_OldPassword.equals(user.getPassword())) - { - ADialog.error(windowNo, frame, "OldPasswordNoMatch"); - return; - } - } - if (MSysConfig.getBooleanValue(MSysConfig.CHANGE_PASSWORD_MUST_DIFFER, true)) - { - if (p_OldPassword.equals(p_NewPassword)) { - ADialog.error(windowNo, frame, "NewPasswordMustDiffer"); - return; - } - } - } - - // new password confirm -// if (!Util.isEmpty(p_NewPassword)) { - if (Util.isEmpty(p_NewPasswordConfirm)) { - ADialog.error(windowNo, frame, "NewPasswordConfirmMandatory"); - return; - } else { - if (!p_NewPassword.equals(p_NewPasswordConfirm)) { - ADialog.error(windowNo, frame, "PasswordNotMatch"); - return; - } - } -// } - - if (!Util.isEmpty(p_NewEMailUserPW)) { - if (Util.isEmpty(p_NewEMailConfirm)) { - ADialog.error(windowNo, frame, "NewEmailConfirmMandatory"); - return; - } else { - if (!p_NewEMailUserPW.equals(p_NewEMailConfirm)) { - ADialog.error(windowNo, frame, "NewEmailNotMatch"); - return; - } - } - } - - if (!Util.isEmpty(p_NewPassword)) - user.set_ValueOfColumn("Password", p_NewPassword); // will be hashed and validate on saveEx - if (!Util.isEmpty(p_NewEMail)) - user.setEMail(p_NewEMail); - if (!Util.isEmpty(p_NewEMailUser)) - user.setEMailUser(p_NewEMailUser); - if (!Util.isEmpty(p_NewEMailUserPW)) - user.setEMailUserPW(p_NewEMailUserPW); - - try { - user.saveEx(); - } - catch(Exception e) - { - ADialog.error(windowNo, frame, e.getLocalizedMessage()); - user.load(user.get_TrxName()); - return; - } - clearForm(); - ADialog.info(windowNo, frame, "RecordSaved"); - return; - } - - private void clearForm() - { - fUser.setValue(null); - txtOldPassword.setText(null); - txtNewPassword.setText(null); - txtRetypeNewPassword.setText(null); - txtNewEMail.setText(null); - txtRetypeNewEMail.setText(null); - txtNewEMailUser.setText(null); - txtNewEMailUserPW.setText(null); - } - - @Override - public void dispose() - { - if (frame != null) - frame.dispose(); - frame = null; - } -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VSQLProcess.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VSQLProcess.java deleted file mode 100644 index 9d299c35ef..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VSQLProcess.java +++ /dev/null @@ -1,255 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.sql.Connection; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.StringTokenizer; -import java.util.logging.Level; - -import org.compiere.apps.ConfirmPanel; -import org.compiere.grid.ed.VText; -import org.compiere.swing.CButton; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextArea; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; - -/** - * Process SQL Commands - * - * @author Jorg Janke - * @version $Id: VSQLProcess.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VSQLProcess extends CPanel - implements FormPanel, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -8445688937366388495L; - - /** - * Initialize Panel - * @param WindowNo window - * @param frame frame - */ - public void init (int WindowNo, FormFrame frame) - { - log.info( "VSQLProcess.init"); - m_WindowNo = WindowNo; - m_frame = frame; - try - { - jbInit(); - frame.getContentPane().add(this, BorderLayout.CENTER); - // frame.getContentPane().add(confirmPanel, BorderLayout.SOUTH); - } - catch(Exception e) - { - log.log(Level.SEVERE, "VSQLProcess.init", e); - } - } // init - - /** - * Dispose - Free Resources - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** Window No */ - @SuppressWarnings("unused") - private int m_WindowNo = 0; - /** FormFrame */ - private FormFrame m_frame; - - /** Log */ - private static CLogger log = CLogger.getCLogger(VSQLProcess.class); - - /** DML Statement */ - private static final String[] DML_KEYWORDS = new String[]{ - "SELECT", "UPDATE", "DELETE", "TRUNCATE" - }; - - private BorderLayout mainLayout = new BorderLayout(); - private CPanel northPanel = new CPanel(); - private CLabel sqlLabel = new CLabel("SQL"); - private VText sqlField = new VText("SQL", false, false, true, 3000, 9000); - private CPanel centerPanel = new CPanel(); - private BorderLayout centerLayout = new BorderLayout(); - private BorderLayout northLayout = new BorderLayout(); - private CTextArea resultField = new CTextArea(20,60); - private CButton sqlButton = ConfirmPanel.createProcessButton(true); - - /** - * Static Init - * @throws Exception - */ - void jbInit() throws Exception - { - this.setLayout(mainLayout); - mainLayout.setHgap(5); - mainLayout.setVgap(5); - // - this.add(northPanel, BorderLayout.NORTH); - northLayout.setHgap(5); - northLayout.setVgap(5); - northPanel.setLayout(northLayout); - sqlLabel.setText("SQL"); - northPanel.add(sqlLabel, BorderLayout.WEST); - // - northPanel.add(sqlField, BorderLayout.CENTER); - sqlButton.addActionListener(this); - northPanel.add(sqlButton, BorderLayout.EAST); - // - this.add(centerPanel, BorderLayout.CENTER); - centerPanel.setLayout(centerLayout); - centerLayout.setHgap(0); - resultField.setReadWrite(false); - centerPanel.add(resultField, BorderLayout.CENTER); - } // jbInit - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - resultField.setText(processStatements (sqlField.getText(), false)); - } // actionedPerformed - - /** - * Process SQL Statements - * @param sqlStatements one or more statements separated by ; - * @param allowDML allow DML statements - * @return result - */ - public static String processStatements (String sqlStatements, boolean allowDML) - { - if (sqlStatements == null || sqlStatements.length() == 0) - return ""; - StringBuilder result = new StringBuilder(); - // - StringTokenizer st = new StringTokenizer(sqlStatements, ";", false); - while (st.hasMoreTokens()) - { - result.append(processStatement(st.nextToken(), allowDML)); - result.append(Env.NL); - } - // - return result.toString(); - } // processStatements - - /** - * Process SQL Statements - * @param sqlStatement one statement - * @param allowDML allow DML statements - * @return result - */ - public static String processStatement (String sqlStatement, boolean allowDML) - { - if (sqlStatement == null) - return ""; - StringBuilder sb = new StringBuilder(); - char[] chars = sqlStatement.toCharArray(); - for (int i = 0; i < chars.length; i++) - { - char c = chars[i]; - if (Character.isWhitespace(c)) - sb.append(' '); - else - sb.append(c); - } - String sql = sb.toString().trim(); - if (sql.length() == 0) - return ""; - // - StringBuffer result = new StringBuffer("SQL> ") - .append(sql) - .append(Env.NL); - if (!allowDML) - { - boolean error = false; - String SQL = sql.toUpperCase(); - for (int i = 0; i < DML_KEYWORDS.length; i++) - { - if (SQL.startsWith(DML_KEYWORDS[i] + " ") - || SQL.indexOf(" " + DML_KEYWORDS[i] + " ") != -1 - || SQL.indexOf("(" + DML_KEYWORDS[i] + " ") != -1) - { - result.append("===> ERROR: Not Allowed Keyword ") - .append(DML_KEYWORDS[i]) - .append(Env.NL); - error = true; - } - } - if (error) - return result.toString(); - } // !allowDML - - // Process - Connection conn = DB.createConnection(true, Connection.TRANSACTION_READ_COMMITTED); - Statement stmt = null; - try - { - stmt = conn.createStatement(); - @SuppressWarnings("unused") - boolean OK = stmt.execute(sql); - int count = stmt.getUpdateCount(); - if (count == -1) - { - result.append("---> ResultSet"); - } - else - result.append("---> Result=").append(count); - } - catch (SQLException e) - { - log.log(Level.SEVERE, "process statement: " + sql + " - " + e.toString()); - result.append("===> ").append(e.toString()); - } - finally - { - DB.close(stmt); - stmt = null; - try - { - conn.close(); - } - catch (SQLException e2) - { - log.log(Level.SEVERE, "processStatement - close connection", e2); - } - conn = null; - } - - // - result.append(Env.NL); - return result.toString(); - } // processStatement - -} // VSQLProcess diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VSetup.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VSetup.java deleted file mode 100644 index b7f0c7c56d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VSetup.java +++ /dev/null @@ -1,508 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Currency; -import java.util.Locale; -import java.util.logging.Level; - -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JFileChooser; -import javax.swing.JLabel; -import javax.swing.JScrollPane; -import javax.swing.JTextField; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ADialog; -import org.compiere.apps.ConfirmPanel; -import org.compiere.model.MSetup; -import org.compiere.plaf.CompiereColor; -import org.compiere.print.PrintUtil; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.ExtensionFileFilter; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -/** - * Setup System - * - * @author Jorg Janke - * @version $Id: VSetup.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - * @deprecated - */ -public class VSetup extends CPanel - implements FormPanel, ActionListener, Runnable -{ - /** - * - */ - private static final long serialVersionUID = 3255776374935155456L; - - /** - * Initialize Panel - * @param WindowNo window - * @param frame frame - */ - public void init (int WindowNo, FormFrame frame) - { - log.info( "VSetup.init"); - m_WindowNo = WindowNo; - m_frame = frame; - try - { - jbInit(); - dynInit(); - frame.getContentPane().add(centerPane, BorderLayout.CENTER); - frame.getContentPane().add(confirmPanel, BorderLayout.SOUTH); - } - catch(Exception e) - { - log.log(Level.SEVERE, "VSetup.init", e); - } - } // init - - /** Window No */ - private int m_WindowNo = 0; - /** FormFrame */ - private FormFrame m_frame; - - /* Natural Account file */ - private File m_file = null; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VSetup.class); - - // - private JScrollPane centerPane = new JScrollPane(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - private CPanel centerPanel = new CPanel(); - private GridBagLayout centerLayout = new GridBagLayout(); - private JLabel lClientName = new JLabel(); - private JTextField fClientName = new JTextField(); - private JLabel lOrgName = new JLabel(); - private JTextField fOrgName = new JTextField(); - private JTextField fOrgValue = new JTextField(); - private JLabel lCurrency = new JLabel(); - private JComboBox fCurrency = new JComboBox(); - private JLabel lUserClient = new JLabel(); - private JTextField fUserClient = new JTextField(); - private JLabel lUserOrg = new JLabel(); - private JTextField fUserOrg = new JTextField(); - private JCheckBox fProject = new JCheckBox(); - private JCheckBox fProduct = new JCheckBox(); - private JCheckBox fBPartner = new JCheckBox(); - private JLabel lAccountSeg = new JLabel(); - private JCheckBox fMCampaign = new JCheckBox(); - private JCheckBox fSRegion = new JCheckBox(); - private JButton buttonLoadAcct = new JButton(); - private JLabel lCountry = new JLabel(); - private JLabel lCity = new JLabel(); - private JComboBox fCountry = new JComboBox(); - private JTextField fCity = new JTextField(); - private JLabel lRegion = new JLabel(); - private JComboBox fRegion = new JComboBox(); - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - CompiereColor.setBackground(this); - centerPanel.setLayout(centerLayout); - String optional = Msg.translate(Env.getCtx(), "Optional"); - // - lClientName.setLabelFor(fClientName); - lClientName.setText(Msg.translate(Env.getCtx(), "AD_Client_ID")); - // lClientName.setToolTipText(""); - fClientName.setText("client"); - fClientName.setColumns(20); - // - lOrgName.setLabelFor(fOrgName); - lOrgName.setText(Msg.translate(Env.getCtx(), "AD_Org_ID")); - fOrgName.setText("org"); - fOrgName.setColumns(20); - // - lCurrency.setLabelFor(fCurrency); - lCurrency.setText(Msg.translate(Env.getCtx(), "C_Currency_ID")); - // lCurrency.setToolTipText(""); - // - lUserClient.setLabelFor(fUserClient); - lUserClient.setText(Msg.parseTranslation(Env.getCtx(), "@AD_User_ID@ @AD_Client_ID@")); - // lUserClient.setToolTipText("User name for client level access"); - fUserClient.setText("clientAdmin"); - fUserClient.setColumns(20); - // - lUserOrg.setLabelFor(fUserOrg); - lUserOrg.setText(Msg.parseTranslation(Env.getCtx(), "@AD_User_ID@ @AD_Org_ID@")); - // lUserOrg.setToolTipText(""); - fUserOrg.setText("clientUser"); - fUserOrg.setColumns(20); - // - lCountry.setLabelFor(fCountry); - lCountry.setText(Msg.translate(Env.getCtx(), "C_Country_ID")); - lCity.setLabelFor(fCity); - lCity.setText(Msg.translate(Env.getCtx(), "C_City_ID")); - fCity.setText("city"); - fCity.setColumns(20); - lRegion.setLabelFor(fRegion); - lRegion.setText(Msg.translate(Env.getCtx(), "C_Region_ID")); - lRegion.setToolTipText(optional); - // - lAccountSeg.setText(optional); - fBPartner.setSelected(true); - fBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID")); - fProduct.setSelected(true); - fProduct.setText(Msg.translate(Env.getCtx(), "M_Product_ID")); - fProject.setText(Msg.translate(Env.getCtx(), "C_Project_ID")); - fMCampaign.setText(Msg.translate(Env.getCtx(), "C_Campaign_ID")); - fSRegion.setText(Msg.translate(Env.getCtx(), "C_SalesRegion_ID")); - // - buttonLoadAcct.setText(Msg.getMsg(Env.getCtx(), "LoadAccountingValues")); - - centerPane.getViewport().add(centerPanel, null); - centerPanel.add(lClientName, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - centerPanel.add(fClientName, new GridBagConstraints(1, 0, 4, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0)); - centerPanel.add(lOrgName, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); - centerPanel.add(fOrgName, new GridBagConstraints(1, 1, 4, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0)); - centerPanel.add(lUserClient, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); - centerPanel.add(fUserClient, new GridBagConstraints(1, 2, 4, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0)); - centerPanel.add(lUserOrg, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); - centerPanel.add(fUserOrg, new GridBagConstraints(1, 3, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0)); - centerPanel.add(lAccountSeg, new GridBagConstraints(0, 8, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); - centerPanel.add(fProject, new GridBagConstraints(1, 9, 3, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0)); - centerPanel.add(fBPartner, new GridBagConstraints(1, 8, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0)); - centerPanel.add(fMCampaign, new GridBagConstraints(1, 10, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0)); - centerPanel.add(fCurrency, new GridBagConstraints(1, 4, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0)); - centerPanel.add(lCurrency, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); - centerPanel.add(buttonLoadAcct, new GridBagConstraints(1, 11, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0)); - centerPanel.add(lCountry, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); - centerPanel.add(lCity, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); - centerPanel.add(fCountry, new GridBagConstraints(1, 5, 3, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0)); - centerPanel.add(fCity, new GridBagConstraints(1, 6, 3, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0)); - centerPanel.add(fProduct, new GridBagConstraints(2, 8, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 0), 0, 0)); - centerPanel.add(fSRegion, new GridBagConstraints(2, 10, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0)); - centerPanel.add(lRegion, new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); - centerPanel.add(fRegion, new GridBagConstraints(1, 7, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0)); - } // jbInit - - /** - * Dynamic Init - */ - private void dynInit() - { - // Using current locale for default values - teo_sarca [ 1691388 ] - Locale locale = Locale.getDefault(); - Currency currency = Currency.getInstance(locale); - // Currency - String sql = "SELECT C_Currency_ID, Description, ISO_Code FROM C_Currency ORDER BY 2"; // teo_sarca [ 1691388 ] - Statement stmt = null; - ResultSet rs = null; - try - { - stmt = DB.createStatement(); - rs = stmt.executeQuery(sql); - while (rs.next()) { - fCurrency.addItem(new KeyNamePair(rs.getInt(1) , rs.getString(2))); - // Currency from locale will be the default currency - teo_sarca [ 1691388 ] - if (currency != null && currency.getCurrencyCode().equals(rs.getString(3))) - fCurrency.setSelectedIndex(fCurrency.getItemCount() - 1); - } - } - catch (SQLException e1) - { - log.log(Level.SEVERE, "VSetup.dynInit -currency", e1); - } - finally - { - DB.close(rs, stmt); - rs = null; stmt = null; - } - - // Country - int C_Country_ID = 0; - sql = "SELECT C_Country_ID, Name, CountryCode FROM C_Country ORDER BY 2"; // teo_sarca [ 1691388 ] - try - { - stmt = DB.createStatement(); - rs = stmt.executeQuery(sql); - while (rs.next()) { - fCountry.addItem(new KeyNamePair(rs.getInt(1) , rs.getString(2))); - // Country from locale will be the default country - teo_sarca [ 1691388 ] - if (locale.getCountry().equals(rs.getString(3))) { - fCountry.setSelectedIndex(fCountry.getItemCount() - 1); - C_Country_ID = rs.getInt(1); - } - } - } - catch (SQLException e1) - { - log.log(Level.SEVERE, "VSetup.dynInit -country", e1); - } - finally - { - DB.close(rs, stmt); - rs = null; stmt = null; - } - - // Region (optional) - sql = "SELECT C_Region_ID, Name, C_Country_ID FROM C_Region ORDER BY C_Country_ID, Name"; - boolean isSelected = false; - try - { - fRegion.addItem(new KeyNamePair(0, " ")); - stmt = DB.createStatement(); - rs = stmt.executeQuery(sql); - while (rs.next()) { - fRegion.addItem(new KeyNamePair(rs.getInt(1) , rs.getString(2))); - // First region for selected country will be the default - teo_sarca [ 1691388 ] - if (!isSelected && rs.getInt(3) == C_Country_ID) { - fRegion.setSelectedIndex(fRegion.getItemCount() - 1); - isSelected = true; - } - } - } - catch (SQLException e1) - { - log.log(Level.SEVERE, "VSetup.dynInit -region", e1); - } - finally - { - DB.close(rs, stmt); - rs = null; stmt = null; - } - - // General Listeners - confirmPanel.addActionListener(this); - buttonLoadAcct.addActionListener(this); - confirmPanel.getOKButton().setEnabled(false); - } // dynInit - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** - * ActionListener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - // load file - if (e.getSource().equals(buttonLoadAcct)) - m_file = getFile(); - // OK - else if (e.getActionCommand().equals(ConfirmPanel.A_OK) && m_file != null) - { - confirmPanel.getCancelButton().setEnabled(false); - confirmPanel.getOKButton().setEnabled(false); - if (createSetup()) - m_frame.startBatch(this); - else - { - confirmPanel.getCancelButton().setEnabled(true); - confirmPanel.getOKButton().setEnabled(true); - } - } - // Cancel - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - dispose(); - } // actionPerformed - - /** - * Get File for CoA - * @return File - */ - private File getFile() - { - File file = null; - String dirName = org.compiere.Adempiere.getAdempiereHome() + File.separator + "data" + File.separator + "import"; - log.config(dirName); - JFileChooser chooser = new JFileChooser(dirName); - chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); - chooser.setMultiSelectionEnabled(false); - chooser.setDialogTitle(Msg.translate(Env.getCtx(), "LoadAccountingValues")); - chooser.addChoosableFileFilter(new ExtensionFileFilter("csv", Msg.getMsg(Env.getCtx(), "FileCSV"))); - // Try selecting file - file = new File(dirName + File.pathSeparator + "AccountingUS.csv"); - if (file.exists()) - chooser.setSelectedFile(file); - - // Show it - if (chooser.showOpenDialog(this.getParent()) == JFileChooser.APPROVE_OPTION) - file = chooser.getSelectedFile(); - else - file = null; - chooser = null; - - if (file == null) - buttonLoadAcct.setText(Msg.translate(Env.getCtx(), "LoadAccountingValues")); - else - buttonLoadAcct.setText(file.getAbsolutePath()); - confirmPanel.getOKButton().setEnabled(file != null); - m_frame.pack(); - return file; - } // getFile - - - /************************************************************************** - * Create Setup - * @return true if created - */ - private boolean createSetup() - { - // Change critical characters ' => " \ => / - fClientName.setText(fClientName.getText().replace('\'','"')); - fClientName.setText(fClientName.getText().replace('\\','/')); - fOrgName.setText(fOrgName.getText().replace('\'','"')); - fOrgName.setText(fOrgName.getText().replace('\\','/')); - fUserClient.setText(fUserClient.getText().replace('\'','"')); - fUserClient.setText(fUserClient.getText().replace('\\','/')); - fUserOrg.setText(fUserOrg.getText().replace('\'','"')); - fUserOrg.setText(fUserOrg.getText().replace('\\','/')); - - // Unique Client Name - String SQL = "UPDATE AD_CLient SET CreatedBy=0 WHERE Name='" + fClientName.getText() + "'"; - if (DB.executeUpdate(SQL, null) != 0) - { - fClientName.setBackground(AdempierePLAF.getFieldBackground_Error()); - ADialog.error(m_WindowNo, this, "NotUnique", lClientName.getText()); - fClientName.requestFocus(); - return false; - } - fClientName.setBackground(AdempierePLAF.getFieldBackground_Normal()); - -/** - // Unique Org Name - SQL = "UPDATE AD_Org SET CreatedBy=0 WHERE Value='" + fOrgName.getText() + "'"; - if (DB.executeUpdate(SQL) != 0) - { - fOrgName.setBackground(AdempierePLAF.getFieldBackground_Error()); - ADialog.error(m_WindowNo, this, "NotUnique", lOrgName.getText()); - return false; - } - fOrgName.setBackground(AdempierePLAF.getFieldBackground_Normal()); -**/ - - // Unique User Name - SQL = "UPDATE AD_User SET CreatedBy=0 WHERE Name='" + fUserClient.getText() + "'"; - if (DB.executeUpdate(SQL, null) != 0) - { - fUserClient.setBackground(AdempierePLAF.getFieldBackground_Error()); - ADialog.error(m_WindowNo, this, "NotUnique", lUserClient.getText()); - fUserClient.requestFocus(); - return false; - } - fUserClient.setBackground(AdempierePLAF.getFieldBackground_Normal()); - SQL = "UPDATE AD_User SET CreatedBy=0 WHERE Name='" + fUserOrg.getText() + "'"; - if (DB.executeUpdate(SQL, null) != 0 || fUserClient.getText().equals(fUserOrg.getText())) - { - fUserOrg.setBackground(AdempierePLAF.getFieldBackground_Error()); - ADialog.error(m_WindowNo, this, "NotUnique", lUserOrg.getText()); - fUserOrg.requestFocus(); - return false; - } - fUserOrg.setBackground(AdempierePLAF.getFieldBackground_Normal()); - - return true; - } // createSetup - - /** - * Create Setup Batch Part. - * if done - disposes window - */ - public void run() - { - MSetup ms = new MSetup(Env.getCtx(), m_WindowNo); - m_frame.setBusyTimer(45); - // Step 1 - boolean ok = ms.createClient(fClientName.getText(), fOrgValue.getText(), fOrgName.getText(), - fUserClient.getText(), fUserOrg.getText(), null, null, null, null, null, null, null, true); // this form is not used - String info = ms.getInfo(); - - if (ok) - { - // Generate Accounting - KeyNamePair currency = (KeyNamePair)fCurrency.getSelectedItem(); - if (!ms.createAccounting(currency, - fProduct.isSelected(), fBPartner.isSelected(), fProject.isSelected(), - fMCampaign.isSelected(), fSRegion.isSelected(), - m_file)) - { - ADialog.error(m_WindowNo, this, "AccountSetupError"); - dispose(); - } else { - // Generate Entities - KeyNamePair p = (KeyNamePair)fCountry.getSelectedItem(); - int C_Country_ID = p.getKey(); - p = (KeyNamePair)fRegion.getSelectedItem(); - int C_Region_ID = p.getKey(); - ms.createEntities(C_Country_ID, fCity.getText(), C_Region_ID, currency.getKey(), null, null); - info += ms.getInfo(); - // Create Print Documents - PrintUtil.setupPrintForm(ms.getAD_Client_ID()); - } - } - - ADialog.info(m_WindowNo, this, "VSetup", info); - dispose(); - } // run - -} // VSetup diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VStatementCreateFromBatch.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VStatementCreateFromBatch.java deleted file mode 100644 index 5eb8579999..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VStatementCreateFromBatch.java +++ /dev/null @@ -1,324 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2013 Elaine Tan * - * Copyright (C) 2013 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.apps.form; - -import static org.compiere.model.SystemIDs.COLUMN_C_BANKSTATEMENT_C_BANKACCOUNT_ID; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.sql.Timestamp; -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.JLabel; -import javax.swing.table.DefaultTableModel; - -import org.compiere.apps.ADialog; -import org.compiere.apps.ConfirmPanel; -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VLookup; -import org.compiere.grid.ed.VNumber; -import org.compiere.grid.ed.VString; -import org.compiere.model.MBankStatement; -import org.compiere.model.MColumn; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MPayment; -import org.compiere.swing.CButton; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * - * @author Elaine - * - */ -public class VStatementCreateFromBatch extends StatementCreateFromBatch implements ActionListener, FormPanel -{ - private VCreateFromForm form; - private FormFrame m_frame; - - public void init (int WindowNo, FormFrame frame) - { - form = new VCreateFromForm(this, frame); - p_WindowNo = frame.getGridTab().getWindowNo();; - m_frame = frame; - initForm(); - } - - @Override - public void initForm() - { - try - { - if (!dynInit()) - return; - jbInit(); - } - catch(Exception e) - { - log.log(Level.SEVERE, "init", e); - } - } - - /** Window No */ - private int p_WindowNo; - - /** Logger */ - private CLogger log = CLogger.getCLogger(getClass()); - - private JLabel bankAccountLabel = new JLabel(); - protected VLookup bankAccountField; - - private CLabel documentNoLabel = new CLabel(Msg.translate(Env.getCtx(), "DocumentNo")); - protected CTextField documentNoField = new CTextField(10); - - private JLabel documentTypeLabel = new JLabel(); - protected VLookup documentTypeField; - - private JLabel authorizationLabel = new JLabel(); - protected VString authorizationField = new VString(); - - private JLabel tenderTypeLabel = new JLabel(); - protected VLookup tenderTypeField; - - private CLabel amtFromLabel = new CLabel(Msg.translate(Env.getCtx(), "PayAmt")); - protected VNumber amtFromField = new VNumber("AmtFrom", false, false, true, DisplayType.Amount, Msg.translate(Env.getCtx(), "AmtFrom")); - private CLabel amtToLabel = new CLabel("-"); - protected VNumber amtToField = new VNumber("AmtTo", false, false, true, DisplayType.Amount, Msg.translate(Env.getCtx(), "AmtTo")); - - protected CLabel BPartner_idLabel = new CLabel(Msg.translate(Env.getCtx(), "BPartner")); - protected VLookup bPartnerLookup; - - private CLabel dateFromLabel = new CLabel(Msg.translate(Env.getCtx(), "DateTrx")); - protected VDate dateFromField = new VDate("DateFrom", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateFrom")); - private CLabel dateToLabel = new CLabel("-"); - protected VDate dateToField = new VDate("DateTo", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateTo")); - - - /** - * Dynamic Init - * @throws Exception if Lookups cannot be initialized - * @return true if initialized - */ - public boolean dynInit() throws Exception - { - super.dynInit(); - - log.config(""); - - //Refresh button - CButton refreshButton = ConfirmPanel.createRefreshButton(false); - refreshButton.setMargin(new Insets (1, 10, 0, 10)); - refreshButton.setDefaultCapable(true); - refreshButton.addActionListener(this); - form.getConfirmPanel().addButton(refreshButton); -// form.getRootPane().setDefaultButton(refreshButton); - - if (m_frame.getGridTab() != null && m_frame.getGridTab().getValue("C_BankStatement_ID") == null) - { - ADialog.error(0, form, "SaveErrorRowNotFound"); - return false; - } - - m_frame.setTitle(getTitle()); - - int AD_Column_ID = COLUMN_C_BANKSTATEMENT_C_BANKACCOUNT_ID; // C_BankStatement.C_BankAccount_ID - MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir); - bankAccountField = new VLookup ("C_BankAccount_ID", true, true, true, lookup); - // Set Default - int C_BankAccount_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "C_BankAccount_ID"); - bankAccountField.setValue(Integer.valueOf(C_BankAccount_ID)); - bankAccountField.addActionListener(this); - // initial Loading - authorizationField = new VString ("authorization", false, false, true, 10, 30, null, null); - authorizationField.addActionListener(this); - - MLookup lookupDocument = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_C_DocType_ID), DisplayType.TableDir); - documentTypeField = new VLookup (MPayment.COLUMNNAME_C_DocType_ID,false,false,true,lookupDocument); - documentTypeField.addActionListener(this); - - MLookup lookupTender = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_TenderType), DisplayType.List); - tenderTypeField = new VLookup (MPayment.COLUMNNAME_TenderType,false,false,true,lookupTender); - tenderTypeField.addActionListener(this); - - bPartnerLookup = new VLookup("C_BPartner_ID", false, false, true, - MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, 3499, DisplayType.Search)); - BPartner_idLabel.setLabelFor(bPartnerLookup); - bPartnerLookup.addActionListener(this); - - Timestamp date = Env.getContextAsDate(Env.getCtx(), p_WindowNo, MBankStatement.COLUMNNAME_StatementDate); - dateToField.setValue(date); - - documentNoField.addActionListener(this); - dateFromField.addActionListener(this); - dateToField.addActionListener(this); - amtFromField.addActionListener(this); - amtToField.addActionListener(this); - - executeQuery(); - - return true; - } // dynInit - - /** - * Static Init. - *
    -	 *  parameterPanel
    -	 *      parameterBankPanel
    -	 *      parameterStdPanel
    -	 *          bPartner/order/invoice/shopment/licator Label/Field
    -	 *  dataPane
    -	 *  southPanel
    -	 *      confirmPanel
    -	 *      statusBar
    -	 *  
    - * @throws Exception - */ - private void jbInit() throws Exception - { - bankAccountLabel.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID")); - authorizationLabel.setText(Msg.translate(Env.getCtx(), "R_AuthCode")); - - documentTypeLabel.setText(Msg.translate(Env.getCtx(), "C_DocType_ID")); - tenderTypeLabel.setText(Msg.translate(Env.getCtx(), "TenderType")); - - documentNoLabel.setLabelFor(documentNoField); - dateFromLabel.setLabelFor(dateFromField); - dateFromField.setToolTipText(Msg.translate(Env.getCtx(), "DateFrom")); - dateToLabel.setLabelFor(dateToField); - dateToField.setToolTipText(Msg.translate(Env.getCtx(), "DateTo")); - amtFromLabel.setLabelFor(amtFromField); - amtFromField.setToolTipText(Msg.translate(Env.getCtx(), "AmtFrom")); - amtToLabel.setLabelFor(amtToField); - amtToField.setToolTipText(Msg.translate(Env.getCtx(), "AmtTo")); - - CPanel parameterPanel = form.getParameterPanel(); - parameterPanel.setLayout(new BorderLayout()); - - CPanel parameterBankPanel = new CPanel(); - parameterBankPanel.setLayout(new GridBagLayout()); - parameterPanel.add(parameterBankPanel, BorderLayout.CENTER); - - parameterBankPanel.add(bankAccountLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - if (bankAccountField != null) - parameterBankPanel.add(bankAccountField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(documentTypeLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - if(documentTypeField!= null) - parameterBankPanel.add(documentTypeField, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(tenderTypeLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - if(tenderTypeField!=null) - parameterBankPanel.add(tenderTypeField, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(BPartner_idLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(bPartnerLookup, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(documentNoLabel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(documentNoField, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(authorizationLabel, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(authorizationField, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(amtFromLabel, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(amtFromField, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - parameterBankPanel.add(amtToLabel, new GridBagConstraints(4, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(amtToField, new GridBagConstraints(5, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(dateFromLabel, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(dateFromField, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - parameterBankPanel.add(dateToLabel, new GridBagConstraints(4, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(dateToField, new GridBagConstraints(5, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - } // jbInit - - /*************************************************************************/ - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (log.isLoggable(Level.CONFIG)) log.config("Action=" + e.getActionCommand()); -// Object source = e.getSource(); - if(e.getActionCommand().equals(ConfirmPanel.A_REFRESH)) - { - Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR); - executeQuery(); - form.tableChanged(null); - Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR); - } - } // actionPerformed - - public void executeQuery() - { - loadTableOIS(getBankAccountData(bankAccountField.getValue(), bPartnerLookup.getValue(), - documentNoField.getText(), dateFromField.getValue(), dateToField.getValue(), - amtFromField.getValue(), amtToField.getValue(), - documentTypeField.getValue(), tenderTypeField.getValue(), authorizationField.getText(), - m_frame.getGridTab())); - } - - protected void loadTableOIS (Vector data) - { - // Remove previous listeners - form.getMiniTable().getModel().removeTableModelListener(form); - // Set Model - DefaultTableModel model = new DefaultTableModel(data, getOISColumnNames()); - model.addTableModelListener(form); - form.getMiniTable().setModel(model); - // - - configureMiniTable(form.getMiniTable()); - } - - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VTreeBOM.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VTreeBOM.java deleted file mode 100644 index e361690041..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VTreeBOM.java +++ /dev/null @@ -1,726 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.Enumeration; -import java.util.List; -import java.util.Properties; -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.JCheckBox; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.JSplitPane; -import javax.swing.JTree; -import javax.swing.SwingUtilities; -import javax.swing.event.TreeSelectionEvent; -import javax.swing.event.TreeSelectionListener; -import javax.swing.table.DefaultTableModel; -import javax.swing.tree.DefaultMutableTreeNode; -import javax.swing.tree.TreePath; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ADialog; -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.StatusBar; -import org.compiere.apps.form.FormFrame; -import org.compiere.apps.form.FormPanel; -import org.compiere.grid.ed.VLookup; -import org.compiere.minigrid.MiniTable; -import org.compiere.model.MColumn; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MProduct; -import org.compiere.model.MProductBOM; -import org.compiere.model.MUOM; -import org.compiere.model.Query; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Language; -import org.compiere.util.Msg; - -/** - * BOM Tree Maintenance - * - * @author Victor Perez,Sergio Ramazzinag - * @version $Id: VTreeMaintenance.java,v 1.1 2004/03/20 04:35:51 jjanke Exp $ - * - * 4Layers - MODIFICATIONS -------------------------------------------------------- - * 2005/04/12 Various improvements to the standard form (Sergio Ramazzina) - * 4Layers -------------------------------------------------------------------- end - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - * @author Paul Bowden, adaxa modified for manufacturing light - * @author Tony Snook, enhancements search, right-click bom, where-used - * - */ -public class VTreeBOM extends CPanel implements FormPanel, ActionListener, TreeSelectionListener -{ - - /** - * - */ - private static final long serialVersionUID = -4045195906352692040L; - - /***************************************************************************** - * Mouse Listener for Popup Menu - */ - final class VTreeBOM_mouseAdapter extends java.awt.event.MouseAdapter - { - /** - * Constructor - * @param adaptee adaptee - */ - VTreeBOM_mouseAdapter(VTreeBOM adaptee) - { - m_adaptee = adaptee; - } - - private VTreeBOM m_adaptee; - - /** - * Mouse Listener - * @param e MouseEvent - */ - public void mouseClicked(MouseEvent e) - { - // popup menu - if (SwingUtilities.isRightMouseButton(e)) - m_adaptee.popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - // Hide the popup if not right click - teo_sarca [ 1734802 ] - else - m_adaptee.popupMenu.setVisible(false); - } // mouse Clicked - - } // VTreeBOM_mouseAdapter - - /** - * Key Pressed - */ - class VTreeBOM_keyAdapter extends java.awt.event.KeyAdapter - { - VTreeBOM m_adaptee; - - /** - * VTreePanel_keyAdapter - * @param adaptee - */ - VTreeBOM_keyAdapter(VTreeBOM adaptee) - { - m_adaptee = adaptee; - } - - /** - * Key Pressed - * @param e - */ - public void keyPressed(KeyEvent e) - { - if (e.getKeyCode() == KeyEvent.VK_ENTER) - m_adaptee.keyPressed(e); - } - } // VTreeBOM_keyAdapter - - - /** - * Tree Maintenance - */ - - /** Window No */ - private int m_WindowNo = 0; - /** FormFrame */ - private FormFrame m_frame; - /** Active Tree */ - private myJTree m_tree; - - private static CLogger log = CLogger.getCLogger(VTreeBOM.class); - - private BorderLayout mainLayout = new BorderLayout (); - private CPanel northPanel = new CPanel (); - - private FlowLayout northLayout = new FlowLayout (FlowLayout.RIGHT,20,5); - private CPanel southPanel = new CPanel(); - private CPanel southPanel2 = new CPanel (); - private BorderLayout southLayout = new BorderLayout(); - private FlowLayout southLayout2 = new FlowLayout (); - - private CLabel labelProduct = new CLabel (); - private VLookup fieldProduct; - private CCheckBox implosion = new CCheckBox (); - private CLabel treeInfo = new CLabel (); - private CLabel spacer = new CLabel (); - // - private JSplitPane splitPane = new JSplitPane (); - private JScrollPane dataPane = new JScrollPane(); - private JScrollPane treePane = new JScrollPane(); - private CCheckBox treeExpand = new CCheckBox(); - private CTextField treeSearch = new CTextField(10); - private CLabel treeSearchLabel = new CLabel(); - private String m_search = ""; - private Enumeration m_nodeEn; - private DefaultMutableTreeNode m_selectedNode; // the selected model node - private int m_selected_id = 0; - private MouseListener mouseListener = new VTreeBOM_mouseAdapter(this); - private KeyListener keyListener = new VTreeBOM_keyAdapter(this); - private DefaultMutableTreeNode m_root = null; - - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - protected StatusBar statusBar = new StatusBar(); - - private MiniTable tableBOM = new MiniTable(); - private Vector> dataBOM = new Vector>(); - private Vector columnNames; - - private final int DIVIDER_LOCATION = 300; - private boolean reload = false; - private Language language = Language.getLoginLanguage(); // Base Language - - JPopupMenu popupMenu = new JPopupMenu(); - private CMenuItem mBOM; - private CMenuItem mImplosion; - private MLookup m_fieldProduct; - - - public Properties getCtx() { - return Env.getCtx(); - } - - /** - * Initialize Panel - * @param WindowNo window - * @param frame frame - */ - public void init (int WindowNo, FormFrame frame) - { - m_WindowNo = WindowNo; - m_frame = frame; - if (log.isLoggable(Level.INFO)) log.info( "VTreeBOM.init - WinNo=" + m_WindowNo); - try - { - preInit(); - jbInit (); - - frame.getContentPane().add(this, BorderLayout.CENTER); - } - catch (Exception ex) - { - log.log(Level.SEVERE,"VTreeMaintenance.init", ex); - } - } // init - - /** - * preInit() - Fill Tree Combo - */ - private void preInit() throws Exception - { - m_fieldProduct = MLookupFactory.get(getCtx(), m_WindowNo, - MColumn.getColumn_ID(MProduct.Table_Name, "M_Product_ID"), - DisplayType.Search, language, MProduct.COLUMNNAME_M_Product_ID, 0, false, - " M_Product.IsSummary = 'N'"); - fieldProduct = new VLookup ("M_Product_ID", false, false, true, m_fieldProduct) { - - /** - * - */ - private static final long serialVersionUID = 1084743143950828526L; - - public void setValue(Object value) { - super.setValue(value); - } - }; - - implosion.addActionListener(this); - splitPane.add (dataPane, JSplitPane.RIGHT); - splitPane.add (treePane, JSplitPane.LEFT); - } // preInit - - /** - * loadTableBOM - * - * - */ - private void loadTableBOM() - { - // Header Info - columnNames = new Vector(10); - - columnNames.add(Msg.getElement(getCtx(), "IsActive")); // 0 - columnNames.add(Msg.getElement(getCtx(), "Line")); // 1 - columnNames.add(Msg.getElement(getCtx(), "M_Product_ID")); // 2 - columnNames.add(Msg.getElement(getCtx(), "C_UOM_ID")); // 3 - columnNames.add(Msg.getElement(getCtx(), "QtyBOM")); // 4 - - DefaultTableModel model = new DefaultTableModel(dataBOM, columnNames); - tableBOM.setModel(model); - - tableBOM.setColumnClass( 0, Boolean.class, true); // 0 IsActive - tableBOM.setColumnClass( 1, String.class,true); // 1 Line (as string) - tableBOM.setColumnClass( 2, KeyNamePair.class,true); // 2 M_Product_ID - tableBOM.setColumnClass( 3, KeyNamePair.class,true); // 3 C_UOM_ID - tableBOM.setColumnClass( 4, BigDecimal.class,true); // 4 QtyBOM - - tableBOM.setMultiSelection(false); - tableBOM.autoSize(); - - } // loadTableBOM - - - /** - * jbInit - * - */ - private void jbInit () - { - this.setLayout (mainLayout); - - // 4Layers - Set initial window dimension - this.setPreferredSize(new Dimension(640, 480)); - - labelProduct.setText (Msg.getElement(getCtx(), "M_Product_ID")); - implosion.setText (Msg.getElement(getCtx(), "Implosion")); - treeInfo.setText ("Selected Product: "); - spacer.setText(" "); - northPanel.setLayout (northLayout); - northLayout.setAlignment (FlowLayout.LEFT); - - // - this.add (northPanel, BorderLayout.NORTH); - - northPanel.add (labelProduct, null); - northPanel.add (fieldProduct, null); - northPanel.add (implosion, null); - northPanel.add (spacer, null); - northPanel.add (spacer, null); - northPanel.add (treeInfo, null); - - treeExpand.setText(Msg.getMsg(Env.getCtx(), "ExpandTree")); - treeExpand.setActionCommand("Expand"); - treeExpand.addMouseListener(mouseListener); - treeExpand.addActionListener(this); - // - treeSearchLabel.setText(Msg.getMsg(Env.getCtx(), "TreeSearch") + " "); - treeSearchLabel.setLabelFor(treeSearch); - treeSearchLabel.setToolTipText(Msg.getMsg(Env.getCtx(), "TreeSearchText")); - treeSearch.setBackground(AdempierePLAF.getInfoBackground()); - treeSearch.addKeyListener(keyListener); - - this.add(southPanel, BorderLayout.SOUTH); - southPanel.setLayout(southLayout); - confirmPanel.addActionListener(this); - southPanel.add(confirmPanel, BorderLayout.SOUTH); - - southPanel2.setLayout(southLayout2); - southLayout2.setAlignment (FlowLayout.LEFT); - - southPanel.add(southPanel2, BorderLayout.NORTH); - southPanel2.add(treeExpand, null);//BorderLayout.EAST); - southPanel2.add(spacer, null); - southPanel2.add(treeSearchLabel, null);//BorderLayout.WEST); - southPanel2.add(treeSearch, null);//BorderLayout.CENTER); - - this.add (splitPane, BorderLayout.CENTER); - - // 4Layers - Set divider location - splitPane.setDividerLocation(DIVIDER_LOCATION); - - mBOM = new CMenuItem(Msg.getMsg(Env.getCtx(), "BOM"), Env.getImageIcon("Detail16.gif")); - mBOM.addActionListener(this); - popupMenu.add(mBOM); - - mImplosion = new CMenuItem(Msg.getMsg(Env.getCtx(), "Implosion"), Env.getImageIcon("Parent16.gif")); - mImplosion.addActionListener(this); - popupMenu.add(mImplosion); - - } // jbInit - - /** - * Enter Key - * @param e event - */ - protected void keyPressed(KeyEvent e) - { - // *** treeSearch *** - if (e.getSource() == treeSearch) - { - String search = treeSearch.getText(); - boolean found = false; - - // at the end - try from top - if (m_nodeEn != null && !m_nodeEn.hasMoreElements()) - m_search = ""; - - // this is the first time - if (!search.equals(m_search)) - { - // get enumeration of all nodes - m_nodeEn = m_root.preorderEnumeration(); - m_search = search; - } - - // search the nodes - while(!found && m_nodeEn != null && m_nodeEn.hasMoreElements()) - { - DefaultMutableTreeNode nd = (DefaultMutableTreeNode)m_nodeEn.nextElement(); - Vector nodeInfo = (Vector )(nd.getUserObject()); - String uoName = ((KeyNamePair)nodeInfo.elementAt(2)).getName() ; - // compare in upper case - if (uoName.toUpperCase().indexOf(search.toUpperCase()) != -1) - { - found = true; - TreePath treePath = new TreePath(nd.getPath()); - m_tree.setSelectionPath(treePath); - m_tree.makeVisible(treePath); // expand it - m_tree.scrollPathToVisible(treePath); - } - } - if (!found) - ADialog.beep(); - } // treeSearch - - } // keyPressed - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (e.getSource() == mBOM) - { - fieldProduct.setValue(m_selected_id); - if (implosion.isSelected()) - implosion.doClick(); - action_loadBOM(); - } - if (e.getSource() == mImplosion) - { - fieldProduct.setValue(m_selected_id); - if (!implosion.isSelected()) - implosion.doClick(); - action_loadBOM(); - } - - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - if(m_selected_id > 0 || getM_Product_ID() > 0) action_loadBOM(); - } - - if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - dispose(); - } - else if (e.getSource() instanceof JCheckBox) - { - if (e.getActionCommand().equals("Expand")) - expandTree(); - } - - } // actionPerformed - - /** - * Action: Fill Tree with all nodes - */ - private void action_loadBOM() - { - m_frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - - reload = false; - - int M_Product_ID = getM_Product_ID(); - if (M_Product_ID == 0) - return; - MProduct M_Product = MProduct.get(getCtx(), M_Product_ID); - treeInfo.setText ("Selected Product: "+M_Product.getValue()); - - Vector line = new Vector(10); - line.add( Boolean.valueOf(M_Product.isActive())); // 0 IsActive - line.add( Integer.valueOf(0).toString()); // 1 Line - KeyNamePair pp = new KeyNamePair(M_Product.getM_Product_ID(),M_Product.getValue().concat("_").concat(M_Product.getName())); - line.add(pp); // 2 M_Product_ID - MUOM u = new MUOM(M_Product.getCtx(), M_Product.getC_UOM_ID(), M_Product.get_TrxName()); - KeyNamePair uom = new KeyNamePair(u.get_ID(), u.getUOMSymbol()); - line.add(uom); // 3 C_UOM_ID - line.add(Env.ONE); // 4 QtyBOM - - DefaultMutableTreeNode parent = new DefaultMutableTreeNode(line); - m_root = (DefaultMutableTreeNode)parent.getRoot(); - dataBOM.clear(); - - if (isImplosion()) - { - for (MProductBOM bomline : getParentBOMs(M_Product_ID)) - { - addParent(bomline, parent); - } - m_tree = new myJTree(parent); - m_tree.addMouseListener(mouseListener); - } - else - { - for (MProductBOM bom : getChildBOMs(M_Product_ID, true)) - { - addChild(bom, parent); - } - m_tree = new myJTree(parent); - m_tree.addMouseListener(mouseListener); - } - - m_tree.addTreeSelectionListener(this); - treePane.getViewport().add (m_tree, null); - loadTableBOM(); - - dataPane.getViewport().add(tableBOM, null); - splitPane.setDividerLocation(DIVIDER_LOCATION); - - m_frame.setCursor(Cursor.getDefaultCursor()); - } // action_loadBOM - - private void action_reloadBOM() - { - m_frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - reload = true; - int M_Product_ID = m_selected_id; - - if (M_Product_ID == 0) - return; - MProduct M_Product = MProduct.get(getCtx(), M_Product_ID); - treeInfo.setText ("Selected Product: "+M_Product.getValue()); - - DefaultMutableTreeNode parent = new DefaultMutableTreeNode(productSummary(M_Product, false)); - dataBOM.clear(); - - if (isImplosion()) - { - for (MProductBOM bomline : getParentBOMs(M_Product_ID)) - { - addParent(bomline, parent); - } - - } - else - { - for (MProductBOM bom : getChildBOMs(M_Product_ID, true)) - { - addChild(bom, parent); - } - } - - loadTableBOM(); - - m_frame.setCursor(Cursor.getDefaultCursor()); - } // action_reloadBOM - - public void addChild(MProductBOM bomline, DefaultMutableTreeNode parent) - { - - MProduct M_Product = MProduct.get(getCtx(), bomline.getM_ProductBOM_ID()); - - Vector line = new Vector(10); - line.add( Boolean.valueOf(bomline.isActive())); // 0 IsActive - line.add( Integer.valueOf(bomline.getLine()).toString()); // 1 Line - KeyNamePair pp = new KeyNamePair(M_Product.getM_Product_ID(),M_Product.getValue().concat("_").concat(M_Product.getName())); - line.add(pp); // 2 M_Product_ID - MUOM u = new MUOM(M_Product.getCtx(), M_Product.getC_UOM_ID(), M_Product.get_TrxName()); - KeyNamePair uom = new KeyNamePair(u.get_ID(), u.getUOMSymbol()); - line.add(uom); // 3 C_UOM_ID - line.add((BigDecimal) ((bomline.getBOMQty()!=null) ? bomline.getBOMQty() : Env.ZERO)); // 4 QtyBOM - - DefaultMutableTreeNode child = new DefaultMutableTreeNode(line); - parent.add(child); - - if(m_selected_id == bomline.getM_Product_ID() || getM_Product_ID() == bomline.getM_Product_ID()) - dataBOM.add(line); - - if(reload) return; - - for (MProductBOM bom : getChildBOMs(bomline.getM_ProductBOM_ID(), false)) - { - addChild(bom, child); - } - } - - public void addParent(MProductBOM bom, DefaultMutableTreeNode parent) - { - MProduct M_Product = MProduct.get(getCtx(), bom.getM_Product_ID()); - - Vector line = new Vector(10); - line.add( Boolean.valueOf(M_Product.isActive())); // 0 IsActive - line.add( Integer.valueOf(bom.getLine()).toString()); // 1 Line - KeyNamePair pp = new KeyNamePair(M_Product.getM_Product_ID(),M_Product.getValue().concat("_").concat(M_Product.getName())); - line.add(pp); // 2 M_Product_ID - MUOM u = new MUOM(M_Product.getCtx(), M_Product.getC_UOM_ID(), M_Product.get_TrxName()); - KeyNamePair uom = new KeyNamePair(u.get_ID(),u.getUOMSymbol()); - line.add(uom); // 3 C_UOM_ID - line.add((BigDecimal) ((bom.getBOMQty()!=null) ? bom.getBOMQty() : Env.ZERO)); // 4 QtyBOM - - if(m_selected_id == bom.getM_ProductBOM_ID() || getM_Product_ID() == bom.getM_ProductBOM_ID()) - dataBOM.add(line); - - DefaultMutableTreeNode child = new DefaultMutableTreeNode(line); - parent.add(child); - - if(reload) return; - - for (MProductBOM bomline : getParentBOMs(bom.getM_Product_ID())) - { - addParent(bomline, child); - } - - } - - public void valueChanged(TreeSelectionEvent event) - { - m_selectedNode = (DefaultMutableTreeNode)m_tree.getLastSelectedPathComponent(); - - /* if nothing is selected */ - if (m_selectedNode == null) return; - - Vector nodeInfo = (Vector )(m_selectedNode.getUserObject()); - - m_selected_id = ((KeyNamePair)nodeInfo.elementAt(2)).getKey() ; - - action_reloadBOM(); - - } - - /** - * Clicked on Expand All - */ - private void expandTree() - { - if (treeExpand.isSelected()) - { - for (int row = 0; row < m_tree.getRowCount(); row++) - m_tree.expandRow(row); - } - else - { -// patch: 1654055 +jgubo Changed direction of collapsing the tree nodes - for (int row = m_tree.getRowCount(); row > 0; row--) - m_tree.collapseRow(row); - } - } // expandTree - - public String productSummary(MProduct product, boolean isLeaf) { - MUOM uom = MUOM.get(getCtx(), product.getC_UOM_ID()); - String value = product.getValue(); - String name = product.get_Translation(MProduct.COLUMNNAME_Name); - // - StringBuilder sb = new StringBuilder(value); - if (name != null && !value.equals(name)) - sb.append("_").append(product.getName()); - sb.append(" [").append(uom.get_Translation(MUOM.COLUMNNAME_UOMSymbol)).append("]"); - // - return sb.toString(); - } - - private boolean isImplosion() { - return implosion.isSelected(); - } - - private int getM_Product_ID() { - Integer Product = (Integer)fieldProduct.getValue(); - if (Product == null) - return 0; - return Product.intValue(); - } - - private List getChildBOMs(int M_Product_ID, boolean onlyActiveRecords) - { - String filter = MProductBOM.COLUMNNAME_M_Product_ID+"=?" - +(onlyActiveRecords ? " AND IsActive='Y'" : ""); - return new Query(getCtx(), MProductBOM.Table_Name, filter, null) - .setParameters(new Object[]{M_Product_ID}) - .setOrderBy(MProductBOM.COLUMNNAME_Line) - .list(); - } - - private List getParentBOMs(int M_Product_ID) - { - String filter = MProductBOM.COLUMNNAME_M_ProductBOM_ID+"=?"; - return new Query(getCtx(), MProductBOM.Table_Name, filter, null) - .setParameters(new Object[]{M_Product_ID}) - .setOrderBy(MProductBOM.COLUMNNAME_M_Product_ID+","+MProductBOM.COLUMNNAME_Line) - .list(); - } -} // VTreeBOM - - -/************************************************************************** - * myJTree - extends convertValueToText method of JTree - */ -class myJTree extends JTree -{ - - /** - * - */ - private static final long serialVersionUID = -5831338565562378100L; - - public myJTree(DefaultMutableTreeNode parent) { - - super(parent); - } - - @Override - public String convertValueToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { - - DefaultMutableTreeNode nd = (DefaultMutableTreeNode)value; - - Vector userObject = (Vector )nd.getUserObject(); - //Product - StringBuilder sb = new StringBuilder(((KeyNamePair)userObject.elementAt(2)).getName()); - //UOM - sb.append(" ["+((KeyNamePair) userObject.elementAt(3)).getName().trim()+"]"); - //BOMQty - BigDecimal BOMQty = (BigDecimal)(userObject.elementAt(4)); - sb.append("x"+BOMQty.setScale(2, RoundingMode.HALF_UP).stripTrailingZeros()); - - return sb.toString(); - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VTreeMaintenance.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VTreeMaintenance.java deleted file mode 100644 index cad54f91d7..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VTreeMaintenance.java +++ /dev/null @@ -1,332 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.DefaultListModel; -import javax.swing.JList; -import javax.swing.JScrollPane; -import javax.swing.JSplitPane; -import javax.swing.ListModel; -import javax.swing.ListSelectionModel; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; - -import org.compiere.apps.ADialog; -import org.compiere.grid.tree.VTreePanel; -import org.compiere.model.MTree; -import org.compiere.model.MTreeNode; -import org.compiere.swing.CButton; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -/** - * Tree Maintenance - * - * @author Jorg Janke - * @version $Id: VTreeMaintenance.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VTreeMaintenance extends TreeMaintenance - implements FormPanel, ActionListener, ListSelectionListener, PropertyChangeListener -{ - private CPanel panel = new CPanel(); - - /** FormFrame */ - private FormFrame m_frame; - - private BorderLayout mainLayout = new BorderLayout (); - private CPanel northPanel = new CPanel (); - private FlowLayout northLayout = new FlowLayout (); - private CLabel treeLabel = new CLabel (); - private CComboBox treeField; - private CButton bAddAll = new CButton (Env.getImageIcon("FastBack24.gif")); - private CButton bAdd = new CButton (Env.getImageIcon("StepBack24.gif")); - private CButton bDelete = new CButton (Env.getImageIcon("StepForward24.gif")); - private CButton bDeleteAll = new CButton (Env.getImageIcon("FastForward24.gif")); - private CCheckBox cbAllNodes = new CCheckBox (); - private CLabel treeInfo = new CLabel (); - // - private JSplitPane splitPane = new JSplitPane (); - private VTreePanel centerTree; - private JList centerList = new JList (); - - - /** - * Initialize Panel - * @param WindowNo window - * @param frame frame - */ - public void init (int WindowNo, FormFrame frame) - { - m_WindowNo = WindowNo; - m_frame = frame; - if (log.isLoggable(Level.INFO)) log.info( "VMerge.init - WinNo=" + m_WindowNo); - try - { - preInit(); - jbInit (); - frame.getContentPane().add(panel, BorderLayout.CENTER); - // frame.getContentPane().add(statusBar, BorderLayout.SOUTH); - action_loadTree(); - } - catch (Exception ex) - { - log.log(Level.SEVERE, "VTreeMaintenance.init", ex); - } - } // init - - /** - * Fill Tree Combo - */ - private void preInit() - { - treeField = new CComboBox(getTreeData()); - treeField.addActionListener(this); - // - centerTree = new VTreePanel (m_WindowNo, false, true); - centerTree.addPropertyChangeListener(VTreePanel.NODE_SELECTION, this); - } // preInit - - /** - * Static init - * @throws Exception - */ - private void jbInit () throws Exception - { - panel.setLayout (mainLayout); - treeLabel.setText (Msg.translate(Env.getCtx(), "AD_Tree_ID")); - cbAllNodes.setEnabled (false); - cbAllNodes.setText (Msg.translate(Env.getCtx(), "IsAllNodes")); - treeInfo.setText (" "); - bAdd.setToolTipText(Msg.getMsg(Env.getCtx(), "AddToTree")); - bAddAll.setToolTipText(Msg.getMsg(Env.getCtx(), "AddAllToTree")); - bDelete.setToolTipText(Msg.getMsg(Env.getCtx(), "DeleteFromTree")); - bDeleteAll.setToolTipText(Msg.getMsg(Env.getCtx(), "DeleteAllFromTree")); - bAdd.addActionListener(this); - bAddAll.addActionListener(this); - bDelete.addActionListener(this); - bDeleteAll.addActionListener(this); - northPanel.setLayout (northLayout); - northLayout.setAlignment (FlowLayout.LEFT); - // - panel.add (northPanel, BorderLayout.NORTH); - northPanel.add (treeLabel, null); - northPanel.add (treeField, null); - northPanel.add (cbAllNodes, null); - northPanel.add (treeInfo, null); - northPanel.add (bAddAll, null); - northPanel.add (bAdd, null); - northPanel.add (bDelete, null); - northPanel.add (bDeleteAll, null); - // - panel.add (splitPane, BorderLayout.CENTER); - splitPane.add (centerTree, JSplitPane.LEFT); - splitPane.add (new JScrollPane(centerList), JSplitPane.RIGHT); - centerList.setSelectionMode (ListSelectionModel.SINGLE_SELECTION); - centerList.addListSelectionListener(this); - } // jbInit - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (e.getSource() == treeField) - action_loadTree(); - else if (e.getSource() == bAddAll) - action_treeAddAll(); - else if (e.getSource() == bAdd) - action_treeAdd((ListItem)centerList.getSelectedValue()); - else if (e.getSource() == bDelete) - action_treeDelete((ListItem)centerList.getSelectedValue()); - else if (e.getSource() == bDeleteAll) - action_treeDeleteAll(); - } // actionPerformed - - - /** - * Action: Fill Tree with all nodes - */ - private void action_loadTree() - { - KeyNamePair tree = (KeyNamePair)treeField.getSelectedItem(); - if (log.isLoggable(Level.INFO)) log.info("Tree=" + tree); - if (tree.getKey() <= 0) - { - centerList.setModel(new DefaultListModel()); - return; - } - // Tree - m_tree = new MTree (Env.getCtx(), tree.getKey(), null); - cbAllNodes.setSelected(m_tree.isAllNodes()); - bAddAll.setEnabled(!m_tree.isAllNodes()); - bAdd.setEnabled(!m_tree.isAllNodes()); - bDelete.setEnabled(!m_tree.isAllNodes()); - bDeleteAll.setEnabled(!m_tree.isAllNodes()); - // - - // List - DefaultListModel model = new DefaultListModel(); - ArrayList items = getTreeItemData(); - for(ListItem item : items) - model.addElement(item); - - // List - if (log.isLoggable(Level.CONFIG)) log.config("#" + model.getSize()); - centerList.setModel(model); - // Tree - centerTree.initTree(m_tree.getAD_Tree_ID()); - } // action_fillTree - - /** - * List Selection Listener - * @param e event - */ - public void valueChanged (ListSelectionEvent e) - { - if (e.getValueIsAdjusting()) - return; - ListItem selected = null; - try - { // throws a ArrayIndexOutOfBoundsException if root is selected - selected = (ListItem)centerList.getSelectedValue(); - } - catch (Exception ex) - { - } - if (log.isLoggable(Level.INFO)) log.info("Selected=" + selected); - if (selected != null) // allow add if not in tree - bAdd.setEnabled(!centerTree.setSelectedNode(selected.id)); - } // valueChanged - - /** - * VTreePanel Changed - * @param e event - */ - public void propertyChange (PropertyChangeEvent e) - { - MTreeNode tn = (MTreeNode)e.getNewValue(); - if (tn == null) - return; - if (log.isLoggable(Level.INFO)) log.info(tn.toString()); - ListModel model = centerList.getModel(); - int size = model.getSize(); - int index = -1; - for (index = 0; index < size; index++) - { - ListItem item = (ListItem)model.getElementAt(index); - if (item.id == tn.getNode_ID()) - break; - } - centerList.setSelectedIndex(index); - } // propertyChange - - /** - * Action: Add Node to Tree - * @param item item - */ - private void action_treeAdd(ListItem item) - { - if (log.isLoggable(Level.INFO)) log.info("Item=" + item); - if (item != null) - { - centerTree.nodeChanged(true, item.id, item.name, - item.description, item.isSummary, item.imageIndicator); - - // May cause Error if in tree - addNode(item); - } - } // action_treeAdd - - /** - * Action: Delete Node from Tree - * @param item item - */ - private void action_treeDelete(ListItem item) - { - if (log.isLoggable(Level.INFO)) log.info("Item=" + item); - if (item != null) - { - centerTree.nodeChanged(false, item.id, item.name, - item.description, item.isSummary, item.imageIndicator); - - deleteNode(item); - } - } // action_treeDelete - - - /** - * Action: Add All Nodes to Tree - */ - private void action_treeAddAll() - { - if (ADialog.ask(m_WindowNo, null, "TreeAddAllItems")) { // idempiere-85 - log.info(""); - ListModel model = centerList.getModel(); - int size = model.getSize(); - int index = -1; - for (index = 0; index < size; index++) - { - ListItem item = (ListItem)model.getElementAt(index); - action_treeAdd(item); - } - } - } // action_treeAddAll - - /** - * Action: Delete All Nodes from Tree - */ - private void action_treeDeleteAll() - { - if (ADialog.ask(m_WindowNo, null, "TreeRemoveAllItems")) { // idempiere-85 - log.info(""); - ListModel model = centerList.getModel(); - int size = model.getSize(); - int index = -1; - for (index = 0; index < size; index++) - { - ListItem item = (ListItem)model.getElementAt(index); - action_treeDelete(item); - } - } - } // action_treeDeleteAll - -} // VTreeMaintenance diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VTrxMaterial.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VTrxMaterial.java deleted file mode 100644 index b74a761279..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VTrxMaterial.java +++ /dev/null @@ -1,290 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.form; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.VetoableChangeListener; -import java.sql.Timestamp; -import java.util.Properties; -import java.util.logging.Level; - -import javax.swing.JLabel; - -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.StatusBar; -import org.compiere.grid.GridController; -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VLocator; -import org.compiere.grid.ed.VLookup; -import org.compiere.model.MLocatorLookup; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.plaf.CompiereColor; -import org.compiere.swing.CPanel; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Material Transaction History - * - * @author Jorg Janke - * @version $Id: VTrxMaterial.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VTrxMaterial extends TrxMaterial - implements FormPanel, ActionListener, VetoableChangeListener -{ - private CPanel panel = new CPanel(); - - /** FormFrame */ - private FormFrame m_frame; - /** Grid Controller */ - private GridController m_gridController; - - // - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel parameterPanel = new CPanel(); - private JLabel orgLabel = new JLabel(); - private VLookup orgField; - private JLabel locatorLabel = new JLabel(); - private VLocator locatorField; - private JLabel productLabel = new JLabel(); - private VLookup productField; - private JLabel dateFLabel = new JLabel(); - private VDate dateFField; - private JLabel dateTLabel = new JLabel(); - private VDate dateTField; - private JLabel mtypeLabel = new JLabel(); - private VLookup mtypeField; - private GridBagLayout parameterLayout = new GridBagLayout(); - private CPanel southPanel = new CPanel(); - private BorderLayout southLayout = new BorderLayout(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true, true, false, false, false, true, true); - private StatusBar statusBar = new StatusBar(); - - - /** - * Initialize Panel - * @param WindowNo window - * @param frame frame - */ - public void init (int WindowNo, FormFrame frame) - { - log.info(""); - m_WindowNo = WindowNo; - m_frame = frame; - try - { - dynParameter(); - jbInit(); - dynInit(); - frame.getContentPane().add(mainPanel, BorderLayout.CENTER); - frame.getContentPane().add(statusBar, BorderLayout.SOUTH); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - } // init - - - /** - * Static Init - * @throws Exception - */ - void jbInit() throws Exception - { - CompiereColor.setBackground(panel); - mainPanel.setLayout(mainLayout); - mainLayout.setVgap(10); - parameterPanel.setLayout(parameterLayout); - // - orgLabel.setText(Msg.translate(Env.getCtx(), "AD_Org_ID")); - locatorLabel.setText(Msg.translate(Env.getCtx(), "M_Locator_ID")); - productLabel.setText(Msg.translate(Env.getCtx(), "Product")); - dateFLabel.setText(Msg.translate(Env.getCtx(), "DateFrom")); - dateTLabel.setText(Msg.translate(Env.getCtx(), "DateTo")); - mtypeLabel.setText(Msg.translate(Env.getCtx(), "MovementType")); - // - mainPanel.add(parameterPanel, BorderLayout.NORTH); - parameterPanel.add(orgLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - parameterPanel.add(orgField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 0, 5), 0, 0)); - parameterPanel.add(mtypeLabel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - parameterPanel.add(mtypeField, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 0, 5), 0, 0)); - parameterPanel.add(dateFLabel, new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - parameterPanel.add(dateFField, new GridBagConstraints(5, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 0, 5), 0, 0)); - - parameterPanel.add(locatorLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - parameterPanel.add(locatorField, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 0, 5), 0, 0)); - parameterPanel.add(productLabel, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - parameterPanel.add(productField, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 0, 5), 0, 0)); - parameterPanel.add(dateTLabel, new GridBagConstraints(4, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - parameterPanel.add(dateTField, new GridBagConstraints(5, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 0, 5), 0, 0)); - // - southPanel.setLayout(southLayout); - southPanel.add(confirmPanel, BorderLayout.NORTH); - southPanel.add(statusBar, BorderLayout.SOUTH); - mainPanel.add(southPanel, BorderLayout.SOUTH); - } // jbInit - - /** - * Initialize Parameter fields - * @throws Exception if Lookups cannot be initialized - */ - private void dynParameter() throws Exception - { - Properties ctx = Env.getCtx(); - // Organization - MLookup orgLookup = MLookupFactory.get (ctx, m_WindowNo, 0, 3660, DisplayType.TableDir); - orgField = new VLookup("AD_Org_ID", false, false, true, orgLookup); - // orgField.addVetoableChangeListener(this); - // Locator - MLocatorLookup locatorLookup = new MLocatorLookup(ctx, m_WindowNo); - locatorField = new VLocator ("M_Locator_ID", false, false, true, locatorLookup, m_WindowNo); - // locatorField.addVetoableChangeListener(this); - // Product - MLookup productLookup = MLookupFactory.get (ctx, m_WindowNo, 0, 3668, DisplayType.Search); - productField = new VLookup("M_Product_ID", false, false, true, productLookup); - productField.addVetoableChangeListener(this); - // Movement Type - MLookup mtypeLookup = MLookupFactory.get (ctx, m_WindowNo, 0, 3666, DisplayType.List); - mtypeField = new VLookup("MovementType", false, false, true, mtypeLookup); - // Dates - dateFField = new VDate("DateFrom", false, false, true, DisplayType.Date, Msg.getMsg(Env.getCtx(), "DateFrom")); - dateTField = new VDate("DateTo", false, false, true, DisplayType.Date, Msg.getMsg(Env.getCtx(), "DateTo")); - // - confirmPanel.addActionListener(this); - statusBar.setStatusLine(""); - } // dynParameter - - /** - * Dynamic Layout (Grid). - * Based on AD_Window: Material Transactions - */ - private void dynInit() - { - super.dynInit(statusBar); - m_gridController = new GridController(); - m_gridController.initGrid(m_mTab, true, m_WindowNo, null, null); - mainPanel.add(m_gridController, BorderLayout.CENTER); - } // dynInit - - - /** - * Dispose - */ - public void dispose() - { - if (m_gridController != null) - m_gridController.dispose(); - m_gridController = null; - m_mTab = null; - if (m_mWindow != null) - m_mWindow.dispose(); - m_mWindow = null; - - orgField = null; - locatorField = null; - productField = null; - mtypeField = null; - dateFField = null; - dateTField = null; - // - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - - /************************************************************************** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - dispose(); - else if (e.getActionCommand().equals(ConfirmPanel.A_REFRESH) - || e.getActionCommand().equals(ConfirmPanel.A_OK)) - refresh(); - else if (e.getActionCommand().equals(ConfirmPanel.A_ZOOM)) - zoom(); - } // actionPerformed - - - /************************************************************************** - * Property Listener - * @param e event - */ - public void vetoableChange (PropertyChangeEvent e) - { - if (e.getPropertyName().equals("M_Product_ID")) - productField.setValue(e.getNewValue()); - } // vetoableChange - - - - /************************************************************************** - * Refresh - Create Query and refresh grid - */ - private void refresh() - { - Object organization = orgField.getValue(); - Object locator = locatorField.getValue(); - Object product = productField.getValue(); - Object movementType = mtypeField.getValue(); - Timestamp movementDateFrom = (Timestamp)dateFField.getValue(); - Timestamp movementDateTo = (Timestamp)dateTField.getValue(); - - panel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - refresh(organization, locator, product, movementType, movementDateFrom, movementDateTo, statusBar); - panel.setCursor(Cursor.getDefaultCursor()); - } // refresh - - /** - * Zoom - */ - public void zoom() - { - super.zoom(); - - // Zoom - AEnv.zoom(AD_Table_ID, Record_ID); - } // zoom - -} // VTrxMaterial diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/package.html b/org.adempiere.ui.swing/src/org/compiere/apps/form/package.html deleted file mode 100644 index d61f1f577a..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - -

    Package org.compiere.apps.form

    - -Custom application form classes and archive viewer - -

    Related Documentation

    - -For overviews, tutorials, examples, guides, and tool documentation, please see: - - - - - - diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/package.html b/org.adempiere.ui.swing/src/org/compiere/apps/package.html deleted file mode 100644 index 0924cbb19d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - -

    Package org.compiere.apps

    - -Contains classes that implement high level application user interface component. - -

    Related Documentation

    - -For overviews, tutorials, examples, guides, and tool documentation, please see: - - - - - - diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java deleted file mode 100644 index 9677d7b428..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java +++ /dev/null @@ -1,1750 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.Vector; -import java.util.logging.Level; -import java.util.regex.Pattern; - -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.Box; -import javax.swing.DefaultComboBoxModel; -import javax.swing.ImageIcon; -import javax.swing.InputMap; -import javax.swing.JButton; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.JTextField; -import javax.swing.JToolBar; -import javax.swing.KeyStroke; -import javax.swing.ListSelectionModel; -import javax.swing.event.CellEditorListener; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.event.TableColumnModelEvent; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableCellRenderer; -import javax.swing.table.TableColumn; - -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.StatusBar; -import org.compiere.grid.ed.VEditor; -import org.compiere.grid.ed.VEditorFactory; -import org.compiere.grid.ed.VLookup; -import org.compiere.model.DataStatusEvent; -import org.compiere.model.DataStatusListener; -import org.compiere.model.GridField; -import org.compiere.model.GridFieldVO; -import org.compiere.model.GridTab; -import org.compiere.model.MColumn; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MProduct; -import org.compiere.model.MQuery; -import org.compiere.model.MRole; -import org.compiere.model.MTable; -import org.compiere.model.MUserQuery; - -import static org.compiere.model.SystemIDs.*; - -import org.compiere.model.X_AD_Column; -import org.compiere.swing.CButton; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CComboBoxEditable; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTabbedPane; -import org.compiere.swing.CTable; -import org.compiere.swing.CTextField; -import org.compiere.util.AdempiereSystemError; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Util; -import org.compiere.util.ValueNamePair; - -/** - * Find/Search Records. - * Based on AD_Find for persistency, query is build to restrict info - * - * @author Jorg Janke - * @version $Id: Find.java,v 1.3 2006/07/30 00:51:27 jjanke Exp $ - * - * @author Teo Sarca, www.arhipac.ro - *
  • BF [ 2564070 ] Saving user queries can produce unnecessary db errors - */ -public final class Find extends CDialog - implements ActionListener, ChangeListener, DataStatusListener -{ - /** - * - */ - private static final long serialVersionUID = -8546399473944170334L; - private int m_AD_Tab_ID; - - /** - * Find Constructor - * @param owner Frame Dialog Owner - * @param targetWindowNo WindowNo of target window - * @param title - * @param AD_Table_ID - * @param tableName - * @param whereExtended - * @param findFields - * @param minRecords number of minimum records - */ - public Find (Frame owner, int targetWindowNo, String title, int AD_Tab_ID, - int AD_Table_ID, String tableName, String whereExtended, - GridField[] findFields, int minRecords) - { - super(owner, Msg.getMsg(Env.getCtx(), "Find") + ": " + title, true); - log.info(title); - // - m_targetWindowNo = targetWindowNo; - m_AD_Tab_ID = AD_Tab_ID; //red1 new field for UserQuery [ 1798539 ] - m_AD_Table_ID = AD_Table_ID; - m_tableName = tableName; - m_whereExtended = whereExtended; - m_findFields = findFields; - // - m_query = new MQuery (tableName); - m_query.addRestriction(Env.parseContext(Env.getCtx(), m_targetWindowNo, whereExtended, false)); - // Required for Column Validation - Env.setContext(Env.getCtx(), m_targetWindowNo, "Find_Table_ID", m_AD_Table_ID); - // - try - { - jbInit(); - initFind(); - if (m_total < minRecords) - { - dispose(); - return; - } - } - catch(Exception e) - { - log.log(Level.SEVERE, "Find", e); - } - // - this.getRootPane().setDefaultButton(confirmPanelS.getOKButton()); - AEnv.showCenterWindow(owner, this); - } // Find - - /** Target Window No */ - private int m_targetWindowNo; - /** Table ID */ - private int m_AD_Table_ID; - /** Table Name */ - private String m_tableName; - /** Where */ - private String m_whereExtended; - /** Search Fields */ - private GridField[] m_findFields; - /** Resulting query */ - private MQuery m_query = null; - /** Is cancel ? */ - private boolean m_isCancel = false; // teo_sarca [ 1708717 ] - /** Logger */ - private static CLogger log = CLogger.getCLogger(Find.class); - - /** Number of records */ - private int m_total; - private PreparedStatement m_pstmt; - // - private boolean hasValue = false; - private boolean hasDocNo = false; - private boolean hasName = false; - private boolean hasDescription = false; - /** Line in Simple Content */ - private int m_sLine = 6; - - /** List of VEditors */ - private ArrayList m_sEditors = new ArrayList(); - /** Target Fields with AD_Column_ID as key */ - private Hashtable m_targetFields = new Hashtable(); - - /** For Grid Controller */ - public static final int TABNO = 99; - /** Length of Fields on first tab */ - public static final int FIELDLENGTH = 20; - /** Reference ID for Yes/No */ - public static final int AD_REFERENCE_ID_YESNO = REFERENCE_YESNO; - - - // - private CPanel southPanel = new CPanel(); - private BorderLayout southLayout = new BorderLayout(); - private StatusBar statusBar = new StatusBar(); - private CTabbedPane tabbedPane = new CTabbedPane(); - private CPanel advancedPanel = new CPanel(); - private BorderLayout advancedLayout = new BorderLayout(); - private ConfirmPanel confirmPanelA = new ConfirmPanel(true, true, false, false, false, false, true); - private CButton bIgnore = new CButton(); - private JToolBar toolBar = new JToolBar(); - private CComboBoxEditable fQueryName = new CComboBoxEditable(); - private CButton bSave = new CButton(); - private CButton bNew = new CButton(); - private CButton bDelete = new CButton(); - private ConfirmPanel confirmPanelS = new ConfirmPanel(true); - private BorderLayout simpleLayout = new BorderLayout(); - private CPanel scontentPanel = new CPanel(); - private GridBagLayout scontentLayout = new GridBagLayout(); - private CPanel simplePanel = new CPanel(); - private CLabel valueLabel = new CLabel(); - private CLabel nameLabel = new CLabel(); - private CLabel descriptionLabel = new CLabel(); - private CTextField valueField = new CTextField(); - private CTextField nameField = new CTextField(); - private CTextField descriptionField = new CTextField(); - private CLabel docNoLabel = new CLabel(); - private CTextField docNoField = new CTextField(); - private Component spaceE; - private Component spaceN; - private Component spaceW; - private Component spaceS; - private JScrollPane advancedScrollPane = new JScrollPane(); - private CTable advancedTable = new CTable() { - - private static final long serialVersionUID = -6201749159307529032L; - - public boolean isCellEditable(int row, int column) - { - boolean editable = ( column == INDEX_COLUMNNAME - || column == INDEX_OPERATOR - || column == INDEX_ANDOR - || column == INDEX_LEFTBRACKET - || column == INDEX_RIGHTBRACKET ); - if (!editable && row >= 0) - { - String columnName = null; - Object value = - getModel().getValueAt(row, INDEX_COLUMNNAME); - if (value != null) - { - if (value instanceof ValueNamePair) - columnName = ((ValueNamePair)value).getValue(); - else - columnName = value.toString(); - } - - // Create Editor - editable = getTargetMField(columnName) != null; - } - - if ( column == INDEX_ANDOR && row == 0 ) - editable = false; - - return editable; - } - - public void columnMoved(TableColumnModelEvent e) { - if (isEditing()) { - cellEditor.stopCellEditing(); - } - super.columnMoved(e); - } - - public void columnMarginChanged(ChangeEvent e) { - if (isEditing()) { - cellEditor.stopCellEditing(); - } - super.columnMarginChanged(e); - } - - }; - - - /** Index AndOr = 0 */ - public static final int INDEX_ANDOR = 0; - /** Index LeftBracket = 1 */ - public static final int INDEX_LEFTBRACKET = 1; - /** Index ColumnName = 2 */ - public static final int INDEX_COLUMNNAME = 2; - /** Index Operator = 3 */ - public static final int INDEX_OPERATOR = 3; - /** Index Value = 4 */ - public static final int INDEX_VALUE = 4; - /** Index Value2 = 5 */ - public static final int INDEX_VALUE2 = 5; - /** Index RightBracket = 6 */ - public static final int INDEX_RIGHTBRACKET = 6; - - /** Advanced Search Column */ - /** Advanced Search Operators */ - public CComboBox columns = null; - public CComboBox operators = null; - private MUserQuery[] userQueries; - private ValueNamePair[] columnValueNamePairs; - - private CComboBox leftBrackets; - - private CComboBox rightBrackets; - - private CComboBox andOr; - - private static final String FIELD_SEPARATOR = "<^>"; - private static final String SEGMENT_SEPARATOR = "<~>"; - - /** - * Static Init. - *
    -	 *  tabbedPane
    -	 *      simplePanel
    -	 *          scontentPanel
    -	 *          confirmPanelS
    -	 *      advancedPanel
    -	 *          toolBar
    -	 *          GC
    -	 *          confirmPanelA
    -	 *  southPanel
    -	 *      statusBar
    -	 *  
    - * @throws Exception - */ - private void jbInit() throws Exception - { - spaceE = Box.createHorizontalStrut(8); - spaceN = Box.createVerticalStrut(8); - spaceW = Box.createHorizontalStrut(8); - spaceS = Box.createVerticalStrut(8); - bIgnore.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/Ignore24.gif"))); - bIgnore.setMargin(new Insets(2, 2, 2, 2)); - bIgnore.setToolTipText(Msg.getMsg(Env.getCtx(),"Ignore")); - bIgnore.addActionListener(this); - fQueryName.setToolTipText (Msg.getMsg(Env.getCtx(),"QueryName")); - fQueryName.setEditable(true); - fQueryName.addActionListener(this); - bSave.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/Save24.gif"))); - bSave.setMargin(new Insets(2, 2, 2, 2)); - bSave.setToolTipText(Msg.getMsg(Env.getCtx(),"Save")); - bSave.addActionListener(this); - bNew.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/New24.gif"))); - bNew.setMargin(new Insets(2, 2, 2, 2)); - bNew.setToolTipText(Msg.getMsg(Env.getCtx(),"New")); - bNew.addActionListener(this); - bDelete.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/Delete24.gif"))); - bDelete.setMargin(new Insets(2, 2, 2, 2)); - bDelete.setToolTipText(Msg.getMsg(Env.getCtx(),"Delete")); - bDelete.addActionListener(this); - // - southPanel.setLayout(southLayout); - valueLabel.setLabelFor(valueField); - valueLabel.setText(Msg.translate(Env.getCtx(),"Value")); - nameLabel.setLabelFor(nameField); - nameLabel.setText(Msg.translate(Env.getCtx(),"Name")); - descriptionLabel.setLabelFor(descriptionField); - descriptionLabel.setText(Msg.translate(Env.getCtx(),"Description")); - valueField.setText("%"); - valueField.setColumns(FIELDLENGTH); - nameField.setText("%"); - nameField.setColumns(FIELDLENGTH); - descriptionField.setText("%"); - descriptionField.setColumns(FIELDLENGTH); - scontentPanel.setToolTipText(Msg.getMsg(Env.getCtx(),"FindTip")); - docNoLabel.setLabelFor(docNoField); - docNoLabel.setText(Msg.translate(Env.getCtx(),"DocumentNo")); - docNoField.setText("%"); - docNoField.setColumns(FIELDLENGTH); - advancedScrollPane.setPreferredSize(new Dimension(540, 410)); - southPanel.add(statusBar, BorderLayout.SOUTH); - this.getContentPane().add(southPanel, BorderLayout.SOUTH); - // - scontentPanel.setLayout(scontentLayout); - simplePanel.setLayout(simpleLayout); - simplePanel.add(confirmPanelS, BorderLayout.SOUTH); - simplePanel.add(scontentPanel, BorderLayout.CENTER); - scontentPanel.add(valueLabel, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(7, 5, 0, 5), 0, 0)); - scontentPanel.add(nameLabel, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(7, 5, 0, 5), 0, 0)); - scontentPanel.add(descriptionLabel, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(7, 5, 5, 5), 0, 0)); - scontentPanel.add(valueField, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 0, 5), 0, 0)); - scontentPanel.add(descriptionField, new GridBagConstraints(2, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - scontentPanel.add(docNoLabel, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(7, 5, 0, 5), 0, 0)); - scontentPanel.add(nameField, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 0, 5), 0, 0)); - scontentPanel.add(docNoField, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 0, 5), 0, 0)); - // - scontentPanel.add(spaceE, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(10, 10, 10, 10), 0, 0)); - scontentPanel.add(spaceN, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(10, 10, 10, 10), 0, 0)); - scontentPanel.add(spaceW, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(10, 10, 10, 10), 0, 0)); - scontentPanel.add(spaceS, new GridBagConstraints(2, 15, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(10, 10, 10, 10), 0, 0)); - // - // tabbedPane.add(simplePanel, Msg.getMsg(Env.getCtx(),"Find")); - tabbedPane.add(simplePanel, Msg.getMsg(Env.getCtx(),"Find")); - // - toolBar.add(bIgnore, null); - toolBar.addSeparator(); - toolBar.add(bNew, null); - toolBar.add(bDelete, null); - toolBar.add(fQueryName, null); - toolBar.add(bSave, null); - advancedPanel.setLayout(advancedLayout); - advancedPanel.add(toolBar, BorderLayout.NORTH); - advancedPanel.add(confirmPanelA, BorderLayout.SOUTH); - advancedPanel.add(advancedScrollPane, BorderLayout.CENTER); - advancedScrollPane.getViewport().add(advancedTable, null); - // tabbedPane.add(advancedPanel, Msg.getMsg(Env.getCtx(),"Advanced")); - tabbedPane.add(advancedPanel, Msg.getMsg(Env.getCtx(),"Advanced")); - // - this.getContentPane().add(tabbedPane, BorderLayout.CENTER); - // - confirmPanelA.addActionListener(this); - confirmPanelS.addActionListener(this); - // - JButton b = ConfirmPanel.createNewButton(true); - confirmPanelS.addComponent (b); - b.addActionListener(this); - // teo_sarca, [ 1670847 ] Find dialog: closing and canceling need same functionality - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent e) { - cmd_cancel(); - } - }); - - } // jbInit - - /** - * Dynamic Init.6 - * Set up GridController - */ - private void initFind() - { - log.config(""); - - // Get Info from target Tab - for (int i = 0; i < m_findFields.length; i++) - { - GridField mField = m_findFields[i]; - - // Make Yes-No searchable as list - if (mField.getVO().displayType == DisplayType.YesNo) - { - GridFieldVO vo = mField.getVO(); - GridFieldVO ynvo = vo.clone(vo.ctx, vo.WindowNo, vo.TabNo, vo.AD_Window_ID, vo.AD_Tab_ID, vo.tabReadOnly); - ynvo.IsDisplayed = true; - ynvo.displayType = DisplayType.List; - ynvo.AD_Reference_Value_ID = AD_REFERENCE_ID_YESNO; - - ynvo.lookupInfo = MLookupFactory.getLookupInfo (ynvo.ctx, ynvo.WindowNo, ynvo.AD_Column_ID, ynvo.displayType, - Env.getLanguage(ynvo.ctx), ynvo.ColumnName, ynvo.AD_Reference_Value_ID, - ynvo.IsParent, ynvo.ValidationCode); - - GridField ynfield = new GridField(ynvo); - - // replace the original field by the YN List field - m_findFields[i] = ynfield; - mField = ynfield; - } - - // Make Buttons searchable - if ( mField.getVO().displayType == DisplayType.Button ) - { - GridFieldVO vo = mField.getVO(); - if ( vo.AD_Reference_Value_ID > 0 ) - { - GridFieldVO postedvo = vo.clone(vo.ctx, vo.WindowNo, vo.TabNo, vo.AD_Window_ID, vo.AD_Tab_ID, vo.tabReadOnly); - postedvo.IsDisplayed = true; - postedvo.displayType = DisplayType.List; - - postedvo.lookupInfo = MLookupFactory.getLookupInfo (postedvo.ctx, postedvo.WindowNo, postedvo.AD_Column_ID, postedvo.displayType, - Env.getLanguage(postedvo.ctx), postedvo.ColumnName, postedvo.AD_Reference_Value_ID, - postedvo.IsParent, postedvo.ValidationCode); - - GridField postedfield = new GridField(postedvo); - - // replace the original field by the Posted List field - m_findFields[i] = postedfield; - mField = postedfield; - } - } - - /** metas: teo_sarca: Specify exactly which are the search fields - http://sourceforge.net/projects/adempiere/forums/forum/610548/topic/3736214 - if (columnName.equals("Value")) - hasValue = true; - else if (columnName.equals("Name")) - hasName = true; - else if (columnName.equals("DocumentNo")) - hasDocNo = true; - else if (columnName.equals("Description")) - hasDescription = true; - else - /**/ - if (mField.isSelectionColumn()) - addSelectionColumn (mField); - /** metas: teo_sarca: Specify exactly which are the search fields - http://sourceforge.net/projects/adempiere/forums/forum/610548/topic/3736214 - else if (columnName.indexOf("Name") != -1) - addSelectionColumn (mField); - /**/ - - // TargetFields - m_targetFields.put (Integer.valueOf(mField.getAD_Column_ID()), mField); - } // for all target tab fields - - // Disable simple query fields - valueLabel.setVisible(hasValue); - valueField.setVisible(hasValue); - if (hasValue) - valueField.addActionListener(this); - docNoLabel.setVisible(hasDocNo); - docNoField.setVisible(hasDocNo); - if (hasDocNo) - docNoField.addActionListener(this); - nameLabel.setVisible(hasName); - nameField.setVisible(hasName); - if (hasName) - nameField.addActionListener(this); - descriptionLabel.setVisible(hasDescription); - descriptionField.setVisible(hasDescription); - if (hasDescription) - descriptionField.addActionListener(this); - - // Get Total - m_total = getNoOfRecords(null, false); - setStatusDB (m_total); - statusBar.setStatusLine(""); - - tabbedPane.addChangeListener(this); - - // Better Labels for OK/Cancel - confirmPanelA.getOKButton().setToolTipText(Msg.getMsg(Env.getCtx(),"QueryEnter")); - confirmPanelA.getCancelButton().setToolTipText(Msg.getMsg(Env.getCtx(),"QueryCancel")); - confirmPanelS.getOKButton().setToolTipText(Msg.getMsg(Env.getCtx(),"QueryEnter")); - confirmPanelS.getCancelButton().setToolTipText(Msg.getMsg(Env.getCtx(),"QueryCancel")); - } // initFind - - /** - * Add Selection Column to first Tab - * @param mField field - */ - private void addSelectionColumn (GridField mField) - { - if (log.isLoggable(Level.CONFIG)) log.config(mField.getHeader()); - int displayLength = mField.getDisplayLength(); - if (displayLength > FIELDLENGTH) - mField.setDisplayLength(FIELDLENGTH); - else - displayLength = 0; - - // Editor - VEditor editor = null; - if (mField.isLookup()) - { - VLookup vl = new VLookup(mField.getColumnName(), false, false, true, - mField.getLookup()); - //setting mField to avoid NPE - vl.setField(mField); - - vl.setName(mField.getColumnName()); - editor = vl; - } - else - { - editor = VEditorFactory.getEditor(mField, false); - editor.setMandatory(false); - editor.setReadWrite(true); - } - // Add action listener to custom text fields - teo_sarca [ 1709292 ] - if (editor instanceof CTextField) { - ((CTextField)editor).addActionListener(this); - } - CLabel label = VEditorFactory.getLabel(mField); - // - if (displayLength > 0) // set it back - mField.setDisplayLength(displayLength); - // - m_sLine++; - if (label != null) // may be null for Y/N - scontentPanel.add(label, new GridBagConstraints(1, m_sLine, 1, 1, 0.0, 0.0 - ,GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(7, 5, 5, 5), 0, 0)); - scontentPanel.add((Component)editor, new GridBagConstraints(2, m_sLine, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - m_sEditors.add(editor); - } // addSelectionColumn - - - /** - * Init Find GridController - */ - private void initFindAdvanced() - { - log.config(""); - advancedTable.setModel(new DefaultTableModel(0, 7)); - advancedTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - advancedTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); - advancedTable.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); - - TableCellRenderer renderer = new ProxyRenderer(advancedTable.getDefaultRenderer(Object.class)); - advancedTable.setDefaultRenderer(Object.class, renderer); - - InputMap im = advancedTable.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); - KeyStroke tab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0); - final Action tabAction = advancedTable.getActionMap().get(im.get(tab)); - Action tabActionWrapper = new AbstractAction() - { - private static final long serialVersionUID = -6868476640719619801L; - - public void actionPerformed(ActionEvent e) - { - tabAction.actionPerformed(e); - - JTable table = (JTable)e.getSource(); - table.requestFocusInWindow(); - } - }; - advancedTable.getActionMap().put(im.get(tab), tabActionWrapper); - KeyStroke shiftTab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, ActionEvent.SHIFT_MASK); - final Action shiftTabAction = advancedTable.getActionMap().get(im.get(shiftTab)); - Action shiftTabActionWrapper = new AbstractAction() - { - private static final long serialVersionUID = 5493691483070046620L; - - public void actionPerformed(ActionEvent e) - { - shiftTabAction.actionPerformed(e); - - JTable table = (JTable)e.getSource(); - table.requestFocusInWindow(); - } - }; - advancedTable.getActionMap().put(im.get(shiftTab), shiftTabActionWrapper); - - // 0 = Columns - ArrayList items = new ArrayList(); - for (int c = 0; c < m_findFields.length; c++) - { - GridField field = m_findFields[c]; - String columnName = field.getColumnName(); - String header = field.getHeader(); - if (header == null || header.length() == 0) - { - header = Msg.translate(Env.getCtx(), columnName); - if (header == null || header.length() == 0) - continue; - } - if (field.isKey()) - header += (" (ID)"); - ValueNamePair pp = new ValueNamePair(columnName, header); - // System.out.println(pp + " = " + field); - items.add(pp); - } - columnValueNamePairs = new ValueNamePair[items.size()]; - items.toArray(columnValueNamePairs); - Arrays.sort(columnValueNamePairs); // sort alpha - columns = new CComboBox(columnValueNamePairs); - columns.addActionListener(this); - TableColumn tc = advancedTable.getColumnModel().getColumn(INDEX_COLUMNNAME); - tc.setPreferredWidth(120); - FindCellEditor dce = new FindCellEditor(columns); - - dce.addCellEditorListener(new CellEditorListener() - { - public void editingCanceled(ChangeEvent ce) - { - } - - public void editingStopped(ChangeEvent ce) - { - int col = advancedTable.getSelectedColumn(); - int row = advancedTable.getSelectedRow(); - if (col == INDEX_COLUMNNAME && row >= 0) - { - advancedTable.setValueAt(null, row, INDEX_VALUE); - advancedTable.setValueAt(null, row, INDEX_VALUE2); - } - } - }); - tc.setCellEditor(dce); - tc.setHeaderValue(Msg.translate(Env.getCtx(), "AD_Column_ID")); - - - // 0 = And/Or - andOr = new CComboBox(new String[] {"",Msg.getMsg(Env.getCtx(),"AND"),Msg.getMsg(Env.getCtx(), "OR")}); - tc = advancedTable.getColumnModel().getColumn(INDEX_ANDOR); - tc.setPreferredWidth(45); - dce = new FindCellEditor(andOr); - tc.setCellEditor(dce); - tc.setHeaderValue(Msg.getMsg(Env.getCtx(), "And/Or")); - - // 1 = Left Bracket - leftBrackets = new CComboBox(new String[] {"","(","((","((("}); - tc = advancedTable.getColumnModel().getColumn(INDEX_LEFTBRACKET); - tc.setPreferredWidth(25); - dce = new FindCellEditor(leftBrackets); - tc.setCellEditor(dce); - tc.setHeaderValue("("); - - // 3 = Operators - operators = new CComboBox(MQuery.OPERATORS); - tc = advancedTable.getColumnModel().getColumn(INDEX_OPERATOR); - tc.setPreferredWidth(55); - dce = new FindCellEditor(operators); - tc.setCellEditor(dce); - tc.setHeaderValue(Msg.getMsg(Env.getCtx(), "Operator")); - - // 4 = QueryValue - tc = advancedTable.getColumnModel().getColumn(INDEX_VALUE); - FindValueEditor fve = new FindValueEditor(this, false); - tc.setCellEditor(fve); - tc.setPreferredWidth(120); - tc.setCellRenderer(new ProxyRenderer(new FindValueRenderer(this, false))); - tc.setHeaderValue(Msg.getMsg(Env.getCtx(), "QueryValue")); - - // 5 = QueryValue2 - tc = advancedTable.getColumnModel().getColumn(INDEX_VALUE2); - tc.setPreferredWidth(120); - fve = new FindValueEditor(this, true); - tc.setCellEditor(fve); - tc.setCellRenderer(new ProxyRenderer(new FindValueRenderer(this, false))); - tc.setHeaderValue(Msg.getMsg(Env.getCtx(), "QueryValue2")); - - // 6 = Right Bracket - rightBrackets = new CComboBox(new String[] {"",")","))",")))"}); - tc = advancedTable.getColumnModel().getColumn(INDEX_RIGHTBRACKET); - tc.setPreferredWidth(25); - dce = new FindCellEditor(rightBrackets); - tc.setCellEditor(dce); - tc.setHeaderValue(")"); - - // phib: disabled auto-completion as it causes date fields to have to be entered twice - //AutoCompletion.enable(columns); - //AutoCompletion.enable(operators); - - //user query - userQueries = MUserQuery.get(Env.getCtx(), m_AD_Tab_ID); - String[] queries = new String[userQueries.length]; - for (int i = 0; i < userQueries.length; i++) - queries[i] = userQueries[i].getName(); - fQueryName.setModel(new DefaultComboBoxModel(queries)); - fQueryName.setValue(""); - - // No Row - Create one - cmd_new(); - } // initFindAdvanced - - /** - * Dispose window - */ - public void dispose() - { - log.config(""); - DB.close(m_pstmt); - m_pstmt = null; - - // Remove action listener from custom fields - teo_sarca [ 1709292 ] - for (VEditor editor : m_sEditors) { - if (editor instanceof CTextField) - ((CTextField)editor).removeActionListener(this); - } - // TargetFields - if (m_targetFields != null) - m_targetFields.clear(); - m_targetFields = null; - // - removeAll(); - super.dispose(); - } // dispose - - - /************************************************************************** - * Action Listener - * @param e ActionEvent - */ - public void actionPerformed (ActionEvent e) - { - if (log.isLoggable(Level.INFO)) log.info(e.getActionCommand()); - // - if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - cmd_cancel(); - else if (e.getActionCommand().equals(ConfirmPanel.A_REFRESH)) - cmd_refresh(); - // - else if (e.getActionCommand().equals(ConfirmPanel.A_NEW)) - { - m_query = MQuery.getNoRecordQuery(m_tableName, true); - m_total = 0; - dispose(); - } - // - else if (e.getSource() == bIgnore) - cmd_ignore(); - else if (e.getSource() == bNew) - cmd_new(); - else if (e.getSource() == bSave) - cmd_save(true); - else if (e.getSource() == bDelete) - cmd_delete(); - // - else if (e.getSource() == columns) - { - String columnName = null; - Object selected = columns.getSelectedItem(); - if (selected != null) - { - if (selected instanceof ValueNamePair) - { - ValueNamePair column = (ValueNamePair)selected; - columnName = column.getValue(); - } - else - { - columnName = selected.toString(); - } - } - - if (columnName != null) - { - if (log.isLoggable(Level.CONFIG)) log.config("Column: " + columnName); - int referenceType = -1; - MTable table = MTable.get(Env.getCtx(), m_tableName); - MColumn col = table.getColumn(columnName); - referenceType = col.getAD_Reference_ID(); - if (DisplayType.isLookup(referenceType) - || DisplayType.YesNo == referenceType - || DisplayType.Button == referenceType) - { - operators.setModel(new DefaultComboBoxModel(MQuery.OPERATORS_LOOKUP)); - } - else if (DisplayType.isNumeric(referenceType) - || DisplayType.isDate(referenceType) - || DisplayType.isID(referenceType)) // Note that lookups were filtered above - { - operators.setModel(new DefaultComboBoxModel(MQuery.OPERATORS_NUMBERS)); - } - else // DisplayType.isText - { - operators.setModel(new DefaultComboBoxModel(MQuery.OPERATORS)); - } - } - } - else if (e.getSource() == fQueryName) - { - Object o = fQueryName.getSelectedItem(); - if (userQueries != null && o != null) - { - String selected = o.toString(); - for (int i = 0; i < userQueries.length; i++) - { - if (userQueries[i].getName().equals(selected)) - { - parseUserQuery(userQueries[i]); - return; - } - } - } - } - else // ConfirmPanel.A_OK and enter in fields - { - if (e.getSource() == confirmPanelA.getOKButton()) - cmd_ok_Advanced(); - else if (e.getSource() == confirmPanelS.getOKButton()) - cmd_ok_Simple(); - else if (e.getSource() instanceof JTextField && - tabbedPane.getSelectedIndex() == 0) - cmd_ok_Simple(); - } - } // actionPerformed - - /** - * Parse delimited string into user query - * Old field sequence: column, operator, value, value to - * New field sequence: column, operator, value, value to, and/or, left brackets, right brackets - * @param userQuery - */ - private void parseUserQuery(MUserQuery userQuery) { - String code = userQuery.getCode(); - if (log.isLoggable(Level.FINE)) log.fine("Parse user query: " + code); - String[] segments = code.split(Pattern.quote(SEGMENT_SEPARATOR),-1); - advancedTable.stopEditor(true); - DefaultTableModel model = (DefaultTableModel)advancedTable.getModel(); - int cnt = model.getRowCount(); - for (int i = cnt - 1; i >=0; i--) - model.removeRow(i); - - for (int i = 0; i < segments.length; i++) - { - String[] fields = segments[i].split(Pattern.quote(FIELD_SEPARATOR)); - model.addRow(new Object[] {"","", null, MQuery.OPERATORS[MQuery.EQUAL_INDEX], null, null, ""}); - String columnName = null; - for (int j = 0; j < fields.length; j++) - { - // column - if (j == 0 ) - { - for (ValueNamePair vnp : columnValueNamePairs) - { - if (vnp.getValue().equals(fields[j])) - { - model.setValueAt(vnp, i, INDEX_COLUMNNAME); - columnName = fields[j]; - break; - } - } - } - // operator - else if (j == 1) - { - for (ValueNamePair vnp : MQuery.OPERATORS) - { - if (vnp.getValue().equals(fields[j])) - { - model.setValueAt(vnp, i, INDEX_OPERATOR); - break; - } - } - } - // value - else if ( j == 2 && fields[j].length() > 0 ) - { - GridField field = getTargetMField(columnName); - Object value = parseString(field, fields[j]); - model.setValueAt(value, i, INDEX_VALUE); - } - // value 2 - else if ( j == 3 && fields[j].length() > 0 ) - { - GridField field = getTargetMField(columnName); - Object value = parseString(field, fields[j]); - model.setValueAt(value, i, INDEX_VALUE2); - } - // and/or - else if (j == 4 && fields[j].length() > 0 ) - { - if ( i != 0 ) - model.setValueAt(fields[j], i, INDEX_ANDOR); - } - else if ( j == 5 && fields[j].length() > 0 ) - { - model.setValueAt(fields[j], i, INDEX_LEFTBRACKET); - } - else if ( j == 6 && fields[j].length() > 0 ) - { - model.setValueAt(fields[j], i, INDEX_RIGHTBRACKET); - } - } - } - advancedTable.invalidate(); - } - - /** - * Change Listener (tab change) - * @param e ChangeEbent - */ - public void stateChanged(ChangeEvent e) - { - // log.info( "Find.stateChanged"); - if (tabbedPane.getSelectedIndex() == 0) - this.getRootPane().setDefaultButton(confirmPanelS.getOKButton()); - else - { - initFindAdvanced(); - this.getRootPane().setDefaultButton(confirmPanelA.getOKButton()); - advancedTable.requestFocusInWindow(); - } - } // stateChanged - - /** - * Simple OK Button pressed - */ - private void cmd_ok_Simple() - { - // Create Query String - StringBuilder msglog; - - m_query = new MQuery(m_tableName); - m_query.addRestriction(Env.parseContext(Env.getCtx(), m_targetWindowNo, m_whereExtended, false)); - if (hasValue && !valueField.getText().equals("%") && valueField.getText().length() != 0) - { - String value = valueField.getText().toUpperCase(); - - if (!value.endsWith("%")) - value += "%"; - m_query.addRestriction("UPPER(Value)", MQuery.LIKE, value, valueLabel.getText(), value); - } - // - if (hasDocNo && !docNoField.getText().equals("%") && docNoField.getText().length() != 0) - { - String value = docNoField.getText().toUpperCase(); - - if (!value.endsWith("%")) - value += "%"; - m_query.addRestriction("UPPER(DocumentNo)", MQuery.LIKE, value, docNoLabel.getText(), value); - } - // - if ((hasName) && !nameField.getText().equals("%") && nameField.getText().length() != 0) - { - String value = nameField.getText().toUpperCase(); - - if (!value.endsWith("%")) - value += "%"; - m_query.addRestriction("UPPER(Name)", MQuery.LIKE, value, nameLabel.getText(), value); - } - // - if (hasDescription && !descriptionField.getText().equals("%") && descriptionField.getText().length() != 0) - { - String value = descriptionField.getText().toUpperCase(); - if (!value.endsWith("%")) - value += "%"; - m_query.addRestriction("UPPER(Description)", MQuery.LIKE, value, descriptionLabel.getText(), value); - } - // Special Editors - for (int i = 0; i < m_sEditors.size(); i++) - { - VEditor ved = (VEditor)m_sEditors.get(i); - Object value = ved.getValue(); - if (value != null && value.toString().length() > 0) - { - String ColumnName = ((Component)ved).getName (); - msglog = new StringBuilder().append(ColumnName).append("=").append(value); - if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); - - // globalqss - Carlos Ruiz - 20060711 - // fix a bug with virtualColumn + isSelectionColumn not yielding results - GridField field = getTargetMField(ColumnName.toString()); - if (field.isVirtualUIColumn()) - continue; - boolean isProductCategoryField = isProductCategoryField(field.getAD_Column_ID()); - StringBuilder ColumnSQL = new StringBuilder().append(field.getColumnSQL(false)); - // - // Be more permissive for String columns - if (isSearchLike(field)) - { - StringBuilder valueStr = new StringBuilder(value.toString().toUpperCase()); - if (!valueStr.toString().endsWith("%")) - valueStr.append("%"); - // - ColumnSQL = new StringBuilder("UPPER(").append(ColumnSQL).append(")"); - value = valueStr.toString(); - } - // - if (value.toString().indexOf('%') != -1) - m_query.addRestriction(ColumnSQL.toString(), MQuery.LIKE, value, ColumnName, ved.getDisplay()); - else if (isProductCategoryField && value instanceof Integer) - m_query.addRestriction(getSubCategoryWhereClause(((Integer) value).intValue())); - else - m_query.addRestriction(ColumnSQL.toString(), MQuery.EQUAL, value, ColumnName, ved.getDisplay()); - /* - if (value.toString().indexOf('%') != -1) - m_query.addRestriction(ColumnName, MQuery.LIKE, value, ColumnName, ved.getDisplay()); - else - m_query.addRestriction(ColumnName, MQuery.EQUAL, value, ColumnName, ved.getDisplay()); - */ - // end globalqss patch - } - } // editors - - m_isCancel = false; // teo_sarca [ 1708717 ] - // Test for no records - if (getNoOfRecords(m_query, true) != 0) - dispose(); - } // cmd_ok_Simple - - - /** - * Advanced OK Button pressed - */ - private void cmd_ok_Advanced() - { - m_isCancel = false; // teo_sarca [ 1708717 ] - // save pending - if (bSave.isEnabled()) - cmd_save(false); - if (getNoOfRecords(m_query, true) != 0) - dispose(); - } // cmd_ok_Advanced - - /** - * Cancel Button pressed - */ - private void cmd_cancel() - { - advancedTable.stopEditor(false); - log.info(""); - m_query = null; - m_total = 999999; - m_isCancel = true; // teo_sarca [ 1708717 ] - dispose(); - } // cmd_ok - - /** - * Ignore - */ - private void cmd_ignore() - { - log.info(""); - } // cmd_ignore - - /** - * New record - */ - private void cmd_new() - { - advancedTable.stopEditor(true); - DefaultTableModel model = (DefaultTableModel)advancedTable.getModel(); - int rows = model.getRowCount(); - model.addRow(new Object[] {rows == 0 ? "" : "AND","", null, MQuery.OPERATORS[MQuery.EQUAL_INDEX], null, null,""}); - advancedTable.requestFocusInWindow(); - } // cmd_new - - /** - * Save (Advanced) - */ - private void cmd_save(boolean saveQuery) - { - advancedTable.stopEditor(true); - // - m_query = new MQuery(m_tableName); - m_query.addRestriction(Env.parseContext(Env.getCtx(), m_targetWindowNo, m_whereExtended, false)); - StringBuilder code = new StringBuilder(); - int openBrackets = 0; - for (int row = 0; row < advancedTable.getRowCount(); row++) - { - // Column - Object column = advancedTable.getValueAt(row, INDEX_COLUMNNAME); - if (column == null) - continue; - String ColumnName = column instanceof ValueNamePair ? - ((ValueNamePair)column).getValue() : column.toString(); - String infoName = column.toString(); - // - GridField field = getTargetMField(ColumnName.toString()); - if (field == null || field.isVirtualUIColumn()) - continue; - boolean isProductCategoryField = isProductCategoryField(field.getAD_Column_ID()); - String ColumnSQL = field.getColumnSQL(false); - - String lBrackets = (String) advancedTable.getValueAt(row, INDEX_LEFTBRACKET); - if ( lBrackets != null ) - openBrackets += lBrackets.length(); - String rBrackets = (String) advancedTable.getValueAt(row, INDEX_RIGHTBRACKET); - if ( rBrackets != null ) - openBrackets -= rBrackets.length(); - - boolean and = true; - if ( row > 0 ) - and = !"OR".equals((String) advancedTable.getValueAt(row, INDEX_ANDOR)); - // Op - Object op = advancedTable.getValueAt(row, INDEX_OPERATOR); - if (op == null) - continue; - String Operator = ((ValueNamePair)op).getValue(); - - // Value ****** - Object value = advancedTable.getValueAt(row, INDEX_VALUE); - if (value == null) - { - if ( MQuery.OPERATORS[MQuery.EQUAL_INDEX].equals(op) - || MQuery.OPERATORS[MQuery.NOT_EQUAL_INDEX].equals(op) ) - { - m_query.addRestriction(ColumnSQL, Operator, null, - infoName, null, and, openBrackets); - - if (code.length() > 0) - code.append(SEGMENT_SEPARATOR); - code.append(ColumnName) - .append(FIELD_SEPARATOR) - .append(Operator) - .append(FIELD_SEPARATOR) - .append("") - .append(FIELD_SEPARATOR) - .append("") - .append(FIELD_SEPARATOR) - .append( and ? "AND" : "OR") - .append(FIELD_SEPARATOR) - .append(lBrackets != null ? lBrackets : "") - .append(FIELD_SEPARATOR) - .append(rBrackets != null ? rBrackets : ""); - } - else - { - continue; - } - } - else - { - Object parsedValue = parseValue(field, value); - if (parsedValue == null) - continue; - String infoDisplay = value.toString(); - if (field.isLookup()) - infoDisplay = field.getLookup().getDisplay(value); - else if (field.getDisplayType() == DisplayType.YesNo) - infoDisplay = Msg.getMsg(Env.getCtx(), infoDisplay); - // Value2 ****** - Object value2 = null; - if (MQuery.OPERATORS[MQuery.BETWEEN_INDEX].equals(op)) - { - value2 = advancedTable.getValueAt(row, INDEX_VALUE2); - if (value2 == null) - continue; - Object parsedValue2 = parseValue(field, value2); - String infoDisplay_to = value2.toString(); - if (parsedValue2 == null) - continue; - m_query.addRangeRestriction(ColumnSQL, parsedValue, parsedValue2, - infoName, infoDisplay, infoDisplay_to, and, openBrackets); - } - else if (isProductCategoryField && MQuery.OPERATORS[MQuery.EQUAL_INDEX].equals(op)) { - if (!(parsedValue instanceof Integer)) { - continue; - } - m_query - - .addRestriction(getSubCategoryWhereClause(((Integer) parsedValue).intValue()), and, openBrackets); - } - else - m_query.addRestriction(ColumnSQL, Operator, parsedValue, - infoName, infoDisplay, and, openBrackets); - - if (code.length() > 0) - code.append(SEGMENT_SEPARATOR); - code.append(ColumnName.toString()) - .append(FIELD_SEPARATOR) - .append(Operator) - .append(FIELD_SEPARATOR) - .append(value.toString()) - .append(FIELD_SEPARATOR) - .append(value2 != null ? value2.toString() : "") - .append(FIELD_SEPARATOR) - .append( and ? "AND" : "OR") - .append(FIELD_SEPARATOR) - .append(lBrackets != null ? lBrackets : "") - .append(FIELD_SEPARATOR) - .append(rBrackets != null ? rBrackets : ""); - - } - } - Object selected = fQueryName.getSelectedItem(); - if (selected != null && saveQuery) { - String name = selected.toString(); - if (Util.isEmpty(name.toString(), true)) - { - ADialog.warn(m_targetWindowNo, this, "FillMandatory", Msg.translate(Env.getCtx(), "Name")); - return; - } - MUserQuery uq = MUserQuery.get(Env.getCtx(), m_AD_Tab_ID, name); - if (uq == null && code.length() > 0) - { - uq = new MUserQuery (Env.getCtx(), 0, null); - uq.setName (name); - uq.setAD_Tab_ID(m_AD_Tab_ID); //red1 UserQuery [ 1798539 ] taking in new field from Compiere - uq.setAD_User_ID(Env.getAD_User_ID(Env.getCtx())); //red1 - [ 1798539 ] missing in Compiere delayed source :-) - } - else if (uq != null && code.length() == 0) - { - if (uq.delete(true)) - { - ADialog.info (m_targetWindowNo, this, "Deleted", name); - refreshUserQueries(); - } - else - ADialog.warn (m_targetWindowNo, this, "DeleteError", name); - return; - } - - uq.setCode (code.toString()); - uq.setAD_Table_ID (m_AD_Table_ID); - // - if (uq.save()) - { - ADialog.info (m_targetWindowNo, this, "Saved", name); - refreshUserQueries(); - } - else - ADialog.warn (m_targetWindowNo, this, "SaveError", name); - } - } // cmd_save - - private void refreshUserQueries() - { - Object selected = fQueryName.getSelectedItem(); - userQueries = MUserQuery.get(Env.getCtx(), m_AD_Tab_ID); - String[] queries = new String[userQueries.length]; - for (int i = 0; i < userQueries.length; i++) - queries[i] = userQueries[i].getName(); - fQueryName.setModel(new DefaultComboBoxModel(queries)); - fQueryName.setSelectedItem(selected); - if (fQueryName.getSelectedIndex() < 0) - fQueryName.setValue(""); - } - - /** - * Checks the given column. - * @param columnId - * @return true if the column is a product category column - */ - private boolean isProductCategoryField(int columnId) { - X_AD_Column col = new X_AD_Column(Env.getCtx(), columnId, null); - if (col.get_ID() == 0) { - return false; // column not found... - } - return MProduct.COLUMNNAME_M_Product_Category_ID.equals(col.getColumnName()); - } - - /** - * Returns a sql where string with the given category id and all of its subcategory ids. - * It is used as restriction in MQuery. - * @param productCategoryId - * @return - */ - private String getSubCategoryWhereClause(int productCategoryId) { - //if a node with this id is found later in the search we have a loop in the tree - int subTreeRootParentId = 0; - StringBuilder retString = new StringBuilder(" M_Product_Category_ID IN ("); - String sql = " SELECT M_Product_Category_ID, M_Product_Category_Parent_ID FROM M_Product_Category"; - final Vector categories = new Vector(100); - Statement stmt = null; - ResultSet rs = null; - try { - stmt = DB.createStatement(); - rs = stmt.executeQuery(sql); - while (rs.next()) { - if(rs.getInt(1)==productCategoryId) { - subTreeRootParentId = rs.getInt(2); - } - categories.add(new SimpleTreeNode(rs.getInt(1), rs.getInt(2))); - } - retString.append(getSubCategoriesString(productCategoryId, categories, subTreeRootParentId)); - retString.append(") "); - } catch (SQLException e) { - log.log(Level.SEVERE, sql, e); - retString = new StringBuilder(); - } catch (AdempiereSystemError e) { - log.log(Level.SEVERE, sql, e); - retString = new StringBuilder(); - } - finally { - DB.close(rs, stmt); - rs = null; stmt = null; - } - return retString.toString(); - } - - /** - * Recursive search for subcategories with loop detection. - * @param productCategoryId - * @param categories - * @param loopIndicatorId - * @return comma seperated list of category ids - * @throws AdempiereSystemError if a loop is detected - */ - private String getSubCategoriesString(int productCategoryId, Vector categories, int loopIndicatorId) throws AdempiereSystemError { - StringBuilder ret = new StringBuilder(); - final Iterator iter = categories.iterator(); - while (iter.hasNext()) { - SimpleTreeNode node = (SimpleTreeNode) iter.next(); - if (node.getParentId() == productCategoryId) { - if (node.getNodeId() == loopIndicatorId) { - throw new AdempiereSystemError("The product category tree contains a loop on categoryId: " + loopIndicatorId); - } - ret.append(getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId)).append(","); - } - } - if (log.isLoggable(Level.FINE)) log.fine(ret.toString()); - StringBuilder msgreturn = new StringBuilder(ret.toString()).append(productCategoryId); - return msgreturn.toString(); - } - - /** - * Simple tree node class for product category tree search. - * @author Karsten Thiemann, kthiemann@adempiere.org - * - */ - private static class SimpleTreeNode { - - private int nodeId; - - private int parentId; - - public SimpleTreeNode(int nodeId, int parentId) { - this.nodeId = nodeId; - this.parentId = parentId; - } - - public int getNodeId() { - return nodeId; - } - - public int getParentId() { - return parentId; - } - } - - - /** - * Parse Value - * @param field column - * @param in value - * @return data type corrected value - */ - private Object parseValue (GridField field, Object in) - { - if (in == null) - return null; - int dt = field.getDisplayType(); - try - { - // Return Integer - if (dt == DisplayType.Integer - || (DisplayType.isID(dt) && field.getColumnName().endsWith("_ID"))) - { - if (in instanceof Integer) - return in; - int i = Integer.parseInt(in.toString()); - return Integer.valueOf(i); - } - // Return BigDecimal - else if (DisplayType.isNumeric(dt)) - { - if (in instanceof BigDecimal) - return in; - return DisplayType.getNumberFormat(dt).parse(in.toString()); - } - // Return Timestamp - else if (DisplayType.isDate(dt)) - { - if (in instanceof Timestamp) - return in; - long time = 0; - try - { - time = DisplayType.getDateFormat_JDBC().parse(in.toString()).getTime(); - return new Timestamp(time); - } - catch (Exception e) - { - StringBuilder msglog = new StringBuilder().append(in.toString()).append("(").append(in.getClass()).append(")").append(e); - log.log(Level.SEVERE, msglog.toString()); - time = DisplayType.getDateFormat(dt).parse(in.toString()).getTime(); - } - return new Timestamp(time); - } - // Return Y/N for Boolean - else if (in instanceof Boolean) - return ((Boolean)in).booleanValue() ? "Y" : "N"; - } - catch (Exception ex) - { - log.log(Level.SEVERE, "Object=" + in, ex); - String error = ex.getLocalizedMessage(); - if (error == null || error.length() == 0) - error = ex.toString(); - StringBuilder errMsg = new StringBuilder(); - errMsg.append(field.getColumnName()).append(" = ").append(in).append(" - ").append(error); - // - ADialog.error(0, this, "ValidationError", errMsg.toString()); - return null; - } - - return in; - } // parseValue - - /** - * Parse String - * @param field column - * @param in value - * @return data type corrected value - */ - private Object parseString(GridField field, String in) - { - StringBuilder msglog = new StringBuilder("Parse: ").append(field).append(":").append(in); - if (log.isLoggable(Level.FINE))log.log(Level.FINE, msglog.toString()); - if (in == null) - return null; - int dt = field.getDisplayType(); - try - { - // Return Integer - if (dt == DisplayType.Integer - || (DisplayType.isID(dt) && field.getColumnName().endsWith("_ID"))) - { - int i = Integer.parseInt(in); - return Integer.valueOf(i); - } - // Return BigDecimal - else if (DisplayType.isNumeric(dt)) - { - return DisplayType.getNumberFormat(dt).parse(in); - } - // Return Timestamp - else if (DisplayType.isDate(dt)) - { - long time = 0; - try - { - time = DisplayType.getDateFormat_JDBC().parse(in).getTime(); - return new Timestamp(time); - } - catch (Exception e) - { - msglog = new StringBuilder(in.toString()).append("(").append(in.getClass()).append(")").append(e); - log.log(Level.SEVERE,msglog.toString()); - time = DisplayType.getDateFormat(dt).parse(in).getTime(); - } - return new Timestamp(time); - } - else if (dt == DisplayType.YesNo) - return Boolean.valueOf(in); - else - return in; - } - catch (Exception ex) - { - log.log(Level.SEVERE, "Object=" + in, ex); - return null; - } - - } // parseValue - /** - * Delete - */ - private void cmd_delete() - { - advancedTable.stopEditor(false); - DefaultTableModel model = (DefaultTableModel)advancedTable.getModel(); - int row = advancedTable.getSelectedRow(); - if (row >= 0) - model.removeRow(row); - cmd_refresh(); - advancedTable.requestFocusInWindow(); - } // cmd_delete - - /** - * Refresh - */ - private void cmd_refresh() - { - advancedTable.stopEditor(false); - int records = getNoOfRecords(m_query, true); - setStatusDB (records); - statusBar.setStatusLine(""); - } // cmd_refresh - - - /************************************************************************** - * Get Query - Retrieve result - * @return String representation of query - */ - public MQuery getQuery() - { - MRole role = MRole.getDefault(); - if (role.isQueryMax(getTotalRecords()) && !m_isCancel) - { - m_query = MQuery.getNoRecordQuery (m_tableName, false); - m_total = 0; - log.warning("Query - over max"); - } - else - if (log.isLoggable(Level.INFO)) log.info("Query=" + m_query); - return m_query; - } // getQuery - - /** - * Get Total Records - * @return no of records - */ - public int getTotalRecords() - { - return m_total; - } // getTotalRecords - - /** - * Get the number of records of target tab - * @param query where clause for target tab - * @param alertZeroRecords show dialog if there are no records - * @return number of selected records; - * if the results are more then allowed this method will return 0 - */ - private int getNoOfRecords (MQuery query, boolean alertZeroRecords) - { - if (log.isLoggable(Level.CONFIG)) log.config("" + query); - StringBuilder sql = new StringBuilder("SELECT COUNT(*) FROM "); - sql.append(m_tableName); - boolean hasWhere = false; - if (m_whereExtended != null && m_whereExtended.length() > 0) - { - sql.append(" WHERE ").append(m_whereExtended); - hasWhere = true; - } - if (query != null && query.isActive()) - { - if (hasWhere) - sql.append(" AND "); - else - sql.append(" WHERE "); - sql.append(query.getWhereClause()); - } - // Add Access - String finalSQL = MRole.getDefault().addAccessSQL(sql.toString(), - m_tableName, MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - finalSQL = Env.parseContext(Env.getCtx(), m_targetWindowNo, finalSQL, false); - Env.setContext(Env.getCtx(), m_targetWindowNo, TABNO, GridTab.CTX_FindSQL, finalSQL); - - // Execute Qusery - m_total = 999999; - Statement stmt = null; - ResultSet rs = null; - try - { - stmt = DB.createStatement(); - rs = stmt.executeQuery(finalSQL); - if (rs.next()) - m_total = rs.getInt(1); - } - catch (SQLException e) - { - log.log(Level.SEVERE, finalSQL, e); - } - finally { - DB.close(rs, stmt); - rs = null; stmt = null; - } - MRole role = MRole.getDefault(); - // No Records - if (m_total == 0 && alertZeroRecords) - ADialog.info(m_targetWindowNo, this, "FindZeroRecords"); - // More then allowed - else if (query != null && role.isQueryMax(m_total)) - { - ADialog.error(m_targetWindowNo, this, "FindOverMax", - m_total + " > " + role.getMaxQueryRecords()); - m_total = 0; // return 0 if more then allowed - teo_sarca [ 1708717 ] - } - else - if (log.isLoggable(Level.CONFIG)) log.config("#" + m_total); - // - if (query != null) - statusBar.setStatusToolTip (query.getWhereClause()); - return m_total; - } // getNoOfRecords - - /** - * Display current count - * @param currentCount String representation of current/total - */ - private void setStatusDB (int currentCount) - { - StringBuilder text = new StringBuilder(" ").append(currentCount).append(" / ").append(m_total).append(" "); - statusBar.setStatusDB(text.toString()); - } // setDtatusDB - - - /************************************************************************** - * Grid Status Changed. - * @param e DataStatueEvent - */ - public void dataStatusChanged (DataStatusEvent e) - { - if (log.isLoggable(Level.CONFIG)) log.config(e.getMessage()); - // Action control - boolean changed = e.isChanged(); - bIgnore.setEnabled(changed); - bNew.setEnabled(!changed); - bSave.setEnabled(changed); - bDelete.setEnabled(!changed); - } // statusChanged - - /** - * Get Target MField - * @param columnName column name - * @return MField - */ - public GridField getTargetMField (String columnName) - { - if (columnName == null) - return null; - for (int c = 0; c < m_findFields.length; c++) - { - GridField field = m_findFields[c]; - if (columnName.equals(field.getColumnName())) - return field; - } - return null; - } // getTargetMField - - private boolean isSearchLike(GridField field) - { - return DisplayType.isText(field.getDisplayType()) - && MColumn.isSuggestSelectionColumn(field.getColumnName(), true); - } - - private static class ProxyRenderer implements TableCellRenderer - { - /** - * Creates a Find.ProxyRenderer. - */ - public ProxyRenderer(TableCellRenderer renderer) - { - this.m_renderer = renderer; - } - - /** The renderer. */ - private TableCellRenderer m_renderer; - - /** - * @see javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable, java.lang.Object, boolean, boolean, int, int) - */ - public Component getTableCellRendererComponent(final JTable table, - Object value, boolean isSelected, boolean hasFocus, final int row, final int col) - { - Component comp = m_renderer.getTableCellRendererComponent(table, - value, isSelected, hasFocus, row, col); - if (hasFocus && table.isCellEditable(row, col)) - table.editCellAt(row, col); - return comp; - } - } // ProxyRenderer - -} // Find diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/FindCellEditor.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/FindCellEditor.java deleted file mode 100644 index 7002c66109..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/FindCellEditor.java +++ /dev/null @@ -1,166 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.Component; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.EventObject; - -import javax.swing.AbstractCellEditor; -import javax.swing.BorderFactory; -import javax.swing.JComboBox; -import javax.swing.JComponent; -import javax.swing.JTable; -import javax.swing.UIManager; -import javax.swing.table.TableCellEditor; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.swing.CEditor; -import org.compiere.util.CLogger; - -/** - * Cell Editor. - *
    - *		Sequence of events:
    - *			isCellEditable
    - *			getTableCellEditor
    - *			shouldSelectCell
    - *			getCellEditorValue
    - *  
    - * A new Editor is created for editable columns. - * @author Jorg Janke - * @version $Id: VCellEditor.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public final class FindCellEditor extends AbstractCellEditor - implements TableCellEditor, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -6542861196427426178L; - - - /** - * Constructor for Grid - * @param mField - */ - public FindCellEditor (CEditor component) - { - super(); - m_editor = component; - //m_editor.addActionListener(this); - // Click - } // FindCellEditor - - /** The Table Editor */ - private CEditor m_editor = null; - /** Table */ - @SuppressWarnings("unused") - private JTable m_table = null; - /** ClickCount */ - //private static int CLICK_TO_START = 1; - /** Logger */ - @SuppressWarnings("unused") - private static CLogger log = CLogger.getCLogger(FindCellEditor.class); - - - /** - * @param anEvent event - * @return true if editable - */ - public boolean isCellEditable (EventObject anEvent) - { - return true; - } // isCellEditable - - /** - * Sets an initial value for the editor. This will cause the editor to - * stopEditing and lose any partially edited value if the editor is editing - * when this method is called. - * Returns the component that should be added to the client's Component hierarchy. - * Once installed in the client's hierarchy this component - * will then be able to draw and receive user input. - * - * @param table - * @param value - * @param isSelected - * @param row - * @param col - * @return component - */ - public Component getTableCellEditorComponent (JTable table, Object value, boolean isSelected, int row, int col) - { - if (row >= 0) - table.setRowSelectionInterval(row,row); // force moving to new row - - m_table = table; - - // Set Value - m_editor.setValue(value); - - // Set Background/Foreground to "normal" (unselected) colors - ((JComponent)m_editor).setForeground(AdempierePLAF.getTextColor_Normal()); - - // Other UI - ((JComponent)m_editor).setFont(table.getFont()); - if ( m_editor instanceof JComboBox) { - ((JComboBox)m_editor).setBorder(BorderFactory.createEmptyBorder()); - } else { - ((JComponent)m_editor).setBorder(UIManager.getBorder("Table.focusCellHighlightBorder")); - } - // - return (Component)m_editor; - } // getTableCellEditorComponent - - /** - * The editing cell should be selected or not - * @param e event - * @return true (constant) - */ - public boolean shouldSelectCell(EventObject e) - { - return true; - } // shouldSelectCell - - /** - * Returns the value contained in the editor - * @return value - */ - public Object getCellEditorValue() - { - return m_editor.getValue(); - } // getCellEditorValue - - /** - * Action Editor - Stop Editor - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - } - - /** - * Dispose - */ - public void dispose() - { - m_editor = null; - m_table = null; - } // dispose - -} // FindCellEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/FindValueEditor.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/FindValueEditor.java deleted file mode 100644 index 64680efeb8..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/FindValueEditor.java +++ /dev/null @@ -1,174 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.Component; -import java.util.EventObject; -import java.util.logging.Level; - -import javax.swing.AbstractCellEditor; -import javax.swing.JTable; -import javax.swing.table.TableCellEditor; - -import org.compiere.grid.ed.VEditor; -import org.compiere.grid.ed.VEditorFactory; -import org.compiere.grid.ed.VNumber; -import org.compiere.grid.ed.VString; -import org.compiere.model.GridField; -import org.compiere.model.MQuery; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.ValueNamePair; - -/** - * Cell editor for Find Value field. - * Editor depends on Column setting - * Has to save entries how they are used in the query, i.e. '' for strings - * - * @author Jorg Janke - * @version $Id: FindValueEditor.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public final class FindValueEditor extends AbstractCellEditor implements TableCellEditor -{ - /** - * - */ - private static final long serialVersionUID = -4819832280924881253L; - - /** - * Constructor - * @param find find - * @param valueTo true if it is the "to" value column - */ - public FindValueEditor (Find find, boolean valueTo) - { - super(); - m_find = find; - m_valueToColumn = valueTo; - } // FindValueEditor - - /** Find Window */ - private Find m_find; - /** Value 2(to) */ - private boolean m_valueToColumn; - /** Between selected */ - private boolean m_between = false; - /** Editor */ - private VEditor m_editor = null; - /** Logger */ - private static CLogger log = CLogger.getCLogger(FindValueEditor.class); - - /** - * Get Value - * Need to convert to String - * @return current value - */ - public Object getCellEditorValue() - { - if (m_editor == null) - return null; - Object obj = m_editor.getValue(); // returns Integer, BidDecimal, String - if (log.isLoggable(Level.CONFIG)) log.config("Obj=" + obj); - return obj; - /** - if (obj == null) - return null; - // - String retValue = obj.toString(); - log.config( "FindValueEditor.getCellEditorValue"); - return retValue; - **/ - } // getCellEditorValue - - /** - * Get Editor - * - * @param table Table - * @param value Value - * @param isSelected cell is selected - * @param row row - * @param col column - * @return Editor component - */ - public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int col) - { - // log.config( "FindValueEditor.getTableCellEditorComponent", "r=" + row + ", c=" + col); - // Between - enables valueToColumn - m_between = false; - Object betweenValue = table.getModel().getValueAt(row, Find.INDEX_OPERATOR); - if (m_valueToColumn && betweenValue != null - && betweenValue.equals(MQuery.OPERATORS[MQuery.BETWEEN_INDEX])) - m_between = true; - - boolean enabled = !m_valueToColumn || (m_valueToColumn && m_between); - if (log.isLoggable(Level.CONFIG)) log.config("(" + value + ") - Enabled=" + enabled); - - if ( enabled ) - { - String columnName = null; - Object column = table.getModel().getValueAt(row, Find.INDEX_COLUMNNAME); - if (column != null) - columnName = ((ValueNamePair)column).getValue(); - - // Create Editor - GridField field = m_find.getTargetMField(columnName); - // log.fine( "Field=" + field.toStringX()); - if (field.isKey()) - m_editor = new VNumber(columnName, false, false, true, DisplayType.Integer, columnName); - else - m_editor = VEditorFactory.getEditor(field, true); - if (m_editor == null) - m_editor = new VString(); - - m_editor.setValue(value); - m_editor.setReadWrite(enabled); - m_editor.setBorder(null); - } - else - { - m_editor = null; - } - // - return (Component)m_editor; - } // getTableCellEditorComponent - - /** - * Cell Editable. - * Called before getTableCellEditorComponent - * @param e event - * @return true if editable - */ - public boolean isCellEditable (EventObject e) - { - // log.config( "FindValueEditor.isCellEditable"); - return true; - } // isCellEditable - - /** - * Cell Selectable. - * Called after getTableCellEditorComponent - * @param e event - * @return true if selectable - */ - public boolean shouldSelectCell (EventObject e) - { - boolean retValue = !m_valueToColumn || (m_valueToColumn && m_between); - // log.config( "FindValueEditor.shouldSelectCell - " + retValue); - return retValue; - } // shouldSelectCell - -} // FindValueEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/FindValueRenderer.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/FindValueRenderer.java deleted file mode 100644 index 6cb0b8f279..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/FindValueRenderer.java +++ /dev/null @@ -1,247 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.Component; -import java.awt.Insets; -import java.sql.Date; -import java.util.logging.Level; - -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JTable; -import javax.swing.table.DefaultTableCellRenderer; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.model.GridField; -import org.compiere.model.Lookup; -import org.compiere.model.MQuery; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.ValueNamePair; - -/** - * Renderer for Find 'Value' Column. - * The value is how it would be used in a query, i.e. with '' for strings - * - * @author Jorg Janke - * @version $Id: FindValueRenderer.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public final class FindValueRenderer extends DefaultTableCellRenderer -{ - /** - * - */ - private static final long serialVersionUID = 5290173817551899865L; - - /** - * Constructor - * @param find find - * @param valueTo true if it is the "to" value column - */ - public FindValueRenderer (Find find, boolean valueTo) - { - super(); - m_find = find; - m_valueToColumn = valueTo; - } // FindValueRenderer - - /** Find Window */ - private Find m_find; - /** Value 2(to) */ - private boolean m_valueToColumn; - /** Between selected */ - private boolean m_between = false; - - /** Current Row */ - private volatile String m_columnName = null; - /** CheckBox */ - private JCheckBox m_check = null; - /** Logger */ - private static CLogger log = CLogger.getCLogger(FindValueRenderer.class); - - /** - * Get Check Box - * @return check box - */ - private JCheckBox getCheck() - { - if (m_check == null) - { - m_check = new JCheckBox(); - m_check.setMargin(new Insets(0,0,0,0)); - m_check.setHorizontalAlignment(JLabel.CENTER); - } - return m_check; - } // getCheck - - - /************************************************************************* - * Get TableCell RendererComponent - * @param table table - * @param value value - * @param isSelected selected - * @param hasFocus focus - * @param row row - * @param col col - * @return renderer component (Label or CheckBox) - */ - public Component getTableCellRendererComponent(JTable table, Object value, - boolean isSelected, boolean hasFocus, int row, int col) - { - // log.config( "FindValueRenderer.getTableCellRendererComponent", "r=" + row + ", c=" + col ); - // Column - m_columnName = null; - Object column = table.getModel().getValueAt(row, Find.INDEX_COLUMNNAME); - if (column != null) { - if (column instanceof ValueNamePair) - m_columnName = ((ValueNamePair)column).getValue(); - else - m_columnName = column.toString(); - } - - // Between - enables valueToColumn - m_between = false; - Object betweenValue = table.getModel().getValueAt(row, Find.INDEX_OPERATOR); - if (m_valueToColumn && betweenValue != null - && betweenValue.equals(MQuery.OPERATORS[MQuery.BETWEEN_INDEX])) - m_between = true; - boolean enabled = !m_valueToColumn || (m_valueToColumn && m_between); - - // set Background - if (enabled) - setBackground(AdempierePLAF.getFieldBackground_Normal()); - else - setBackground(AdempierePLAF.getFieldBackground_Inactive()); - - // log.config( "FindValueRenderer.getTableCellRendererComponent - (" + value + ") - Enabled=" + enabled); - - Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col); - if (value == null || (m_valueToColumn && !m_between)) - return c; - // - GridField field = getMField(); - if (field != null && field.getDisplayType() == DisplayType.YesNo) - { - JCheckBox cb = getCheck(); - if (value instanceof Boolean) - cb.setSelected(((Boolean)value).booleanValue()); - else - cb.setSelected(value.toString().indexOf('Y') != -1); - return cb; - } - return c; - } // getTableCellRendererComponent - - - /************************************************************************** - * Format Display Value - * @param value value - */ - protected void setValue(Object value) - { - boolean enabled = !m_valueToColumn || (m_valueToColumn && m_between); - // Log.trace (Log.l4_Data, "FindValueRenderer.setValue (" + value + ") - Enabled=" + enabled); - if (value == null || !enabled) - { - super.setValue(null); - return; - } - - String retValue = null; - - // Strip ' ' - if (value != null) - { - String str = value.toString(); - if (str.startsWith("'") && str.endsWith("'")) - { - str = str.substring(1, str.length()-1); - value = str; - } - } - - int displayType = 0; - GridField field = getMField(); - if (field != null) - displayType = field.getDisplayType(); - else - log.log(Level.SEVERE, "FindValueRenderer.setValue (" + value + ") ColumnName=" + m_columnName + " No Target Column"); - - setHorizontalAlignment(JLabel.LEFT); - // Number - if (DisplayType.isNumeric(displayType)) - { - setHorizontalAlignment(JLabel.RIGHT); - retValue = DisplayType.getNumberFormat(displayType).format(value); - } - // Date - else if (DisplayType.isDate(displayType)) - { - if (value instanceof Date) - { - retValue = DisplayType.getDateFormat(displayType).format(value); - setHorizontalAlignment(JLabel.RIGHT); - } - else if (value instanceof String) // JDBC format - { - try - { - java.util.Date date = DisplayType.getDateFormat_JDBC().parse((String)value); - retValue = DisplayType.getDateFormat(displayType).format(date); - setHorizontalAlignment(JLabel.RIGHT); - } - catch (Exception e) - { - // log.log(Level.SEVERE, "FindValueRenderer.setValue", e); - retValue = value.toString(); - } - } - else - retValue = value.toString(); - } - // Row ID - else if (displayType == DisplayType.RowID) - retValue = ""; - // Lookup - else if (DisplayType.isLookup(displayType) && field != null) - { - Lookup lookup = field.getLookup(); - if (lookup != null) - retValue = lookup.getDisplay(value); - } - // other - else - { - super.setValue(value); - return; - } - // log.config( "FindValueRenderer.setValue (" + retValue + ") - DT=" + displayType); - super.setValue(retValue); - } // setValue - - /** - * Get MField - * @return field - */ - private GridField getMField () - { - return m_find.getTargetMField(m_columnName); - } // getMField - - -} // FindValueRenderer diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/Info.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/Info.java deleted file mode 100644 index 96d01c2d5f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/Info.java +++ /dev/null @@ -1,1292 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.MouseEvent; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.SwingUtilities; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; - -import org.adempiere.client.InfoManager; -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.AWindow; -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.PrintScreenPainter; -import org.compiere.apps.StatusBar; -import org.compiere.grid.ed.Calculator; -import org.compiere.minigrid.IDColumn; -import org.compiere.minigrid.MiniTable; -import org.compiere.model.I_A_Asset; -import org.compiere.model.I_C_BPartner; -import org.compiere.model.I_C_CashLine; -import org.compiere.model.I_C_Invoice; -import org.compiere.model.I_C_Order; -import org.compiere.model.I_C_Payment; -import org.compiere.model.I_M_InOut; -import org.compiere.model.I_M_Product; -import org.compiere.model.I_S_ResourceAssignment; -import org.compiere.model.MQuery; -import org.compiere.model.MRole; -import org.compiere.model.MSysConfig; -import org.compiere.swing.CDialog; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -/** - * Search Information and return selection - Base Class. - *
    - *  Structure:
    - *      parameterPanel  (JPanel) - for subclasses to add parameter fields
    - *      scrollPame      (JScrollPane)
    - *          m_table     (MiniTable)
    - *      southPanel      (JPanel)
    - *          confirmPanel
    - *          statusPanel
    - *  
    - * - * @author Jorg Janke - * @version $Id: Info.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * - * @author Teo Sarca - *
  • FR [ 2846869 ] Info class - add more helper methods - * https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2846869&group_id=176962 - *
  • FR [ 2847305 ] Info class improvements - * https://sourceforge.net/tracker/?func=detail&aid=2847305&group_id=176962&atid=879335 - *
  • BF [ 2860556 ] Info class throws false error - * https://sourceforge.net/tracker/?func=detail&aid=2860556&group_id=176962&atid=879332 - */ -public abstract class Info extends CDialog - implements ListSelectionListener -{ - /** - * - */ - private static final long serialVersionUID = -5606614040914295869L; - - - - /** - * Factory Constructor - * @param frame parent frame - * @param modal new window is modal - * @param WindowNo window no - * @param tableName table name of the search - * @param keyColumn key column of the search - * @param value query value - * @param multiSelection allow to select more than one row - * @param whereClause fully qualified where clause for the search - * @return special or general Info Window - */ - public static Info create (Frame frame, boolean modal, int WindowNo, - String tableName, String keyColumn, String value, - boolean multiSelection, String whereClause) - { - Info info = InfoManager.create(frame, modal, WindowNo, tableName, keyColumn, value, - multiSelection, whereClause, true); - // - AEnv.positionCenterWindow(frame, info); - return info; - } // create - - /** - * Show BPartner Info (non modal) - * @param frame Parent Frame - * @param WindowNo window no - */ - public static void showBPartner (Frame frame, int WindowNo) - { - Info info = InfoManager.create(frame, false, WindowNo, - I_C_BPartner.Table_Name, I_C_BPartner.COLUMNNAME_C_BPartner_ID, - "", false, "", false); - AEnv.showCenterWindow(frame, info); - } // showBPartner - - /** - * Show Asset Info (non modal) - * @param frame Parent Frame - * @param WindowNo window no - */ - public static void showAsset (Frame frame, int WindowNo) - { - Info info = InfoManager.create(frame, false, WindowNo, - I_A_Asset.Table_Name, I_A_Asset.COLUMNNAME_A_Asset_ID, - "", false, "", false); - AEnv.showCenterWindow(frame, info); - } // showBPartner - - /** - * Show Product Info (non modal) - * @param frame Parent Frame - * @param WindowNo window no - */ - public static void showProduct (Frame frame, int WindowNo) - { - Info info = InfoManager.create(frame, false, WindowNo, - I_M_Product.Table_Name, I_M_Product.COLUMNNAME_M_Product_ID, - "", false, "", false); - AEnv.showCenterWindow(frame, info); - } // showProduct - - /** - * Show Order Info (non modal) - * @param frame Parent Frame - * @param WindowNo window no - * @param value query value - */ - public static void showOrder (Frame frame, int WindowNo, String value) - { - Info info = InfoManager.create(frame, false, WindowNo, - I_C_Order.Table_Name, I_C_Order.COLUMNNAME_C_Order_ID, - "", false, "", false); - AEnv.showCenterWindow(frame, info); - } // showOrder - - /** - * Show Invoice Info (non modal) - * @param frame Parent Frame - * @param WindowNo window no - * @param value query value - */ - public static void showInvoice (Frame frame, int WindowNo, String value) - { - Info info = InfoManager.create(frame, false, WindowNo, - I_C_Invoice.Table_Name, I_C_Invoice.COLUMNNAME_C_Invoice_ID, - "", false, "", false); - AEnv.showCenterWindow(frame, info); - } // showInvoice - - /** - * Show Shipment Info (non modal) - * @param frame Parent Frame - * @param WindowNo window no - * @param value query value - */ - public static void showInOut (Frame frame, int WindowNo, String value) - { - Info info = InfoManager.create(frame, false, WindowNo, - I_M_InOut.Table_Name, I_M_InOut.COLUMNNAME_M_InOut_ID, - "", false, "", false); - AEnv.showCenterWindow(frame, info); - } // showInOut - - /** - * Show Payment Info (non modal) - * @param frame Parent Frame - * @param WindowNo window no - * @param value query value - */ - public static void showPayment (Frame frame, int WindowNo, String value) - { - Info info = InfoManager.create(frame, false, WindowNo, - I_C_Payment.Table_Name, I_C_Payment.COLUMNNAME_C_Payment_ID, - "", false, "", false); - AEnv.showCenterWindow(frame, info); - } // showPayment - - /** - * Show Cash Line Info (non modal) - * @param frame Parent Frame - * @param WindowNo window no - * @param value query value - */ - public static void showCashLine (Frame frame, int WindowNo, String value) - { - Info info = InfoManager.create(frame, false, WindowNo, - I_C_CashLine.Table_Name, I_C_CashLine.COLUMNNAME_C_CashLine_ID, - "", false, "", false); - AEnv.showCenterWindow(frame, info); - } // showCashLine - - /** - * Show Assignment Info (non modal) - * @param frame Parent Frame - * @param WindowNo window no - * @param value query value - */ - public static void showAssignment (Frame frame, int WindowNo, String value) - { - Info info = InfoManager.create(frame, false, WindowNo, - I_S_ResourceAssignment.Table_Name, I_S_ResourceAssignment.COLUMNNAME_S_ResourceAssignment_ID, - "", false, "", false); - AEnv.showCenterWindow(frame, info); - } // showAssignment - - /** Window Width */ - Toolkit toolkit = Toolkit.getDefaultToolkit(); - Dimension screensize = toolkit.getScreenSize(); - - protected final int INFO_WIDTH = screensize.width > 1500 ? 1500 : screensize.width - 100; - protected final int SCREEN_HEIGHT = screensize.height; - - private boolean p_lookup; - - /************************************************************************** - * Detail Constructor - * @param frame parent frame - * @param modal modal - * @param WindowNo window no - * @param tableName table name - * @param keyColumn key column name - * @param multiSelection multiple selection - * @param whereClause where clause - */ - protected Info (Frame frame, boolean modal, int WindowNo, - String tableName, String keyColumn, - boolean multiSelection, String whereClause) - { - this(frame,modal,WindowNo,tableName,keyColumn,multiSelection,whereClause,true); - } - - /************************************************************************** - * Detail Constructor - * @param frame parent frame - * @param modal modal - * @param WindowNo window no - * @param tableName table name - * @param keyColumn key column name - * @param multiSelection multiple selection - * @param whereClause where clause - * @param lookup - */ - protected Info (Frame frame, boolean modal, int WindowNo, - String tableName, String keyColumn, - boolean multiSelection, String whereClause, boolean lookup) - { - super (frame, modal); - if (log.isLoggable(Level.INFO)) log.info("WinNo=" + p_WindowNo + " " + whereClause); - p_WindowNo = WindowNo; - p_tableName = tableName; - p_keyColumn = keyColumn; - p_multiSelection = multiSelection; - p_lookup = lookup; - if (whereClause == null || whereClause.indexOf('@') == -1) - p_whereClause = whereClause; - else - { - p_whereClause = Env.parseContext(Env.getCtx(), p_WindowNo, whereClause, false, false); - if (p_whereClause.length() == 0) - log.log(Level.SEVERE, "Cannot parse context= " + whereClause); - } - - try - { - jbInit(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "Info", ex); - } - } // Info - - - /** Master (owning) Window */ - protected int p_WindowNo; - /** Table Name */ - protected String p_tableName; - /** Key Column Name */ - protected String p_keyColumn; - /** Enable more than one selection */ - protected boolean p_multiSelection; - /** Specify if the records should be checked(selected) by default (multi selection mode only) */ - private boolean p_isDefaultSelected = MSysConfig.getBooleanValue(MSysConfig.INFO_DEFAULTSELECTED, false, Env.getAD_Client_ID(Env.getCtx())); - /** True if double click on a row toggles if row is selected (multi selection mode only) */ - private boolean p_doubleClickTogglesSelection = MSysConfig.getBooleanValue(MSysConfig.INFO_DOUBLECLICKTOGGLESSELECTION, false, Env.getAD_Client_ID(Env.getCtx())); - /** Initial WHERE Clause */ - protected String p_whereClause = ""; - - /** Table */ - protected MiniTable p_table = new MiniTable(); - /** Model Index of Key Column */ - private int m_keyColumnIndex = -1; - /** OK pressed */ - private boolean m_ok = false; - /** Cancel pressed - need to differentiate between OK - Cancel - Exit */ - private boolean m_cancel = false; - /** Result IDs */ - private ArrayList m_results = new ArrayList(3); - - /** Layout of Grid */ - protected Info_Column[] p_layout; - /** Main SQL Statement */ - private String m_sqlMain; - /** Count SQL Statement */ - private String m_sqlCount; - /** Order By Clause */ - private String m_sqlOrder; - - /** Loading success indicator */ - protected boolean p_loadedOK = false; - /** SO Zoom Window */ - private int m_SO_Window_ID = -1; - /** PO Zoom Window */ - private int m_PO_Window_ID = -1; - - /** Worker */ - private Worker m_worker = null; - - /** Logger */ - protected CLogger log = CLogger.getCLogger(getClass()); - - /** Static Layout */ - private CPanel southPanel = new CPanel(); - private BorderLayout southLayout = new BorderLayout(); - protected ConfirmPanel confirmPanel = new ConfirmPanel(true, true, true, true, true, true, true); - //Begin - [FR 1823612 ] Product Info Screen Improvements - protected CPanel addonPanel = new CPanel(); - //End - [FR 1823612 ] Product Info Screen Improvements - protected StatusBar statusBar = new StatusBar(); - protected CPanel parameterPanel = new CPanel(); - private JScrollPane scrollPane = new JScrollPane(); - // - private JPopupMenu popup = new JPopupMenu(); - private CMenuItem calcMenu = new CMenuItem(); - - /** - * Static Init - * @throws Exception - */ - protected void jbInit() throws Exception - { - this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - southPanel.setLayout(southLayout); - //Begin - [FR 1823612 ] Product Info Screen Improvements - southPanel.add(addonPanel, BorderLayout.NORTH); - //End - [FR 1823612 ] Product Info Screen Improvements - southPanel.add(confirmPanel, BorderLayout.CENTER); - southPanel.add(statusBar, BorderLayout.SOUTH); - getContentPane().add(southPanel, BorderLayout.SOUTH); - this.getContentPane().add(parameterPanel, BorderLayout.NORTH); - this.getContentPane().add(scrollPane, BorderLayout.CENTER); - scrollPane.getViewport().add(p_table, null); - // - confirmPanel.addActionListener(this); - confirmPanel.getResetButton().setVisible(hasReset()); - confirmPanel.getCustomizeButton().setVisible(hasCustomize()); - confirmPanel.getHistoryButton().setVisible(hasHistory()); - confirmPanel.getZoomButton().setVisible(hasZoom()); - // - JButton print = ConfirmPanel.createPrintButton(true); - print.addActionListener(this); - confirmPanel.addButton(print); - // - popup.add(calcMenu); - calcMenu.setText(Msg.getMsg(Env.getCtx(), "Calculator")); - calcMenu.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/Calculator16.gif"))); - calcMenu.addActionListener(this); - // - p_table.getSelectionModel().addListSelectionListener(this); - enableButtons(); - } // jbInit - - /** - * Loaded correctly - * @return true if loaded OK - */ - public boolean loadedOK() - { - return p_loadedOK; - } // loadedOK - - /** - * Set Status Line - * @param text text - * @param error error - */ - public void setStatusLine (String text, boolean error) - { - statusBar.setStatusLine(text, error); - Thread.yield(); - } // setStatusLine - - /** - * Set Status DB - * @param text text - */ - public void setStatusDB (String text) - { - statusBar.setStatusDB(text); - } // setStatusDB - - - - /************************************************************************** - * Prepare Table, Construct SQL (m_m_sqlMain, m_sqlAdd) - * and size Window - * @param layout layout array - * @param from from clause - * @param staticWhere where clause - * @param orderBy order by clause - */ - protected void prepareTable (Info_Column[] layout, String from, String staticWhere, String orderBy) - { - p_layout = layout; - StringBuffer sql = new StringBuffer ("SELECT "); - // add columns & sql - for (int i = 0; i < layout.length; i++) - { - if (i > 0) - sql.append(", "); - sql.append(layout[i].getColSQL()); - // adding ID column - if (layout[i].isIDcol()) - sql.append(",").append(layout[i].getIDcolSQL()); - // add to model - p_table.addColumn(layout[i].getColHeader()); - if (layout[i].isColorColumn()) - p_table.setColorColumn(i); - if (layout[i].getColClass() == IDColumn.class) - m_keyColumnIndex = i; - } - - // Table Selection (Invoked before setting column class so that row selection is enabled) - p_table.setRowSelectionAllowed(true); - p_table.addMouseListener(this); - p_table.setMultiSelection(p_multiSelection); - p_table.setShowTotals(true); - - // set editors (two steps) - for (int i = 0; i < layout.length; i++) - p_table.setColumnClass(i, layout[i].getColClass(), layout[i].isReadOnly(), layout[i].getColHeader()); - - sql.append( " FROM ").append(from); - // - sql.append(" WHERE ").append(staticWhere); - m_sqlMain = sql.toString(); - m_sqlCount = "SELECT COUNT(*) FROM " + from + " WHERE " + staticWhere; - // - m_sqlOrder = ""; - if (orderBy != null && orderBy.length() > 0) - m_sqlOrder = " ORDER BY " + orderBy; - - if (m_keyColumnIndex == -1) - log.log(Level.SEVERE, "No KeyColumn - " + sql); - - // Window Sizing - parameterPanel.setPreferredSize(new Dimension (INFO_WIDTH, parameterPanel.getPreferredSize().height)); - //Begin - [FR 1823612 ] Product Info Screen Improvements - scrollPane.setPreferredSize(new Dimension(INFO_WIDTH, 300)); - //End - [FR 1823612 ] Product Info Screen Improvements - } // prepareTable - - - /************************************************************************** - * Execute Query - */ - protected void executeQuery() - { - // ignore when running - if (m_worker != null && m_worker.isAlive()) - return; - // - if (!testCount()) - return; - - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - setStatusLine(Msg.getMsg(Env.getCtx(), "StartSearch"), false); - m_worker = new Worker(); - m_worker.start(); - } // executeQuery - - /** - * Test Row Count - * @return true if display - */ - private boolean testCount() - { - long start = System.currentTimeMillis(); - String dynWhere = getSQLWhere(); - StringBuilder sql = new StringBuilder (m_sqlCount); - if (dynWhere.length() > 0) - sql.append(dynWhere); // includes first AND - String countSql = Msg.parseTranslation(Env.getCtx(), sql.toString()); // Variables - countSql = MRole.getDefault().addAccessSQL(countSql, getTableName(), - MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); - log.finer(countSql); - PreparedStatement pstmt = null; - ResultSet rs = null; - int no = -1; - try - { - pstmt = DB.prepareStatement(countSql, null); - setParameters (pstmt, true); - rs = pstmt.executeQuery(); - if (rs.next()) - no = rs.getInt(1); - } - catch (Exception e) - { - log.log(Level.SEVERE, countSql, e); - no = -2; - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - " + (System.currentTimeMillis()-start) + "ms"); - //Armen: add role checking (Patch #1694788 ) - MRole role = MRole.getDefault(); - if (role.isQueryMax(no)) - return ADialog.ask(p_WindowNo, this, "InfoHighRecordCount", String.valueOf(no)); - return true; - } // testCount - - - /** - * Save Selection - Called by dispose - */ - protected void saveSelection () - { - // Already disposed - if (p_table == null) - return; - - if (log.isLoggable(Level.CONFIG)) log.config( "OK=" + m_ok); - if (!m_ok) // did not press OK - { - m_results.clear(); - p_table.removeAll(); - p_table = null; - return; - } - - // Multi Selection - if (p_multiSelection) - { - m_results.addAll(getSelectedRowKeys()); - } - else // singleSelection - { - Integer data = getSelectedRowKey(); - if (data != null) - m_results.add(data); - } - if (log.isLoggable(Level.CONFIG)) log.config(getSelectedSQL()); - - // Save Settings of detail info screens - saveSelectionDetail(); - // Clean-up - p_table.removeAll(); - p_table = null; - } // saveSelection - - /** - * Get the key of currently selected row - * @return selected key - */ - protected Integer getSelectedRowKey() - { - ArrayList selectedDataList = getSelectedRowKeys(); - if (selectedDataList.size() == 0) - { - return null; - } - else - { - return selectedDataList.get(0); - } - } // getSelectedRowKey - - /** - * Get the keys of selected row/s based on layout defined in prepareTable - * @return IDs if selection present - * @author ashley - */ - protected ArrayList getSelectedRowKeys() - { - ArrayList selectedDataList = new ArrayList(); - - if (m_keyColumnIndex == -1) - { - return selectedDataList; - } - - if (p_multiSelection) - { - int rows = p_table.getRowCount(); - for (int row = 0; row < rows; row++) - { - // If this is the Totals row (last row), we need to skip it - teo_sarca [ 2860556 ] - if (p_table.getShowTotals() && row == rows - 1) - { - continue; - } - Object data = p_table.getModel().getValueAt(row, m_keyColumnIndex); - if (data instanceof IDColumn) - { - IDColumn dataColumn = (IDColumn)data; - if (dataColumn.isSelected()) - { - selectedDataList.add(dataColumn.getRecord_ID()); - } - } - else - { - log.severe("For multiple selection, IDColumn should be key column for selection"); - } - } - } - - if (selectedDataList.size() == 0) - { - int row = p_table.getSelectedRow(); - if (row != -1 && m_keyColumnIndex != -1) - { - Object data = p_table.getModel().getValueAt(row, m_keyColumnIndex); - if (data instanceof IDColumn) - selectedDataList.add(((IDColumn)data).getRecord_ID()); - if (data instanceof Integer) - selectedDataList.add((Integer)data); - } - } - - return selectedDataList; - } // getSelectedRowKeys - - /** - * Get selected Keys - * @return selected keys (Integers) - */ - public Object[] getSelectedKeys() - { - if (!m_ok || m_results.size() == 0) - return null; - Integer values[] = new Integer[m_results.size()]; - m_results.toArray(values); - return values; - } // getSelectedKeys; - - /** - * Get (first) selected Key - * @return selected key - */ - public Object getSelectedKey() - { - if (!m_ok || m_results.size() == 0) - return null; - return m_results.get(0); - } // getSelectedKey - - /** - * Is cancelled? - * - if pressed Cancel = true - * - if pressed OK or window closed = false - * @return true if cancelled - */ - public boolean isCancelled() - { - return m_cancel; - } // isCancelled - - /** - * Get where clause for (first) selected key - * @return WHERE Clause - */ - public String getSelectedSQL() - { - // No results - Object[] keys = getSelectedKeys(); - if (keys == null || keys.length == 0) - { - if (log.isLoggable(Level.CONFIG)) log.config("No Results - OK=" - + m_ok + ", Cancel=" + m_cancel); - return ""; - } - // - StringBuilder sb = new StringBuilder(getKeyColumn()); - if (keys.length > 1) - sb.append(" IN ("); - else - sb.append("="); - - // Add elements - for (int i = 0; i < keys.length; i++) - { - if (getKeyColumn().endsWith("_ID")) - sb.append(keys[i].toString()).append(","); - else - sb.append("'").append(keys[i].toString()).append("',"); - } - - sb.replace(sb.length()-1, sb.length(), ""); - if (keys.length > 1) - sb.append(")"); - return sb.toString(); - } // getSelectedSQL; - - - /************************************************************************** - * (Button) Action Listener & Popup Menu - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - // Popup => Calculator - if (e.getSource().equals(calcMenu)) - { - BigDecimal number = null; - Object data = p_table.getSelectedValue(); - try - { - if (data != null) - { - if (data instanceof BigDecimal) - number = (BigDecimal)data; - else - number = new BigDecimal(data.toString()); - } - } - catch (Exception ex) {} - Calculator c = new Calculator(null, number); - c.setVisible(true); - return; - } // popup - - // Confirm Panel - String cmd = e.getActionCommand(); - if (cmd.equals(ConfirmPanel.A_OK)) - { - dispose(true); - } - else if (cmd.equals(ConfirmPanel.A_CANCEL)) - { - m_cancel = true; - dispose(false); - } - // - else if (cmd.equals(ConfirmPanel.A_HISTORY)) - showHistory(); - else if (cmd.equals(ConfirmPanel.A_CUSTOMIZE)) - customize(); - else if (cmd.equals(ConfirmPanel.A_ZOOM)) - zoom(); - else if (cmd.equals(ConfirmPanel.A_RESET)) - doReset(); - else if (cmd.equals(ConfirmPanel.A_PRINT)) - PrintScreenPainter.printScreen(this); - // Default - else - executeQuery(); - } // actionPerformed - - /** - * Zoom to target - * @param AD_Window_ID window id - * @param zoomQuery zoom query - */ - protected void zoom (int AD_Window_ID, MQuery zoomQuery) - { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - final AWindow frame = new AWindow(null); -// AD_Window_ID = AEnv.specialZoom (AD_Window_ID, -1, zoomQuery, ""); // ZoomCondition TODO - if (!frame.initWindow(AD_Window_ID, zoomQuery)) - return; - AEnv.addToWindowManager(frame); - // Modal Window causes UI lock - if (isModal()) - { - setModal(false); // remove modal option has no effect - dispose(); // VLookup.actionButton - Result = null (not cancelled) - } - else - setCursor(Cursor.getDefaultCursor()); - - // VLookup gets info after method finishes - new Thread() - { - public void run() - { - try - { - sleep(50); - } - catch (Exception e) - { - } - AEnv.showCenterScreen(frame); - } - }.start(); - } // zoom - - /** - * Dispose (not OK) - */ - public void dispose() - { - dispose(false); - } // dispose - - /** - * Dispose and save Selection - * @param ok OK pressed - */ - public void dispose(boolean ok) - { - if (log.isLoggable(Level.CONFIG)) log.config("OK=" + ok); - m_ok = ok; - - // End Worker - if (m_worker != null) - { - // worker continues, but it does not block UI - if (m_worker.isAlive()) - m_worker.interrupt(); - if (log.isLoggable(Level.CONFIG)) log.config("Worker alive=" + m_worker.isAlive()); - } - m_worker = null; - // - saveSelection(); - removeAll(); - super.dispose(); - } // dispose - - /** - * Get Table name Synonym - * @return table name - */ - protected String getTableName() - { - return p_tableName; - } // getTableName - - /** - * Get Key Column Name - * @return column name - */ - protected String getKeyColumn() - { - return p_keyColumn; - } // getKeyColumn - - - /************************************************************************** - * Table Selection Changed - * @param e event - */ - public void valueChanged(ListSelectionEvent e) - { - if (e.getValueIsAdjusting()) - return; - enableButtons(); - } // calueChanged - - /** - * Enable OK, History, Zoom if row/s selected - * --- - * Changes: Changed the logic for accomodating multiple selection - * @author ashley - */ - protected void enableButtons () - { - boolean enable = (p_table.getSelectedRowCount() == 1); - confirmPanel.getOKButton().setEnabled(p_table.getSelectedRowCount() > 0); - - if (hasHistory()) - confirmPanel.getHistoryButton().setEnabled(enable); - if (hasZoom()) - confirmPanel.getZoomButton().setEnabled(enable); - } // enableButtons - - - /************************************************************************** - * Get dynamic WHERE part of SQL - * To be overwritten by concrete classes - * @return WHERE clause - */ - protected abstract String getSQLWhere(); - - /** - * Set Parameters for Query - * To be overwritten by concrete classes - * @param pstmt statement - * @param forCount for counting records - * @throws SQLException - */ - protected abstract void setParameters (PreparedStatement pstmt, boolean forCount) - throws SQLException; - - /** - * Reset Parameters - * To be overwritten by concrete classes - */ - protected void doReset() {} - /** - * Has Reset (false) - * To be overwritten by concrete classes - * @return true if it has reset (default false) - */ - protected boolean hasReset() {return false;} - /** - * History dialog - * To be overwritten by concrete classes - */ - protected void showHistory() {} - /** - * Has History (false) - * To be overwritten by concrete classes - * @return true if it has history (default false) - */ - protected boolean hasHistory() {return false;} - /** - * Customize dialog - * To be overwritten by concrete classes - */ - protected void customize() {} - /** - * Has Customize (false) - * To be overwritten by concrete classes - * @return true if it has customize (default false) - */ - protected boolean hasCustomize() {return false;} - /** - * Zoom action - * To be overwritten by concrete classes - */ - protected void zoom() {} - /** - * Has Zoom (false) - * To be overwritten by concrete classes - * @return true if it has zoom (default false) - */ - protected boolean hasZoom() {return false;} - /** - * Save Selection Details - * To be overwritten by concrete classes - */ - protected void saveSelectionDetail() {} - - /** - * Get Zoom Window - * @param tableName table name - * @param isSOTrx sales trx - * @return AD_Window_ID - */ - protected int getAD_Window_ID (String tableName, boolean isSOTrx) - { - if (!isSOTrx && m_PO_Window_ID > 0) - return m_PO_Window_ID; - if (m_SO_Window_ID > 0) - return m_SO_Window_ID; - // - String sql = "SELECT AD_Window_ID, PO_Window_ID FROM AD_Table WHERE TableName=?"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setString(1, tableName); - rs = pstmt.executeQuery(); - if (rs.next()) - { - m_SO_Window_ID = rs.getInt(1); - m_PO_Window_ID = rs.getInt(2); - } - } - catch (Exception e) - { - log.log(Level.SEVERE, sql, e); - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - // - if (!isSOTrx && m_PO_Window_ID > 0) - return m_PO_Window_ID; - return m_SO_Window_ID; - } // getAD_Window_ID - - /** - * - * @return Index of Key Column - */ - protected int getKeyColumnIndex() - { - return m_keyColumnIndex; - } - - /** - * - * @return true if OK button was pressed - */ - public boolean isOkPressed() - { - return m_ok; - } - - /** - * - * @return true if Cancel button was pressed - */ - public boolean isCancelPressed() - { - return m_cancel; - } - - /** - * Specify if the records should be checked(selected) by default. - * (for multi-selection only) - * @param value - */ - public void setDefaultSelected(boolean value) - { - p_isDefaultSelected = value; - } - - /** - * (for multi-selection only) - * @return true if records are selected by default - */ - public boolean isDefaultSelected() - { - return p_isDefaultSelected; - } - - /** - * (for multi-selection only) - * @param value true if double click should toggle record selection - */ - public void setDoubleClickTogglesSelection(boolean value) - { - p_doubleClickTogglesSelection = value; - } - - /** - * (for multi-selection only) - * @return true if double click should toggle record selection - */ - public boolean isDoubleClickTogglesSelection() - { - return p_doubleClickTogglesSelection; - } - -// reset value so that is always treated as new entry - public boolean isResetValue() - { - return false; - } - - public boolean isLookup() - { - return p_lookup; - } - - /************************************************************************** - * Mouse Clicked - * @param e event - */ - public void mouseClicked(MouseEvent e) - { - // log.fine( "Info.mouseClicked", - // "ClickCount=" + e.getClickCount() + ", Right=" + SwingUtilities.isRightMouseButton(e) - // + ", r=" + m_table.getSelectedRow() + ", c=" + m_table.getSelectedColumn()); - - // Double click with selected row => exit/zoom - if (e.getClickCount() > 1 && p_table.getSelectedRow() != -1) - { - if (isLookup() && p_multiSelection && isDoubleClickTogglesSelection()) - { - if (m_keyColumnIndex >= 0) - { - Object data = p_table.getValueAt(p_table.getSelectedRow(), m_keyColumnIndex); - if (data instanceof IDColumn) - { - IDColumn id = (IDColumn)data; - id.setSelected(!id.isSelected()); - p_table.setValueAt(data, p_table.getSelectedRow(), m_keyColumnIndex); - } - } - } - else - { - if (isLookup()) - { - dispose(true); - } - else - { - zoom(); - } - - } - } - // Right Click => start Calculator - else if (SwingUtilities.isRightMouseButton(e)) - { - popup.show(e.getComponent(), e.getX(), e.getY()); - } - } // mouseClicked - - - /** - * Worker - */ - class Worker extends Thread - { - private PreparedStatement m_pstmt = null; - private ResultSet m_rs = null; - - /** - * Do Work (load data) - */ - public void run() - { - // setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - // setStatusLine(Msg.getMsg(Env.getCtx(), "StartSearch"), false); - long start = System.currentTimeMillis(); - - // Clear Table - p_table.setRowCount(0); - // - String dynWhere = getSQLWhere(); - StringBuilder sql = new StringBuilder (m_sqlMain); - if (dynWhere.length() > 0) - sql.append(dynWhere); // includes first AND - sql.append(m_sqlOrder); - String dataSql = Msg.parseTranslation(Env.getCtx(), sql.toString()); // Variables - dataSql = MRole.getDefault().addAccessSQL(dataSql, getTableName(), - MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); - log.finer(dataSql); - - try - { - m_pstmt = DB.prepareStatement(dataSql, null); - setParameters (m_pstmt, false); // no count - if (log.isLoggable(Level.FINE)) log.fine("Start query - " + (System.currentTimeMillis()-start) + "ms"); - m_rs = m_pstmt.executeQuery(); - if (log.isLoggable(Level.FINE)) log.fine("End query - " + (System.currentTimeMillis()-start) + "ms"); - while (m_rs.next()) - { - if (this.isInterrupted()) { - log.finer("Interrupted"); - close(); - return; - } - int row = p_table.getRowCount(); - p_table.setRowCount(row+1); - int colOffset = 1; // columns start with 1 - for (int col = 0; col < p_layout.length; col++) - { - Object data = null; - Class c = p_layout[col].getColClass(); - int colIndex = col + colOffset; - if (c == IDColumn.class) - { - data = new IDColumn(m_rs.getInt(colIndex)); - if (p_multiSelection) - ((IDColumn)data).setSelected(isDefaultSelected()); - } - else if (c == Boolean.class) - data = Boolean.valueOf("Y".equals(m_rs.getString(colIndex))); - else if (c == Timestamp.class) - data = m_rs.getTimestamp(colIndex); - else if (c == BigDecimal.class) - data = m_rs.getBigDecimal(colIndex); - else if (c == Double.class) - data = Double.valueOf(m_rs.getDouble(colIndex)); - else if (c == Integer.class) - data = Integer.valueOf(m_rs.getInt(colIndex)); - else if (c == KeyNamePair.class) - { - String display = m_rs.getString(colIndex); - int key = m_rs.getInt(colIndex+1); - data = new KeyNamePair(key, display); - colOffset++; - } - else - data = m_rs.getString(colIndex); - // store - p_table.setValueAt(data, row, col); - // if (log.isLoggable(Level.FINE)) log.fine( "r=" + row + ", c=" + col + " " + m_layout[col].getColHeader(), - // "data=" + data.toString() + " " + data.getClass().getName() + " * " + m_table.getCellRenderer(row, col)); - } - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, dataSql, e); - } - close(); - // - int no = p_table.getRowCount(); - if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - " + (System.currentTimeMillis()-start) + "ms"); - if(p_table.getShowTotals()) - p_table.addTotals(p_layout); - p_table.autoSize(); - // - setCursor(Cursor.getDefaultCursor()); - setStatusLine(Integer.toString(no) + " " + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false); - setStatusDB(Integer.toString(no)); - if (no == 0) { - if (log.isLoggable(Level.FINE)) log.fine(dataSql); - } else { - p_table.getSelectionModel().setSelectionInterval(0, 0); - p_table.requestFocus(); - } - } // run - - /** - * Close ResultSet and Statement - */ - private void close() { - DB.close(m_rs, m_pstmt); - m_rs = null; - m_pstmt = null; - } - - /** - * Interrupt this thread - cancel the query if still in execution - * Carlos Ruiz - globalqss - [2826660] - Info product performance BIG problem - */ - public void interrupt() { - if (m_pstmt != null) { - try { - m_pstmt.cancel(); - close(); - } catch (SQLException e) { - log.log(Level.SEVERE, "Cannot cancel SQL statement", e); - } - } - super.interrupt(); - } - } // Worker - -} // Info diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoAsset.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoAsset.java deleted file mode 100644 index 068af00995..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoAsset.java +++ /dev/null @@ -1,332 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.Frame; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.logging.Level; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.AEnv; -import org.compiere.apps.ALayout; -import org.compiere.apps.ALayoutConstraint; -import org.compiere.grid.ed.VLookup; -import org.compiere.minigrid.IDColumn; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MQuery; -import org.compiere.swing.CLabel; -import org.compiere.swing.CTextField; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Asset Information - * - * @author Jorg Janke - * @version $Id: InfoAsset.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class InfoAsset extends Info -{ - /** - * - */ - private static final long serialVersionUID = 6014685562933753813L; - - /** - * Standard Constructor - * @param frame frame - * @param modal modal - * @param WindowNo window no - * @param A_Asset_ID asset - * @param value Query Value or Name if enclosed in @ - * @param multiSelection multiple selections - * @param whereClause where clause - */ - public InfoAsset (Frame frame, boolean modal, int WindowNo, - int A_Asset_ID, String value, - boolean multiSelection, String whereClause) - { - this(frame, modal, WindowNo, A_Asset_ID, value, multiSelection, whereClause, true); - } - - /** - * Standard Constructor - * @param frame frame - * @param modal modal - * @param WindowNo window no - * @param A_Asset_ID asset - * @param value Query Value or Name if enclosed in @ - * @param multiSelection multiple selections - * @param whereClause where clause - * @param lookup - */ - public InfoAsset (Frame frame, boolean modal, int WindowNo, - int A_Asset_ID, String value, - boolean multiSelection, String whereClause, boolean lookup) - { - super (frame, modal, WindowNo, "a", "A_Asset_ID", multiSelection, whereClause); - if (log.isLoggable(Level.INFO)) log.info(value + ", ID=" + A_Asset_ID + ", WHERE=" + whereClause); - setTitle(Msg.getMsg(Env.getCtx(), "InfoAsset")); - // - statInit(); - initInfo (value, A_Asset_ID, whereClause); - // - int no = p_table.getRowCount(); - setStatusLine(Integer.toString(no) + " " + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false); - setStatusDB(Integer.toString(no)); - // AutoQuery - if (value != null && value.length() > 0) - executeQuery(); - p_loadedOK = true; - // Focus - // fieldValue.requestFocus(); - - AEnv.positionCenterWindow(frame, this); - } // InfoProduct - - /** From Clause */ - private static String s_assetFROM = "A_ASSET a" - + " LEFT OUTER JOIN M_Product p ON (a.M_Product_ID=p.M_Product_ID)" - + " LEFT OUTER JOIN C_BPartner bp ON (a.C_BPartner_ID=bp.C_BPartner_ID)" - + " LEFT OUTER JOIN AD_User u ON (a.AD_User_ID=u.AD_User_ID)"; - - /** Array of Column Info */ - private static final Info_Column[] s_assetLayout = { - new Info_Column(" ", "a.A_Asset_ID", IDColumn.class), - new Info_Column(Msg.translate(Env.getCtx(), "Value"), "a.Value", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "Name"), "a.Name", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "M_Product_ID"), "p.Name", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "C_BPartner_ID"), "bp.Name", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "AD_User_ID"), "u.Name", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "AssetServiceDate"), "a.AssetServiceDate", Timestamp.class), - new Info_Column(Msg.translate(Env.getCtx(), "GuaranteeDate"), "a.GuaranteeDate", Timestamp.class), - new Info_Column(Msg.translate(Env.getCtx(), "VersionNo"), "a.VersionNo", String.class) - }; - - // - private CLabel labelValue = new CLabel(); - private CTextField fieldValue = new CTextField(10); - private CLabel labelName = new CLabel(); - private CTextField fieldName = new CTextField(10); - // - private CLabel lBPartner_ID = new CLabel(Msg.translate(Env.getCtx(), "BPartner")); - private VLookup fBPartner_ID; - private CLabel lProduct_ID = new CLabel(Msg.translate(Env.getCtx(), "Product")); - private VLookup fProduct_ID; - - /** - * Static Setup - add fields to parameterPanel - */ - private void statInit() - { - labelValue.setText(Msg.getMsg(Env.getCtx(), "Value")); - fieldValue.setBackground(AdempierePLAF.getInfoBackground()); - fieldValue.addActionListener(this); - labelName.setText(Msg.getMsg(Env.getCtx(), "Name")); - fieldName.setBackground(AdempierePLAF.getInfoBackground()); - fieldName.addActionListener(this); - // From A_Asset. - fBPartner_ID = new VLookup("C_BPartner_ID", false, false, true, - MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, 8065, DisplayType.Search)); - lBPartner_ID.setLabelFor(fBPartner_ID); - fBPartner_ID.setBackground(AdempierePLAF.getInfoBackground()); - fProduct_ID = new VLookup("M_Product_ID", false, false, true, - MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, 8047, DisplayType.Search)); - lProduct_ID.setLabelFor(fProduct_ID); - fProduct_ID.setBackground(AdempierePLAF.getInfoBackground()); - // - parameterPanel.setLayout(new ALayout()); - // - parameterPanel.add(labelValue, new ALayoutConstraint(0,0)); - parameterPanel.add(fieldValue, null); - parameterPanel.add(lBPartner_ID, null); - parameterPanel.add(fBPartner_ID, null); - // - parameterPanel.add(labelName, new ALayoutConstraint(1,0)); - parameterPanel.add(fieldName, null); - parameterPanel.add(lProduct_ID, null); - parameterPanel.add(fProduct_ID, null); - } // statInit - - /** - * Dynamic Init - * @param value value - * @param whereClause where clause - */ - private void initInfo (String value, int A_Asset_ID, String whereClause) - { - // Create Grid - StringBuilder where = new StringBuilder(); - where.append("a.IsActive='Y'"); - if (whereClause != null && whereClause.length() > 0) - where.append(" AND ").append(whereClause); - // - prepareTable(s_assetLayout, s_assetFROM, - where.toString(), - "a.Value"); - - // Set Value - if (value == null) - value = "%"; - if (!value.endsWith("%")) - value += "%"; - fieldValue.setText(value); - } // initInfo - - /*************************************************************************/ - - /** - * Construct SQL Where Clause and define parameters. - * (setParameters needs to set parameters) - * Includes first AND - * @return WHERE clause - */ - protected String getSQLWhere() - { - StringBuilder sql = new StringBuilder(); - // => Value - String value = fieldValue.getText().toUpperCase(); - if (!(value.equals("") || value.equals("%"))) - sql.append(" AND UPPER(a.Value) LIKE ?"); - // => Name - String name = fieldName.getText().toUpperCase(); - if (!(name.equals("") || name.equals("%"))) - sql.append (" AND UPPER(a.Name) LIKE ?"); - // C_BPartner_ID - Integer C_BPartner_ID = (Integer)fBPartner_ID.getValue(); - if (C_BPartner_ID != null) - sql.append (" AND a.C_BPartner_ID=").append(C_BPartner_ID); - // M_Product_ID - Integer M_Product_ID = (Integer)fProduct_ID.getValue(); - if (M_Product_ID != null) - sql.append (" AND a.M_Product_ID=").append(M_Product_ID); - // - return sql.toString(); - } // getSQLWhere - - /** - * Set Parameters for Query - * (as defined in getSQLWhere) - * - * @param pstmt pstmt - * @param forCount for counting records - * @throws SQLException - */ - protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException - { - int index = 1; - // => Value - String value = fieldValue.getText().toUpperCase(); - if (!(value.equals("") || value.equals("%"))) - { - if (!value.endsWith("%")) - value += "%"; - pstmt.setString(index++, value); - if (log.isLoggable(Level.FINE)) log.fine("Value: " + value); - } - // => Name - String name = fieldName.getText().toUpperCase(); - if (!(name.equals("") || name.equals("%"))) - { - if (!name.endsWith("%")) - name += "%"; - pstmt.setString(index++, name); - if (log.isLoggable(Level.FINE)) log.fine("Name: " + name); - } - } // setParameters - - /** - * Save Selection Details - * Get Location/Partner Info - */ - public void saveSelectionDetail() - { - int row = p_table.getSelectedRow(); - if (row == -1) - return; - - // publish for Callout to read - Integer ID = getSelectedRowKey(); - Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "A_Asset_ID", ID == null ? "0" : ID.toString()); - } // saveSelectionDetail - - - /*************************************************************************/ - - /** - * Show History - */ - protected void showHistory() - { - log.info( "InfoAsset.showHistory"); - } // showHistory - - /** - * Has History - * @return true - */ - protected boolean hasHistory() - { - return false; - } // hasHistory - - /** - * Zoom - */ - protected void zoom() - { - log.info( "InfoAsset.zoom"); - Integer A_Asset_ID = getSelectedRowKey(); - if (A_Asset_ID == null) - return; - MQuery query = new MQuery("A_Asset"); - query.addRestriction("A_Asset_ID", MQuery.EQUAL, A_Asset_ID); - query.setRecordCount(1); - int AD_WindowNo = getAD_Window_ID("A_Asset", true); - zoom (AD_WindowNo, query); - } // zoom - - /** - * Has Zoom - * @return true - */ - protected boolean hasZoom() - { - return true; - } // hasZoom - - /** - * Customize - */ - protected void customize() - { - log.info( "InfoAsset.customize"); - } // customize - - /** - * Has Customize - * @return false - */ - protected boolean hasCustomize() - { - return false; // for now - } // hasCustomize - -} // InfoAsset diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoAssignment.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoAssignment.java deleted file mode 100644 index e861bfb561..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoAssignment.java +++ /dev/null @@ -1,330 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.Frame; -import java.awt.event.ActionEvent; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.logging.Level; - -import org.compiere.apps.AEnv; -import org.compiere.apps.ALayout; -import org.compiere.apps.ALayoutConstraint; -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VLookup; -import org.compiere.minigrid.IDColumn; -import org.compiere.model.Lookup; -import org.compiere.model.MLookupFactory; -import static org.compiere.model.SystemIDs.*; -import org.compiere.swing.CButton; -import org.compiere.swing.CLabel; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; - - -/** - * View Assignments and optionally create Resource Assigments - * - * @author Jorg Janke - * @version $Id: InfoAssignment.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class InfoAssignment extends Info -{ - /** - * - */ - private static final long serialVersionUID = 5017170699571459745L; - - /** - * Constructor - * @param frame frame - * @param modal modal - * @param WindowNo WindowNo - * @param value Query value Name or Value if contains numbers - * @param multiSelection multiple selection - * @param whereClause where clause - */ - public InfoAssignment (Frame frame, boolean modal, int WindowNo, - String value, boolean multiSelection, String whereClause) - { - this(frame, modal, WindowNo, value, multiSelection, whereClause, true); - } - - /** - * Constructor - * @param frame frame - * @param modal modal - * @param WindowNo WindowNo - * @param value Query value Name or Value if contains numbers - * @param multiSelection multiple selection - * @param whereClause where clause - * @param lookup - */ - public InfoAssignment (Frame frame, boolean modal, int WindowNo, - String value, boolean multiSelection, String whereClause, boolean lookup) - { - super (frame, modal, WindowNo, "ra", "S_ResourceAssigment_ID", - multiSelection, whereClause, lookup); - log.info(value); - setTitle(Msg.getMsg(Env.getCtx(), "InfoAssignment")); - // - if (!initLookups()) - return; - statInit(); - initInfo (value, whereClause); - // - int no = p_table.getRowCount(); - setStatusLine(Integer.toString(no) + " " + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false); - setStatusDB(Integer.toString(no)); - // AutoQuery - // if (value != null && value.length() > 0) - // executeQuery(); - p_loadedOK = true; - - AEnv.positionCenterWindow(frame, this); - } // InfoAssignment - - // - private CLabel labelResourceType = new CLabel(Msg.translate(Env.getCtx(), "S_ResourceType_ID")); - private VLookup fieldResourceType; - private CLabel labelResource = new CLabel(Msg.translate(Env.getCtx(), "S_Resource_ID")); - private VLookup fieldResource; - private CLabel labelFrom = new CLabel(Msg.translate(Env.getCtx(), "DateFrom")); - private VDate fieldFrom = new VDate(DisplayType.Date); - private CLabel labelTo = new CLabel(Msg.translate(Env.getCtx(), "DateTo")); - private VDate fieldTo = new VDate(DisplayType.Date); - private CButton bNew = new CButton(); - - /** - * Initialize Lookups - * @return true if OK - */ - private boolean initLookups() - { - try - { - int AD_Column_ID = COLUMN_S_RESOURCE_S_RESOURCETYPE_ID; // S_Resource.S_ResourceType_ID - Lookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir); - fieldResourceType = new VLookup ("S_ResourceType_ID", false, false, true, lookup); - AD_Column_ID = COLUMN_S_RESOURCEASSIGNMENT_S_RESOURCE_ID; // S_ResourceAssignment.S_Resource_ID - lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir); - fieldResource = new VLookup ("S_Resource_ID", false, false, true, lookup); - } - catch (Exception e) - { - log.log(Level.SEVERE, "InfoAssignment.initLookup"); - return false; - } - // - bNew.setIcon(Env.getImageIcon("New16.gif")); - return true; - } // initLookups - - /** - * Static Setup - add fields to parameterPanel. - *
    -	 * 		ResourceType	Resource	DateTimeFrom	DateTimeTo	New
    -	 *  
    - */ - private void statInit() - { - parameterPanel.setLayout(new ALayout()); - parameterPanel.add(labelResourceType, new ALayoutConstraint(0,0)); - parameterPanel.add(labelResource, null); - parameterPanel.add(labelFrom, null); - parameterPanel.add(labelTo, null); - // parameterPanel.add(labelPhone, null); - // parameterPanel.add(checkFuzzy, null); - // - parameterPanel.add(fieldResourceType, new ALayoutConstraint(1,0)); - parameterPanel.add(fieldResource, null); - parameterPanel.add(fieldFrom, null); - parameterPanel.add(fieldTo, null); - parameterPanel.add(bNew, null); - // parameterPanel.add(checkCustomer, null); - } // statInit - - /** -SELECT rt.Name, r.Name, ra.AssignDateFrom, ra.AssignDateTo, ra.Qty, uom.UOMSymbol, ra.IsConfirmed -FROM S_ResourceAssignment ra, S_ResourceType rt, S_Resource r, C_UOM uom -WHERE ra.IsActive='Y' -AND ra.S_Resource_ID=r.S_Resource_ID -AND r.S_ResourceType_ID=rt.S_ResourceType_ID -AND rt.C_UOM_ID=uom.C_UOM_ID - */ - - /** From Clause */ - private static String s_assignmentFROM = - "S_ResourceAssignment ra, S_ResourceType rt, S_Resource r, C_UOM uom"; - private static String s_assignmentWHERE = - "ra.IsActive='Y' AND ra.S_Resource_ID=r.S_Resource_ID " - + "AND r.S_ResourceType_ID=rt.S_ResourceType_ID AND rt.C_UOM_ID=uom.C_UOM_ID"; - - /** Array of Column Info */ - private static Info_Column[] s_assignmentLayout = { - new Info_Column(" ", "ra.S_ResourceAssignment_ID", IDColumn.class), - new Info_Column(Msg.translate(Env.getCtx(), "S_ResourceType_ID"), "rt.Name", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "S_Resource_ID"), "r.Name", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "AssignDateFrom"), "ra.AssignDateFrom", Timestamp.class), - new Info_Column(Msg.translate(Env.getCtx(), "Qty"), "ra.Qty", Double.class), - new Info_Column(Msg.translate(Env.getCtx(), "C_UOM_ID"), "uom.UOMSymbol", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "AssignDateTo"), "ra.AssignDateTo", Timestamp.class), - new Info_Column(Msg.translate(Env.getCtx(), "IsConfirmed"), "ra.IsConfirmed", Boolean.class) - }; - - - /** - * Dynamic Init - * @param value value - * @param whereClause where clause - */ - private void initInfo(String value, String whereClause) - { - // C_BPartner bp, AD_User c, C_BPartner_Location l, C_Location a - - // Create Grid - StringBuilder where = new StringBuilder(s_assignmentWHERE); - if (whereClause != null && whereClause.length() > 0) - where.append(" AND ").append(whereClause); - // - prepareTable(s_assignmentLayout, s_assignmentFROM, - where.toString(), - "rt.Name,r.Name,ra.AssignDateFrom"); - } // initInfo - - /*************************************************************************/ - - /** - * Action Listner - * - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - // don't requery if fieldValue and fieldName are empty - // return; - // - super.actionPerformed(e); - } // actionPerformed - - /*************************************************************************/ - - /** - * Get dynamic WHERE part of SQL - * To be overwritten by concrete classes - * @return WHERE clause - */ - protected String getSQLWhere() - { - StringBuilder sql = new StringBuilder(); - // - Integer S_ResourceType_ID = (Integer)fieldResourceType.getValue(); - if (S_ResourceType_ID != null) - sql.append(" AND rt.S_ResourceType_ID=").append(S_ResourceType_ID.intValue()); - // - Integer S_Resource_ID = (Integer)fieldResource.getValue(); - if (S_Resource_ID != null) - sql.append(" AND r.S_Resource_ID=").append(S_Resource_ID.intValue()); - // - Timestamp ts = fieldFrom.getTimestamp(); - if (ts != null) - sql.append(" AND TRUNC(ra.AssignDateFrom)>=").append(DB.TO_DATE(ts,false)); - // - ts = fieldTo.getTimestamp(); - if (ts != null) - sql.append(" AND TRUNC(ra.AssignDateTo)<=").append(DB.TO_DATE(ts,false)); - return sql.toString(); - } // getSQLWhere - - /** - * Set Parameters for Query - * To be overwritten by concrete classes - * @param pstmt pstmt - * @param forCount for counting records - * @throws SQLException - */ - protected void setParameters (PreparedStatement pstmt, boolean forCount) throws SQLException - { - } - - /** - * History dialog - * To be overwritten by concrete classes - */ - protected void showHistory() - { - } - - /** - * Has History (false) - * To be overwritten by concrete classes - * @return true if it has history (default false) - */ - protected boolean hasHistory() - { - return false; - } - - /** - * Customize dialog - * To be overwritten by concrete classes - */ - protected void customize() - { - } - - /** - * Has Customize (false) - * To be overwritten by concrete classes - * @return true if it has customize (default false) - */ - protected boolean hasCustomize() - { - return false; - } - - /** - * Zoom action - * To be overwritten by concrete classes - */ - protected void zoom() - { - } - - /** - * Has Zoom (false) - * To be overwritten by concrete classes - * @return true if it has zoom (default false) - */ - protected boolean hasZoom() - { - return false; - } - - /** - * Save Selection Details - * To be overwritten by concrete classes - */ - protected void saveSelectionDetail() - { - } - -} // InfoAssignment diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoBPartner.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoBPartner.java deleted file mode 100644 index 883e4ec07b..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoBPartner.java +++ /dev/null @@ -1,506 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.Frame; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.logging.Level; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.AEnv; -import org.compiere.apps.ALayout; -import org.compiere.apps.ALayoutConstraint; -import org.compiere.grid.ed.VCheckBox; -import org.compiere.minigrid.IDColumn; -import org.compiere.model.MQuery; -import org.compiere.swing.CLabel; -import org.compiere.swing.CTextField; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -/** - * Search Business Partner and return selection - * - * @author Jorg Janke - * @version $Id: InfoBPartner.java,v 1.3 2006/07/30 00:51:27 jjanke Exp $ - */ -public class InfoBPartner extends Info -{ - /** - * - */ - private static final long serialVersionUID = 5550733934685665946L; - - /** - * Standard Constructor - * @param frame frame - * @param modal modal - * @param WindowNo WindowNo - * @param value Query value Name or Value if contains numbers - * @param isSOTrx if false, query vendors only - * @param multiSelection multiple selection - * @param whereClause where clause - */ - public InfoBPartner(Frame frame, boolean modal, int WindowNo, - String value, boolean isSOTrx, - boolean multiSelection, String whereClause) - { - this(frame, modal, WindowNo, value, isSOTrx, multiSelection, whereClause, true); - } - - /** - * Standard Constructor - * @param frame frame - * @param modal modal - * @param WindowNo WindowNo - * @param value Query value Name or Value if contains numbers - * @param isSOTrx if false, query vendors only - * @param multiSelection multiple selection - * @param whereClause where clause - * @param lookup - */ - public InfoBPartner(Frame frame, boolean modal, int WindowNo, - String value, boolean isSOTrx, - boolean multiSelection, String whereClause, boolean lookup) - { - super (frame, modal, WindowNo, "C_BPartner", "C_BPartner_ID", multiSelection, whereClause, lookup); - log.info(value); - setTitle(Msg.getMsg(Env.getCtx(), "InfoBPartner")); - m_isSOTrx = isSOTrx; - // - statInit(); - initInfo (value, whereClause); - // - int no = p_table.getRowCount(); - setStatusLine(Integer.toString(no) + " " + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false); - setStatusDB(Integer.toString(no)); - // AutoQuery - if (value != null && value.length() > 0) - executeQuery(); - p_loadedOK = true; - // Focus - fieldValue.requestFocus(); - - AEnv.positionCenterWindow(frame, this); - } // InfoBPartner - - /** SalesOrder Trx */ - private boolean m_isSOTrx = false; - - private int m_AD_User_ID_index = -1; - private int m_C_BPartner_Location_ID_index = -1; - - /** From Clause */ - private static String s_partnerFROM = "C_BPartner" - + " LEFT OUTER JOIN C_BPartner_Location l ON (C_BPartner.C_BPartner_ID=l.C_BPartner_ID AND l.IsActive='Y')" - + " LEFT OUTER JOIN AD_User c ON (C_BPartner.C_BPartner_ID=c.C_BPartner_ID AND (c.C_BPartner_Location_ID IS NULL OR c.C_BPartner_Location_ID=l.C_BPartner_Location_ID) AND c.IsActive='Y')" - + " LEFT OUTER JOIN C_Location a ON (l.C_Location_ID=a.C_Location_ID)"; - - /** Array of Column Info */ - private static Info_Column[] s_partnerLayout = { - new Info_Column(" ", "C_BPartner.C_BPartner_ID", IDColumn.class), - new Info_Column(Msg.translate(Env.getCtx(), "Value"), "C_BPartner.Value", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "Name"), "C_BPartner.Name", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "Contact"), "c.Name AS Contact", KeyNamePair.class, "c.AD_User_ID"), - new Info_Column(Msg.translate(Env.getCtx(), "SO_CreditAvailable"), "C_BPartner.SO_CreditLimit-C_BPartner.SO_CreditUsed AS SO_CreditAvailable", BigDecimal.class, true, true, null), - new Info_Column(Msg.translate(Env.getCtx(), "SO_CreditUsed"), "C_BPartner.SO_CreditUsed", BigDecimal.class), - new Info_Column(Msg.translate(Env.getCtx(), "Phone"), "c.Phone", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "Postal"), "a.Postal", KeyNamePair.class, "l.C_BPartner_Location_ID"), - new Info_Column(Msg.translate(Env.getCtx(), "City"), "a.City", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "TotalOpenBalance"), "C_BPartner.TotalOpenBalance", BigDecimal.class), - new Info_Column(Msg.translate(Env.getCtx(), "Revenue"), "C_BPartner.ActualLifetimeValue", BigDecimal.class), - new Info_Column(Msg.translate(Env.getCtx(), "Address1"), "a.Address1", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "IsShipTo"), "l.IsShipTo", Boolean.class), - new Info_Column(Msg.translate(Env.getCtx(), "IsBillTo"), "l.IsBillTo", Boolean.class) - }; - - // - private CLabel labelValue = new CLabel(); - private CTextField fieldValue = new CTextField(10); - private CLabel labelName = new CLabel(); - private CTextField fieldName = new CTextField(10); - private CLabel labelContact = new CLabel(); - private CTextField fieldContact = new CTextField(10); - private CLabel labelEMail = new CLabel(); - private CTextField fieldEMail = new CTextField(10); - private CLabel labelPostal = new CLabel(); - private CTextField fieldPostal = new CTextField(10); - private CLabel labelPhone = new CLabel(); - private CTextField fieldPhone = new CTextField(10); - private VCheckBox checkAND = new VCheckBox(); - private VCheckBox checkCustomer = new VCheckBox(); - - /** - * Static Setup - add fields to parameterPanel - */ - private void statInit() - { - labelValue.setText(Msg.getMsg(Env.getCtx(), "Value")); - fieldValue.setBackground(AdempierePLAF.getInfoBackground()); - fieldValue.addActionListener(this); - - labelName.setText(Msg.getMsg(Env.getCtx(), "Name")); - fieldName.setBackground(AdempierePLAF.getInfoBackground()); - fieldName.addActionListener(this); - - labelContact.setText(Msg.getMsg(Env.getCtx(), "Contact")); - fieldContact.setBackground(AdempierePLAF.getInfoBackground()); - fieldContact.addActionListener(this); - - labelEMail.setText(Msg.getMsg(Env.getCtx(), "EMail")); - fieldEMail.setBackground(AdempierePLAF.getInfoBackground()); - fieldEMail.addActionListener(this); - - labelPostal.setText(Msg.getMsg(Env.getCtx(), "Postal")); - fieldPostal.setBackground(AdempierePLAF.getInfoBackground()); - fieldPostal.addActionListener(this); - - labelPhone.setText(Msg.translate(Env.getCtx(), "Phone")); - fieldPhone.setBackground(AdempierePLAF.getInfoBackground()); - fieldPhone.addActionListener(this); - - checkAND.setText(Msg.getMsg(Env.getCtx(), "SearchAND", true)); - checkAND.setToolTipText(Msg.getMsg(Env.getCtx(), "SearchANDInfo")); - checkAND.setSelected(true); - checkAND.addActionListener(this); - if (m_isSOTrx) - checkCustomer.setText(Msg.getMsg(Env.getCtx(), "OnlyCustomers")); - else - checkCustomer.setText(Msg.getMsg(Env.getCtx(), "OnlyVendors")); - checkCustomer.setSelected(true); - checkCustomer.setFocusable(false); - checkCustomer.setRequestFocusEnabled(false); - checkCustomer.addActionListener(this); - // - parameterPanel.setLayout(new ALayout()); - // - parameterPanel.add(labelValue, new ALayoutConstraint(0,0)); - parameterPanel.add(fieldValue, null); - parameterPanel.add(labelContact, null); - parameterPanel.add(fieldContact, null); - parameterPanel.add(labelPhone, null); - parameterPanel.add(fieldPhone, null); - parameterPanel.add(checkCustomer, null); - // - parameterPanel.add(labelName, new ALayoutConstraint(1,0)); - parameterPanel.add(fieldName, null); - parameterPanel.add(labelEMail, null); - parameterPanel.add(fieldEMail, null); - parameterPanel.add(labelPostal, null); - parameterPanel.add(fieldPostal, null); - parameterPanel.add(checkAND, null); - } // statInit - - /** - * Dynamic Init - * @param value value - * @param whereClause where clause - */ - private void initInfo(String value, String whereClause) - { - /** From - C_BPartner - LEFT OUTER JOIN C_BPartner_Location l ON (C_BPartner.C_BPartner_ID=l.C_BPartner_ID AND l.IsActive='Y') - LEFT OUTER JOIN AD_User c ON (C_BPartner.C_BPartner_ID=c.C_BPartner_ID AND (c.C_BPartner_Location_ID IS NULL OR c.C_BPartner_Location_ID=l.C_BPartner_Location_ID) AND c.IsActive='Y') - LEFT OUTER JOIN C_Location a ON (l.C_Location_ID=a.C_Location_ID) - **/ - - // Create Grid - StringBuilder where = new StringBuilder(); - where.append("C_BPartner.IsSummary='N' AND C_BPartner.IsActive='Y'"); - if (whereClause != null && whereClause.length() > 0) - where.append(" AND ").append(whereClause); - // - prepareTable(s_partnerLayout, s_partnerFROM, - where.toString(), - "C_BPartner.Value"); - - // Get indexes - for (int i = 0; i < p_layout.length; i++) - { - if (p_layout[i].getIDcolSQL().indexOf("AD_User_ID") != -1) - m_AD_User_ID_index = i; - if (p_layout[i].getIDcolSQL().indexOf("C_BPartner_Location_ID") != -1) - m_C_BPartner_Location_ID_index = i; - } - - // Set Value - if (value == null) - value = "%"; - if (!value.endsWith("%")) - value += "%"; - - // Put query string in Name if not numeric - if (value.equals("%")) - fieldName.setText(value); - // No Numbers entered - else if ((value.indexOf('0')+value.indexOf('1')+value.indexOf('2')+value.indexOf('3')+value.indexOf('4') +value.indexOf('5') - +value.indexOf('6')+value.indexOf('7')+value.indexOf('8')+value.indexOf('9')) == -10) - { - if (value.startsWith("%")) - fieldName.setText(value); - else - fieldName.setText("%" + value); - } - // Number entered - else - fieldValue.setText(value); - } // initInfo - - /*************************************************************************/ - - /** - * Construct SQL Where Clause and define parameters. - * (setParameters needs to set parameters) - * Includes first AND - * @return WHERE clause - */ - protected String getSQLWhere() - { - ArrayList list = new ArrayList(); - // => Value - String value = fieldValue.getText().toUpperCase(); - if (!(value.equals("") || value.equals("%"))) - list.add ("UPPER(C_BPartner.Value) LIKE ?"); - // => Name - String name = fieldName.getText().toUpperCase(); - if (!(name.equals("") || name.equals("%"))) - list.add ("UPPER(C_BPartner.Name) LIKE ?"); - // => Contact - String contact = fieldContact.getText().toUpperCase(); - if (!(contact.equals("") || contact.equals("%"))) - list.add ("UPPER(c.Name) LIKE ?"); - // => EMail - String email = fieldEMail.getText().toUpperCase(); - if (!(email.equals("") || email.equals("%"))) - list.add ("UPPER(c.EMail) LIKE ?"); - // => Phone - String phone = fieldPhone.getText().toUpperCase(); - if (!(phone.equals("") || phone.equals("%"))) - list.add ("UPPER(c.Phone) LIKE ?"); - // => Postal - String postal = fieldPostal.getText().toUpperCase(); - if (!(postal.equals("") || postal.equals("%"))) - list.add ("UPPER(a.Postal) LIKE ?"); - - StringBuilder sql = new StringBuilder(); - int size = list.size(); - // Just one - if (size == 1) - sql.append(" AND ").append(list.get(0)); - else if (size > 1) - { - boolean AND = checkAND.isSelected(); - sql.append(" AND "); - if (!AND) - sql.append("("); - for (int i = 0; i < size; i++) - { - if (i > 0) - sql.append(AND ? " AND " : " OR "); - sql.append(list.get(i)); - } - if (!AND) - sql.append(")"); - } - - // Static SQL - if (checkCustomer.isSelected()) - { - sql.append(" AND "); - if (m_isSOTrx) - sql.append ("C_BPartner.IsCustomer='Y'"); - else - sql.append ("C_BPartner.IsVendor='Y'"); - } - return sql.toString(); - } // getSQLWhere - - /** - * Set Parameters for Query. - * (as defined in getSQLWhere) - * @param pstmt pstmt - * @param forCount for counting records - * @throws SQLException - */ - protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException - { - int index = 1; - // => Value - String value = fieldValue.getText().toUpperCase(); - if (!(value.equals("") || value.equals("%"))) - { - if (!value.endsWith("%")) - value += "%"; - pstmt.setString(index++, value); - if (log.isLoggable(Level.FINE)) log.fine("Value: " + value); - } - // => Name - String name = fieldName.getText().toUpperCase(); - if (!(name.equals("") || name.equals("%"))) - { - if (!name.endsWith("%")) - name += "%"; - pstmt.setString(index++, name); - if (log.isLoggable(Level.FINE)) log.fine("Name: " + name); - } - // => Contact - String contact = fieldContact.getText().toUpperCase(); - if (!(contact.equals("") || contact.equals("%"))) - { - if (!contact.endsWith("%")) - contact += "%"; - pstmt.setString(index++, contact); - if (log.isLoggable(Level.FINE)) log.fine("Contact: " + contact); - } - // => EMail - String email = fieldEMail.getText().toUpperCase(); - if (!(email.equals("") || email.equals("%"))) - { - if (!email.endsWith("%")) - email += "%"; - pstmt.setString(index++, email); - if (log.isLoggable(Level.FINE)) log.fine("EMail: " + email); - } - // => Phone - String phone = fieldPhone.getText().toUpperCase(); - if (!(phone.equals("") || phone.equals("%"))) - { - if (!phone.endsWith("%")) - phone += "%"; - pstmt.setString(index++, phone); - if (log.isLoggable(Level.FINE)) log.fine("Phone: " + phone); - } - // => Postal - String postal = fieldPostal.getText().toUpperCase(); - if (!(postal.equals("") || postal.equals("%"))) - { - if (!postal.endsWith("%")) - postal += "%"; - pstmt.setString(index++, postal); - if (log.isLoggable(Level.FINE)) log.fine("Postal: " + postal); - } - } // setParameters - - /*************************************************************************/ - - /** - * Save Selection Details - * Get Location/Partner Info - */ - public void saveSelectionDetail() - { - int row = p_table.getSelectedRow(); - if (row == -1) - return; - - int AD_User_ID = 0; - int C_BPartner_Location_ID = 0; - - if (m_AD_User_ID_index != -1) - { - Object data = p_table.getModel().getValueAt(row, m_AD_User_ID_index); - if (data instanceof KeyNamePair) - AD_User_ID = ((KeyNamePair)data).getKey(); - } - if (m_C_BPartner_Location_ID_index != -1) - { - Object data = p_table.getModel().getValueAt(row, m_C_BPartner_Location_ID_index); - if (data instanceof KeyNamePair) - C_BPartner_Location_ID = ((KeyNamePair)data).getKey(); - } - // publish for Callout to read - Integer ID = getSelectedRowKey(); - Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_BPartner_ID", ID == null ? "0" : ID.toString()); - Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "AD_User_ID", String.valueOf(AD_User_ID)); - Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_BPartner_Location_ID", String.valueOf(C_BPartner_Location_ID)); - } // saveSelectionDetail - - - /************************************************************************** - * Show History - */ - protected void showHistory() - { - log.info(""); - Integer C_BPartner_ID = getSelectedRowKey(); - if (C_BPartner_ID == null) - return; - InvoiceHistory ih = new InvoiceHistory (this, C_BPartner_ID.intValue(), - 0, 0, 0); - ih.setVisible(true); - ih = null; - } // showHistory - - /** - * Has History - * @return true - */ - protected boolean hasHistory() - { - return true; - } // hasHistory - - /** - * Zoom - */ - protected void zoom() - { - log.info( "InfoBPartner.zoom"); - Integer C_BPartner_ID = getSelectedRowKey(); - if (C_BPartner_ID == null) - return; - // AEnv.zoom(MBPartner.Table_ID, C_BPartner_ID.intValue(), true); // SO - - MQuery query = new MQuery("C_BPartner"); - query.addRestriction("C_BPartner_ID", MQuery.EQUAL, C_BPartner_ID); - query.setRecordCount(1); - int AD_WindowNo = getAD_Window_ID("C_BPartner", true); // SO - zoom (AD_WindowNo, query); - } // zoom - - /** - * Has Zoom - * @return true - */ - protected boolean hasZoom() - { - return true; - } // hasZoom - - /** - * Customize - */ - protected void customize() - { - log.info( "InfoBPartner.customize"); - } // customize - - /** - * Has Customize - * @return false - */ - protected boolean hasCustomize() - { - return false; // for now - } // hasCustomize - -} // InfoBPartner diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoCashLine.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoCashLine.java deleted file mode 100644 index f22cb97439..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoCashLine.java +++ /dev/null @@ -1,398 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.Frame; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.logging.Level; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ALayout; -import org.compiere.apps.ALayoutConstraint; -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VLookup; -import org.compiere.grid.ed.VNumber; -import org.compiere.minigrid.IDColumn; -import org.compiere.model.MCashLine; -import org.compiere.model.MColumn; -import org.compiere.model.MLookupFactory; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CTextField; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Util; - -/** - * Info Payment - * - * @author Jorg Janke - * @version $Id: InfoCashLine.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *
  • FR [ 1976044 ] Info Cash Line: search by Charge - */ -public class InfoCashLine extends Info -{ - /** - * - */ - private static final long serialVersionUID = -3315036454469996930L; - - /** - * Detail Protected Contructor - * @param frame parent frame - * @param modal modal - * @param WindowNo window no - * @param value query value - * @param multiSelection multiple selections - * @param whereClause whwre clause - */ - public InfoCashLine(Frame frame, boolean modal, int WindowNo, String value, - boolean multiSelection, String whereClause) - { - super (frame, modal, WindowNo, "cl", "C_CashLine_ID", multiSelection, whereClause); - log.info( "InfoCashLine"); - setTitle(Msg.getMsg(Env.getCtx(), "InfoCashLine")); - // - try - { - statInit(); - p_loadedOK = initInfo (); - } - catch (Exception e) - { - return; - } - // - int no = p_table.getRowCount(); - setStatusLine(Integer.toString(no) + " " + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false); - setStatusDB(Integer.toString(no)); - if (value != null && value.length() > 0) - { - fName.setValue(value); - executeQuery(); - } - // - pack(); - // Focus - fName.requestFocus(); - } // InfoCashLine - - - // Static Info - private CLabel lName = new CLabel(Msg.translate(Env.getCtx(), "Name")); - private CTextField fName = new CTextField(10); - private CLabel lCashBook_ID = new CLabel(Msg.translate(Env.getCtx(), "C_CashBook_ID")); - private VLookup fCashBook_ID; -// private CLabel lOrg_ID = new CLabel(Msg.translate(Env.getCtx(), "AD_Org_ID")); -// private VLookup fOrg_ID; - private CLabel lInvoice_ID = new CLabel(Msg.translate(Env.getCtx(), "C_Invoice_ID")); - private VLookup fInvoice_ID; - private CLabel lCharge_ID = new CLabel(Msg.translate(Env.getCtx(), "C_Charge_ID")); - private VLookup fCharge_ID; - private CLabel lBankAccount_ID = new CLabel(Msg.translate(Env.getCtx(), "C_BankAccount_ID")); - private VLookup fBankAccount_ID; - private CCheckBox cbAbsolute = new CCheckBox (Msg.translate(Env.getCtx(), "AbsoluteAmt")); - // - private CLabel lDateFrom = new CLabel(Msg.translate(Env.getCtx(), "StatementDate")); - private VDate fDateFrom = new VDate("DateFrom", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateFrom")); - private CLabel lDateTo = new CLabel("-"); - private VDate fDateTo = new VDate("DateTo", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateTo")); - private CLabel lAmtFrom = new CLabel(Msg.translate(Env.getCtx(), "Amount")); - private VNumber fAmtFrom = new VNumber("AmtFrom", false, false, true, DisplayType.Amount, Msg.translate(Env.getCtx(), "AmtFrom")); - private CLabel lAmtTo = new CLabel("-"); - private VNumber fAmtTo = new VNumber("AmtTo", false, false, true, DisplayType.Amount, Msg.translate(Env.getCtx(), "AmtTo")); - - /** Array of Column Info */ - private static final Info_Column[] s_cashLayout = { - new Info_Column(" ", "cl.C_CashLine_ID", IDColumn.class), - new Info_Column(Msg.translate(Env.getCtx(), "C_CashBook_ID"), - "(SELECT cb.Name FROM C_CashBook cb WHERE cb.C_CashBook_ID=c.C_CashBook_ID)", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "Name"), - "c.Name", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "StatementDate"), - "c.StatementDate", Timestamp.class), - new Info_Column(Msg.translate(Env.getCtx(), "Line"), - "cl.Line", Integer.class), - // new Info_Column(Msg.translate(Env.getCtx(), "C_Currency_ID"), - // "(SELECT ISO_Code FROM C_Currency c WHERE c.C_Currency_ID=cl.C_Currency_ID)", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "Amount"), - "cl.Amount", BigDecimal.class, true, true, null), - // - new Info_Column(Msg.translate(Env.getCtx(), "C_Invoice_ID"), - "(SELECT i.DocumentNo||'_'||" + DB.TO_CHAR("i.DateInvoiced",DisplayType.Date,Env.getAD_Language(Env.getCtx())) - + "||'_'||" + DB.TO_CHAR("i.GrandTotal",DisplayType.Amount,Env.getAD_Language(Env.getCtx())) - + " FROM C_Invoice i WHERE i.C_Invoice_ID=cl.C_Invoice_ID)", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "C_BankAccount_ID"), - "(SELECT b.Name||' '||ba.AccountNo FROM C_Bank b, C_BankAccount ba WHERE b.C_Bank_ID=ba.C_Bank_ID AND ba.C_BankAccount_ID=cl.C_BankAccount_ID)", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "C_Charge_ID"), - "(SELECT ca.Name FROM C_Charge ca WHERE ca.C_Charge_ID=cl.C_Charge_ID)", String.class), - // - new Info_Column(Msg.translate(Env.getCtx(), "DiscountAmt"), - "cl.DiscountAmt", BigDecimal.class), - new Info_Column(Msg.translate(Env.getCtx(), "WriteOffAmt"), - "cl.WriteOffAmt", BigDecimal.class), - new Info_Column(Msg.translate(Env.getCtx(), "Description"), - "cl.Description", String.class) - }; - - /** - * Static Setup - add fields to parameterPanel - * @throws Exception if Lookups cannot be created - */ - private void statInit() throws Exception - { - lName.setLabelFor(fName); - fName.setBackground(AdempierePLAF.getInfoBackground()); - fName.addActionListener(this); - // - // 5249 - C_Cash.C_CashBook_ID - fCashBook_ID = new VLookup("C_CashBook_ID", false, false, true, - MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, 5249, DisplayType.TableDir)); - lCashBook_ID.setLabelFor(fCashBook_ID); - fCashBook_ID.setBackground(AdempierePLAF.getInfoBackground()); - // 5354 - C_CashLine.C_Invoice_ID - fInvoice_ID = new VLookup("C_Invoice_ID", false, false, true, - MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, 5354, DisplayType.Search)); - lInvoice_ID.setLabelFor(fInvoice_ID); - fInvoice_ID.setBackground(AdempierePLAF.getInfoBackground()); - // 5295 - C_CashLine.C_BankAccount_ID - fBankAccount_ID = new VLookup("C_BankAccount_ID", false, false, true, - MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, 5295, DisplayType.TableDir)); - lBankAccount_ID.setLabelFor(fBankAccount_ID); - fBankAccount_ID.setBackground(AdempierePLAF.getInfoBackground()); - // 5296 - C_CashLine.C_Charge_ID - fCharge_ID = new VLookup(MCashLine.COLUMNNAME_C_Charge_ID, false, false, true, - MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, - MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_Charge_ID), - DisplayType.TableDir) ); - // 5291 - C_CashLine.C_Cash_ID - // - lDateFrom.setLabelFor(fDateFrom); - fDateFrom.setBackground(AdempierePLAF.getInfoBackground()); - fDateFrom.setToolTipText(Msg.translate(Env.getCtx(), "DateFrom")); - lDateTo.setLabelFor(fDateTo); - fDateTo.setBackground(AdempierePLAF.getInfoBackground()); - fDateTo.setToolTipText(Msg.translate(Env.getCtx(), "DateTo")); - lAmtFrom.setLabelFor(fAmtFrom); - fAmtFrom.setBackground(AdempierePLAF.getInfoBackground()); - fAmtFrom.setToolTipText(Msg.translate(Env.getCtx(), "AmtFrom")); - lAmtTo.setLabelFor(fAmtTo); - fAmtTo.setBackground(AdempierePLAF.getInfoBackground()); - fAmtTo.setToolTipText(Msg.translate(Env.getCtx(), "AmtTo")); - // - parameterPanel.setLayout(new ALayout()); - // First Row - parameterPanel.add(lCashBook_ID, new ALayoutConstraint(0,0)); - parameterPanel.add(fCashBook_ID, null); - parameterPanel.add(lName, null); - parameterPanel.add(fName, null); - parameterPanel.add(cbAbsolute, new ALayoutConstraint(0,5)); - // 2nd Row - parameterPanel.add(lInvoice_ID, new ALayoutConstraint(1,0)); - parameterPanel.add(fInvoice_ID, null); - parameterPanel.add(lDateFrom, null); - parameterPanel.add(fDateFrom, null); - parameterPanel.add(lDateTo, null); - parameterPanel.add(fDateTo, null); - // 3rd Row - parameterPanel.add(lBankAccount_ID, new ALayoutConstraint(2,0)); - parameterPanel.add(fBankAccount_ID, null); - parameterPanel.add(lAmtFrom, null); - parameterPanel.add(fAmtFrom, null); - parameterPanel.add(lAmtTo, null); - parameterPanel.add(fAmtTo, null); - // 4th Row - parameterPanel.add(lCharge_ID, new ALayoutConstraint(3,0)); - parameterPanel.add(fCharge_ID, null); - } // statInit - - /** - * General Init - * @return true, if success - */ - private boolean initInfo () - { - // prepare table - StringBuilder where = new StringBuilder("cl.IsActive='Y'"); - if (p_whereClause.length() > 0) - where.append(" AND ").append(Util.replace(p_whereClause, "C_CashLine.", "cl.")); - prepareTable (s_cashLayout, - "C_CashLine cl INNER JOIN C_Cash c ON (cl.C_Cash_ID=c.C_Cash_ID)", - where.toString(), - "2,3,cl.Line"); - - return true; - } // initInfo - - - /************************************************************************** - * Construct SQL Where Clause and define parameters - * (setParameters needs to set parameters) - * Includes first AND - * @return sql where clause - */ - protected String getSQLWhere() - { - StringBuilder sql = new StringBuilder(); - if (fName.getText().length() > 0) - sql.append(" AND UPPER(c.Name) LIKE ?"); - // - if (fCashBook_ID.getValue() != null) - sql.append(" AND c.C_CashBook_ID=?"); - // - if (fInvoice_ID.getValue() != null) - sql.append(" AND cl.C_Invoice_ID=?"); - // - if (fDateFrom.getValue() != null || fDateTo.getValue() != null) - { - Timestamp from = (Timestamp)fDateFrom.getValue(); - Timestamp to = (Timestamp)fDateTo.getValue(); - if (from == null && to != null) - sql.append(" AND TRUNC(c.StatementDate) <= ?"); - else if (from != null && to == null) - sql.append(" AND TRUNC(c.StatementDate) >= ?"); - else if (from != null && to != null) - sql.append(" AND TRUNC(c.StatementDate) BETWEEN ? AND ?"); - } - // - if (fAmtFrom.getValue() != null || fAmtTo.getValue() != null) - { - BigDecimal from = (BigDecimal)fAmtFrom.getValue(); - BigDecimal to = (BigDecimal)fAmtTo.getValue(); - if (cbAbsolute.isSelected()) - sql.append(" AND ABS(cl.Amount)"); - else - sql.append(" AND cl.Amount"); - // - if (from == null && to != null) - sql.append(" <=?"); - else if (from != null && to == null) - sql.append(" >=?"); - else if (from != null && to != null) - { - if (from.compareTo(to) == 0) - sql.append(" =?"); - else - sql.append(" BETWEEN ? AND ?"); - } - } - if (fCharge_ID.getValue() != null) { - sql.append(" AND cl.").append(MCashLine.COLUMNNAME_C_Charge_ID).append("=?"); - } - - if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); - return sql.toString(); - } // getSQLWhere - - /** - * Set Parameters for Query. - * (as defined in getSQLWhere) - * @param pstmt statement - * @param forCount for counting records - * @throws SQLException - */ - protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException - { - int index = 1; - if (fName.getText().length() > 0) - pstmt.setString(index++, getSQLText(fName)); - // - if (fCashBook_ID.getValue() != null) - { - Integer cb = (Integer)fCashBook_ID.getValue(); - pstmt.setInt(index++, cb.intValue()); - if (log.isLoggable(Level.FINE)) log.fine("CashBook=" + cb); - } - // - if (fInvoice_ID.getValue() != null) - { - Integer i = (Integer)fInvoice_ID.getValue(); - pstmt.setInt(index++, i.intValue()); - if (log.isLoggable(Level.FINE)) log.fine("Invoice=" + i); - } - // - if (fDateFrom.getValue() != null || fDateTo.getValue() != null) - { - Timestamp from = (Timestamp)fDateFrom.getValue(); - Timestamp to = (Timestamp)fDateTo.getValue(); - if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); - if (from == null && to != null) - pstmt.setTimestamp(index++, to); - else if (from != null && to == null) - pstmt.setTimestamp(index++, from); - else if (from != null && to != null) - { - pstmt.setTimestamp(index++, from); - pstmt.setTimestamp(index++, to); - } - } - // - if (fAmtFrom.getValue() != null || fAmtTo.getValue() != null) - { - BigDecimal from = (BigDecimal)fAmtFrom.getValue(); - BigDecimal to = (BigDecimal)fAmtTo.getValue(); - if (cbAbsolute.isSelected()) - { - if (from != null) - from = from.abs(); - if (to != null) - to = to.abs(); - } - if (log.isLoggable(Level.FINE)) log.fine("Amt From=" + from + ", To=" + to + ", Absolute=" + cbAbsolute.isSelected()); - if (from == null && to != null) - pstmt.setBigDecimal(index++, to); - else if (from != null && to == null) - pstmt.setBigDecimal(index++, from); - else if (from != null && to != null) - { - if (from.compareTo(to) == 0) - pstmt.setBigDecimal(index++, from); - else - { - pstmt.setBigDecimal(index++, from); - pstmt.setBigDecimal(index++, to); - } - } - } - if (fCharge_ID.getValue() != null) { - Integer i = (Integer)fCharge_ID.getValue(); - pstmt.setInt(index++, i.intValue()); - if (log.isLoggable(Level.FINE)) log.fine("Charge=" + i); - } - } // setParameters - - /** - * Get SQL WHERE parameter - * @param f field - * @return Upper case text with % at the end - */ - private String getSQLText (CTextField f) - { - String s = f.getText().toUpperCase(); - if (!s.endsWith("%")) - s += "%"; - if (log.isLoggable(Level.FINE)) log.fine( "String=" + s); - return s; - } // getSQLText -} // InfoCashLine diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoFactory.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoFactory.java deleted file mode 100644 index 6f39dbbe1f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoFactory.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.compiere.apps.search; - -import java.awt.Frame; - -public interface InfoFactory { - - /** - * Factory Constructor - * @param frame parent frame - * @param modal new window is modal - * @param WindowNo window no - * @param tableName table name of the search - * @param keyColumn key column of the search - * @param value query value - * @param multiSelection allow to select more than one row - * @param whereClause fully qualified where clause for the search - * @return special or general Info Window - */ - public Info create (Frame frame, boolean modal, int WindowNo, - String tableName, String keyColumn, String value, - boolean multiSelection, String whereClause); -} diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoGeneral.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoGeneral.java deleted file mode 100644 index 6f2571bcbe..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoGeneral.java +++ /dev/null @@ -1,477 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.Frame; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.JLabel; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.ALayout; -import org.compiere.apps.ALayoutConstraint; -import org.compiere.minigrid.IDColumn; -import org.compiere.swing.CLabel; -import org.compiere.swing.CTextField; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Generic Table Search - *

    - * Change log: - *

      - *
    • 2007-02-14 - teo_sarca - [ 1659737 ] InfoGeneral not working with virtual columns - *
    - * - * @author Jorg Janke - * @version $Id: InfoGeneral.java,v 1.3 2006/10/06 00:42:38 jjanke Exp $ - */ -public class InfoGeneral extends Info -{ - /** - * - */ - private static final long serialVersionUID = -7588425490485071820L; - - /** - * Detail Protected Constructor. - * - * @param frame parent - * @param modal modal - * @param WindowNo window no - * @param value QueryValue - * @param tableName table name - * @param keyColumn key column (ignored) - * @param multiSelection multiple selections - * @param whereClause where clause - */ - public InfoGeneral (Frame frame, boolean modal, int WindowNo, String value, - String tableName, String keyColumn, - boolean multiSelection, String whereClause) - { - this(frame, modal, WindowNo, value, tableName, keyColumn, multiSelection, whereClause, true); - } - - /** - * Detail Protected Constructor. - * - * @param frame parent - * @param modal modal - * @param WindowNo window no - * @param value QueryValue - * @param tableName table name - * @param keyColumn key column (ignored) - * @param multiSelection multiple selections - * @param whereClause where clause - * @param lookup - */ - public InfoGeneral (Frame frame, boolean modal, int WindowNo, String value, - String tableName, String keyColumn, - boolean multiSelection, String whereClause, boolean lookup) - { - super (frame, modal, WindowNo, tableName, keyColumn, multiSelection, whereClause, lookup); - if (log.isLoggable(Level.INFO)) log.info(tableName + " - " + keyColumn + " - " + whereClause); - setTitle(Msg.getMsg(Env.getCtx(), "Info")); - // - statInit(); - p_loadedOK = initInfo (); - if (!p_loadedOK) - return; - // - int no = p_table.getRowCount(); - setStatusLine(Integer.toString(no) + " " - + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false); - setStatusDB(Integer.toString(no)); - // Focus - textField1.setValue(value); - textField1.requestFocus(); - if (value != null && value.length() > 0) - executeQuery(); - p_loadedOK = true; - - AEnv.positionCenterWindow(frame, this); - } // InfoGeneral - - /** String Array of Column Info */ - private Info_Column[] m_generalLayout; - /** list of query columns */ - private ArrayList m_queryColumns = new ArrayList(); - /** list of query columns (SQL) */ - private ArrayList m_queryColumnsSql = new ArrayList(); - - // Static data - private CLabel label1 = new CLabel(); - private CTextField textField1 = new CTextField(10); - private CLabel label2 = new CLabel(); - private CTextField textField2 = new CTextField(10); - private CLabel label3 = new CLabel(); - private CTextField textField3 = new CTextField(10); - private CLabel label4 = new CLabel(); - private CTextField textField4 = new CTextField(10); - - /** - * Static Setup - add fields to parameterPanel (GridLayout) - */ - private void statInit() - { - label1.setLabelFor(textField1); - label1.setText("Label1"); - label1.setHorizontalAlignment(JLabel.LEADING); - textField1.setBackground(AdempierePLAF.getInfoBackground()); - label2.setLabelFor(textField2); - label2.setText("Label2"); - label2.setHorizontalAlignment(JLabel.LEADING); - textField2.setBackground(AdempierePLAF.getInfoBackground()); - label3.setLabelFor(textField3); - label3.setText("Label3"); - label3.setHorizontalAlignment(JLabel.LEADING); - textField3.setBackground(AdempierePLAF.getInfoBackground()); - label4.setLabelFor(textField4); - label4.setText("Label4"); - label4.setHorizontalAlignment(JLabel.LEADING); - textField4.setBackground(AdempierePLAF.getInfoBackground()); - // - parameterPanel.setLayout(new ALayout()); - parameterPanel.add(label1, new ALayoutConstraint(0,0)); - parameterPanel.add(label2, null); - parameterPanel.add(label3, null); - parameterPanel.add(label4, null); - // - parameterPanel.add(textField1, new ALayoutConstraint(1,0)); - parameterPanel.add(textField2, null); - parameterPanel.add(textField3, null); - parameterPanel.add(textField4, null); - } // statInit - - /** - * General Init - * @return true, if success - */ - private boolean initInfo () - { - if (!initInfoTable()) - return false; - - // prepare table - StringBuilder where = new StringBuilder("IsActive='Y'"); - if (p_whereClause.length() > 0) - where.append(" AND ").append(p_whereClause); - prepareTable(m_generalLayout, - p_tableName, - where.toString(), - "2"); - - // Set & enable Fields - label1.setText(Msg.translate(Env.getCtx(), m_queryColumns.get(0).toString())); - textField1.addActionListener(this); - if (m_queryColumns.size() > 1) - { - label2.setText(Msg.translate(Env.getCtx(), m_queryColumns.get(1).toString())); - textField2.addActionListener(this); - } - else - { - label2.setVisible(false); - textField2.setVisible(false); - } - if (m_queryColumns.size() > 2) - { - label3.setText(Msg.translate(Env.getCtx(), m_queryColumns.get(2).toString())); - textField3.addActionListener(this); - } - else - { - label3.setVisible(false); - textField3.setVisible(false); - } - if (m_queryColumns.size() > 3) - { - label4.setText(Msg.translate(Env.getCtx(), m_queryColumns.get(3).toString())); - textField4.addActionListener(this); - } - else - { - label4.setVisible(false); - textField4.setVisible(false); - } - return true; - } // initInfo - - - /** - * Init info with Table. - * - find QueryColumns (Value, Name, ..) - * - build gridController & columsn - * @return true if success - */ - private boolean initInfoTable () - { - // Get Query Columns ------------------------------------------------- - String sql = "SELECT c.ColumnName, t.AD_Table_ID, t.TableName, c.ColumnSql " - + "FROM AD_Table t" - + " INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID)" - + "WHERE c.AD_Reference_ID IN (10,14)" - + " AND t.TableName=?" // #1 - // Displayed in Window - + " AND EXISTS (SELECT * FROM AD_Field f " - + "WHERE f.AD_Column_ID=c.AD_Column_ID" - + " AND f.IsDisplayed='Y' AND f.IsEncrypted='N' AND f.ObscureType IS NULL) " - // - + "ORDER BY c.IsIdentifier DESC, c.AD_Reference_ID, c.SeqNo"; - int AD_Table_ID = 0; - String tableName = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setString(1, p_tableName); - rs = pstmt.executeQuery(); - while (rs.next()) - { - m_queryColumns.add(rs.getString(1)); - String columnSql = rs.getString(4); - if (columnSql != null && columnSql.length() > 0 && columnSql.contains("@")) - columnSql = "NULL"; - if (columnSql != null && columnSql.contains("@")) - columnSql = Env.parseContext(Env.getCtx(), -1, columnSql, false, true); - if (columnSql != null && columnSql.length() > 0) - m_queryColumnsSql.add(columnSql); - else - m_queryColumnsSql.add(rs.getString(1)); - - if (AD_Table_ID == 0) - { - AD_Table_ID = rs.getInt(2); - tableName = rs.getString(3); - } - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - return false; - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - // Miminum check - if (m_queryColumns.size() == 0) - { - ADialog.error(p_WindowNo, this, "Error", "No query columns found"); - log.log(Level.SEVERE, "No query columns found"); - return false; - } - if (log.isLoggable(Level.FINEST)) log.finest("Table " + tableName + ", ID=" + AD_Table_ID - + ", QueryColumns #" + m_queryColumns.size()); - // Only 4 Query Columns - while (m_queryColumns.size() > 4) { - m_queryColumns.remove(m_queryColumns.size()-1); - m_queryColumnsSql.remove(m_queryColumnsSql.size()-1); - } - // Set Title - String title = Msg.translate(Env.getCtx(), tableName + "_ID"); // best bet - if (title.endsWith("_ID")) - title = Msg.translate(Env.getCtx(), tableName); // second best bet - setTitle(getTitle() + " " + title); - - - // Get Display Columns ----------------------------------------------- - ArrayList list = new ArrayList(); - sql = "SELECT c.ColumnName, c.AD_Reference_ID, c.IsKey, f.IsDisplayed, c.AD_Reference_Value_ID, c.ColumnSql " - + "FROM AD_Column c" - + " INNER JOIN AD_Table t ON (c.AD_Table_ID=t.AD_Table_ID)" - + " INNER JOIN AD_Tab tab ON (t.AD_Window_ID=tab.AD_Window_ID)" - + " INNER JOIN AD_Field f ON (tab.AD_Tab_ID=f.AD_Tab_ID AND f.AD_Column_ID=c.AD_Column_ID) " - + "WHERE t.AD_Table_ID=? " - + " AND (c.IsKey='Y' OR " - // + " (f.IsDisplayed='Y' AND f.IsEncrypted='N' AND f.ObscureType IS NULL)) " - + " (f.IsEncrypted='N' AND f.ObscureType IS NULL)) " - + "ORDER BY c.IsKey DESC, f.SeqNo"; - - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, AD_Table_ID); - rs = pstmt.executeQuery(); - while (rs.next()) - { - String columnName = rs.getString(1); - int displayType = rs.getInt(2); - boolean isKey = rs.getString(3).equals("Y"); - boolean isDisplayed = rs.getString(4).equals("Y"); - int AD_Reference_Value_ID = rs.getInt(5); - // teo_sarca - String columnSql = rs.getString(6); - if (columnSql != null && columnSql.length() > 0 && columnSql.contains("@")) - columnSql = "NULL"; - if (columnSql != null && columnSql.contains("@")) - columnSql = Env.parseContext(Env.getCtx(), -1, columnSql, false, true); - if (columnSql == null || columnSql.length() == 0) - columnSql = columnName; - // Default - StringBuffer colSql = new StringBuffer(columnSql); - Class colClass = null; - // - if (isKey) - colClass = IDColumn.class; - else if (!isDisplayed) - ; - else if (displayType == DisplayType.YesNo) - colClass = Boolean.class; - else if (displayType == DisplayType.Amount) - colClass = BigDecimal.class; - else if (displayType == DisplayType.Number || displayType == DisplayType.Quantity) - colClass = Double.class; - else if (displayType == DisplayType.Integer) - colClass = Integer.class; - else if (displayType == DisplayType.String || displayType == DisplayType.Text || displayType == DisplayType.Memo) - colClass = String.class; - else if (DisplayType.isDate(displayType)) - colClass = Timestamp.class; - // ignore Binary, Button, ID, RowID - // else if (displayType == DisplayType.Account) - // else if (displayType == DisplayType.Location) - // else if (displayType == DisplayType.Locator) - else if (displayType == DisplayType.List) - { - if (Env.isBaseLanguage(Env.getCtx(), "AD_Ref_List")) - colSql = new StringBuffer("(SELECT l.Name FROM AD_Ref_List l WHERE l.AD_Reference_ID=") - .append(AD_Reference_Value_ID).append(" AND l.Value=").append(columnSql) - .append(") AS ").append(columnName); - else - colSql = new StringBuffer("(SELECT t.Name FROM AD_Ref_List l, AD_Ref_List_Trl t " - + "WHERE l.AD_Ref_List_ID=t.AD_Ref_List_ID AND l.AD_Reference_ID=") - .append(AD_Reference_Value_ID).append(" AND l.Value=").append(columnSql) - .append(" AND t.AD_Language='").append(Env.getAD_Language(Env.getCtx())) - .append("') AS ").append(columnName); - colClass = String.class; - } - // else if (displayType == DisplayType.Table) - // else if (displayType == DisplayType.TableDir || displayType == DisplayType.Search) - - if (colClass != null) - { - list.add(new Info_Column(Msg.translate(Env.getCtx(), columnName), colSql.toString(), colClass)); - if (log.isLoggable(Level.FINEST)) log.finest("Added Column=" + columnName); - } - else - if (log.isLoggable(Level.FINEST)) log.finest("Not Added Column=" + columnName); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - return false; - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - if (list.size() == 0) - { - ADialog.error(p_WindowNo, this, "Error", "No Info Columns"); - log.log(Level.SEVERE, "No Info for AD_Table_ID=" + AD_Table_ID + " - " + sql); - return false; - } - if (log.isLoggable(Level.FINEST)) log.finest("InfoColumns #" + list.size()); - - // Convert ArrayList to Array - m_generalLayout = new Info_Column[list.size()]; - list.toArray(m_generalLayout); - return true; - } // initInfoTable - - - /************************************************************************** - * Construct SQL Where Clause and define parameters. - * (setParameters needs to set parameters) - * Includes first AND - * @return where clause - */ - protected String getSQLWhere() - { - StringBuffer sql = new StringBuffer(); - addSQLWhere (sql, 0, textField1.getText().toUpperCase()); - addSQLWhere (sql, 1, textField2.getText().toUpperCase()); - addSQLWhere (sql, 2, textField3.getText().toUpperCase()); - addSQLWhere (sql, 3, textField4.getText().toUpperCase()); - return sql.toString(); - } // getSQLWhere - - /** - * Add directly Query as Strings - * @param sql sql buffer - * @param index index - * @param value value - */ - private void addSQLWhere(StringBuffer sql, int index, String value) - { - if (!(value.equals("") || value.equals("%")) && index < m_queryColumns.size()) - { - // Angelo Dabala' (genied) nectosoft: [2893220] avoid to append string parameters directly because of special chars like quote(s) - sql.append(" AND UPPER(").append(m_queryColumnsSql.get(index).toString()).append(") LIKE ?"); - } - } // addSQLWhere - - /** - * Get SQL WHERE parameter - * @param f field - * @return sql part - */ - private String getSQLText (CTextField f) - { - String s = f.getText().toUpperCase(); - if (!s.endsWith("%")) - s += "%"; - if (log.isLoggable(Level.FINE)) log.fine( "String=" + s); - return s; - } // getSQLText - - /** - * Set Parameters for Query. - * (as defined in getSQLWhere) - * @param pstmt statement - * @param forCount for counting records - * @throws SQLException - */ - protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException - { - int index = 1; - if (textField1.getText().length() > 0) - pstmt.setString(index++, getSQLText(textField1)); - if (textField2.getText().length() > 0) - pstmt.setString(index++, getSQLText(textField2)); - if (textField3.getText().length() > 0) - pstmt.setString(index++, getSQLText(textField3)); - if (textField4.getText().length() > 0) - pstmt.setString(index++, getSQLText(textField4)); - } // setParameters - -} // InfoGeneral diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoInOut.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoInOut.java deleted file mode 100644 index a8acede1c1..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoInOut.java +++ /dev/null @@ -1,348 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.Frame; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.logging.Level; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ALayout; -import org.compiere.apps.ALayoutConstraint; -import org.compiere.grid.ed.VCheckBox; -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VLookup; -import org.compiere.minigrid.IDColumn; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MQuery; -import org.compiere.swing.CLabel; -import org.compiere.swing.CTextField; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Util; - - -/** - * Info InOut - * - * @author Jorg Janke - * @version $Id: InfoInOut.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class InfoInOut extends Info -{ - /** - * - */ - private static final long serialVersionUID = -2066307179999903184L; - - /** - * Detail Protected Contructor - * @param frame parent frame - * @param modal modal - * @param WindowNo window no - * @param value query value - * @param multiSelection multiple selections - * @param whereClause where clause - */ - public InfoInOut(Frame frame, boolean modal, int WindowNo, String value, - boolean multiSelection, String whereClause) - { - this(frame, modal, WindowNo, value, multiSelection, whereClause, true); - } - - /** - * Detail Protected Contructor - * @param frame parent frame - * @param modal modal - * @param WindowNo window no - * @param value query value - * @param multiSelection multiple selections - * @param whereClause where clause - * @param lookup - */ - public InfoInOut(Frame frame, boolean modal, int WindowNo, String value, - boolean multiSelection, String whereClause, boolean lookup) - { - super (frame, modal, WindowNo, "i", "M_InOut_ID", multiSelection, whereClause, lookup); - log.info( "InfoInOut"); - setTitle(Msg.getMsg(Env.getCtx(), "InfoInOut")); - // - try - { - statInit(); - p_loadedOK = initInfo (); - } - catch (Exception e) - { - return; - } - // - int no = p_table.getRowCount(); - setStatusLine(Integer.toString(no) + " " + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false); - setStatusDB(Integer.toString(no)); - if (value != null && value.length() > 0) - { - fDocumentNo.setValue(value); - executeQuery(); - } - // - pack(); - // Focus - fDocumentNo.requestFocus(); - } // InfoInOut - - /** String Array of Column Info */ - //private Info_Column[] m_generalLayout; - /** list of query columns */ - //private ArrayList m_queryColumns = new ArrayList(); - /** Table Name */ - //private String m_tableName; - /** Key Column Name */ - //private String m_keyColumn; - - // Static Info - private CLabel lDocumentNo = new CLabel(Msg.translate(Env.getCtx(), "DocumentNo")); - private CTextField fDocumentNo = new CTextField(10); - private CLabel lDescription = new CLabel(Msg.translate(Env.getCtx(), "Description")); - private CTextField fDescription = new CTextField(10); - private CLabel lPOReference = new CLabel(Msg.translate(Env.getCtx(), "POReference")); - private CTextField fPOReference = new CTextField(10); - // -// private CLabel lOrg_ID = new CLabel(Msg.translate(Env.getCtx(), "AD_Org_ID")); -// private VLookup fOrg_ID; - private CLabel lBPartner_ID = new CLabel(Msg.translate(Env.getCtx(), "BPartner")); - private VLookup fBPartner_ID; - // - private CLabel lDateFrom = new CLabel(Msg.translate(Env.getCtx(), "MovementDate")); - private VDate fDateFrom = new VDate("DateFrom", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateFrom")); - private CLabel lDateTo = new CLabel("-"); - private VDate fDateTo = new VDate("DateTo", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateTo")); - private VCheckBox fIsSOTrx = new VCheckBox ("IsSOTrx", false, false, true, Msg.translate(Env.getCtx(), "IsSOTrx"), "", false); - - /** Array of Column Info */ - private static final Info_Column[] s_invoiceLayout = { - new Info_Column(" ", "i.M_InOut_ID", IDColumn.class), - new Info_Column(Msg.translate(Env.getCtx(), "C_BPartner_ID"), "(SELECT Name FROM C_BPartner bp WHERE bp.C_BPartner_ID=i.C_BPartner_ID)", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "MovementDate"), "i.MovementDate", Timestamp.class), - new Info_Column(Msg.translate(Env.getCtx(), "DocumentNo"), "i.DocumentNo", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "Description"), "i.Description", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "POReference"), "i.POReference", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "IsSOTrx"), "i.IsSOTrx", Boolean.class) - }; - - /** - * Static Setup - add fields to parameterPanel - * @throws Exception if Lookups cannot be initialized - */ - private void statInit() throws Exception - { - lDocumentNo.setLabelFor(fDocumentNo); - fDocumentNo.setBackground(AdempierePLAF.getInfoBackground()); - fDocumentNo.addActionListener(this); - lDescription.setLabelFor(fDescription); - fDescription.setBackground(AdempierePLAF.getInfoBackground()); - fDescription.addActionListener(this); - lPOReference.setLabelFor(fPOReference); - fPOReference.setBackground(AdempierePLAF.getInfoBackground()); - fPOReference.addActionListener(this); - fIsSOTrx.setSelected(!"N".equals(Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx"))); - fIsSOTrx.addActionListener(this); - // - // fOrg_ID = new VLookup("AD_Org_ID", false, false, true, - // MLookupFactory.create(Env.getCtx(), 3486, m_WindowNo, DisplayType.TableDir, false), - // DisplayType.TableDir, m_WindowNo); - // lOrg_ID.setLabelFor(fOrg_ID); - // fOrg_ID.setBackground(AdempierePLAF.getInfoBackground()); - fBPartner_ID = new VLookup("C_BPartner_ID", false, false, true, - MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, 3499, DisplayType.Search)); - lBPartner_ID.setLabelFor(fBPartner_ID); - fBPartner_ID.setBackground(AdempierePLAF.getInfoBackground()); - // - lDateFrom.setLabelFor(fDateFrom); - fDateFrom.setBackground(AdempierePLAF.getInfoBackground()); - fDateFrom.setToolTipText(Msg.translate(Env.getCtx(), "DateFrom")); - lDateTo.setLabelFor(fDateTo); - fDateTo.setBackground(AdempierePLAF.getInfoBackground()); - fDateTo.setToolTipText(Msg.translate(Env.getCtx(), "DateTo")); - // - parameterPanel.setLayout(new ALayout()); - // First Row - parameterPanel.add(lDocumentNo, new ALayoutConstraint(0,0)); - parameterPanel.add(fDocumentNo, null); - parameterPanel.add(lBPartner_ID, null); - parameterPanel.add(fBPartner_ID, null); - parameterPanel.add(fIsSOTrx, new ALayoutConstraint(0,5)); - // 2nd Row - parameterPanel.add(lDescription, new ALayoutConstraint(1,0)); - parameterPanel.add(fDescription, null); - parameterPanel.add(lDateFrom, null); - parameterPanel.add(fDateFrom, null); - parameterPanel.add(lDateTo, null); - parameterPanel.add(fDateTo, null); - // 3rd Row - parameterPanel.add(lPOReference, new ALayoutConstraint(2,0)); - parameterPanel.add(fPOReference, null); - // parameterPanel.add(lOrg_ID, null); - // parameterPanel.add(fOrg_ID, null); - } // statInit - - /** - * General Init - * @return true, if success - */ - private boolean initInfo () - { - // Set Defaults - String bp = Env.getContext(Env.getCtx(), p_WindowNo, "C_BPartner_ID"); - if (bp != null && bp.length() != 0) - fBPartner_ID.setValue(Integer.valueOf(bp)); - - // prepare table - StringBuilder where = new StringBuilder("i.IsActive='Y'"); - if (p_whereClause.length() > 0) - where.append(" AND ").append(Util.replace(p_whereClause, "M_InOut.", "i.")); - prepareTable(s_invoiceLayout, - " M_InOut i", - where.toString(), - "2,3,4"); - - return true; - } // initInfo - - /*************************************************************************/ - - /** - * Construct SQL Where Clause and define parameters. - * (setParameters needs to set parameters) - * Includes first AND - * @return where clause - */ - protected String getSQLWhere() - { - StringBuilder sql = new StringBuilder(); - if (fDocumentNo.getText().length() > 0) - sql.append(" AND UPPER(i.DocumentNo) LIKE ?"); - if (fDescription.getText().length() > 0) - sql.append(" AND UPPER(i.Description) LIKE ?"); - if (fPOReference.getText().length() > 0) - sql.append(" AND UPPER(i.POReference) LIKE ?"); - // - if (fBPartner_ID.getValue() != null) - sql.append(" AND i.C_BPartner_ID=?"); - // - if (fDateFrom.getValue() != null || fDateTo.getValue() != null) - { - Timestamp from = (Timestamp)fDateFrom.getValue(); - Timestamp to = (Timestamp)fDateTo.getValue(); - if (from == null && to != null) - sql.append(" AND TRUNC(i.MovementDate) <= ?"); - else if (from != null && to == null) - sql.append(" AND TRUNC(i.MovementDate) >= ?"); - else if (from != null && to != null) - sql.append(" AND TRUNC(i.MovementDate) BETWEEN ? AND ?"); - } - sql.append(" AND i.IsSOTrx=?"); - - // log.fine( "InfoInOut.setWhereClause", sql.toString()); - return sql.toString(); - } // getSQLWhere - - /** - * Set Parameters for Query. - * (as defined in getSQLWhere) - * @param pstmt statement - * @param forCount for counting records - * @throws SQLException - */ - protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException - { - int index = 1; - if (fDocumentNo.getText().length() > 0) - pstmt.setString(index++, getSQLText(fDocumentNo)); - if (fDescription.getText().length() > 0) - pstmt.setString(index++, getSQLText(fDescription)); - if (fPOReference.getText().length() > 0) - pstmt.setString(index++, getSQLText(fPOReference)); - // - if (fBPartner_ID.getValue() != null) - { - Integer bp = (Integer)fBPartner_ID.getValue(); - pstmt.setInt(index++, bp.intValue()); - if (log.isLoggable(Level.FINE)) log.fine("BPartner=" + bp); - } - // - if (fDateFrom.getValue() != null || fDateTo.getValue() != null) - { - Timestamp from = (Timestamp)fDateFrom.getValue(); - Timestamp to = (Timestamp)fDateTo.getValue(); - if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); - if (from == null && to != null) - pstmt.setTimestamp(index++, to); - else if (from != null && to == null) - pstmt.setTimestamp(index++, from); - else if (from != null && to != null) - { - pstmt.setTimestamp(index++, from); - pstmt.setTimestamp(index++, to); - } - } - pstmt.setString(index++, fIsSOTrx.isSelected() ? "Y" : "N"); - } // setParameters - - /** - * Get SQL WHERE parameter - * @param f field - * @return sql part - */ - private String getSQLText (CTextField f) - { - String s = f.getText().toUpperCase(); - if (!s.endsWith("%")) - s += "%"; - if (log.isLoggable(Level.FINE)) log.fine( "String=" + s); - return s; - } // getSQLText - - /** - * Zoom - */ - protected void zoom() - { - log.info( "InfoInOut.zoom"); - Integer M_InOut_ID = getSelectedRowKey(); - if (M_InOut_ID == null) - return; - MQuery query = new MQuery("M_InOut"); - query.addRestriction("M_InOut_ID", MQuery.EQUAL, M_InOut_ID); - query.setRecordCount(1); - int AD_WindowNo = getAD_Window_ID("M_InOut", fIsSOTrx.isSelected()); - zoom (AD_WindowNo, query); - } // zoom - - /** - * Has Zoom - * @return true - */ - protected boolean hasZoom() - { - return true; - } // hasZoom - -} // InfoInOut diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoInvoice.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoInvoice.java deleted file mode 100644 index 9e052da1a2..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoInvoice.java +++ /dev/null @@ -1,452 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.Frame; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.logging.Level; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ALayout; -import org.compiere.apps.ALayoutConstraint; -import org.compiere.grid.ed.VCheckBox; -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VLookup; -import org.compiere.grid.ed.VNumber; -import org.compiere.minigrid.IDColumn; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MQuery; -import org.compiere.swing.CLabel; -import org.compiere.swing.CTextField; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; -import org.compiere.util.Util; - -/** - * Info Invoice - * - * @author Jorg Janke - * @version $Id: InfoInvoice.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - * FR [ 1926882 ] Info Invoice: display Due Date - */ -public class InfoInvoice extends Info -{ - /** - * - */ - private static final long serialVersionUID = 2119484421367033632L; - - /** - * Detail Protected Contructor - * - * @param frame parent frame - * @param modal modal - * @param WindowNo window no - * @param value query value - * @param multiSelection multiple selections - * @param whereClause where clause - */ - public InfoInvoice(Frame frame, boolean modal, int WindowNo, String value, - boolean multiSelection, String whereClause) - { - this(frame, modal, WindowNo, value, multiSelection, whereClause, true); - } - - /** - * Detail Protected Contructor - * - * @param frame parent frame - * @param modal modal - * @param WindowNo window no - * @param value query value - * @param multiSelection multiple selections - * @param whereClause where clause - * @param lookup - */ - public InfoInvoice(Frame frame, boolean modal, int WindowNo, String value, - boolean multiSelection, String whereClause, boolean lookup) - { - super (frame, modal, WindowNo, "i", "C_Invoice_ID", multiSelection, whereClause, lookup); - setTitle(Msg.getMsg(Env.getCtx(), "InfoInvoice")); - // - try - { - statInit(); - p_loadedOK = initInfo (); - } - catch (Exception e) - { - return; - } - // - int no = p_table.getRowCount(); - setStatusLine(Integer.toString(no) + " " + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false); - setStatusDB(Integer.toString(no)); - if (value != null && value.length() > 0) - { - fDocumentNo.setValue(value); - executeQuery(); - } - // - pack(); - // Focus - fDocumentNo.requestFocus(); - } // InfoInvoice - - /** String Array of Column Info */ - //private Info_Column[] m_generalLayout; - /** list of query columns */ - //private ArrayList m_queryColumns = new ArrayList(); - /** Table Name */ - //private String m_tableName; - /** Key Column Name */ - //private String m_keyColumn; - - // Static Info - private CLabel lDocumentNo = new CLabel(Msg.translate(Env.getCtx(), "DocumentNo")); - private CTextField fDocumentNo = new CTextField(10); - private CLabel lDescription = new CLabel(Msg.translate(Env.getCtx(), "Description")); - private CTextField fDescription = new CTextField(10); -// private CLabel lPOReference = new CLabel(Msg.translate(Env.getCtx(), "POReference")); -// private CTextField fPOReference = new CTextField(10); - // -// private CLabel lOrg_ID = new CLabel(Msg.translate(Env.getCtx(), "AD_Org_ID")); -// private VLookup fOrg_ID; - private CLabel lBPartner_ID = new CLabel(Msg.translate(Env.getCtx(), "BPartner")); - private VLookup fBPartner_ID; - private CLabel lOrder_ID = new CLabel(Msg.translate(Env.getCtx(), "C_Order_ID")); - private VLookup fOrder_ID; - private VCheckBox fIsPaid = new VCheckBox ("IsPaid", false, false, true, Msg.translate(Env.getCtx(), "IsPaid"), "", false); - private VCheckBox fIsSOTrx = new VCheckBox ("IsSOTrx", false, false, true, Msg.translate(Env.getCtx(), "IsSOTrx"), "", false); - // - private CLabel lDateFrom = new CLabel(Msg.translate(Env.getCtx(), "DateInvoiced")); - private VDate fDateFrom = new VDate("DateFrom", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateFrom")); - private CLabel lDateTo = new CLabel("-"); - private VDate fDateTo = new VDate("DateTo", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateTo")); - private CLabel lAmtFrom = new CLabel(Msg.translate(Env.getCtx(), "GrandTotal")); - private VNumber fAmtFrom = new VNumber("AmtFrom", false, false, true, DisplayType.Amount, Msg.translate(Env.getCtx(), "AmtFrom")); - private CLabel lAmtTo = new CLabel("-"); - private VNumber fAmtTo = new VNumber("AmtTo", false, false, true, DisplayType.Amount, Msg.translate(Env.getCtx(), "AmtTo")); - - /** Array of Column Info */ - private static final Info_Column[] s_invoiceLayout = { - new Info_Column(" ", "i.C_Invoice_ID", IDColumn.class), - new Info_Column(Msg.translate(Env.getCtx(), "C_BPartner_ID"), "(SELECT Name FROM C_BPartner bp WHERE bp.C_BPartner_ID=i.C_BPartner_ID)", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "DateInvoiced"), "i.DateInvoiced", Timestamp.class), - new Info_Column(Msg.translate(Env.getCtx(), "DueDate"), "i.DueDate", Timestamp.class), - new Info_Column(Msg.translate(Env.getCtx(), "DocumentNo"), "i.DocumentNo", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "C_Currency_ID"), "(SELECT ISO_Code FROM C_Currency c WHERE c.C_Currency_ID=i.C_Currency_ID)", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "GrandTotal"), "i.GrandTotal", BigDecimal.class), - new Info_Column(Msg.translate(Env.getCtx(), "ConvertedAmount"), "currencyBase(i.GrandTotal, i.C_Currency_ID, i.DateAcct, i.AD_Client_ID, i.AD_Org_ID)", BigDecimal.class), - new Info_Column(Msg.translate(Env.getCtx(), "OpenAmt"), "invoiceOpen(C_Invoice_ID,C_InvoicePaySchedule_ID)", BigDecimal.class, true, true, null), - new Info_Column(Msg.translate(Env.getCtx(), "IsPaid"), "i.IsPaid", Boolean.class), - new Info_Column(Msg.translate(Env.getCtx(), "IsSOTrx"), "i.IsSOTrx", Boolean.class), - new Info_Column(Msg.translate(Env.getCtx(), "Description"), "i.Description", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "POReference"), "i.POReference", String.class), - new Info_Column("", "''", KeyNamePair.class, "i.C_InvoicePaySchedule_ID") - }; - private static int INDEX_PAYSCHEDULE = s_invoiceLayout.length - 1; // last item - - /** - * Static Setup - add fields to parameterPanel - * @throws Exception - */ - private void statInit() throws Exception - { - lDocumentNo.setLabelFor(fDocumentNo); - fDocumentNo.setBackground(AdempierePLAF.getInfoBackground()); - fDocumentNo.addActionListener(this); - lDescription.setLabelFor(fDescription); - fDescription.setBackground(AdempierePLAF.getInfoBackground()); - fDescription.addActionListener(this); - // lPOReference.setLabelFor(lPOReference); - // fPOReference.setBackground(AdempierePLAF.getInfoBackground()); - // fPOReference.addActionListener(this); - fIsPaid.setSelected(false); - fIsPaid.addActionListener(this); - fIsSOTrx.setSelected(!"N".equals(Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx"))); - fIsSOTrx.addActionListener(this); - // - // fOrg_ID = new VLookup("AD_Org_ID", false, false, true, - // MLookupFactory.create(Env.getCtx(), 3486, m_WindowNo, DisplayType.TableDir, false), - // DisplayType.TableDir, m_WindowNo); - // lOrg_ID.setLabelFor(fOrg_ID); - // fOrg_ID.setBackground(AdempierePLAF.getInfoBackground()); - // C_Invoice.C_BPartner_ID - fBPartner_ID = new VLookup("C_BPartner_ID", false, false, true, - MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, 3499, DisplayType.Search)); - lBPartner_ID.setLabelFor(fBPartner_ID); - fBPartner_ID.setBackground(AdempierePLAF.getInfoBackground()); - // C_Invoice.C_Order_ID - fOrder_ID = new VLookup("C_Order_ID", false, false, true, - MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, 4247, DisplayType.Search)); - lOrder_ID.setLabelFor(fOrder_ID); - fOrder_ID.setBackground(AdempierePLAF.getInfoBackground()); - // - lDateFrom.setLabelFor(fDateFrom); - fDateFrom.setBackground(AdempierePLAF.getInfoBackground()); - fDateFrom.setToolTipText(Msg.translate(Env.getCtx(), "DateFrom")); - lDateTo.setLabelFor(fDateTo); - fDateTo.setBackground(AdempierePLAF.getInfoBackground()); - fDateTo.setToolTipText(Msg.translate(Env.getCtx(), "DateTo")); - lAmtFrom.setLabelFor(fAmtFrom); - fAmtFrom.setBackground(AdempierePLAF.getInfoBackground()); - fAmtFrom.setToolTipText(Msg.translate(Env.getCtx(), "AmtFrom")); - lAmtTo.setLabelFor(fAmtTo); - fAmtTo.setBackground(AdempierePLAF.getInfoBackground()); - fAmtTo.setToolTipText(Msg.translate(Env.getCtx(), "AmtTo")); - // - parameterPanel.setLayout(new ALayout()); - // First Row - parameterPanel.add(lDocumentNo, new ALayoutConstraint(0,0)); - parameterPanel.add(fDocumentNo, null); - parameterPanel.add(lBPartner_ID, null); - parameterPanel.add(fBPartner_ID, null); - parameterPanel.add(fIsSOTrx, new ALayoutConstraint(0,5)); - parameterPanel.add(fIsPaid, null); - // 2nd Row - parameterPanel.add(lDescription, new ALayoutConstraint(1,0)); - parameterPanel.add(fDescription, null); - parameterPanel.add(lDateFrom, null); - parameterPanel.add(fDateFrom, null); - parameterPanel.add(lDateTo, null); - parameterPanel.add(fDateTo, null); - // 3rd Row - parameterPanel.add(lOrder_ID, new ALayoutConstraint(2,0)); - parameterPanel.add(fOrder_ID, null); - parameterPanel.add(lAmtFrom, null); - parameterPanel.add(fAmtFrom, null); - parameterPanel.add(lAmtTo, null); - parameterPanel.add(fAmtTo, null); - // parameterPanel.add(lOrg_ID, null); - // parameterPanel.add(fOrg_ID, null); - } // statInit - - /** - * General Init - * @return true, if success - */ - private boolean initInfo () - { - // Set Defaults - String bp = Env.getContext(Env.getCtx(), p_WindowNo, "C_BPartner_ID"); - if (bp != null && bp.length() != 0) - fBPartner_ID.setValue(Integer.valueOf(bp)); - - // prepare table - StringBuilder where = new StringBuilder("i.IsActive='Y'"); - if (p_whereClause.length() > 0) - where.append(" AND ").append(Util.replace(p_whereClause, "C_Invoice.", "i.")); - prepareTable(s_invoiceLayout, - " C_Invoice_v i", // corrected for CM - where.toString(), - "2,3,4,5"); - // - // MAllocationLine.setIsPaid(Env.getCtx(), 0, null); - return true; - } // initInfo - - - /************************************************************************** - * Construct SQL Where Clause and define parameters. - * (setParameters needs to set parameters) - * Includes first AND - * @return sql - */ - protected String getSQLWhere() - { - StringBuilder sql = new StringBuilder(); - if (fDocumentNo.getText().length() > 0) - sql.append(" AND UPPER(i.DocumentNo) LIKE ?"); - if (fDescription.getText().length() > 0) - sql.append(" AND UPPER(i.Description) LIKE ?"); - // if (fPOReference.getText().length() > 0) - // sql.append(" AND UPPER(i.POReference) LIKE ?"); - // - if (fBPartner_ID.getValue() != null) - sql.append(" AND i.C_BPartner_ID=?"); - // - if (fOrder_ID.getValue() != null) - sql.append(" AND i.C_Order_ID=?"); - // - if (fDateFrom.getValue() != null || fDateTo.getValue() != null) - { - Timestamp from = (Timestamp)fDateFrom.getValue(); - Timestamp to = (Timestamp)fDateTo.getValue(); - if (from == null && to != null) - sql.append(" AND TRUNC(i.DateInvoiced) <= ?"); - else if (from != null && to == null) - sql.append(" AND TRUNC(i.DateInvoiced) >= ?"); - else if (from != null && to != null) - sql.append(" AND TRUNC(i.DateInvoiced) BETWEEN ? AND ?"); - } - // - if (fAmtFrom.getValue() != null || fAmtTo.getValue() != null) - { - BigDecimal from = (BigDecimal)fAmtFrom.getValue(); - BigDecimal to = (BigDecimal)fAmtTo.getValue(); - if (from == null && to != null) - sql.append(" AND i.GrandTotal <= ?"); - else if (from != null && to == null) - sql.append(" AND i.GrandTotal >= ?"); - else if (from != null && to != null) - sql.append(" AND i.GrandTotal BETWEEN ? AND ?"); - } - // - sql.append(" AND i.IsPaid=? AND i.IsSOTrx=?"); - - // log.fine( "InfoInvoice.setWhereClause", sql.toString()); - return sql.toString(); - } // getSQLWhere - - /** - * Set Parameters for Query. - * (as defined in getSQLWhere) - * @param pstmt statement - * @param forCount for counting records - * @throws SQLException - */ - protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException - { - int index = 1; - if (fDocumentNo.getText().length() > 0) - pstmt.setString(index++, getSQLText(fDocumentNo)); - if (fDescription.getText().length() > 0) - pstmt.setString(index++, getSQLText(fDescription)); - // if (fPOReference.getText().length() > 0) - // pstmt.setString(index++, getSQLText(fPOReference)); - // - if (fBPartner_ID.getValue() != null) - { - Integer bp = (Integer)fBPartner_ID.getValue(); - pstmt.setInt(index++, bp.intValue()); - if (log.isLoggable(Level.FINE)) log.fine("BPartner=" + bp); - } - // - if (fOrder_ID.getValue() != null) - { - Integer order = (Integer)fOrder_ID.getValue(); - pstmt.setInt(index++, order.intValue()); - if (log.isLoggable(Level.FINE)) log.fine("Order=" + order); - } - // - if (fDateFrom.getValue() != null || fDateTo.getValue() != null) - { - Timestamp from = (Timestamp)fDateFrom.getValue(); - Timestamp to = (Timestamp)fDateTo.getValue(); - if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); - if (from == null && to != null) - pstmt.setTimestamp(index++, to); - else if (from != null && to == null) - pstmt.setTimestamp(index++, from); - else if (from != null && to != null) - { - pstmt.setTimestamp(index++, from); - pstmt.setTimestamp(index++, to); - } - } - // - if (fAmtFrom.getValue() != null || fAmtTo.getValue() != null) - { - BigDecimal from = (BigDecimal)fAmtFrom.getValue(); - BigDecimal to = (BigDecimal)fAmtTo.getValue(); - if (log.isLoggable(Level.FINE)) log.fine("Amt From=" + from + ", To=" + to); - if (from == null && to != null) - pstmt.setBigDecimal(index++, to); - else if (from != null && to == null) - pstmt.setBigDecimal(index++, from); - else if (from != null && to != null) - { - pstmt.setBigDecimal(index++, from); - pstmt.setBigDecimal(index++, to); - } - } - pstmt.setString(index++, fIsPaid.isSelected() ? "Y" : "N"); - pstmt.setString(index++, fIsSOTrx.isSelected() ? "Y" : "N"); - } // setParameters - - /** - * Get SQL WHERE parameter - * @param f field - * @return sql - */ - private String getSQLText (CTextField f) - { - String s = f.getText().toUpperCase(); - if (!s.endsWith("%")) - s += "%"; - if (log.isLoggable(Level.FINE)) log.fine( "String=" + s); - return s; - } // getSQLText - - /** - * Zoom - */ - protected void zoom() - { - log.info( "InfoInvoice.zoom"); - Integer C_Invoice_ID = getSelectedRowKey(); - if (C_Invoice_ID == null) - return; - MQuery query = new MQuery("C_Invoice"); - query.addRestriction("C_Invoice_ID", MQuery.EQUAL, C_Invoice_ID); - query.setRecordCount(1); - int AD_WindowNo = getAD_Window_ID("C_Invoice", fIsSOTrx.isSelected()); - zoom (AD_WindowNo, query); - } // zoom - - /** - * Has Zoom - * @return true - */ - protected boolean hasZoom() - { - return true; - } // hasZoom - - /** - * Save Selection Settings - */ - protected void saveSelectionDetail() - { - // publish for Callout to read - Integer ID = getSelectedRowKey(); - Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_Invoice_ID", ID == null ? "0" : ID.toString()); - // - int C_InvoicePaySchedule_ID = 0; - int row = p_table.getSelectedRow(); - if (row >= 0) - { - Object value = p_table.getValueAt(row, INDEX_PAYSCHEDULE); - if (value != null && value instanceof KeyNamePair) - C_InvoicePaySchedule_ID = ((KeyNamePair)value).getKey(); - } - if (C_InvoicePaySchedule_ID <= 0) // not selected - Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_InvoicePaySchedule_ID", "0"); - else - Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_InvoicePaySchedule_ID", String.valueOf(C_InvoicePaySchedule_ID)); - } // saveSelectionDetail - - -} // InfoInvoice diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoOrder.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoOrder.java deleted file mode 100644 index fb000407aa..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoOrder.java +++ /dev/null @@ -1,394 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.Frame; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.logging.Level; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ALayout; -import org.compiere.apps.ALayoutConstraint; -import org.compiere.grid.ed.VCheckBox; -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VLookup; -import org.compiere.grid.ed.VNumber; -import org.compiere.minigrid.IDColumn; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MQuery; -import org.compiere.swing.CLabel; -import org.compiere.swing.CTextField; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Util; - -/** - * Info Order - * - * @author Jorg Janke - * @version $Id: InfoOrder.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class InfoOrder extends Info -{ - /** - * - */ - private static final long serialVersionUID = 2246871771555208114L; - - /** - * Detail Protected Contructor - * @param frame parent frame - * @param modal modal - * @param WindowNo window no - * @param value query value - * @param multiSelection multiple selections - * @param whereClause where clause - */ - public InfoOrder(Frame frame, boolean modal, int WindowNo, String value, - boolean multiSelection, String whereClause) - { - this(frame, modal, WindowNo, value, multiSelection, whereClause, true); - } - - /** - * Detail Protected Contructor - * @param frame parent frame - * @param modal modal - * @param WindowNo window no - * @param value query value - * @param multiSelection multiple selections - * @param whereClause where clause - * @param lookup - */ - public InfoOrder(Frame frame, boolean modal, int WindowNo, String value, - boolean multiSelection, String whereClause, boolean lookup) - { - super (frame, modal, WindowNo, "o", "C_Order_ID", multiSelection, whereClause, lookup); - log.info( "InfoOrder"); - setTitle(Msg.getMsg(Env.getCtx(), "InfoOrder")); - // - try - { - statInit(); - p_loadedOK = initInfo (); - } - catch (Exception e) - { - return; - } - // - int no = p_table.getRowCount(); - setStatusLine(Integer.toString(no) + " " + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false); - setStatusDB(Integer.toString(no)); - if (value != null && value.length() > 0) - { - fDocumentNo.setValue(value); - executeQuery(); - } - // - pack(); - // Focus - fDocumentNo.requestFocus(); - } // InfoOrder - - /** String Array of Column Info */ - //private Info_Column[] m_generalLayout; - /** list of query columns */ - //private ArrayList m_queryColumns = new ArrayList(); - /** Table Name */ - //private String m_tableName; - /** Key Column Name */ - //private String m_keyColumn; - - // Static Info - private CLabel lDocumentNo = new CLabel(Msg.translate(Env.getCtx(), "DocumentNo")); - private CTextField fDocumentNo = new CTextField(10); - private CLabel lDescription = new CLabel(Msg.translate(Env.getCtx(), "Description")); - private CTextField fDescription = new CTextField(10); - private CLabel lPOReference = new CLabel(Msg.translate(Env.getCtx(), "POReference")); - private CTextField fPOReference = new CTextField(10); - // -// private CLabel lOrg_ID = new CLabel(Msg.translate(Env.getCtx(), "AD_Org_ID")); -// private VLookup fOrg_ID; - private CLabel lBPartner_ID = new CLabel(Msg.translate(Env.getCtx(), "BPartner")); - private VLookup fBPartner_ID; - // - private CLabel lDateFrom = new CLabel(Msg.translate(Env.getCtx(), "DateOrdered")); - private VDate fDateFrom = new VDate("DateFrom", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateFrom")); - private CLabel lDateTo = new CLabel("-"); - private VDate fDateTo = new VDate("DateTo", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateTo")); - private CLabel lAmtFrom = new CLabel(Msg.translate(Env.getCtx(), "GrandTotal")); - private VNumber fAmtFrom = new VNumber("AmtFrom", false, false, true, DisplayType.Amount, Msg.translate(Env.getCtx(), "AmtFrom")); - private CLabel lAmtTo = new CLabel("-"); - private VNumber fAmtTo = new VNumber("AmtTo", false, false, true, DisplayType.Amount, Msg.translate(Env.getCtx(), "AmtTo")); - private VCheckBox fIsSOTrx = new VCheckBox ("IsSOTrx", false, false, true, Msg.translate(Env.getCtx(), "IsSOTrx"), "", false); - - /** Array of Column Info */ - private static final Info_Column[] s_invoiceLayout = { - new Info_Column(" ", "o.C_Order_ID", IDColumn.class), - new Info_Column(Msg.translate(Env.getCtx(), "C_BPartner_ID"), "(SELECT Name FROM C_BPartner bp WHERE bp.C_BPartner_ID=o.C_BPartner_ID)", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "DateOrdered"), "o.DateOrdered", Timestamp.class), - new Info_Column(Msg.translate(Env.getCtx(), "DocumentNo"), "o.DocumentNo", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "C_Currency_ID"), "(SELECT ISO_Code FROM C_Currency c WHERE c.C_Currency_ID=o.C_Currency_ID)", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "GrandTotal"), "o.GrandTotal", BigDecimal.class), - new Info_Column(Msg.translate(Env.getCtx(), "ConvertedAmount"), "currencyBase(o.GrandTotal,o.C_Currency_ID,o.DateAcct, o.AD_Client_ID,o.AD_Org_ID)", BigDecimal.class), - new Info_Column(Msg.translate(Env.getCtx(), "IsSOTrx"), "o.IsSOTrx", Boolean.class), - new Info_Column(Msg.translate(Env.getCtx(), "Description"), "o.Description", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "POReference"), "o.POReference", String.class) - }; - - /** - * Static Setup - add fields to parameterPanel - * @throws Exception if Lookups cannot be initialized - */ - private void statInit() throws Exception - { - lDocumentNo.setLabelFor(fDocumentNo); - fDocumentNo.setBackground(AdempierePLAF.getInfoBackground()); - fDocumentNo.addActionListener(this); - lDescription.setLabelFor(fDescription); - fDescription.setBackground(AdempierePLAF.getInfoBackground()); - fDescription.addActionListener(this); - lPOReference.setLabelFor(fPOReference); - fPOReference.setBackground(AdempierePLAF.getInfoBackground()); - fPOReference.addActionListener(this); - fIsSOTrx.setSelected(!"N".equals(Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx"))); - fIsSOTrx.addActionListener(this); - // - // fOrg_ID = new VLookup("AD_Org_ID", false, false, true, - // MLookupFactory.create(Env.getCtx(), 3486, m_WindowNo, DisplayType.TableDir, false), - // DisplayType.TableDir, m_WindowNo); - // lOrg_ID.setLabelFor(fOrg_ID); - // fOrg_ID.setBackground(AdempierePLAF.getInfoBackground()); - fBPartner_ID = new VLookup("C_BPartner_ID", false, false, true, - MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, 3499, DisplayType.Search)); - lBPartner_ID.setLabelFor(fBPartner_ID); - fBPartner_ID.setBackground(AdempierePLAF.getInfoBackground()); - // - lDateFrom.setLabelFor(fDateFrom); - fDateFrom.setBackground(AdempierePLAF.getInfoBackground()); - fDateFrom.setToolTipText(Msg.translate(Env.getCtx(), "DateFrom")); - lDateTo.setLabelFor(fDateTo); - fDateTo.setBackground(AdempierePLAF.getInfoBackground()); - fDateTo.setToolTipText(Msg.translate(Env.getCtx(), "DateTo")); - lAmtFrom.setLabelFor(fAmtFrom); - fAmtFrom.setBackground(AdempierePLAF.getInfoBackground()); - fAmtFrom.setToolTipText(Msg.translate(Env.getCtx(), "AmtFrom")); - lAmtTo.setLabelFor(fAmtTo); - fAmtTo.setBackground(AdempierePLAF.getInfoBackground()); - fAmtTo.setToolTipText(Msg.translate(Env.getCtx(), "AmtTo")); - // - parameterPanel.setLayout(new ALayout()); - // First Row - parameterPanel.add(lDocumentNo, new ALayoutConstraint(0,0)); - parameterPanel.add(fDocumentNo, null); - parameterPanel.add(lBPartner_ID, null); - parameterPanel.add(fBPartner_ID, null); - parameterPanel.add(fIsSOTrx, new ALayoutConstraint(0,5)); - // 2nd Row - parameterPanel.add(lDescription, new ALayoutConstraint(1,0)); - parameterPanel.add(fDescription, null); - parameterPanel.add(lDateFrom, null); - parameterPanel.add(fDateFrom, null); - parameterPanel.add(lDateTo, null); - parameterPanel.add(fDateTo, null); - // 3rd Row - parameterPanel.add(lPOReference, new ALayoutConstraint(2,0)); - parameterPanel.add(fPOReference, null); - parameterPanel.add(lAmtFrom, null); - parameterPanel.add(fAmtFrom, null); - parameterPanel.add(lAmtTo, null); - parameterPanel.add(fAmtTo, null); - // parameterPanel.add(lOrg_ID, null); - // parameterPanel.add(fOrg_ID, null); - } // statInit - - /** - * General Init - * @return true, if success - */ - private boolean initInfo () - { - // Set Defaults - String bp = Env.getContext(Env.getCtx(), p_WindowNo, "C_BPartner_ID"); - if (bp != null && bp.length() != 0) - fBPartner_ID.setValue(Integer.valueOf(bp)); - - // prepare table - StringBuilder where = new StringBuilder("o.IsActive='Y'"); - if (p_whereClause.length() > 0) - where.append(" AND ").append(Util.replace(p_whereClause, "C_Order.", "o.")); - prepareTable(s_invoiceLayout, - " C_Order o", - where.toString(), - "2,3,4"); - - return true; - } // initInfo - - - /************************************************************************** - * Construct SQL Where Clause and define parameters. - * (setParameters needs to set parameters) - * Includes first AND - * @return sql - */ - protected String getSQLWhere() - { - StringBuilder sql = new StringBuilder(); - if (fDocumentNo.getText().length() > 0) - sql.append(" AND UPPER(o.DocumentNo) LIKE ?"); - if (fDescription.getText().length() > 0) - sql.append(" AND UPPER(o.Description) LIKE ?"); - if (fPOReference.getText().length() > 0) - sql.append(" AND UPPER(o.POReference) LIKE ?"); - // - if (fBPartner_ID.getValue() != null) - sql.append(" AND o.C_BPartner_ID=?"); - // - if (fDateFrom.getValue() != null || fDateTo.getValue() != null) - { - Timestamp from = (Timestamp)fDateFrom.getValue(); - Timestamp to = (Timestamp)fDateTo.getValue(); - if (from == null && to != null) - sql.append(" AND TRUNC(o.DateOrdered) <= ?"); - else if (from != null && to == null) - sql.append(" AND TRUNC(o.DateOrdered) >= ?"); - else if (from != null && to != null) - sql.append(" AND TRUNC(o.DateOrdered) BETWEEN ? AND ?"); - } - // - if (fAmtFrom.getValue() != null || fAmtTo.getValue() != null) - { - BigDecimal from = (BigDecimal)fAmtFrom.getValue(); - BigDecimal to = (BigDecimal)fAmtTo.getValue(); - if (from == null && to != null) - sql.append(" AND o.GrandTotal <= ?"); - else if (from != null && to == null) - sql.append(" AND o.GrandTotal >= ?"); - else if (from != null && to != null) - sql.append(" AND o.GrandTotal BETWEEN ? AND ?"); - } - sql.append(" AND o.IsSOTrx=?"); - - if (log.isLoggable(Level.FINER)) log.finer(sql.toString()); - return sql.toString(); - } // getSQLWhere - - /** - * Set Parameters for Query. - * (as defined in getSQLWhere) - * @param pstmt statement - * @param forCount for counting records - * @throws SQLException - */ - protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException - { - int index = 1; - if (fDocumentNo.getText().length() > 0) - pstmt.setString(index++, getSQLText(fDocumentNo)); - if (fDescription.getText().length() > 0) - pstmt.setString(index++, getSQLText(fDescription)); - if (fPOReference.getText().length() > 0) - pstmt.setString(index++, getSQLText(fPOReference)); - // - if (fBPartner_ID.getValue() != null) - { - Integer bp = (Integer)fBPartner_ID.getValue(); - pstmt.setInt(index++, bp.intValue()); - if (log.isLoggable(Level.FINE)) log.fine("BPartner=" + bp); - } - // - if (fDateFrom.getValue() != null || fDateTo.getValue() != null) - { - Timestamp from = (Timestamp)fDateFrom.getValue(); - Timestamp to = (Timestamp)fDateTo.getValue(); - if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); - if (from == null && to != null) - pstmt.setTimestamp(index++, to); - else if (from != null && to == null) - pstmt.setTimestamp(index++, from); - else if (from != null && to != null) - { - pstmt.setTimestamp(index++, from); - pstmt.setTimestamp(index++, to); - } - } - // - if (fAmtFrom.getValue() != null || fAmtTo.getValue() != null) - { - BigDecimal from = (BigDecimal)fAmtFrom.getValue(); - BigDecimal to = (BigDecimal)fAmtTo.getValue(); - if (log.isLoggable(Level.FINE)) log.fine("Amt From=" + from + ", To=" + to); - if (from == null && to != null) - pstmt.setBigDecimal(index++, to); - else if (from != null && to == null) - pstmt.setBigDecimal(index++, from); - else if (from != null && to != null) - { - pstmt.setBigDecimal(index++, from); - pstmt.setBigDecimal(index++, to); - } - } - pstmt.setString(index++, fIsSOTrx.isSelected() ? "Y" : "N"); - } // setParameters - - /** - * Get SQL WHERE parameter - * @param f field - * @return sql - */ - private String getSQLText (CTextField f) - { - String s = f.getText().toUpperCase(); - if (!s.endsWith("%")) - s += "%"; - if (log.isLoggable(Level.FINE)) log.fine("String=" + s); - return s; - } // getSQLText - - - /** - * Zoom - */ - protected void zoom() - { - log.info(""); - Integer C_Order_ID = getSelectedRowKey(); - if (C_Order_ID == null) - return; - MQuery query = new MQuery("C_Order"); - query.addRestriction("C_Order_ID", MQuery.EQUAL, C_Order_ID); - query.setRecordCount(1); - int AD_WindowNo = getAD_Window_ID("C_Order", fIsSOTrx.isSelected()); - zoom (AD_WindowNo, query); - } // zoom - - /** - * Has Zoom - * @return true - */ - protected boolean hasZoom() - { - return true; - } // hasZoom - -} // InfoOrder diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoPAttribute.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoPAttribute.java deleted file mode 100644 index 08001591e4..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoPAttribute.java +++ /dev/null @@ -1,597 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.Box; -import javax.swing.JDialog; - -import org.compiere.apps.AEnv; -import org.compiere.apps.ALayout; -import org.compiere.apps.ALayoutConstraint; -import org.compiere.apps.ConfirmPanel; -import org.compiere.grid.ed.VComboBox; -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VLine; -import org.compiere.grid.ed.VNumber; -import org.compiere.grid.ed.VString; -import org.compiere.model.MAttribute; -import org.compiere.model.MAttributeSet; -import org.compiere.model.MRole; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -/** - * Search by Product Attribute. - * - * @author Jorg Janke - * @version $Id: InfoPAttribute.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class InfoPAttribute extends CDialog -{ - /** - * - */ - private static final long serialVersionUID = -4309055112258081495L; - - /* the attribute set selected on the InfoProduct window */ - private int p_M_AttributeSet_ID = 0; - - /** - * Constructor. - * Called from InfoProduct,cmd_InfoPAttribute - * @param parent - */ - public InfoPAttribute (JDialog parent) - { - super (parent, Msg.getMsg(Env.getCtx(), "InfoPAttribute"), true); - if (parent instanceof InfoProduct) { - p_M_AttributeSet_ID = ((InfoProduct)parent).getM_AttributeSet_ID(); - } - try - { - jbInit(); - dynInit(); - } - catch (Exception e) - { - log.log(Level.SEVERE, "InfoPAttribute", e); - } - AEnv.showCenterWindow(parent, this); - } // InfoPAttribute - - /** Resulting Query */ - private String m_query = ""; - /** Product Attribute Editors */ - private ArrayList m_productEditors = new ArrayList(); - private ArrayList m_productEditorsTo = new ArrayList(); - /** Instance Attribute Editors */ - private ArrayList m_instanceEditors = new ArrayList(); - private ArrayList m_instanceEditorsTo = new ArrayList(); - /** Logger */ - private static CLogger log = CLogger.getCLogger(InfoPAttribute.class); - - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel centerPanel = new CPanel(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - // - private CLabel serNoLabel = new CLabel(Msg.translate(Env.getCtx(), "SerNo")); - private VString serNoField = new VString("SerNo", false, false, true, 10, 20, null, null); - private CLabel lotLabel = new CLabel(Msg.translate(Env.getCtx(), "Lot")); - private VString lotField = new VString("Lot", false, false, true, 10, 20, null, null); - private VComboBox guaranteeDateSelection = null; - private VDate guaranteeDateField = new VDate ("GuaranteeDate", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "GuaranteeDate")); - private CLabel lotLabel2 = new CLabel(Msg.translate(Env.getCtx(), "M_Lot_ID")); - private VComboBox lotSelection = null; - // - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - this.getContentPane().add(mainPanel, BorderLayout.CENTER); - mainPanel.setLayout(mainLayout); - mainPanel.add(centerPanel, BorderLayout.CENTER); - centerPanel.setLayout(new ALayout()); - // ConfirmPanel - confirmPanel.addActionListener(this); - mainPanel.add(confirmPanel, BorderLayout.SOUTH); - } // jbInit - - /** - * Dynamic Init of the Center Panel - */ - private void dynInit() - { - int row = addAttributes(); - - boolean isGuarantee = true; - boolean isSerial = true; - boolean isLot = true; - if (p_M_AttributeSet_ID > 0) { - MAttributeSet as = new MAttributeSet(Env.getCtx(), p_M_AttributeSet_ID, null); - isGuarantee = as.isGuaranteeDate(); - isSerial = as.isSerNo(); - isLot = as.isLot(); - } - // - String s = Msg.translate(Env.getCtx(), "GuaranteeDate"); - guaranteeDateSelection = new VComboBox (new Object[] - {s + " <", s + " =", s + " >"}); - // guaranteeDateSelection.setPreferredSize(); - initLotSelection(); - // Fixed Instance Selection Fields - if (isSerial) { - centerPanel.add(serNoLabel, new ALayoutConstraint(row++, 0)); - centerPanel.add(serNoField, null); - } - if (isLot) { - centerPanel.add(lotLabel, new ALayoutConstraint(row++, 0)); - centerPanel.add(lotField, null); - centerPanel.add(lotLabel2, new ALayoutConstraint(row++, 0)); - centerPanel.add(lotSelection, null); - } - if (isGuarantee) { - centerPanel.add(guaranteeDateSelection, new ALayoutConstraint(row++, 0)); - centerPanel.add(guaranteeDateField, null); - } - // - Dimension d = centerPanel.getPreferredSize(); - d.width = 400; - centerPanel.setPreferredSize(d); - } // dynInit - - /** - * Add Attributes - * @return rows - */ - private int addAttributes() - { - int row = 0; - PreparedStatement pstmt = null; - ResultSet rs = null; - String whereAttributeSet; - if (p_M_AttributeSet_ID > 0) - whereAttributeSet = "AND M_Attribute_ID IN (SELECT M_Attribute_ID FROM M_AttributeUse WHERE M_AttributeSet_ID="+p_M_AttributeSet_ID+")"; - else - whereAttributeSet = ""; - String sql = MRole.getDefault().addAccessSQL( - "SELECT M_Attribute_ID, Name, Description, AttributeValueType, IsInstanceAttribute " - + "FROM M_Attribute " - + "WHERE IsActive='Y' " - + whereAttributeSet - + " ORDER BY IsInstanceAttribute, Name", - "M_Attribute", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - boolean instanceLine = false; - try - { - pstmt = DB.prepareStatement(sql, null); - rs = pstmt.executeQuery(); - while (rs.next()) - { - int attribute_ID = rs.getInt(1); - String name = rs.getString(2); - String description = rs.getString(3); - String attributeValueType = rs.getString(4); - boolean isInstanceAttribute = "Y".equals(rs.getString(5)); - // Instance switch - if (!instanceLine && isInstanceAttribute) - { - CPanel group = new CPanel(); - group.setBorder(new VLine(Msg.translate(Env.getCtx(), "IsInstanceAttribute"))); - group.add(Box.createVerticalStrut(VLine.SPACE)); - centerPanel.add(group, new ALayoutConstraint(row++, 0)); - instanceLine = true; - } - // - CLabel label = new CLabel(name); - if (description != null && description.length() > 0) - label.setToolTipText(description); - centerPanel.add(label, new ALayoutConstraint(row++, 0)); - Component field = null; - if (MAttribute.ATTRIBUTEVALUETYPE_List.equals(attributeValueType)) - field = new VComboBox(getAttributeList(attribute_ID)); - else if (MAttribute.ATTRIBUTEVALUETYPE_Number.equals(attributeValueType)) - field = new VNumber(name, false, false, true, DisplayType.Number, name); - else - field = new VString(name, false, false, true, 10, 40, null, null); - label.setLabelFor(field); - centerPanel.add(field, null); - // - field.setName(String.valueOf(attribute_ID)); - if (isInstanceAttribute) - m_instanceEditors.add(field); - else - m_productEditors.add(field); - - // To (numbers) - Component fieldTo = null; - if (MAttribute.ATTRIBUTEVALUETYPE_Number.equals(attributeValueType)) - { - fieldTo = new VNumber(name, false, false, true, DisplayType.Number, name); - centerPanel.add(new CLabel("-"), null); - centerPanel.add(fieldTo, null); - } - if (isInstanceAttribute) - m_instanceEditorsTo.add(fieldTo); - else - m_productEditorsTo.add(fieldTo); - } - } - catch (Exception e) - { - log.log(Level.SEVERE, sql, e); - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - - // print instance line if not printed - if (!instanceLine) { - boolean isGuarantee = true; - boolean isSerial = true; - boolean isLot = true; - if (p_M_AttributeSet_ID > 0) { - MAttributeSet as = new MAttributeSet(Env.getCtx(), p_M_AttributeSet_ID, null); - isGuarantee = as.isGuaranteeDate(); - isSerial = as.isSerNo(); - isLot = as.isLot(); - } - if (isGuarantee || isSerial || isLot) { - CPanel group = new CPanel(); - group.setBorder(new VLine(Msg.translate(Env.getCtx(), "IsInstanceAttribute"))); - group.add(Box.createVerticalStrut(VLine.SPACE)); - centerPanel.add(group, new ALayoutConstraint(row++, 0)); - instanceLine = true; - } - } - - return row; - } // addProductAttributes - - /** - * Get Attribute List - * @param M_Attribute_ID attribure - * @return array - */ - private KeyNamePair[] getAttributeList(int M_Attribute_ID) - { - ArrayList list = new ArrayList(); - list.add(new KeyNamePair(-1, "")); - - PreparedStatement pstmt = null; - ResultSet rs = null; - String sql = MRole.getDefault().addAccessSQL( - "SELECT M_AttributeValue_ID, Value, Name " - + "FROM M_AttributeValue " - + "WHERE M_Attribute_ID=? " - + "ORDER BY 2", - "M_AttributeValue", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, M_Attribute_ID); - rs = pstmt.executeQuery(); - while (rs.next()) - list.add(new KeyNamePair(rs.getInt(1), rs.getString(3))); - } - catch (Exception e) - { - log.log(Level.SEVERE, sql, e); - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - KeyNamePair[] retValue = new KeyNamePair[list.size()]; - list.toArray(retValue); - return retValue; - } // getAttributeList - - - /** - * Initialize Lot Selection - */ - private void initLotSelection() - { - ArrayList list = new ArrayList(); - list.add(new KeyNamePair(-1, "")); - - String whereAttributeSet; - if (p_M_AttributeSet_ID > 0) - whereAttributeSet = "AND M_Product_ID IN (SELECT M_Product_ID FROM M_Product WHERE M_AttributeSet_ID="+p_M_AttributeSet_ID+")"; - else - whereAttributeSet = ""; - String sql = MRole.getDefault().addAccessSQL( - "SELECT M_Lot_ID, Name FROM M_Lot WHERE IsActive='Y' " + whereAttributeSet + " ORDER BY 2", - "M_Lot", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - rs = pstmt.executeQuery(); - while (rs.next()) - list.add(new KeyNamePair(rs.getInt(1), rs.getString(2))); - } - catch (Exception e) - { - log.log(Level.SEVERE, sql, e); - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - // Create List - KeyNamePair[] items = new KeyNamePair[list.size()]; - list.toArray(items); - lotSelection = new VComboBox(items); - } // initLotSelection - - - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - createQuery(); - dispose(); - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - m_query = null; - dispose(); - } - } // actionPerformed - - /** - * Create Query - * - * Available synonyms: - * M_Product p - * M_ProductPrice pr - * M_AttributeSet pa - * - * @return query - */ - private String createQuery() - { - /** Base Query - SELECT * - FROM M_Product p - INNER JOIN M_ProductPrice pr ON (p.M_Product_ID=pr.M_Product_ID) - LEFT OUTER JOIN M_AttributeSet pa ON (p.M_AttributeSet_ID=pa.M_AttributeSet_ID) - WHERE - **/ - - /*** Instance Attributes */ - StringBuilder sb = new StringBuilder(); - // Serial No - String s = serNoField.getText(); - if (s != null && s.length() > 0) - { - sb.append(" AND asi.SerNo"); - if (s.indexOf('%') == -1 && s.indexOf('_') == 1) - sb.append("="); - else - sb.append(" LIKE "); - sb.append(DB.TO_STRING(s)); - } - // Lot Number - s = lotField.getText(); - if (s != null && s.length() > 0) - { - sb.append(" AND asi.Lot"); - if (s.indexOf('%') == -1 && s.indexOf('_') == 1) - sb.append("="); - else - sb.append(" LIKE "); - sb.append(DB.TO_STRING(s)); - } - // Lot ID - KeyNamePair pp = (KeyNamePair)lotSelection.getSelectedItem(); - if (pp != null && pp.getKey() != -1) - { - int ID = pp.getKey(); - sb.append(" AND asi.M_Lot_ID=").append(ID); - } - - // Guarantee Date - Timestamp ts = (Timestamp)guaranteeDateField.getValue(); - if (ts != null) - { - sb.append(" AND TRUNC(asi.GuaranteeDate)"); - int index = guaranteeDateSelection.getSelectedIndex(); // < = > - if (index == 0) - sb.append("<"); - else if (index == 1) - sb.append("="); - else - sb.append(">"); - sb.append(DB.TO_DATE(ts,true)); - } - - // Instance Editors - for (int i = 0; i < m_instanceEditors.size(); i++) - { - StringBuffer iAttr = new StringBuffer(); - Component c = (Component)m_instanceEditors.get(i); - Component cTo = (Component)m_instanceEditorsTo.get(i); - int M_Attribute_ID = Integer.parseInt(c.getName()); - if (c instanceof VComboBox) - { - VComboBox field = (VComboBox)c; - pp = (KeyNamePair)field.getSelectedItem(); - if (pp != null && pp.getKey() != -1) - { - iAttr.append("M_Attribute_ID=").append(M_Attribute_ID) - .append(" AND M_AttributeValue_ID=").append(pp.getKey()); - } - } - else if (c instanceof VNumber) - { - VNumber field = (VNumber)c; - BigDecimal value = (BigDecimal)field.getValue(); - VNumber fieldTo = (VNumber)cTo; - BigDecimal valueTo = (BigDecimal)fieldTo.getValue(); - if (value != null || valueTo != null) - { - iAttr.append("M_Attribute_ID=").append(M_Attribute_ID) - .append(" AND ValueNumber"); - if (value != null && valueTo == null) - iAttr.append("=").append(value); - else if (value == null && valueTo != null) - iAttr.append("<=").append(valueTo); - else if (value != null && valueTo != null) - iAttr.append(" BETWEEN ").append(value) - .append(" AND ").append(valueTo); - } - } - else - { - VString field = (VString)c; - String value = field.getText(); - if (value != null && value.length() > 0) - { - iAttr.append("M_Attribute_ID=").append(M_Attribute_ID) - .append(" AND Value"); - if (value.indexOf('%') == -1 && value.indexOf('_') == -1) - iAttr.append("="); - else - iAttr.append(" LIKE "); - iAttr.append(DB.TO_STRING(value)); - } - } - // Add to where - if (iAttr.length() > 0) - sb.append(" AND asi.M_AttributeSetInstance_ID IN " - + "(SELECT M_AttributeSetInstance_ID FROM M_AttributeInstance " - + "WHERE ") - .append(iAttr).append(")"); - } - - // finish Instance Attributes - if (sb.length() > 0) - { - sb.insert(0, " AND EXISTS (SELECT * FROM M_Storage s" - + " INNER JOIN M_AttributeSetInstance asi ON (s.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID) " - + "WHERE s.M_Product_ID=p.M_Product_ID"); - sb.append(")"); - } - - - // Product Attributes - for (int i = 0; i < m_productEditors.size(); i++) - { - StringBuffer pAttr = new StringBuffer(); - Component c = (Component)m_productEditors.get(i); - Component cTo = (Component)m_productEditorsTo.get(i); - int M_Attribute_ID = Integer.parseInt(c.getName()); - if (c instanceof VComboBox) - { - VComboBox field = (VComboBox)c; - pp = (KeyNamePair)field.getSelectedItem(); - if (pp != null && pp.getKey() != -1) - { - pAttr.append("M_Attribute_ID=").append(M_Attribute_ID) - .append(" AND M_AttributeValue_ID=").append(pp.getKey()); - } - } - else if (c instanceof VNumber) - { - VNumber field = (VNumber)c; - BigDecimal value = (BigDecimal)field.getValue(); - VNumber fieldTo = (VNumber)cTo; - BigDecimal valueTo = (BigDecimal)fieldTo.getValue(); - if (value != null || valueTo != null) - { - pAttr.append("M_Attribute_ID=").append(M_Attribute_ID) - .append(" AND ValueNumber"); - if (value != null && valueTo == null) - pAttr.append("=").append(value); - else if (value == null && valueTo != null) - pAttr.append("<=").append(valueTo); - else if (value != null && valueTo != null) - pAttr.append(" BETWEEN ").append(value) - .append(" AND ").append(valueTo); - } - } - else - { - VString field = (VString)c; - String value = field.getText(); - if (value != null && value.length() > 0) - { - pAttr.append("M_Attribute_ID=").append(M_Attribute_ID) - .append(" AND Value"); - if (value.indexOf('%') == -1 && value.indexOf('_') == -1) - pAttr.append("="); - else - pAttr.append(" LIKE "); - pAttr.append(DB.TO_STRING(value)); - } - } - // Add to Where - if (pAttr.length() > 0) - sb.append(" AND p.M_AttributeSetInstance_ID IN " - + "(SELECT M_AttributeSetInstance_ID " - + "FROM M_AttributeInstance WHERE ") - .append(pAttr).append(")"); - } - // - m_query = null; - if (sb.length() > 0) - m_query = sb.toString(); - log.config(m_query); - return m_query; - } // createQuery - - /** - * Get resulting Query WHERE - * @return query or null - */ - public String getWhereClause() - { - return m_query; - } // getQuery - -} // InfoPAttribute diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoPayment.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoPayment.java deleted file mode 100644 index 87afc3e650..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoPayment.java +++ /dev/null @@ -1,385 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.Frame; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.logging.Level; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ALayout; -import org.compiere.apps.ALayoutConstraint; -import org.compiere.grid.ed.VCheckBox; -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VLookup; -import org.compiere.grid.ed.VNumber; -import org.compiere.minigrid.IDColumn; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MQuery; -import org.compiere.swing.CLabel; -import org.compiere.swing.CTextField; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Util; - -/** - * Info Payment - * - * @author Jorg Janke - * @version $Id: InfoPayment.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class InfoPayment extends Info -{ - /** - * - */ - private static final long serialVersionUID = -2917241055484901704L; - - /** - * Detail Protected Contructor - * @param frame parent frame - * @param modal modal - * @param WindowNo window no - * @param value query value - * @param multiSelection multiple selections - * @param whereClause whwre clause - */ - public InfoPayment(Frame frame, boolean modal, int WindowNo, String value, - boolean multiSelection, String whereClause) - { - this(frame, modal, WindowNo, value, multiSelection, whereClause, true); - } - - /** - * Detail Protected Contructor - * @param frame parent frame - * @param modal modal - * @param WindowNo window no - * @param value query value - * @param multiSelection multiple selections - * @param whereClause whwre clause - * @param lookup - */ - public InfoPayment(Frame frame, boolean modal, int WindowNo, String value, - boolean multiSelection, String whereClause, boolean lookup) - { - super (frame, modal, WindowNo, "p", "C_Payment_ID", multiSelection, whereClause, lookup); - log.info( "InfoPayment"); - setTitle(Msg.getMsg(Env.getCtx(), "InfoPayment")); - // - try - { - statInit(); - p_loadedOK = initInfo (); - } - catch (Exception e) - { - return; - } - // - int no = p_table.getRowCount(); - setStatusLine(Integer.toString(no) + " " + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false); - setStatusDB(Integer.toString(no)); - if (value != null && value.length() > 0) - { - fDocumentNo.setValue(value); - executeQuery(); - } - // - pack(); - // Focus - fDocumentNo.requestFocus(); - } // InfoPayment - - /** String Array of Column Info */ - //private Info_Column[] m_generalLayout; - /** list of query columns */ - //private ArrayList m_queryColumns = new ArrayList(); - /** Table Name */ - //private String m_tableName; - /** Key Column Name */ - //private String m_keyColumn; - - // Static Info - private CLabel lDocumentNo = new CLabel(Msg.translate(Env.getCtx(), "DocumentNo")); - private CTextField fDocumentNo = new CTextField(10); - // -// private CLabel lOrg_ID = new CLabel(Msg.translate(Env.getCtx(), "AD_Org_ID")); -// private VLookup fOrg_ID; - private CLabel lBPartner_ID = new CLabel(Msg.translate(Env.getCtx(), "BPartner")); - private VLookup fBPartner_ID; - // - private CLabel lDateFrom = new CLabel(Msg.translate(Env.getCtx(), "DateTrx")); - private VDate fDateFrom = new VDate("DateFrom", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateFrom")); - private CLabel lDateTo = new CLabel("-"); - private VDate fDateTo = new VDate("DateTo", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateTo")); - private CLabel lAmtFrom = new CLabel(Msg.translate(Env.getCtx(), "PayAmt")); - private VNumber fAmtFrom = new VNumber("AmtFrom", false, false, true, DisplayType.Amount, Msg.translate(Env.getCtx(), "AmtFrom")); - private CLabel lAmtTo = new CLabel("-"); - private VNumber fAmtTo = new VNumber("AmtTo", false, false, true, DisplayType.Amount, Msg.translate(Env.getCtx(), "AmtTo")); - private VCheckBox fIsReceipt = new VCheckBox ("IsReceipt", false, false, true, Msg.translate(Env.getCtx(), "IsReceipt"), "", false); - - /** Array of Column Info */ - private static final Info_Column[] s_paymentLayout = { - new Info_Column(" ", "p.C_Payment_ID", IDColumn.class), - new Info_Column(Msg.translate(Env.getCtx(), "C_BankAccount_ID"), - "(SELECT b.Name || ' ' || ba.AccountNo FROM C_Bank b, C_BankAccount ba WHERE b.C_Bank_ID=ba.C_Bank_ID AND ba.C_BankAccount_ID=p.C_BankAccount_ID)", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "C_BPartner_ID"), - "(SELECT Name FROM C_BPartner bp WHERE bp.C_BPartner_ID=p.C_BPartner_ID)", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "DateTrx"), - "p.DateTrx", Timestamp.class), - new Info_Column(Msg.translate(Env.getCtx(), "DocumentNo"), - "p.DocumentNo", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "IsReceipt"), - "p.IsReceipt", Boolean.class), - new Info_Column(Msg.translate(Env.getCtx(), "C_Currency_ID"), - "(SELECT ISO_Code FROM C_Currency c WHERE c.C_Currency_ID=p.C_Currency_ID)", String.class), - new Info_Column(Msg.translate(Env.getCtx(), "PayAmt"), - "p.PayAmt", BigDecimal.class), - new Info_Column(Msg.translate(Env.getCtx(), "ConvertedAmount"), - "currencyBase(p.PayAmt,p.C_Currency_ID,p.DateTrx, p.AD_Client_ID,p.AD_Org_ID)", BigDecimal.class), - new Info_Column(Msg.translate(Env.getCtx(), "DiscountAmt"), - "p.DiscountAmt", BigDecimal.class), - new Info_Column(Msg.translate(Env.getCtx(), "WriteOffAmt"), - "p.WriteOffAmt", BigDecimal.class), - new Info_Column(Msg.translate(Env.getCtx(), "IsAllocated"), - "p.IsAllocated", Boolean.class) - }; - - /** - * Static Setup - add fields to parameterPanel - * @throws Exception if Lookups cannot be created - */ - private void statInit() throws Exception - { - lDocumentNo.setLabelFor(fDocumentNo); - fDocumentNo.setBackground(AdempierePLAF.getInfoBackground()); - fDocumentNo.addActionListener(this); - fIsReceipt.setSelected(!"N".equals(Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx"))); - fIsReceipt.addActionListener(this); - // - // fOrg_ID = new VLookup("AD_Org_ID", false, false, true, - // MLookupFactory.create(Env.getCtx(), 3486, m_WindowNo, DisplayType.TableDir, false), - // DisplayType.TableDir, m_WindowNo); - // lOrg_ID.setLabelFor(fOrg_ID); - // fOrg_ID.setBackground(AdempierePLAF.getInfoBackground()); - fBPartner_ID = new VLookup("C_BPartner_ID", false, false, true, - MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, 3499, DisplayType.Search)); - lBPartner_ID.setLabelFor(fBPartner_ID); - fBPartner_ID.setBackground(AdempierePLAF.getInfoBackground()); - // - lDateFrom.setLabelFor(fDateFrom); - fDateFrom.setBackground(AdempierePLAF.getInfoBackground()); - fDateFrom.setToolTipText(Msg.translate(Env.getCtx(), "DateFrom")); - lDateTo.setLabelFor(fDateTo); - fDateTo.setBackground(AdempierePLAF.getInfoBackground()); - fDateTo.setToolTipText(Msg.translate(Env.getCtx(), "DateTo")); - lAmtFrom.setLabelFor(fAmtFrom); - fAmtFrom.setBackground(AdempierePLAF.getInfoBackground()); - fAmtFrom.setToolTipText(Msg.translate(Env.getCtx(), "AmtFrom")); - lAmtTo.setLabelFor(fAmtTo); - fAmtTo.setBackground(AdempierePLAF.getInfoBackground()); - fAmtTo.setToolTipText(Msg.translate(Env.getCtx(), "AmtTo")); - // - parameterPanel.setLayout(new ALayout()); - // First Row - parameterPanel.add(lDocumentNo, new ALayoutConstraint(0,0)); - parameterPanel.add(fDocumentNo, null); - parameterPanel.add(lBPartner_ID, null); - parameterPanel.add(fBPartner_ID, null); - parameterPanel.add(fIsReceipt, new ALayoutConstraint(0,5)); - // 2nd Row - parameterPanel.add(lDateFrom, new ALayoutConstraint(1,2)); - parameterPanel.add(fDateFrom, null); - parameterPanel.add(lDateTo, null); - parameterPanel.add(fDateTo, null); - // 3rd Row - parameterPanel.add(lAmtFrom, new ALayoutConstraint(2,2)); - parameterPanel.add(fAmtFrom, null); - parameterPanel.add(lAmtTo, null); - parameterPanel.add(fAmtTo, null); - // parameterPanel.add(lOrg_ID, null); - // parameterPanel.add(fOrg_ID, null); - } // statInit - - /** - * General Init - * @return true, if success - */ - private boolean initInfo () - { - // Set Defaults - String bp = Env.getContext(Env.getCtx(), p_WindowNo, "C_BPartner_ID"); - if (bp != null && bp.length() != 0) - fBPartner_ID.setValue(Integer.valueOf(bp)); - - // prepare table - StringBuilder where = new StringBuilder("p.IsActive='Y'"); - if (p_whereClause.length() > 0) - where.append(" AND ").append(Util.replace(p_whereClause, "C_Payment.", "p.")); - prepareTable(s_paymentLayout, - " C_Payment_v p", - where.toString(), - "2,3,4"); - // - // MPayment.setIsAllocated(Env.getCtx(), 0, null); - return true; - } // initInfo - - - /************************************************************************** - * Construct SQL Where Clause and define parameters - * (setParameters needs to set parameters) - * Includes first AND - * @return sql where clause - */ - protected String getSQLWhere() - { - StringBuilder sql = new StringBuilder(); - if (fDocumentNo.getText().length() > 0) - sql.append(" AND UPPER(p.DocumentNo) LIKE ?"); - // - if (fBPartner_ID.getValue() != null) - sql.append(" AND p.C_BPartner_ID=?"); - // - if (fDateFrom.getValue() != null || fDateTo.getValue() != null) - { - Timestamp from = (Timestamp)fDateFrom.getValue(); - Timestamp to = (Timestamp)fDateTo.getValue(); - if (from == null && to != null) - sql.append(" AND TRUNC(p.DateTrx) <= ?"); - else if (from != null && to == null) - sql.append(" AND TRUNC(p.DateTrx) >= ?"); - else if (from != null && to != null) - sql.append(" AND TRUNC(p.DateTrx) BETWEEN ? AND ?"); - } - // - if (fAmtFrom.getValue() != null || fAmtTo.getValue() != null) - { - BigDecimal from = (BigDecimal)fAmtFrom.getValue(); - BigDecimal to = (BigDecimal)fAmtTo.getValue(); - if (from == null && to != null) - sql.append(" AND p.PayAmt <= ?"); - else if (from != null && to == null) - sql.append(" AND p.PayAmt >= ?"); - else if (from != null && to != null) - sql.append(" AND p.PayAmt BETWEEN ? AND ?"); - } - sql.append(" AND p.IsReceipt=?"); - - if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); - return sql.toString(); - } // getSQLWhere - - /** - * Set Parameters for Query. - * (as defined in getSQLWhere) - * @param pstmt statement - * @param forCount for counting records - * @throws SQLException - */ - protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException - { - int index = 1; - if (fDocumentNo.getText().length() > 0) - pstmt.setString(index++, getSQLText(fDocumentNo)); - // - if (fBPartner_ID.getValue() != null) - { - Integer bp = (Integer)fBPartner_ID.getValue(); - pstmt.setInt(index++, bp.intValue()); - if (log.isLoggable(Level.FINE)) log.fine("BPartner=" + bp); - } - // - if (fDateFrom.getValue() != null || fDateTo.getValue() != null) - { - Timestamp from = (Timestamp)fDateFrom.getValue(); - Timestamp to = (Timestamp)fDateTo.getValue(); - if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); - if (from == null && to != null) - pstmt.setTimestamp(index++, to); - else if (from != null && to == null) - pstmt.setTimestamp(index++, from); - else if (from != null && to != null) - { - pstmt.setTimestamp(index++, from); - pstmt.setTimestamp(index++, to); - } - } - // - if (fAmtFrom.getValue() != null || fAmtTo.getValue() != null) - { - BigDecimal from = (BigDecimal)fAmtFrom.getValue(); - BigDecimal to = (BigDecimal)fAmtTo.getValue(); - if (log.isLoggable(Level.FINE)) log.fine("Amt From=" + from + ", To=" + to); - if (from == null && to != null) - pstmt.setBigDecimal(index++, to); - else if (from != null && to == null) - pstmt.setBigDecimal(index++, from); - else if (from != null && to != null) - { - pstmt.setBigDecimal(index++, from); - pstmt.setBigDecimal(index++, to); - } - } - pstmt.setString(index++, fIsReceipt.isSelected() ? "Y" : "N"); - } // setParameters - - /** - * Get SQL WHERE parameter - * @param f field - * @return Upper case text with % at the end - */ - private String getSQLText (CTextField f) - { - String s = f.getText().toUpperCase(); - if (!s.endsWith("%")) - s += "%"; - if (log.isLoggable(Level.FINE)) log.fine( "String=" + s); - return s; - } // getSQLText - - /** - * Zoom - */ - protected void zoom() - { - log.info( "InfoPayment.zoom"); - Integer C_Payment_ID = getSelectedRowKey(); - if (C_Payment_ID == null) - return; - MQuery query = new MQuery("C_Payment"); - query.addRestriction("C_Payment_ID", MQuery.EQUAL, C_Payment_ID); - query.setRecordCount(1); - int AD_WindowNo = getAD_Window_ID("C_Payment", fIsReceipt.isSelected()); - zoom (AD_WindowNo, query); - } // zoom - - /** - * Has Zoom - * @return true - */ - protected boolean hasZoom() - { - return true; - } // hasZoom - -} // InfoPayment diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java deleted file mode 100644 index d9d600e5bd..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java +++ /dev/null @@ -1,1412 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.JScrollPane; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.plaf.ColorUIResource; -import javax.swing.table.DefaultTableModel; - -import org.adempiere.plaf.AdempierePLAF; -import org.adempiere.plaf.AdempiereTaskPaneUI; -import org.compiere.apps.AEnv; -import org.compiere.apps.ALayout; -import org.compiere.apps.ALayoutConstraint; -import org.compiere.apps.ConfirmPanel; -import org.compiere.grid.ed.VComboBox; -import org.compiere.minigrid.ColumnInfo; -import org.compiere.minigrid.IDColumn; -import org.compiere.minigrid.MiniTable; -import org.compiere.model.MDocType; -import org.compiere.model.MQuery; -import org.compiere.model.MRole; -import org.compiere.swing.CButton; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTabbedPane; -import org.compiere.swing.CTextArea; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogMgt; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; -import org.compiere.util.Util; -import org.jdesktop.swingx.JXTaskPane; - - -/** - * Search Product and return selection - * - * @author Jorg Janke - * @version $Id: InfoProduct.java,v 1.4 2006/07/30 00:51:27 jjanke Exp $ - * - * @author Bogdan Ioan, SC ARHIPAC SERVICE SRL - *
  • FR [ 2012362 ] Info Product: Add Product Category - */ -public class InfoProduct extends Info implements ActionListener, ChangeListener -{ - /** - * - */ - private static final long serialVersionUID = -2119729271332154941L; - - /** - * Standard Constructor - * @param frame frame - * @param modal modal - * @param WindowNo window no - * @param M_Warehouse_ID warehouse - * @param M_PriceList_ID price list - * @param value Query Value or Name if enclosed in @ - * @param multiSelection multiple selections - * @param whereClause where clause - */ - public InfoProduct(Frame frame, boolean modal, int WindowNo, - int M_Warehouse_ID, int M_PriceList_ID, String value, - boolean multiSelection, String whereClause) - { - this(frame, modal, WindowNo, M_Warehouse_ID, M_PriceList_ID, value, multiSelection, whereClause, true); - } - - /** - * Standard Constructor - * @param frame frame - * @param modal modal - * @param WindowNo window no - * @param M_Warehouse_ID warehouse - * @param M_PriceList_ID price list - * @param value Query Value or Name if enclosed in @ - * @param multiSelection multiple selections - * @param whereClause where clause - */ - public InfoProduct(Frame frame, boolean modal, int WindowNo, - int M_Warehouse_ID, int M_PriceList_ID, String value, - boolean multiSelection, String whereClause, boolean lookup) - { - super (frame, modal, WindowNo, "p", "M_Product_ID", multiSelection, whereClause, lookup); - if (log.isLoggable(Level.INFO)) log.info(value + ", Wh=" + M_Warehouse_ID + ", PL=" + M_PriceList_ID + ", WHERE=" + whereClause); - setTitle(Msg.getMsg(Env.getCtx(), "InfoProduct")); - // - statInit(); - initInfo (value, M_Warehouse_ID, M_PriceList_ID); - m_C_BPartner_ID = Env.getContextAsInt(Env.getCtx(), WindowNo, "C_BPartner_ID"); - - // - int no = p_table.getRowCount(); - setStatusLine(Integer.toString(no) + " " + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false); - setStatusDB(Integer.toString(no)); - // AutoQuery - if (value != null && value.length() > 0) - executeQuery(); - p_loadedOK = true; - // Focus - fieldValue.requestFocus(); - - //Begin - fer_luck @ centuryon - mWindowNo = WindowNo; - //End - fer_luck @ centuryon - AEnv.positionCenterWindow(frame, this); - } // InfoProduct - - /** SQL From */ - private static final String s_productFrom = - "M_Product p" - + " LEFT OUTER JOIN M_ProductPrice pr ON (p.M_Product_ID=pr.M_Product_ID AND pr.IsActive='Y')" - + " LEFT OUTER JOIN M_AttributeSet pa ON (p.M_AttributeSet_ID=pa.M_AttributeSet_ID)" - + " LEFT OUTER JOIN M_Product_PO ppo ON (p.M_Product_ID=ppo.M_Product_ID and ppo.IsCurrentVendor='Y' and ppo.IsActive='Y')" - + " LEFT OUTER JOIN C_BPartner bp ON (ppo.C_BPartner_ID=bp.C_BPartner_ID)"; - - /** Array of Column Info */ - private static Info_Column[] s_productLayout = null; - private static int INDEX_NAME = 0; - private static int INDEX_PATTRIBUTE = 0; - - // - private CLabel labelValue = new CLabel(); - private CTextField fieldValue = new CTextField(10); - private CLabel labelName = new CLabel(); - private CTextField fieldName = new CTextField(10); - private CLabel labelUPC = new CLabel(); - private CTextField fieldUPC = new CTextField(10); - private CLabel labelSKU = new CLabel(); - private CTextField fieldSKU = new CTextField(10); - private CLabel labelPriceList = new CLabel(); - private VComboBox pickPriceList = new VComboBox(); - private CLabel labelWarehouse = new CLabel(); - private VComboBox pickWarehouse = new VComboBox(); - private CLabel labelVendor = new CLabel(); - private CTextField fieldVendor = new CTextField(10); - private CLabel labelProductCategory = new CLabel(); - private VComboBox pickProductCategory = new VComboBox(); - private CLabel labelAS = new CLabel(); // @Trifon - private VComboBox pickAS = new VComboBox(); // @Trifon - - //Begin - fer_luck @ centuryon - private CTextArea fieldDescription = new CTextArea(); - JXTaskPane warehouseStockPanel = new JXTaskPane(); - CPanel tablePanel = new CPanel(); - MiniTable warehouseTbl = new MiniTable(); - String m_sqlWarehouse; - MiniTable substituteTbl = new MiniTable(); - String m_sqlSubstitute; - MiniTable relatedTbl = new MiniTable(); - String m_sqlRelated; - //Available to Promise Tab - private MiniTable m_tableAtp = new MiniTable(); - private DefaultTableModel m_modelAtp = null; - private int m_M_Product_ID = 0; - int mWindowNo = 0; - //End - fer_luck @ centuryon - - //IDEMPIERE-339 - MiniTable productpriceTbl = new MiniTable(); - String m_sqlProductprice; - - /** Search Button */ - private CButton m_InfoPAttributeButton = new CButton(Env.getImageIcon("PAttribute16.gif")); - /** Instance Button */ - private CButton m_PAttributeButton = null; - /** ASI */ - private int m_M_AttributeSetInstance_ID = -1; - /** Locator */ - private int m_M_Locator_ID = 0; - - private String m_pAttributeWhere = null; - private int m_C_BPartner_ID = 0; - - /** - * Static Setup - add fields to parameterPanel - */ - private void statInit() - { - labelValue.setText(Msg.getMsg(Env.getCtx(), "Value")); - fieldValue.setBackground(AdempierePLAF.getInfoBackground()); - fieldValue.addActionListener(this); - - labelName.setText(Msg.getMsg(Env.getCtx(), "Name")); - fieldName.setBackground(AdempierePLAF.getInfoBackground()); - fieldName.addActionListener(this); - - labelUPC.setText(Msg.translate(Env.getCtx(), "UPC")); - fieldUPC.setBackground(AdempierePLAF.getInfoBackground()); - fieldUPC.addActionListener(this); - - labelSKU.setText(Msg.translate(Env.getCtx(), "SKU")); - fieldSKU.setBackground(AdempierePLAF.getInfoBackground()); - fieldSKU.addActionListener(this); - - labelWarehouse.setText(Msg.getMsg(Env.getCtx(), "Warehouse")); - pickWarehouse.setBackground(AdempierePLAF.getInfoBackground()); - - labelPriceList.setText(Msg.getMsg(Env.getCtx(), "PriceListVersion")); - pickPriceList.setBackground(AdempierePLAF.getInfoBackground()); - - labelProductCategory.setText(Msg.translate(Env.getCtx(), "M_Product_Category_ID")); - pickProductCategory.setBackground(AdempierePLAF.getInfoBackground()); - - // @Trifon - labelAS.setText(Msg.translate(Env.getCtx(), "M_AttributeSet_ID")); - pickAS.setBackground(AdempierePLAF.getInfoBackground()); - - m_InfoPAttributeButton.setMargin(new Insets(2,2,2,2)); - m_InfoPAttributeButton.setToolTipText(Msg.getMsg(Env.getCtx(), "InfoPAttribute")); - m_InfoPAttributeButton.addActionListener(this); - - labelVendor.setText(Msg.translate(Env.getCtx(), "Vendor")); - fieldVendor.setBackground(AdempierePLAF.getInfoBackground()); - fieldVendor.addActionListener(this); - - // Line 1 - parameterPanel.setLayout(new ALayout()); - parameterPanel.add(labelValue, new ALayoutConstraint(0,0)); - parameterPanel.add(fieldValue, null); - parameterPanel.add(labelUPC, null); - parameterPanel.add(fieldUPC, null); - parameterPanel.add(labelWarehouse, null); - parameterPanel.add(pickWarehouse, null); - parameterPanel.add(m_InfoPAttributeButton); - // Line 2 - parameterPanel.add(labelName, new ALayoutConstraint(1,0)); - parameterPanel.add(fieldName, null); - parameterPanel.add(labelSKU, null); - parameterPanel.add(fieldSKU, null); - parameterPanel.add(labelVendor, null); - parameterPanel.add(fieldVendor, null); - - // Line 3 - parameterPanel.add(labelPriceList, new ALayoutConstraint(2,0)); - parameterPanel.add(pickPriceList, null); - parameterPanel.add(labelProductCategory, null); - parameterPanel.add(pickProductCategory, null); - parameterPanel.add(labelAS, null); // @Trifon - parameterPanel.add(pickAS, null); // @Trifon - - // Product Attribute Instance - m_PAttributeButton = ConfirmPanel.createPAttributeButton(true); - confirmPanel.addButton(m_PAttributeButton); - m_PAttributeButton.addActionListener(this); - m_PAttributeButton.setEnabled(false); - - //Begin - fer_luck @ centuryon - //add taskpane - fieldDescription.setBackground(AdempierePLAF.getInfoBackground()); - fieldDescription.setEditable(false); - fieldDescription.setPreferredSize(new Dimension(INFO_WIDTH - 100, 100)); - - warehouseStockPanel.setTitle(Msg.translate(Env.getCtx(), "WarehouseStock")); - warehouseStockPanel.setUI(new AdempiereTaskPaneUI()); - warehouseStockPanel.getContentPane().setBackground(new ColorUIResource(251,248,241)); - warehouseStockPanel.getContentPane().setForeground(new ColorUIResource(251,0,0)); - - ColumnInfo[] s_layoutWarehouse = new ColumnInfo[]{ - new ColumnInfo(Msg.translate(Env.getCtx(), "Warehouse"), "Warehouse", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "QtyAvailable"), "sum(QtyAvailable)", Double.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOnHand"), "sum(QtyOnHand)", Double.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "QtyReserved"), "sum(QtyReserved)", Double.class)}; - /** From Clause */ - String s_sqlFrom = " M_PRODUCT_STOCK_V "; - /** Where Clause */ - String s_sqlWhere = "Value = ?"; - m_sqlWarehouse = warehouseTbl.prepareTable(s_layoutWarehouse, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_STOCK_V"); - m_sqlWarehouse += " GROUP BY Warehouse"; - warehouseTbl.setRowSelectionAllowed(true); - warehouseTbl.setMultiSelection(false); - warehouseTbl.addMouseListener(this); - warehouseTbl.getSelectionModel().addListSelectionListener(this); - warehouseTbl.setShowTotals(true); - warehouseTbl.autoSize(); - - ColumnInfo[] s_layoutSubstitute = new ColumnInfo[]{ - new ColumnInfo(Msg.translate(Env.getCtx(), "Warehouse"), "orgname", String.class), - new ColumnInfo( - Msg.translate(Env.getCtx(), "Value"), - "(Select Value from M_Product p where p.M_Product_ID=M_PRODUCT_SUBSTITUTERELATED_V.Substitute_ID)", - String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "Name", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "QtyAvailable"), "QtyAvailable", Double.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOnHand"), "QtyOnHand", Double.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "QtyReserved"), "QtyReserved", Double.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "PriceStd"), "PriceStd", Double.class)}; - s_sqlFrom = "M_PRODUCT_SUBSTITUTERELATED_V"; - s_sqlWhere = "M_Product_ID = ? AND M_PriceList_Version_ID = ? and RowType = 'S'"; - m_sqlSubstitute = substituteTbl.prepareTable(s_layoutSubstitute, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_SUBSTITUTERELATED_V"); - substituteTbl.setRowSelectionAllowed(false); - substituteTbl.setMultiSelection(false); - substituteTbl.addMouseListener(this); - substituteTbl.getSelectionModel().addListSelectionListener(this); - substituteTbl.autoSize(); - - ColumnInfo[] s_layoutRelated = new ColumnInfo[]{ - new ColumnInfo(Msg.translate(Env.getCtx(), "Warehouse"), "orgname", String.class), - new ColumnInfo( - Msg.translate(Env.getCtx(), "Value"), - "(Select Value from M_Product p where p.M_Product_ID=M_PRODUCT_SUBSTITUTERELATED_V.Substitute_ID)", - String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "Name", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "QtyAvailable"), "QtyAvailable", Double.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOnHand"), "QtyOnHand", Double.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "QtyReserved"), "QtyReserved", Double.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "PriceStd"), "PriceStd", Double.class)}; - s_sqlFrom = "M_PRODUCT_SUBSTITUTERELATED_V"; - s_sqlWhere = "M_Product_ID = ? AND M_PriceList_Version_ID = ? and RowType = 'R'"; - m_sqlRelated = relatedTbl.prepareTable(s_layoutRelated, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_SUBSTITUTERELATED_V"); - relatedTbl.setRowSelectionAllowed(false); - relatedTbl.setMultiSelection(false); - relatedTbl.addMouseListener(this); - relatedTbl.getSelectionModel().addListSelectionListener(this); - relatedTbl.autoSize(); - - //Available to Promise Tab - m_tableAtp.setRowSelectionAllowed(false); - m_tableAtp.setMultiSelection(false); - - //IDEMPIERE-339 - ArrayList list = new ArrayList(); - list.add(new ColumnInfo(Msg.translate(Env.getCtx(), "PriceListVersion"), "plv.Name", String.class)); - list.add(new ColumnInfo(Msg.translate(Env.getCtx(), "ValidFrom"), "plv.ValidFrom", Timestamp.class)); - if (MRole.getDefault().isColumnAccess(251 /*M_ProductPrice*/, 3027/*PriceList*/, false)) - list.add(new ColumnInfo(Msg.translate(Env.getCtx(), "PriceList"), "bomPriceList(pp.M_Product_ID, pp.M_PriceList_Version_ID) AS PriceList", Double.class)); - if (MRole.getDefault().isColumnAccess(251 /*M_ProductPrice*/, 3028/*PriceStd*/, false)) - list.add(new ColumnInfo(Msg.translate(Env.getCtx(), "PriceStd"), "bomPriceStd(pp.M_Product_ID, pp.M_PriceList_Version_ID) AS PriceStd", Double.class)); - if (MRole.getDefault().isColumnAccess(251 /*M_ProductPrice*/, 3028/*PriceStd*/, false) && MRole.getDefault().isColumnAccess(251 /*M_ProductPrice*/, 3029/*PriceLimit*/, false)) - list.add(new ColumnInfo(Msg.translate(Env.getCtx(), "Margin"), "bomPriceStd(pp.M_Product_ID, pp.M_PriceList_Version_ID)-bomPriceLimit(pp.M_Product_ID, pp.M_PriceList_Version_ID) AS Margin", Double.class)); - if (MRole.getDefault().isColumnAccess(251 /*M_ProductPrice*/, 3029/*PriceLimit*/, false)) - list.add(new ColumnInfo(Msg.translate(Env.getCtx(), "PriceLimit"), "bomPriceLimit(pp.M_Product_ID, pp.M_PriceList_Version_ID) AS PriceLimit", Double.class)); - ColumnInfo[] s_layoutProductPrice = new ColumnInfo[list.size()]; - list.toArray(s_layoutProductPrice); - s_sqlFrom = "M_ProductPrice pp INNER JOIN M_PriceList_Version plv ON (pp.M_PriceList_Version_ID = plv.M_PriceList_Version_ID)"; - s_sqlWhere = "pp.M_Product_ID = ? AND plv.IsActive = 'Y' AND pp.IsActive = 'Y'"; - m_sqlProductprice = productpriceTbl.prepareTable(s_layoutProductPrice, s_sqlFrom, s_sqlWhere, false, "pp") + " ORDER BY plv.ValidFrom DESC"; - productpriceTbl.setRowSelectionAllowed(false); - productpriceTbl.setMultiSelection(false); - productpriceTbl.addMouseListener(this); - productpriceTbl.getSelectionModel().addListSelectionListener(this); - productpriceTbl.autoSize(); - - CTabbedPane jTab = new CTabbedPane(); - jTab.addTab(Msg.translate(Env.getCtx(), "Warehouse"), new JScrollPane(warehouseTbl)); - jTab.setPreferredSize(new Dimension(INFO_WIDTH, SCREEN_HEIGHT > 600 ? 250 : 105)); - jTab.addTab(Msg.translate(Env.getCtx(), "Description"), new JScrollPane(fieldDescription)); - jTab.addTab(Msg.translate(Env.getCtx(), "Substitute_ID"), new JScrollPane(substituteTbl)); - jTab.addTab(Msg.translate(Env.getCtx(), "RelatedProduct_ID"), new JScrollPane(relatedTbl)); - jTab.addTab(Msg.getMsg(Env.getCtx(), "ATP"), new JScrollPane(m_tableAtp)); - jTab.addTab(Msg.translate(Env.getCtx(), "Price"), new JScrollPane(productpriceTbl)); - jTab.addChangeListener(this); - tablePanel.setPreferredSize(new Dimension(INFO_WIDTH, SCREEN_HEIGHT > 600 ? 255 : 110)); - tablePanel.add(jTab); - - warehouseStockPanel.setCollapsed(true); - warehouseStockPanel.add(tablePanel); - this.addonPanel.add(warehouseStockPanel); - - this.p_table.addKeyListener(new KeyAdapter() { - public void keyReleased(KeyEvent ke){ - int row = ((MiniTable)ke.getSource()).getSelectedRow(); - refresh( - ((MiniTable)ke.getSource()).getValueAt(row,2), - new BigDecimal(pickWarehouse.getValue().toString()).intValue(), - new BigDecimal(pickPriceList.getValue().toString()).intValue() - ); - warehouseStockPanel.setCollapsed(false); - } - }); - - this.p_table.addMouseListener(new MouseAdapter() { - public void mouseClicked(MouseEvent me) { - int row = ((MiniTable)me.getSource()).getSelectedRow(); - refresh( - ((MiniTable)me.getSource()).getValueAt(row,2), - new BigDecimal(pickWarehouse.getValue().toString()).intValue(), - new BigDecimal(pickPriceList.getValue().toString()).intValue() - ); - warehouseStockPanel.setCollapsed(false); - } - }); - //End - fer_luck @ centuryon - } // statInit - - //Begin - fer_luck @ centuryon - /** - * Refresh Query - */ - private void refresh(Object obj, int M_Warehouse_ID, int M_PriceList_Version_ID) - { - //int M_Product_ID = 0; - String sql = m_sqlWarehouse; - log.finest(sql); - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setString(1, (String)obj); - rs = pstmt.executeQuery(); - warehouseTbl.loadTable(rs); - } - catch (Exception e) - { - log.log(Level.WARNING, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - - m_M_Product_ID = getSelectedRowKey(); - sql = "SELECT DocumentNote FROM M_Product WHERE M_Product_ID=?"; - fieldDescription.setText(DB.getSQLValueString(null, sql, m_M_Product_ID)); - - sql = m_sqlSubstitute; - log.finest(sql); - try { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_M_Product_ID); - pstmt.setInt(2, M_PriceList_Version_ID); - rs = pstmt.executeQuery(); - substituteTbl.loadTable(rs); - } catch (Exception e) { - log.log(Level.WARNING, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - - sql = m_sqlRelated; - log.finest(sql); - try { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_M_Product_ID); - pstmt.setInt(2, M_PriceList_Version_ID); - rs = pstmt.executeQuery(); - relatedTbl.loadTable(rs); - } catch (Exception e) { - log.log(Level.WARNING, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - initAtpTab(M_Warehouse_ID); - - // IDEMPIERE-339 - sql = m_sqlProductprice; - log.finest(sql); - try { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_M_Product_ID); - rs = pstmt.executeQuery(); - productpriceTbl.loadTable(rs); - } catch (Exception e) { - log.log(Level.WARNING, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - } // refresh - //End - fer_luck @ centuryon - - /** - * Dynamic Init - * - * @param value value - * @param M_Warehouse_ID warehouse - * @param M_PriceList_ID price list - */ - private void initInfo (String value, int M_Warehouse_ID, int M_PriceList_ID) - { - // Pick init - fillPicks(M_PriceList_ID); - int M_PriceList_Version_ID = findPLV (M_PriceList_ID); - // Set Value - if (value != null && value.length() > 0 && value.indexOf("_") > 0) { - String values[] = value.split("_"); - fieldValue.setText(values[0]); - } - else - fieldValue.setText(value); - // Set Warehouse - if (M_Warehouse_ID == 0) - M_Warehouse_ID = Env.getContextAsInt(Env.getCtx(), "#M_Warehouse_ID"); - if (M_Warehouse_ID != 0) - setWarehouse (M_Warehouse_ID); - // Set PriceList Version - if (M_PriceList_Version_ID != 0) - setPriceListVersion (M_PriceList_Version_ID); - - // Create Grid - String orderBy = null; - StringBuilder where = new StringBuilder(); - where.append("p.IsActive='Y'"); - if (M_Warehouse_ID != 0) - { - where.append(" AND p.IsSummary='N'"); - orderBy = "QtyAvailable DESC"; - } - - // dynamic Where Clause - if (p_whereClause != null && p_whereClause.length() > 0) - where.append(" AND ") // replace fully qualified name with alias - .append(Util.replace(p_whereClause, "M_Product.", "p.")); - // - prepareTable(getProductLayout(), - s_productFrom, - where.toString(), - orderBy); - p_table.setShowTotals(false); - // - pickWarehouse.addActionListener(this); - pickPriceList.addActionListener(this); - pickProductCategory.addActionListener(this); - pickAS.addActionListener(this); // @Trifon - } // initInfo - - /** - * Fill Picks with values - * - * @param M_PriceList_ID price list - */ - private void fillPicks (int M_PriceList_ID) - { - // Price List - String SQL = "SELECT M_PriceList_Version.M_PriceList_Version_ID," - + " M_PriceList_Version.Name || ' (' || c.Iso_Code || ')' AS ValueName " - + "FROM M_PriceList_Version, M_PriceList pl, C_Currency c " - + "WHERE M_PriceList_Version.M_PriceList_ID=pl.M_PriceList_ID" - + " AND pl.C_Currency_ID=c.C_Currency_ID" - + " AND M_PriceList_Version.IsActive='Y' AND pl.IsActive='Y'"; - // Same PL currency as original one - if (M_PriceList_ID != 0) - SQL += " AND EXISTS (SELECT * FROM M_PriceList xp WHERE xp.M_PriceList_ID=" + M_PriceList_ID - + " AND pl.C_Currency_ID=xp.C_Currency_ID)"; - // Add Access & Order - SQL = MRole.getDefault().addAccessSQL (SQL, "M_PriceList_Version", true, false) // fully qualified - RO - + " ORDER BY M_PriceList_Version.Name"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pickPriceList.addItem(new KeyNamePair (0, "")); - pstmt = DB.prepareStatement(SQL, null); - rs = pstmt.executeQuery(); - while (rs.next()) - { - KeyNamePair kn = new KeyNamePair (rs.getInt(1), rs.getString(2)); - pickPriceList.addItem(kn); - } - DB.close(rs, pstmt); - rs = null; pstmt = null; - - // Warehouse - SQL = MRole.getDefault().addAccessSQL ( - "SELECT M_Warehouse_ID, Value || ' - ' || Name AS ValueName " - + "FROM M_Warehouse " - + "WHERE IsActive='Y'", - "M_Warehouse", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO) - + " ORDER BY Value"; - pickWarehouse.addItem(new KeyNamePair (0, "")); - pstmt = DB.prepareStatement(SQL, null); - rs = pstmt.executeQuery(); - while (rs.next()) - { - KeyNamePair kn = new KeyNamePair - (rs.getInt("M_Warehouse_ID"), rs.getString("ValueName")); - pickWarehouse.addItem(kn); - } - DB.close(rs, pstmt); - rs = null; pstmt = null; - - // Product Category - SQL = MRole.getDefault().addAccessSQL ( - "SELECT M_Product_Category_ID, Value || ' - ' || Name FROM M_Product_Category WHERE IsActive='Y'", - "M_Product_Category", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO) - + " ORDER BY Value"; - for (KeyNamePair kn : DB.getKeyNamePairs(SQL, true)) { - pickProductCategory.addItem(kn); - } - - // Attribute Set - @Trifon - SQL = MRole.getDefault().addAccessSQL ( - "SELECT M_AttributeSet_ID, Name FROM M_AttributeSet WHERE IsActive='Y'", - "M_AttributeSet", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO) - + " ORDER BY Name"; - for (KeyNamePair kn : DB.getKeyNamePairs(SQL, true)) { - pickAS.addItem(kn); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, SQL, e); - setStatusLine(e.getLocalizedMessage(), true); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - } // fillPicks - - /** - * Set Warehouse - * - * @param M_Warehouse_ID warehouse - */ - private void setWarehouse(int M_Warehouse_ID) - { - for (int i = 0; i < pickWarehouse.getItemCount(); i++) - { - KeyNamePair kn = (KeyNamePair)pickWarehouse.getItemAt(i); - if (kn.getKey() == M_Warehouse_ID) - { - pickWarehouse.setSelectedIndex(i); - return; - } - } - } // setWarehouse - - /** - * Set PriceList - * - * @param M_PriceList_Version_ID price list - */ - private void setPriceListVersion(int M_PriceList_Version_ID) - { - if (log.isLoggable(Level.CONFIG)) log.config("M_PriceList_Version_ID=" + M_PriceList_Version_ID); - for (int i = 0; i < pickPriceList.getItemCount(); i++) - { - KeyNamePair kn = (KeyNamePair)pickPriceList.getItemAt(i); - if (kn.getKey() == M_PriceList_Version_ID) - { - pickPriceList.setSelectedIndex(i); - return; - } - } - log.fine("NOT found"); - } // setPriceList - - /** - * Find Price List Version and update context - * - * @param M_PriceList_ID price list - * @return M_PriceList_Version_ID price list version - */ - private int findPLV (int M_PriceList_ID) - { - Timestamp priceDate = null; - // Sales Order Date - String dateStr = Env.getContext(Env.getCtx(), p_WindowNo, "DateOrdered"); - if (dateStr != null && dateStr.length() > 0) - priceDate = Env.getContextAsDate(Env.getCtx(), p_WindowNo, "DateOrdered"); - else // Invoice Date - { - dateStr = Env.getContext(Env.getCtx(), p_WindowNo, "DateInvoiced"); - if (dateStr != null && dateStr.length() > 0) - priceDate = Env.getContextAsDate(Env.getCtx(), p_WindowNo, "DateInvoiced"); - } - // Today - if (priceDate == null) - priceDate = new Timestamp(System.currentTimeMillis()); - // - if (log.isLoggable(Level.CONFIG)) log.config("M_PriceList_ID=" + M_PriceList_ID + " - " + priceDate); - int retValue = 0; - String sql = "SELECT plv.M_PriceList_Version_ID, plv.ValidFrom " - + "FROM M_PriceList pl, M_PriceList_Version plv " - + "WHERE pl.M_PriceList_ID=plv.M_PriceList_ID" - + " AND plv.IsActive='Y'" - + " AND pl.M_PriceList_ID=? " // 1 - + "ORDER BY plv.ValidFrom DESC"; - // find newest one - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, M_PriceList_ID); - rs = pstmt.executeQuery(); - while (rs.next() && retValue == 0) - { - Timestamp plDate = rs.getTimestamp(2); - if (!priceDate.before(plDate)) - retValue = rs.getInt(1); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - Env.setContext(Env.getCtx(), p_WindowNo, "M_PriceList_Version_ID", retValue); - return retValue; - } // findPLV - - - /************************************************************************** - * Construct SQL Where Clause and define parameters - * (setParameters needs to set parameters) - * Includes first AND - * @return SQL WHERE clause - */ - protected String getSQLWhere() - { - StringBuilder where = new StringBuilder(); - - // Optional PLV - int M_PriceList_Version_ID = 0; - KeyNamePair pl = (KeyNamePair)pickPriceList.getSelectedItem(); - if (pl != null) - M_PriceList_Version_ID = pl.getKey(); - if (M_PriceList_Version_ID != 0) - where.append(" AND pr.M_PriceList_Version_ID=?"); - - // Optional Product Category - if (getM_Product_Category_ID() > 0) { - where.append(" AND p.M_Product_Category_ID=?"); - } - - // Optional Attribute Set - if (getM_AttributeSet_ID() > 0) { - where.append(" AND p.M_AttributeSet_ID=?"); - } - - // Product Attribute Search - if (m_pAttributeWhere != null) - { - where.append(m_pAttributeWhere); - return where.toString(); - } - - // => Value - String value = fieldValue.getText().toUpperCase(); - if (!(value.equals("") || value.equals("%"))) - where.append(" AND UPPER(p.Value) LIKE ?"); - - // => Name - String name = fieldName.getText().toUpperCase(); - if (!(name.equals("") || name.equals("%"))) - where.append(" AND UPPER(p.Name) LIKE ?"); - - // => UPC - String upc = fieldUPC.getText().toUpperCase(); - if (!(upc.equals("") || upc.equals("%"))) - where.append(" AND UPPER(p.UPC) LIKE ?"); - - // => SKU - String sku = fieldSKU.getText().toUpperCase(); - if (!(sku.equals("") || sku.equals("%"))) - where.append(" AND UPPER(p.SKU) LIKE ?"); - // => Vendor - String vendor = fieldVendor.getText().toUpperCase(); - if (!(vendor.equals("") || vendor.equals("%"))) - where.append(" AND UPPER(bp.Name) LIKE ? AND ppo.IsCurrentVendor='Y'"); - - return where.toString(); - } // getSQLWhere - - /** - * Set Parameters for Query - * (as defined in getSQLWhere) - * - * @param pstmt pstmt - * @param forCount for counting records - * @throws SQLException - */ - protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException - { - int index = 1; - - // => Warehouse - int M_Warehouse_ID = 0; - KeyNamePair wh = (KeyNamePair)pickWarehouse.getSelectedItem(); - if (wh != null) - M_Warehouse_ID = wh.getKey(); - if (!forCount) // parameters in select - { - for (int i = 0; i < p_layout.length; i++) - { - if (p_layout[i].getColSQL().indexOf('?') != -1) - pstmt.setInt(index++, M_Warehouse_ID); - } - } - if (log.isLoggable(Level.FINE)) log.fine("M_Warehouse_ID=" + M_Warehouse_ID + " (" + (index-1) + "*)"); - - // => PriceList - int M_PriceList_Version_ID = 0; - KeyNamePair pl = (KeyNamePair)pickPriceList.getSelectedItem(); - if (pl != null) - M_PriceList_Version_ID = pl.getKey(); - if (M_PriceList_Version_ID != 0) - { - pstmt.setInt(index++, M_PriceList_Version_ID); - if (log.isLoggable(Level.FINE)) log.fine("M_PriceList_Version_ID=" + M_PriceList_Version_ID); - } - // => Product Category - int M_Product_Category_ID = getM_Product_Category_ID(); - if (M_Product_Category_ID > 0) { - pstmt.setInt(index++, M_Product_Category_ID); - if (log.isLoggable(Level.FINE)) log.fine("M_Product_Category_ID=" + M_Product_Category_ID); - } - // => Attribute Set - @Trifon - int M_AttributeSet_ID = getM_AttributeSet_ID(); - if (M_AttributeSet_ID > 0) { - pstmt.setInt(index++, M_AttributeSet_ID); - if (log.isLoggable(Level.FINE)) log.fine("M_AttributeSet_ID=" + M_AttributeSet_ID); - } - // Rest of Parameter in Query for Attribute Search - if (m_pAttributeWhere != null) - return; - - // => Value - String value = fieldValue.getText().toUpperCase(); - if (!(value.equals("") || value.equals("%"))) - { - if (!value.endsWith("%")) - value += "%"; - pstmt.setString(index++, value); - if (log.isLoggable(Level.FINE)) log.fine("Value: " + value); - } - - // => Name - String name = fieldName.getText().toUpperCase(); - if (!(name.equals("") || name.equals("%"))) - { - if (!name.endsWith("%")) - name += "%"; - pstmt.setString(index++, name); - if (log.isLoggable(Level.FINE)) log.fine("Name: " + name); - } - - // => UPC - String upc = fieldUPC.getText().toUpperCase(); - if (!(upc.equals("") || upc.equals("%"))) - { - if (!upc.endsWith("%")) - upc += "%"; - pstmt.setString(index++, upc); - if (log.isLoggable(Level.FINE)) log.fine("UPC: " + upc); - } - - // => SKU - String sku = fieldSKU.getText().toUpperCase(); - if (!(sku.equals("") || sku.equals("%"))) - { - if (!sku.endsWith("%")) - sku += "%"; - pstmt.setString(index++, sku); - if (log.isLoggable(Level.FINE)) log.fine("SKU: " + sku); - } - - // => Vendor - String vendor = fieldVendor.getText().toUpperCase(); - if (!(vendor.equals("") || vendor.equals("%"))) - { - if (!vendor.endsWith("%")) - vendor += "%"; - pstmt.setString(index++, vendor); - if (log.isLoggable(Level.FINE)) log.fine("Vendor: " + vendor); - } - - } // setParameters - - - /************************************************************************** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - // don't requery if fieldValue and fieldName are empty - if (e.getSource() == pickWarehouse || e.getSource() == pickPriceList) - { - // IDEMPIERE-337 - Improve Info Product Window - boolean execute = true; - if (fieldValue.getText().length() == 0 && fieldName.getText().length() == 0 && p_table.getRowCount() == 0) - execute = false; - p_table.setRowCount(0); - ((DefaultTableModel)p_table.getModel()).setColumnCount(0); - int M_Warehouse_ID = ((KeyNamePair)pickWarehouse.getSelectedItem()).getKey(); - // Create Grid - StringBuilder where = new StringBuilder(); - where.append("p.IsActive='Y'"); - if (M_Warehouse_ID != 0) - where.append(" AND p.IsSummary='N'"); - // dynamic Where Clause - if (p_whereClause != null && p_whereClause.length() > 0) - where.append(" AND ") // replace fully qualified name with alias - .append(Util.replace(p_whereClause, "M_Product.", "p.")); - // - p_table.removeMouseListener(this); - prepareTable(getProductLayout(), - s_productFrom, - where.toString(), - ""); - p_table.setShowTotals(false); - if (!execute) - return; - } - - // Product Attribute Search - if (e.getSource().equals(m_InfoPAttributeButton)) - { - cmd_InfoPAttribute(); - return; - } - m_pAttributeWhere = null; - - // Query Product Attribute Instance - int row = p_table.getSelectedRow(); - if (e.getSource().equals(m_PAttributeButton) && row != -1) - { - Integer productInteger = getSelectedRowKey(); - String productName = (String)p_table.getValueAt(row, INDEX_NAME); - KeyNamePair warehouse = (KeyNamePair)pickWarehouse.getSelectedItem(); - if (productInteger == null || productInteger.intValue() == 0 || warehouse == null) - return; - String title = warehouse.getName() + " - " + productName; - PAttributeInstance pai = new PAttributeInstance (this, title, - warehouse.getKey(), 0, productInteger.intValue(), m_C_BPartner_ID); - m_M_AttributeSetInstance_ID = pai.getM_AttributeSetInstance_ID(); - m_M_Locator_ID = pai.getM_Locator_ID(); - if (m_M_AttributeSetInstance_ID != -1) - dispose(true); - return; - } - // - super.actionPerformed(e); - } // actionPerformed - - /** - * Enable PAttribute if row selected/changed - */ - protected void enableButtons () - { - m_M_AttributeSetInstance_ID = -1; - if (m_PAttributeButton != null) - { - int row = p_table.getSelectedRow(); - boolean enabled = false; - if (row >= 0) - { - Object value = p_table.getValueAt(row, INDEX_PATTRIBUTE); - enabled = Boolean.TRUE.equals(value); - } - m_PAttributeButton.setEnabled(enabled); - } - super.enableButtons(); - } // enableButtons - - /** - * Query per Product Attribute. - * - * Available synonyms: - * M_Product p - * M_ProductPrice pr - * M_AttributeSet pa - * - */ - private void cmd_InfoPAttribute() - { - InfoPAttribute ia = new InfoPAttribute(this); - m_pAttributeWhere = ia.getWhereClause(); - if (m_pAttributeWhere != null) - executeQuery(); - } // cmdInfoAttribute - - /** - * Show History - */ - protected void showHistory() - { - log.info(""); - Integer M_Product_ID = getSelectedRowKey(); - if (M_Product_ID == null) - return; - KeyNamePair kn = (KeyNamePair)pickWarehouse.getSelectedItem(); - int M_Warehouse_ID = kn.getKey(); - int M_AttributeSetInstance_ID = m_M_AttributeSetInstance_ID; - if (m_M_AttributeSetInstance_ID < -1) // not selected - M_AttributeSetInstance_ID = 0; - // - InvoiceHistory ih = new InvoiceHistory (this, 0, - M_Product_ID.intValue(), M_Warehouse_ID, M_AttributeSetInstance_ID); - ih.setVisible(true); - ih = null; - } // showHistory - - /** - * Has History - * - * @return true (has history) - */ - protected boolean hasHistory() - { - return true; - } // hasHistory - - /** - * Zoom - */ - protected void zoom() - { - if (log.isLoggable(Level.INFO)) log.info(""); - Integer M_Product_ID = getSelectedRowKey(); - if (M_Product_ID == null) - return; - // AEnv.zoom(MProduct.Table_ID, M_Product_ID.intValue(), true); // SO - - MQuery query = new MQuery("M_Product"); - query.addRestriction("M_Product_ID", MQuery.EQUAL, M_Product_ID); - query.setRecordCount(1); - int AD_WindowNo = getAD_Window_ID("M_Product", true); // SO - zoom (AD_WindowNo, query); - } // zoom - - /** - * Has Zoom - * @return (has zoom) - */ - protected boolean hasZoom() - { - return true; - } // hasZoom - - /** - * Customize - */ - protected void customize() - { - log.info(""); - } // customize - - /** - * Has Customize - * @return false (no customize) - */ - protected boolean hasCustomize() - { - return false; // for now - } // hasCustomize - - /** - * Save Selection Settings for PriceList - */ - protected void saveSelectionDetail() - { - // publish for Callout to read - Integer ID = getSelectedRowKey(); - Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_Product_ID", ID == null ? "0" : ID.toString()); - KeyNamePair kn = (KeyNamePair)pickPriceList.getSelectedItem(); - Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_PriceList_Version_ID", kn.getID()); - kn = (KeyNamePair)pickWarehouse.getSelectedItem(); - Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_Warehouse_ID", kn.getID()); - // - if (m_M_AttributeSetInstance_ID == -1) // not selected - { - Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID", "0"); - Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_Locator_ID", "0"); - } - else - { - Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID", - String.valueOf(m_M_AttributeSetInstance_ID)); - Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_Locator_ID", - String.valueOf(m_M_Locator_ID)); - } - } // saveSelectionDetail - - /** - * Get Product Layout - * - * @return array of Column_Info - */ - protected Info_Column[] getProductLayout() - { - // IDEMPIERE-337 - //if (s_productLayout != null && s_productLayoutRole == MRole.getDefault().getAD_Role_ID()) - // return s_productLayout; - // - s_productLayout = null; - // IDEMPIERE_337 - int M_Warehouse_ID = 0; - KeyNamePair warehouse = (KeyNamePair)pickWarehouse.getSelectedItem(); - M_Warehouse_ID = warehouse.getKey(); - int M_PriceList_ID = 0; - KeyNamePair pricelist = (KeyNamePair)pickPriceList.getSelectedItem(); - M_PriceList_ID = pricelist.getKey(); - - ArrayList list = new ArrayList(); - list.add(new Info_Column(" ", "DISTINCT p.M_Product_ID", IDColumn.class, !p_multiSelection)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "Discontinued").substring(0, 1), "p.Discontinued", Boolean.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "Value"), "p.Value", String.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "Name"), "p.Name", String.class)); - // IDEMPIERE-337 - if (M_Warehouse_ID != 0) - list.add(new Info_Column(Msg.translate(Env.getCtx(), "QtyAvailable"), "case when p.IsBOM='N' and (p.ProductType!='I' OR p.IsStocked='N') then to_number(get_Sysconfig('QTY_TO_SHOW_FOR_SERVICES', '99999', p.ad_client_id, 0), '99999999999') else bomQtyAvailable(p.M_Product_ID,?,0) end AS QtyAvailable", Double.class, true, true, null)); - if (MRole.getDefault().isColumnAccess(251 /*M_ProductPrice*/, 3027/*PriceList*/, false) && M_PriceList_ID != 0) - list.add(new Info_Column(Msg.translate(Env.getCtx(), "PriceList"), "bomPriceList(p.M_Product_ID, pr.M_PriceList_Version_ID) AS PriceList", BigDecimal.class)); - if (MRole.getDefault().isColumnAccess(251 /*M_ProductPrice*/, 3028/*PriceStd*/, false) && M_PriceList_ID !=0) - list.add(new Info_Column(Msg.translate(Env.getCtx(), "PriceStd"), "bomPriceStd(p.M_Product_ID, pr.M_PriceList_Version_ID) AS PriceStd", BigDecimal.class)); - if (M_Warehouse_ID != 0) - { - list.add(new Info_Column(Msg.translate(Env.getCtx(), "QtyOnHand"), "case when p.IsBOM='N' and (p.ProductType!='I' OR p.IsStocked='N') then to_number(get_Sysconfig('QTY_TO_SHOW_FOR_SERVICES', '99999', p.ad_client_id, 0), '99999999999') else bomQtyOnHand(p.M_Product_ID,?,0) end AS QtyOnHand", Double.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "QtyReserved"), "bomQtyReserved(p.M_Product_ID,?,0) AS QtyReserved", Double.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "QtyOrdered"), "bomQtyOrdered(p.M_Product_ID,?,0) AS QtyOrdered", Double.class)); - if (isUnconfirmed()) - { - list.add(new Info_Column(Msg.translate(Env.getCtx(), "QtyUnconfirmed"), "(SELECT SUM(c.TargetQty) FROM M_InOutLineConfirm c INNER JOIN M_InOutLine il ON (c.M_InOutLine_ID=il.M_InOutLine_ID) INNER JOIN M_InOut i ON (il.M_InOut_ID=i.M_InOut_ID) WHERE c.Processed='N' AND i.M_Warehouse_ID=? AND il.M_Product_ID=p.M_Product_ID) AS QtyUnconfirmed", Double.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "QtyUnconfirmedMove"), "(SELECT SUM(c.TargetQty) FROM M_MovementLineConfirm c INNER JOIN M_MovementLine ml ON (c.M_MovementLine_ID=ml.M_MovementLine_ID) INNER JOIN M_Locator l ON (ml.M_LocatorTo_ID=l.M_Locator_ID) WHERE c.Processed='N' AND l.M_Warehouse_ID=? AND ml.M_Product_ID=p.M_Product_ID) AS QtyUnconfirmedMove", Double.class)); - } - } - if (MRole.getDefault().isColumnAccess(251 /*M_ProductPrice*/, 3028/*PriceStd*/, false) && MRole.getDefault().isColumnAccess(251 /*M_ProductPrice*/, 3029/*PriceLimit*/, false) && M_PriceList_ID != 0) - list.add(new Info_Column(Msg.translate(Env.getCtx(), "Margin"), "bomPriceStd(p.M_Product_ID, pr.M_PriceList_Version_ID)-bomPriceLimit(p.M_Product_ID, pr.M_PriceList_Version_ID) AS Margin", BigDecimal.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "Vendor"), "bp.Name", String.class)); - if (MRole.getDefault().isColumnAccess(251 /*M_ProductPrice*/, 3029/*PriceLimit*/, false) && M_PriceList_ID != 0) - list.add(new Info_Column(Msg.translate(Env.getCtx(), "PriceLimit"), "bomPriceLimit(p.M_Product_ID, pr.M_PriceList_Version_ID) AS PriceLimit", BigDecimal.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "IsInstanceAttribute"), "pa.IsInstanceAttribute", Boolean.class)); - s_productLayout = new Info_Column[list.size()]; - list.toArray(s_productLayout); - INDEX_NAME = 3; - INDEX_PATTRIBUTE = s_productLayout.length - 1; // last item - - return s_productLayout; - } // getProductLayout - - /** - * System has Unconfirmed records - * @return true if unconfirmed - */ - private boolean isUnconfirmed() - { - int no = DB.getSQLValue(null, - "SELECT COUNT(*) FROM M_InOutLineConfirm WHERE AD_Client_ID=?", - Env.getAD_Client_ID(Env.getCtx())); - if (no > 0) - return true; - no = DB.getSQLValue(null, - "SELECT COUNT(*) FROM M_MovementLineConfirm WHERE AD_Client_ID=?", - Env.getAD_Client_ID(Env.getCtx())); - return no > 0; - } // isUnconfirmed - - - /** - * Tab Changed - * @param e event - */ - public void stateChanged(ChangeEvent e) - { - if(e.getSource() instanceof CTabbedPane) - { - CTabbedPane tab = (CTabbedPane) e.getSource(); - - if(tab.getSelectedIndex() == 4 && warehouseTbl.getRowCount() > 0) - { - // If no warehouse row is selected in the warehouse tab, use the first warehouse - // row to prevent array index out of bounds. BF 3051361 - int selectedRow = warehouseTbl.getSelectedRow(); - if (selectedRow<0) selectedRow = 0; - String value = (String)warehouseTbl.getValueAt(selectedRow,0); - int M_Warehouse_ID = DB.getSQLValue(null, "SELECT M_Warehouse_ID FROM M_Warehouse WHERE UPPER(Name) = UPPER(?) AND AD_Client_ID=?", new Object[] { value ,Env.getAD_Client_ID(Env.getCtx())}); - initAtpTab(M_Warehouse_ID); - } - } - - } // stateChanged - - /** - * Query ATP - */ - private void initAtpTab (int m_M_Warehouse_ID) - { - - // Header - Vector columnNames = new Vector(); - columnNames.add(Msg.translate(Env.getCtx(), "Date")); - columnNames.add(Msg.translate(Env.getCtx(), "QtyOnHand")); - columnNames.add(Msg.translate(Env.getCtx(), "C_BPartner_ID")); - columnNames.add(Msg.translate(Env.getCtx(), "QtyOrdered")); - columnNames.add(Msg.translate(Env.getCtx(), "QtyReserved")); - columnNames.add(Msg.translate(Env.getCtx(), "M_Locator_ID")); - columnNames.add(Msg.translate(Env.getCtx(), "M_AttributeSetInstance_ID")); - columnNames.add(Msg.translate(Env.getCtx(), "DocumentNo")); - columnNames.add(Msg.translate(Env.getCtx(), "M_Warehouse_ID")); - - // Fill Storage Data - boolean showDetail = CLogMgt.isLevelFine(); - String sql = "SELECT s.QtyOnHand, s.QtyReserved, s.QtyOrdered," - + " productAttribute(s.M_AttributeSetInstance_ID), s.M_AttributeSetInstance_ID,"; - if (!showDetail) - sql = "SELECT SUM(s.QtyOnHand), SUM(s.QtyReserved), SUM(s.QtyOrdered)," - + " productAttribute(s.M_AttributeSetInstance_ID), 0,"; - sql += " w.Name, l.Value " - + "FROM M_Storage s" - + " INNER JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)" - + " INNER JOIN M_Warehouse w ON (l.M_Warehouse_ID=w.M_Warehouse_ID) " - + "WHERE M_Product_ID=?"; - if (m_M_Warehouse_ID != 0) - sql += " AND l.M_Warehouse_ID=?"; - if (m_M_AttributeSetInstance_ID > 0) - sql += " AND s.M_AttributeSetInstance_ID=?"; - sql += " AND (s.QtyOnHand<>0 OR s.QtyReserved<>0 OR s.QtyOrdered<>0)"; - if (!showDetail) - sql += " GROUP BY productAttribute(s.M_AttributeSetInstance_ID), w.Name, l.Value"; - sql += " ORDER BY l.Value"; - - Vector> data = new Vector>(); - double qty = 0; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_M_Product_ID); - if (m_M_Warehouse_ID != 0) - pstmt.setInt(2, m_M_Warehouse_ID); - if (m_M_AttributeSetInstance_ID > 0) - pstmt.setInt(3, m_M_AttributeSetInstance_ID); - rs = pstmt.executeQuery(); - while (rs.next()) - { - Vector line = new Vector(9); - line.add(null); // Date - double qtyOnHand = rs.getDouble(1); - qty += qtyOnHand; - line.add(Double.valueOf(qtyOnHand)); // Qty - line.add(null); // BPartner - line.add(Double.valueOf(rs.getDouble(3))); // QtyOrdered - line.add(Double.valueOf(rs.getDouble(2))); // QtyReserved - line.add(rs.getString(7)); // Locator - String asi = rs.getString(4); - if (showDetail && (asi == null || asi.length() == 0)) - asi = "{" + rs.getInt(5) + "}"; - line.add(asi); // ASI - line.add(null); // DocumentNo - line.add(rs.getString(6)); // Warehouse - data.add(line); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - - // Orders - sql = "SELECT o.DatePromised, ol.QtyReserved," - + " productAttribute(ol.M_AttributeSetInstance_ID), ol.M_AttributeSetInstance_ID," - + " dt.DocBaseType, bp.Name," - + " dt.PrintName || ' ' || o.DocumentNo As DocumentNo, w.Name " - + "FROM C_Order o" - + " INNER JOIN C_OrderLine ol ON (o.C_Order_ID=ol.C_Order_ID)" - + " INNER JOIN C_DocType dt ON (o.C_DocType_ID=dt.C_DocType_ID)" - + " INNER JOIN M_Warehouse w ON (ol.M_Warehouse_ID=w.M_Warehouse_ID)" - + " INNER JOIN C_BPartner bp ON (o.C_BPartner_ID=bp.C_BPartner_ID) " - + "WHERE ol.QtyReserved<>0" - + " AND ol.M_Product_ID=?"; - if (m_M_Warehouse_ID != 0) - sql += " AND ol.M_Warehouse_ID=?"; - if (m_M_AttributeSetInstance_ID > 0) - sql += " AND ol.M_AttributeSetInstance_ID=?"; - sql += " ORDER BY o.DatePromised"; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_M_Product_ID); - if (m_M_Warehouse_ID != 0) - pstmt.setInt(2, m_M_Warehouse_ID); - if (m_M_AttributeSetInstance_ID > 0) - pstmt.setInt(3, m_M_AttributeSetInstance_ID); - rs = pstmt.executeQuery(); - while (rs.next()) - { - Vector line = new Vector(9); - line.add(rs.getTimestamp(1)); // Date - double oq = rs.getDouble(2); - String DocBaseType = rs.getString(5); - Double qtyReserved = null; - Double qtyOrdered = null; - if (MDocType.DOCBASETYPE_PurchaseOrder.equals(DocBaseType)) - { - qtyOrdered = Double.valueOf(oq); - qty += oq; - } - else - { - qtyReserved = Double.valueOf(oq); - qty -= oq; - } - line.add(Double.valueOf(qty)); // Qty - line.add(rs.getString(6)); // BPartner - line.add(qtyOrdered); // QtyOrdered - line.add(qtyReserved); // QtyReserved - line.add(null); // Locator - String asi = rs.getString(3); - if (showDetail && (asi == null || asi.length() == 0)) - asi = "{" + rs.getInt(4) + "}"; - line.add(asi); // ASI - line.add(rs.getString(7)); // DocumentNo - line.add(rs.getString(8)); // Warehouse - data.add(line); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - - // Table - MiniTable table = null; - m_modelAtp = new DefaultTableModel(data, columnNames); - m_tableAtp.setModel(m_modelAtp); - table = m_tableAtp; - // - table.setColumnClass(0, Timestamp.class, true); // Date - table.setColumnClass(1, Double.class, true); // Quantity - table.setColumnClass(2, String.class, true); // Partner - table.setColumnClass(3, Double.class, true); // Quantity - table.setColumnClass(4, Double.class, true); // Quantity - table.setColumnClass(5, String.class, true); // Locator - table.setColumnClass(6, String.class, true); // ASI - table.setColumnClass(7, String.class, true); // DocNo - table.setColumnClass(8, String.class, true); // Warehouse - // - table.autoSize(); - } // initAtpTab - - /** - * @return selected product category ID - */ - public int getM_Product_Category_ID() { - int M_Product_Category_ID = 0; - KeyNamePair pc = (KeyNamePair)pickProductCategory.getSelectedItem(); - if (pc != null) - M_Product_Category_ID = pc.getKey(); - return M_Product_Category_ID; - } - - /** - * @return selected Attribute Set ID - */ - public int getM_AttributeSet_ID() { - int M_AttributeSet_ID = 0; - KeyNamePair as = (KeyNamePair)pickAS.getSelectedItem(); - if (as != null) - M_AttributeSet_ID = as.getKey(); - return M_AttributeSet_ID; - } - - @Override - public boolean isResetValue() { - return true; - } - - -} // InfoProduct diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoSchedule.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoSchedule.java deleted file mode 100644 index 2b10d83153..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoSchedule.java +++ /dev/null @@ -1,451 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.GregorianCalendar; -import java.util.logging.Level; - -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JScrollPane; -import javax.swing.JTabbedPane; -import javax.swing.SwingConstants; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.StatusBar; -import org.compiere.grid.ed.VDate; -import org.compiere.model.MResourceAssignment; -import org.compiere.model.MRole; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - - -/** - * Schedule - Resource availability & assigment. - * - * @author Jorg Janke - * @version $Id: InfoSchedule.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class InfoSchedule extends CDialog - implements ActionListener, ChangeListener -{ - /** - * - */ - private static final long serialVersionUID = 7364837484557281167L; - - /** - * Constructor - * @param frame Parent - * @param mAssignment optional assignment - * @param createNew if true, allows to create new assignments - */ - public InfoSchedule (Frame frame, MResourceAssignment mAssignment, boolean createNew) - { - super(frame, Msg.getMsg(Env.getCtx(), "InfoSchedule"), frame != null && createNew); - if (mAssignment == null) - m_mAssignment = new MResourceAssignment(Env.getCtx(), 0, null); - else - m_mAssignment = mAssignment; - if (mAssignment != null) - if (log.isLoggable(Level.INFO)) log.info(mAssignment.toString()); - m_dateFrom = m_mAssignment.getAssignDateFrom(); - if (m_dateFrom == null) - m_dateFrom = new Timestamp(System.currentTimeMillis()); - m_createNew = createNew; - try - { - jbInit(); - dynInit(createNew); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "InfoSchedule", ex); - } - AEnv.showCenterWindow(frame, this); - } // InfoSchedule - - /** - * IDE Constructor - */ - public InfoSchedule() - { - this (null, null, false); - } // InfoSchedule - - /** Resource */ - private MResourceAssignment m_mAssignment; - /** Date */ - private Timestamp m_dateFrom = null; - /** Loading */ - private boolean m_loading = false; - /** Ability to create new assignments */ - private boolean m_createNew; - /** Logger */ - private static CLogger log = CLogger.getCLogger(InfoSchedule.class); - - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel parameterPanel = new CPanel(); - private GridBagLayout parameterLayout = new GridBagLayout(); - private JLabel labelResourceType = new JLabel(); - private JComboBox fieldResourceType = new JComboBox(); - private JLabel labelResource = new JLabel(); - private JComboBox fieldResource = new JComboBox(); - private JButton bPrevious = new JButton(); - private JLabel labelDate = new JLabel(); - private VDate fieldDate = new VDate(); - private JButton bNext = new JButton(); - private JTabbedPane timePane = new JTabbedPane(); - private VSchedule daySchedule = new VSchedule(this, VSchedule.TYPE_DAY); - private VSchedule weekSchedule = new VSchedule(this, VSchedule.TYPE_WEEK); - private VSchedule monthSchedule = new VSchedule(this, VSchedule.TYPE_MONTH); - private StatusBar statusBar = new StatusBar(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - - /** - * Static Layout - * @throws Exception - */ - private void jbInit() throws Exception - { - mainPanel.setLayout(mainLayout); - parameterPanel.setLayout(parameterLayout); - labelResourceType.setHorizontalTextPosition(SwingConstants.LEADING); - labelResourceType.setText(Msg.translate(Env.getCtx(), "S_ResourceType_ID")); - labelResource.setHorizontalTextPosition(SwingConstants.LEADING); - labelResource.setText(Msg.translate(Env.getCtx(), "S_Resource_ID")); - bPrevious.setMargin(new Insets(0, 0, 0, 0)); - bPrevious.setText("<"); - labelDate.setText(Msg.translate(Env.getCtx(), "Date")); - bNext.setMargin(new Insets(0, 0, 0, 0)); - bNext.setText(">"); - getContentPane().add(mainPanel, BorderLayout.CENTER); - mainPanel.add(parameterPanel, BorderLayout.NORTH); - parameterPanel.add(labelResourceType, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(8, 8, 0, 0), 0, 0)); - parameterPanel.add(fieldResourceType, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 8, 8, 4), 0, 0)); - parameterPanel.add(labelResource, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(8, 4, 0, 4), 0, 0)); - parameterPanel.add(fieldResource, new GridBagConstraints(1, 1, 1, 1, 0.5, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 8, 4), 0, 0)); - parameterPanel.add(bPrevious, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 8, 8, 0), 0, 0)); - parameterPanel.add(labelDate, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(8, 0, 0, 0), 0, 0)); - parameterPanel.add(fieldDate, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 8, 0), 0, 0)); - parameterPanel.add(bNext, new GridBagConstraints(4, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 8, 8), 0, 0)); - // - mainPanel.add(new JScrollPane(timePane), BorderLayout.CENTER); - timePane.add(daySchedule, Msg.getMsg(Env.getCtx(), "Day")); - timePane.add(weekSchedule, Msg.getMsg(Env.getCtx(), "Week")); - timePane.add(monthSchedule, Msg.getMsg(Env.getCtx(), "Month")); - // timePane.add(daySchedule, Msg.getMsg(Env.getCtx(), "Day")); - // timePane.add(weekSchedule, Msg.getMsg(Env.getCtx(), "Week")); - // timePane.add(monthSchedule, Msg.getMsg(Env.getCtx(), "Month")); - timePane.addChangeListener(this); - // - mainPanel.add(confirmPanel, BorderLayout.SOUTH); - // - this.getContentPane().add(statusBar, BorderLayout.SOUTH); - } // jbInit - - /** - * Dynamic Init - * @param createNew if true, allows to create new assignments - */ - private void dynInit (boolean createNew) - { - // Resource - fillResourceType(); - fillResource(); - fieldResourceType.addActionListener(this); - fieldResource.addActionListener(this); - - // Date - fieldDate.setValue(m_dateFrom); - fieldDate.addActionListener(this); - bPrevious.addActionListener(this); - bNext.addActionListener(this); - - // Set Init values - daySchedule.setCreateNew(createNew); - weekSchedule.setCreateNew(createNew); - monthSchedule.setCreateNew(createNew); - // - confirmPanel.addActionListener(this); - displayCalendar(); - } // dynInit - - /** - * Fill Resource Type (one time) - */ - private void fillResourceType() - { - // Get ResourceType of selected Resource - int S_ResourceType_ID = 0; - if (m_mAssignment.getS_Resource_ID() != 0) - { - String sql = "SELECT S_ResourceType_ID FROM S_Resource WHERE S_Resource_ID=?"; - S_ResourceType_ID = DB.getSQLValue(null, sql, m_mAssignment.getS_Resource_ID()); - } - - // Get Resource Types - String sql = MRole.getDefault().addAccessSQL( - "SELECT S_ResourceType_ID, Name FROM S_ResourceType WHERE IsActive='Y' ORDER BY 2", - "S_ResourceType", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - KeyNamePair defaultValue = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - rs = pstmt.executeQuery(); - while (rs.next()) - { - KeyNamePair pp = new KeyNamePair(rs.getInt(1), rs.getString(2)); - if (S_ResourceType_ID == pp.getKey()) - defaultValue = pp; - fieldResourceType.addItem(pp); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - if (defaultValue != null) - fieldResourceType.setSelectedItem(defaultValue); - } // fillResourceType - - /** - * Fill Resource Pick from Resource Type - */ - private void fillResource() - { - // Get Resource Type - KeyNamePair pp = (KeyNamePair)fieldResourceType.getSelectedItem(); - if (pp == null) - return; - int S_ResourceType_ID = pp.getKey(); - - KeyNamePair defaultValue = null; - - // Load Resources - m_loading = true; - fieldResource.removeAllItems(); - String sql = "SELECT S_Resource_ID, Name FROM S_Resource WHERE IsActive='Y' AND S_ResourceType_ID=? ORDER BY 2"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, S_ResourceType_ID); - rs = pstmt.executeQuery(); - while (rs.next()) - { - pp = new KeyNamePair(rs.getInt(1), rs.getString(2)); - if (m_mAssignment.getS_Resource_ID() == pp.getKey()) - defaultValue = pp; - fieldResource.addItem(pp); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - if (defaultValue != null) - fieldResource.setSelectedItem(defaultValue); - - m_loading = false; - } // fillResource - - /** - * Display Calendar for selected Resource, Time(day/week/month) and Date - */ - private void displayCalendar () - { - // Get Values - KeyNamePair pp = (KeyNamePair)fieldResource.getSelectedItem(); - if (pp == null) - return; - int S_Resource_ID = pp.getKey(); - m_mAssignment.setS_Resource_ID(S_Resource_ID); - Timestamp date = fieldDate.getTimestamp(); - int index = timePane.getSelectedIndex(); - if (log.isLoggable(Level.CONFIG)) log.config("Index=" + index + ", ID=" + S_Resource_ID + " - " + date); - - // Set Info - m_loading = true; - if (index == 0) - daySchedule.recreate (S_Resource_ID, date); - else if (index == 1) - weekSchedule.recreate (S_Resource_ID, date); - else - monthSchedule.recreate (S_Resource_ID, date); - m_loading = false; - repaint(); - } // displayCalendar - - /************************************************************************** - * Dispose. - */ - public void dispose() - { - daySchedule.dispose(); - weekSchedule.dispose(); - monthSchedule.dispose(); - this.removeAll(); - super.dispose(); - } // dispose - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (m_loading) - return; - this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - dispose(); - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - dispose(); - // - else if (e.getSource() == fieldResourceType) - { - fillResource(); - displayCalendar(); - } - // - else if (e.getSource() == fieldResource || e.getSource() == fieldDate) - displayCalendar(); - // - else if (e.getSource() == bPrevious) - adjustDate(-1); - else if (e.getSource() == bNext) - adjustDate(+1); - // - this.setCursor(Cursor.getDefaultCursor()); - } // actionPerformed - - /** - * Change Listener (Tab Pane) - * @param e event - */ - public void stateChanged (ChangeEvent e) - { - displayCalendar(); - } // stateChanged - - /** - * Adjust Date - * @param diff difference - */ - private void adjustDate (int diff) - { - Timestamp date = fieldDate.getTimestamp(); - GregorianCalendar cal = new GregorianCalendar(); - cal.setTime(date); - if (timePane.getSelectedIndex() == 0) - cal.add(java.util.Calendar.DAY_OF_YEAR, diff); - else if (timePane.getSelectedIndex() == 1) - cal.add(java.util.Calendar.WEEK_OF_YEAR, diff); - else - cal.add(java.util.Calendar.MONTH, diff); - // - fieldDate.setValue(new Timestamp(cal.getTimeInMillis())); - displayCalendar (); - } // adjustDate - - /*************************************************************************/ - - /** - * Callback. - * Called from VSchedulePanel after VAssignmentDialog finished - * @param assignment New/Changed Assignment - */ - public void mAssignmentCallback (MResourceAssignment assignment) - { - m_mAssignment = assignment; - if (m_createNew) - dispose(); - else - displayCalendar(); - } // mAssignmentCallback - - /** - * Get Assignment - * @return Assignment - */ - public MResourceAssignment getMResourceAssignment() - { - return m_mAssignment; - } // getMResourceAssignment - - - - /** -SELECT o.DocumentNo, ol.Line, ol.Description -FROM C_OrderLine ol, C_Order o -WHERE ol.S_ResourceAssignment_ID=1 - AND ol.C_Order_ID=o.C_Order_ID -UNION -SELECT i.DocumentNo, il.Line, il.Description -FROM C_InvoiceLine il, C_Invoice i -WHERE il.S_ResourceAssignment_ID=1 - AND il.C_Invoice_ID=i.C_Invoice_ID -UNION -SELECT e.DocumentNo, el.Line, el.Description -FROM S_TimeExpenseLine el, S_TimeExpense e -WHERE el.S_ResourceAssignment_ID=1 - AND el.S_TimeExpense_ID=el.S_TimeExpense_ID - */ -} // InfoSchedule diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/Info_Column.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/Info_Column.java deleted file mode 100644 index f08386f894..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/Info_Column.java +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import org.compiere.minigrid.ColumnInfo; - -/** - * Info Column Details - * - * @author Jorg Janke - * @version $Id: Info_Column.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * - * NOTE: Use {@link org.compiere.minigrid.ColumnInfo} instead - */ -public class Info_Column extends ColumnInfo -{ - /** - * Create Info Column (r/o and not color column) - * - * @param colHeader Column Header - * @param colSQL SQL select code for column - * @param colClass class of column - determines display - */ - public Info_Column (String colHeader, String colSQL, Class colClass) - { - super(colHeader, colSQL, colClass); - } // Info_Column - - /** - * Create Info Column (r/o and not color column) - * - * @param colHeader Column Header - * @param colSQL SQL select code for column - * @param colClass class of column - determines display - * @param IDcolSQL SQL select for the ID of the for the displayed column (KeyNamePair) - */ - public Info_Column (String colHeader, String colSQL, Class colClass, String IDcolSQL) - { - super(colHeader, colSQL, colClass, true, false, IDcolSQL); - } // Info_Column - - /** - * Create Info Column (not color column) - * - * @param colHeader Column Header - * @param colSQL SQL select code for column - * @param colClass class of column - determines display - * @param readOnly column is read only - * @author ashley - */ - public Info_Column (String colHeader, String colSQL, Class colClass, boolean readOnly) - { - super(colHeader, colSQL, colClass, readOnly, false, null); - } // Info_Column - - /** - * Create Info Column - * - * @param colHeader Column Header - * @param colSQL SQL select code for column - * @param colClass class of column - determines display - * @param readOnly column is read only - * @param colorColumn if true, value of column determines foreground color - * @param IDcolSQL SQL select for the ID of the for the displayed column - */ - public Info_Column (String colHeader, String colSQL, Class colClass, - boolean readOnly, boolean colorColumn, String IDcolSQL) - { - super(colHeader, colSQL, colClass, readOnly, colorColumn, IDcolSQL); - } // Info_Column - public void setIDcolSQL(String IDcolSQL) - { - super.setKeyPairColSQL(IDcolSQL); - } - public String getIDcolSQL() - { - return super.getKeyPairColSQL(); - } - public boolean isIDcol() - { - return super.isKeyPairCol(); - } -} // infoColumn diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InvoiceHistory.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InvoiceHistory.java deleted file mode 100644 index 7fdba6ab75..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InvoiceHistory.java +++ /dev/null @@ -1,710 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.BorderLayout; -import java.awt.Dialog; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.JLabel; -import javax.swing.JScrollPane; -import javax.swing.JTabbedPane; -import javax.swing.WindowConstants; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.table.DefaultTableModel; - -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.minigrid.MiniTable; -import org.compiere.model.MDocType; -import org.compiere.model.MPriceList; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogMgt; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Price History for BPartner/Product - * - * @author Jorg Janke - * @version $Id: InvoiceHistory.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class InvoiceHistory extends CDialog - implements ActionListener, ChangeListener -{ - /** - * - */ - private static final long serialVersionUID = 7886949815469558804L; - - /** - * Show History - * @param C_BPartner_ID partner - * @param M_Product_ID product - * @param M_Warehouse_ID warehouse - * @param M_AttributeSetInstance_ID ASI - */ - public InvoiceHistory (Dialog frame, - int C_BPartner_ID, int M_Product_ID, int M_Warehouse_ID, int M_AttributeSetInstance_ID) - { - super(frame, Msg.getMsg(Env.getCtx(), "PriceHistory"), true); - if (log.isLoggable(Level.CONFIG)) log.config("C_BPartner_ID=" + C_BPartner_ID - + ", M_Product_ID=" + M_Product_ID - + ", M_Warehouse_ID=" + M_Warehouse_ID - + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID); - m_C_BPartner_ID = C_BPartner_ID; - m_M_Product_ID = M_Product_ID; - m_M_Warehouse_ID = M_Warehouse_ID; - m_M_AttributeSetInstance_ID = M_AttributeSetInstance_ID; - try - { - jbInit(); - dynInit(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - mainPanel.setPreferredSize(new Dimension(700,400)); - AEnv.positionCenterWindow(frame, this); - } // InvoiceHistory - - private int m_C_BPartner_ID; - private int m_M_Product_ID; - private int m_M_Warehouse_ID; - private int m_M_AttributeSetInstance_ID; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(InvoiceHistory.class); - - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel northPanel = new CPanel(); - private JLabel label = new JLabel(); - private FlowLayout northLayout = new FlowLayout(); - // - private ConfirmPanel confirmPanel = new ConfirmPanel(); - private JTabbedPane centerTabbedPane = new JTabbedPane(); - // - private JScrollPane pricePane = new JScrollPane(); - private MiniTable m_tablePrice = new MiniTable(); - private DefaultTableModel m_modelPrice = null; - - private JScrollPane reservedPane = new JScrollPane(); - private MiniTable m_tableReserved = new MiniTable(); - private DefaultTableModel m_modelReserved = null; - - private JScrollPane orderedPane = new JScrollPane(); - private MiniTable m_tableOrdered = new MiniTable(); - private DefaultTableModel m_modelOrdered = null; - - private JScrollPane unconfirmedPane = new JScrollPane(); - private MiniTable m_tableUnconfirmed = new MiniTable(); - private DefaultTableModel m_modelUnconfirmed = null; - - private JScrollPane atpPane = new JScrollPane(); - private MiniTable m_tableAtp = new MiniTable(); - private DefaultTableModel m_modelAtp = null; - - /** - * Ststic Init - */ - void jbInit() throws Exception - { - this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); - mainPanel.setLayout(mainLayout); - label.setText("Label"); - northPanel.setLayout(northLayout); - northLayout.setAlignment(FlowLayout.LEFT); - getContentPane().add(mainPanel); - mainPanel.add(northPanel, BorderLayout.NORTH); - northPanel.add(label, null); - mainPanel.add(confirmPanel, BorderLayout.SOUTH); - mainPanel.add(centerTabbedPane, BorderLayout.CENTER); - centerTabbedPane.addChangeListener(this); - centerTabbedPane.add(pricePane, Msg.getMsg(Env.getCtx(), "PriceHistory")); - centerTabbedPane.add(reservedPane, Msg.translate(Env.getCtx(), "QtyReserved")); - centerTabbedPane.add(orderedPane, Msg.translate(Env.getCtx(), "QtyOrdered")); - centerTabbedPane.add(unconfirmedPane, Msg.getMsg(Env.getCtx(), "QtyUnconfirmed")); - if (m_M_Product_ID != 0) - centerTabbedPane.add(atpPane, Msg.getMsg(Env.getCtx(), "ATP")); - // - pricePane.getViewport().add(m_tablePrice, null); - reservedPane.getViewport().add(m_tableReserved, null); - orderedPane.getViewport().add(m_tableOrdered, null); - unconfirmedPane.getViewport().add(m_tableUnconfirmed, null); - if (m_M_Product_ID != 0) - atpPane.getViewport().add(m_tableAtp, null); - // - confirmPanel.addActionListener(this); - } // jbInit - - /** - * Dynamic Init for Price Tab - */ - private boolean dynInit() - { - // Header - Vector columnNames = new Vector(); - columnNames.add(Msg.translate(Env.getCtx(), m_C_BPartner_ID == 0 ? "C_BPartner_ID" : "M_Product_ID")); - columnNames.add(Msg.translate(Env.getCtx(), "PriceActual")); - columnNames.add(Msg.translate(Env.getCtx(), "QtyInvoiced")); - columnNames.add(Msg.translate(Env.getCtx(), "Discount")); - columnNames.add(Msg.translate(Env.getCtx(), "DocumentNo")); - columnNames.add(Msg.translate(Env.getCtx(), "DateInvoiced")); - columnNames.add(Msg.translate(Env.getCtx(), "AD_Org_ID")); - - // Fill Data - Vector> data = null; - if (m_C_BPartner_ID == 0) - data = queryBPartner(); // BPartner of Product - else - data = queryProduct(); // Product of BPartner - - // Table - m_modelPrice = new DefaultTableModel(data, columnNames); - m_tablePrice.setModel(m_modelPrice); - // - m_tablePrice.setColumnClass(0, String.class, true); // Product/Partner - m_tablePrice.setColumnClass(1, Double.class, true); // Price - m_tablePrice.setColumnClass(2, Double.class, true); // Quantity - m_tablePrice.setColumnClass(3, BigDecimal.class, true); // Discount (%) to limit precision - m_tablePrice.setColumnClass(4, String.class, true); // DocNo - m_tablePrice.setColumnClass(5, Timestamp.class, true); // Date - m_tablePrice.setColumnClass(6, String.class, true); // Org - // - m_tablePrice.autoSize(); - // - return data.size() != 0; - } // dynInit - - - /** - * Get Info for Product for given Business Parner - */ - private Vector> queryProduct () - { - String sql = "SELECT p.Name,l.PriceActual,l.PriceList,l.QtyInvoiced," // 1,2,3,4 - + "i.DateInvoiced,dt.PrintName || ' ' || i.DocumentNo As DocumentNo," // 5,6 - + "o.Name, " // 7 - + "NULL, i.M_PriceList_ID " // 8,9 - + "FROM C_Invoice i" - + " INNER JOIN C_InvoiceLine l ON (i.C_Invoice_ID=l.C_Invoice_ID)" - + " INNER JOIN C_DocType dt ON (i.C_DocType_ID=dt.C_DocType_ID)" - + " INNER JOIN AD_Org o ON (i.AD_Org_ID=o.AD_Org_ID)" - + " INNER JOIN M_Product p ON (l.M_Product_ID=p.M_Product_ID) " - + "WHERE i.C_BPartner_ID=? " - + "ORDER BY i.DateInvoiced DESC"; - - Vector> data = fillTable (sql, m_C_BPartner_ID); - - sql = "SELECT Name from C_BPartner WHERE C_BPartner_ID=?"; - fillLabel (sql, m_C_BPartner_ID); - return data; - } // queryProduct - - /** - * Get Info for Business Partners for given Product - */ - private Vector> queryBPartner () - { - String sql = "SELECT bp.Name,l.PriceActual,l.PriceList,l.QtyInvoiced," // 1,2,3,4 - + "i.DateInvoiced,dt.PrintName || ' ' || i.DocumentNo As DocumentNo," // 5,6 - + "o.Name," // 7 - + "NULL, i.M_PriceList_ID" // 8,9 - + " FROM C_Invoice i" - + " INNER JOIN C_InvoiceLine l ON (i.C_Invoice_ID=l.C_Invoice_ID)" - + " INNER JOIN C_DocType dt ON (i.C_DocType_ID=dt.C_DocType_ID)" - + " INNER JOIN AD_Org o ON (i.AD_Org_ID=o.AD_Org_ID)" - + " INNER JOIN C_BPartner bp ON (i.C_BPartner_ID=bp.C_BPartner_ID) " - + "WHERE l.M_Product_ID=? " - + "ORDER BY i.DateInvoiced DESC"; - - Vector> data = fillTable (sql, m_M_Product_ID); - - sql = "SELECT Name from M_Product WHERE M_Product_ID=?"; - fillLabel (sql, m_M_Product_ID); - return data; - } // qyeryBPartner - - /** - * Fill Table - */ - private Vector> fillTable (String sql, int parameter) - { - if (log.isLoggable(Level.FINE)) log.fine(sql + "; Parameter=" + parameter); - Vector> data = new Vector>(); - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, parameter); - rs = pstmt.executeQuery(); - while (rs.next()) - { - Vector line = new Vector(6); - // 0-Name, 1-PriceActual, 2-QtyInvoiced, 3-Discount, 4-DocumentNo, 5-DateInvoiced - line.add(rs.getString(1)); // Name - line.add(rs.getBigDecimal(2)); // Price - line.add(Double.valueOf(rs.getDouble(4))); // Qty - BigDecimal discountBD = rs.getBigDecimal(8); - if (discountBD == null) { - double priceList = rs.getDouble(3); - double priceActual = rs.getDouble(2); - if (priceList != 0) { - discountBD = BigDecimal.valueOf((priceList - priceActual)/priceList * 100); - // Rounding: - int precision = MPriceList.getStandardPrecision(Env.getCtx(), rs.getInt(9)); - if (discountBD.scale() > precision) - discountBD = discountBD.setScale(precision, RoundingMode.HALF_UP); - } - else - discountBD = Env.ZERO; - } - line.add(discountBD); // Discount - line.add(rs.getString(6)); // DocNo - line.add(rs.getTimestamp(5)); // Date - line.add(rs.getString(7)); // Org/Warehouse - data.add(line); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - if (log.isLoggable(Level.FINE)) log.fine("#" + data.size()); - return data; - } // fillTable - - /** - * Set Label - * to product or bp name - */ - private void fillLabel (String sql, int parameter) - { - if (log.isLoggable(Level.FINE)) log.fine(sql + "; Parameter=" + parameter); - String retValue = DB.getSQLValueString(null, sql, parameter); - if (retValue != null) - label.setText(retValue); - } // fillLabel - - - /** - * Action Listener - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - dispose(); - } // actionPerformed - - - /** - * Tab Changed - * @param e event - */ - public void stateChanged(ChangeEvent e) - { - if (centerTabbedPane.getSelectedIndex() == 1) - initReservedOrderedTab(true); - else if (centerTabbedPane.getSelectedIndex() == 2) - initReservedOrderedTab(false); - else if (centerTabbedPane.getSelectedIndex() == 3) - initUnconfirmedTab(); - else if (centerTabbedPane.getSelectedIndex() == 4) - initAtpTab(); - } // stateChanged - - /** - * Query Reserved/Ordered - * @param reserved po/so - */ - private void initReservedOrderedTab (boolean reserved) - { - // Done already - if (reserved && m_modelReserved != null) - return; - if (!reserved && m_modelOrdered != null) - return; - - // Header - Vector columnNames = new Vector(); - columnNames.add(Msg.translate(Env.getCtx(), m_C_BPartner_ID == 0 ? "C_BPartner_ID" : "M_Product_ID")); - columnNames.add(Msg.translate(Env.getCtx(), "PriceActual")); - columnNames.add(Msg.translate(Env.getCtx(), reserved ? "QtyReserved" : "QtyOrdered")); - columnNames.add(Msg.translate(Env.getCtx(), "Discount")); - columnNames.add(Msg.translate(Env.getCtx(), "DocumentNo")); - columnNames.add(Msg.translate(Env.getCtx(), "DateOrdered")); - columnNames.add(Msg.translate(Env.getCtx(), "M_Warehouse_ID")); - - // Fill Data - Vector> data = null; - if (m_C_BPartner_ID == 0) - { - String sql = "SELECT bp.Name, ol.PriceActual,ol.PriceList,ol.QtyReserved," - + "o.DateOrdered,dt.PrintName || ' ' || o.DocumentNo As DocumentNo, " - + "w.Name," - + "ol.Discount, 0 " // 8,9=M_PriceList_ID - + "FROM C_Order o" - + " INNER JOIN C_OrderLine ol ON (o.C_Order_ID=ol.C_Order_ID)" - + " INNER JOIN C_DocType dt ON (o.C_DocType_ID=dt.C_DocType_ID)" - + " INNER JOIN M_Warehouse w ON (ol.M_Warehouse_ID=w.M_Warehouse_ID)" - + " INNER JOIN C_BPartner bp ON (o.C_BPartner_ID=bp.C_BPartner_ID) " - + "WHERE ol.QtyReserved<>0" - + " AND ol.M_Product_ID=?" - + " AND o.IsSOTrx=" + (reserved ? "'Y'" : "'N'") - + " ORDER BY o.DateOrdered"; - data = fillTable (sql, m_M_Product_ID); // Product By BPartner - } - else - { - String sql = "SELECT p.Name, ol.PriceActual,ol.PriceList,ol.QtyReserved," - + "o.DateOrdered,dt.PrintName || ' ' || o.DocumentNo As DocumentNo, " - + "w.Name," - + "ol.Discount, 0 " // 8,9=M_PriceList_ID - + "FROM C_Order o" - + " INNER JOIN C_OrderLine ol ON (o.C_Order_ID=ol.C_Order_ID)" - + " INNER JOIN C_DocType dt ON (o.C_DocType_ID=dt.C_DocType_ID)" - + " INNER JOIN M_Warehouse w ON (ol.M_Warehouse_ID=w.M_Warehouse_ID)" - + " INNER JOIN M_Product p ON (ol.M_Product_ID=p.M_Product_ID) " - + "WHERE ol.QtyReserved<>0" - + " AND o.C_BPartner_ID=?" - + " AND o.IsSOTrx=" + (reserved ? "'Y'" : "'N'") - + " ORDER BY o.DateOrdered"; - data = fillTable (sql, m_C_BPartner_ID);// Product of BP - } - - // Table - MiniTable table = null; - if (reserved) - { - m_modelReserved = new DefaultTableModel(data, columnNames); - m_tableReserved.setModel(m_modelReserved); - table = m_tableReserved; - } - else - { - m_modelOrdered = new DefaultTableModel(data, columnNames); - m_tableOrdered.setModel(m_modelOrdered); - table = m_tableOrdered; - } - // - table.setColumnClass(0, String.class, true); // Product/Partner - table.setColumnClass(1, BigDecimal.class, true); // Price - table.setColumnClass(2, Double.class, true); // Quantity - table.setColumnClass(3, BigDecimal.class, true); // Discount (%) - table.setColumnClass(4, String.class, true); // DocNo - table.setColumnClass(5, Timestamp.class, true); // Date - table.setColumnClass(6, String.class, true); // Warehouse - // - table.autoSize(); - } // initReservedOrderedTab - - - /** - * Query Unconfirmed - */ - private void initUnconfirmedTab () - { - // Done already - if (m_modelUnconfirmed != null) - return; - - // Header - Vector columnNames = new Vector(); - columnNames.add(Msg.translate(Env.getCtx(), m_C_BPartner_ID == 0 ? "C_BPartner_ID" : "M_Product_ID")); - columnNames.add(Msg.translate(Env.getCtx(), "MovementQty")); - columnNames.add(Msg.translate(Env.getCtx(), "MovementDate")); - columnNames.add(Msg.translate(Env.getCtx(), "IsSOTrx")); - columnNames.add(Msg.translate(Env.getCtx(), "DocumentNo")); - columnNames.add(Msg.translate(Env.getCtx(), "M_Warehouse_ID")); - - // Fill Data - String sql = null; - int parameter = 0; - if (m_C_BPartner_ID == 0) - { - sql = "SELECT bp.Name," - + " CASE WHEN io.IsSOTrx='Y' THEN iol.MovementQty*-1 ELSE iol.MovementQty END AS MovementQty," - + " io.MovementDate,io.IsSOTrx," - + " dt.PrintName || ' ' || io.DocumentNo As DocumentNo," - + " w.Name " - + "FROM M_InOutLine iol" - + " INNER JOIN M_InOut io ON (iol.M_InOut_ID=io.M_InOut_ID)" - + " INNER JOIN C_BPartner bp ON (io.C_BPartner_ID=bp.C_BPartner_ID)" - + " INNER JOIN C_DocType dt ON (io.C_DocType_ID=dt.C_DocType_ID)" - + " INNER JOIN M_Warehouse w ON (io.M_Warehouse_ID=w.M_Warehouse_ID)" - + " INNER JOIN M_InOutLineConfirm lc ON (iol.M_InOutLine_ID=lc.M_InOutLine_ID) " - + "WHERE iol.M_Product_ID=?" - + " AND lc.Processed='N' " - + "ORDER BY io.MovementDate,io.IsSOTrx"; - parameter = m_M_Product_ID; - } - else - { - sql = "SELECT p.Name," - + " CASE WHEN io.IsSOTrx='Y' THEN iol.MovementQty*-1 ELSE iol.MovementQty END AS MovementQty," - + " io.MovementDate,io.IsSOTrx," - + " dt.PrintName || ' ' || io.DocumentNo As DocumentNo," - + " w.Name " - + "FROM M_InOutLine iol" - + " INNER JOIN M_InOut io ON (iol.M_InOut_ID=io.M_InOut_ID)" - + " INNER JOIN M_Product p ON (iol.M_Product_ID=p.M_Product_ID)" - + " INNER JOIN C_DocType dt ON (io.C_DocType_ID=dt.C_DocType_ID)" - + " INNER JOIN M_Warehouse w ON (io.M_Warehouse_ID=w.M_Warehouse_ID)" - + " INNER JOIN M_InOutLineConfirm lc ON (iol.M_InOutLine_ID=lc.M_InOutLine_ID) " - + "WHERE io.C_BPartner_ID=?" - + " AND lc.Processed='N' " - + "ORDER BY io.MovementDate,io.IsSOTrx"; - parameter = m_C_BPartner_ID; - } - Vector> data = new Vector>(); - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, parameter); - rs = pstmt.executeQuery(); - while (rs.next()) - { - Vector line = new Vector(6); - // 1-Name, 2-MovementQty, 3-MovementDate, 4-IsSOTrx, 5-DocumentNo - line.add(rs.getString(1)); // Name - line.add(Double.valueOf(rs.getDouble(2))); // Qty - line.add(rs.getTimestamp(3)); // Date - line.add(Boolean.valueOf("Y".equals(rs.getString(4)))); // IsSOTrx - line.add(rs.getString(5)); // DocNo - line.add(rs.getString(6)); // Warehouse - data.add(line); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - if (log.isLoggable(Level.FINE)) log.fine("#" + data.size()); - - // Table - m_modelUnconfirmed = new DefaultTableModel(data, columnNames); - m_tableUnconfirmed.setModel(m_modelUnconfirmed); - MiniTable table = m_tableUnconfirmed; - // - table.setColumnClass(0, String.class, true); // Product/Partner - table.setColumnClass(1, Double.class, true); // MovementQty - table.setColumnClass(2, Timestamp.class, true); // MovementDate - table.setColumnClass(3, Boolean.class, true); // IsSOTrx - table.setColumnClass(4, String.class, true); // DocNo - // - table.autoSize(); - } // initUnconfirmedTab - - /** - * Query ATP - */ - private void initAtpTab () - { - // Done already - if (m_modelAtp != null) - return; - - // Header - Vector columnNames = new Vector(); - columnNames.add(Msg.translate(Env.getCtx(), "Date")); - columnNames.add(Msg.translate(Env.getCtx(), "QtyOnHand")); - columnNames.add(Msg.translate(Env.getCtx(), "C_BPartner_ID")); - columnNames.add(Msg.translate(Env.getCtx(), "QtyOrdered")); - columnNames.add(Msg.translate(Env.getCtx(), "QtyReserved")); - columnNames.add(Msg.translate(Env.getCtx(), "M_Locator_ID")); - columnNames.add(Msg.translate(Env.getCtx(), "M_AttributeSetInstance_ID")); - columnNames.add(Msg.translate(Env.getCtx(), "DocumentNo")); - columnNames.add(Msg.translate(Env.getCtx(), "M_Warehouse_ID")); - - // Fill Storage Data - boolean showDetail = CLogMgt.isLevelFine(); - String sql = "SELECT s.QtyOnHand, s.QtyReserved, s.QtyOrdered," - + " productAttribute(s.M_AttributeSetInstance_ID), s.M_AttributeSetInstance_ID,"; - if (!showDetail) - sql = "SELECT SUM(s.QtyOnHand), SUM(s.QtyReserved), SUM(s.QtyOrdered)," - + " productAttribute(s.M_AttributeSetInstance_ID), 0,"; - sql += " w.Name, l.Value " - + "FROM M_Storage s" - + " INNER JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)" - + " INNER JOIN M_Warehouse w ON (l.M_Warehouse_ID=w.M_Warehouse_ID) " - + "WHERE M_Product_ID=?"; - if (m_M_Warehouse_ID != 0) - sql += " AND l.M_Warehouse_ID=?"; - if (m_M_AttributeSetInstance_ID > 0) - sql += " AND s.M_AttributeSetInstance_ID=?"; - sql += " AND (s.QtyOnHand<>0 OR s.QtyReserved<>0 OR s.QtyOrdered<>0)"; - if (!showDetail) - sql += " GROUP BY productAttribute(s.M_AttributeSetInstance_ID), w.Name, l.Value"; - sql += " ORDER BY l.Value"; - - Vector> data = new Vector>(); - double qty = 0; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_M_Product_ID); - if (m_M_Warehouse_ID != 0) - pstmt.setInt(2, m_M_Warehouse_ID); - if (m_M_AttributeSetInstance_ID > 0) - pstmt.setInt(3, m_M_AttributeSetInstance_ID); - rs = pstmt.executeQuery(); - while (rs.next()) - { - Vector line = new Vector(9); - line.add(null); // Date - double qtyOnHand = rs.getDouble(1); - qty += qtyOnHand; - line.add(Double.valueOf(qtyOnHand)); // Qty - line.add(null); // BPartner - line.add(Double.valueOf(rs.getDouble(3))); // QtyOrdered - line.add(Double.valueOf(rs.getDouble(2))); // QtyReserved - line.add(rs.getString(7)); // Locator - String asi = rs.getString(4); - if (showDetail && (asi == null || asi.length() == 0)) - asi = "{" + rs.getInt(5) + "}"; - line.add(asi); // ASI - line.add(null); // DocumentNo - line.add(rs.getString(6)); // Warehouse - data.add(line); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - - // Orders - sql = "SELECT o.DatePromised, ol.QtyReserved," - + " productAttribute(ol.M_AttributeSetInstance_ID), ol.M_AttributeSetInstance_ID," - + " dt.DocBaseType, bp.Name," - + " dt.PrintName || ' ' || o.DocumentNo As DocumentNo, w.Name " - + "FROM C_Order o" - + " INNER JOIN C_OrderLine ol ON (o.C_Order_ID=ol.C_Order_ID)" - + " INNER JOIN C_DocType dt ON (o.C_DocType_ID=dt.C_DocType_ID)" - + " INNER JOIN M_Warehouse w ON (ol.M_Warehouse_ID=w.M_Warehouse_ID)" - + " INNER JOIN C_BPartner bp ON (o.C_BPartner_ID=bp.C_BPartner_ID) " - + "WHERE ol.QtyReserved<>0" - + " AND ol.M_Product_ID=?"; - if (m_M_Warehouse_ID != 0) - sql += " AND ol.M_Warehouse_ID=?"; - if (m_M_AttributeSetInstance_ID > 0) - sql += " AND ol.M_AttributeSetInstance_ID=?"; - sql += " ORDER BY o.DatePromised"; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_M_Product_ID); - if (m_M_Warehouse_ID != 0) - pstmt.setInt(2, m_M_Warehouse_ID); - if (m_M_AttributeSetInstance_ID > 0) - pstmt.setInt(3, m_M_AttributeSetInstance_ID); - rs = pstmt.executeQuery(); - while (rs.next()) - { - Vector line = new Vector(9); - line.add(rs.getTimestamp(1)); // Date - double oq = rs.getDouble(2); - String DocBaseType = rs.getString(5); - Double qtyReserved = null; - Double qtyOrdered = null; - if (MDocType.DOCBASETYPE_PurchaseOrder.equals(DocBaseType)) - { - qtyOrdered = Double.valueOf(oq); - qty += oq; - } - else - { - qtyReserved = Double.valueOf(oq); - qty -= oq; - } - line.add(Double.valueOf(qty)); // Qty - line.add(rs.getString(6)); // BPartner - line.add(qtyOrdered); // QtyOrdered - line.add(qtyReserved); // QtyReserved - line.add(null); // Locator - String asi = rs.getString(3); - if (showDetail && (asi == null || asi.length() == 0)) - asi = "{" + rs.getInt(4) + "}"; - line.add(asi); // ASI - line.add(rs.getString(7)); // DocumentNo - line.add(rs.getString(8)); // Warehouse - data.add(line); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - - // Table - MiniTable table = null; - m_modelAtp = new DefaultTableModel(data, columnNames); - m_tableAtp.setModel(m_modelAtp); - table = m_tableAtp; - // - table.setColumnClass(0, Timestamp.class, true); // Date - table.setColumnClass(1, Double.class, true); // Quantity - table.setColumnClass(2, String.class, true); // Partner - table.setColumnClass(3, Double.class, true); // Quantity - table.setColumnClass(4, Double.class, true); // Quantity - table.setColumnClass(5, String.class, true); // Locator - table.setColumnClass(6, String.class, true); // ASI - table.setColumnClass(7, String.class, true); // DocNo - table.setColumnClass(8, String.class, true); // Warehouse - // - table.autoSize(); - } // initAtpTab - -} // InvoiceHistory diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/PAttributeInstance.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/PAttributeInstance.java deleted file mode 100644 index 12cbeb8cc3..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/PAttributeInstance.java +++ /dev/null @@ -1,401 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.BorderLayout; -import java.awt.event.ActionEvent; -import java.awt.event.MouseEvent; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.Timestamp; -import java.util.logging.Level; - -import javax.swing.JDialog; -import javax.swing.JFrame; -import javax.swing.JScrollPane; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; - -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.minigrid.ColumnInfo; -import org.compiere.minigrid.IDColumn; -import org.compiere.minigrid.MiniTable; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - - -/** - * Display Product Attribute Instance Info - * - * @author Jorg Janke - * @version $Id: PAttributeInstance.java,v 1.3 2006/07/30 00:51:27 jjanke Exp $ - */ -public class PAttributeInstance extends CDialog - implements ListSelectionListener -{ - /** - * - */ - private static final long serialVersionUID = -3743466565716139916L; - - /** - * Constructor - * @param parent frame parent - * @param title title - * @param M_Warehouse_ID warehouse key name pair - * @param M_Locator_ID locator - * @param M_Product_ID product key name pair - * @param C_BPartner_ID bp - */ - public PAttributeInstance(JFrame parent, String title, - int M_Warehouse_ID, int M_Locator_ID, int M_Product_ID, int C_BPartner_ID) - { - super (parent, Msg.getMsg(Env.getCtx(), "PAttributeInstance") + title, true); - init (M_Warehouse_ID, M_Locator_ID, M_Product_ID, C_BPartner_ID); - AEnv.showCenterWindow(parent, this); - } // PAttributeInstance - - /** - * Constructor - * @param parent dialog parent - * @param title title - * @param M_Warehouse_ID warehouse key name pair - * @param M_Locator_ID locator - * @param M_Product_ID product key name pair - * @param C_BPartner_ID bp - */ - public PAttributeInstance(JDialog parent, String title, - int M_Warehouse_ID, int M_Locator_ID, int M_Product_ID, int C_BPartner_ID) - { - super (parent, Msg.getMsg(Env.getCtx(), "PAttributeInstance") + title, true); - init (M_Warehouse_ID, M_Locator_ID, M_Product_ID, C_BPartner_ID); - AEnv.showCenterWindow(parent, this); - } // PAttributeInstance - - /** - * Initialization - * @param M_Warehouse_ID wh - * @param M_Locator_ID loc - * @param M_Product_ID product - * @param C_BPartner_ID partner - */ - private void init (int M_Warehouse_ID, int M_Locator_ID, int M_Product_ID, int C_BPartner_ID) - { - if (log.isLoggable(Level.INFO)) log.info("M_Warehouse_ID=" + M_Warehouse_ID - + ", M_Locator_ID=" + M_Locator_ID - + ", M_Product_ID=" + M_Product_ID); - m_M_Warehouse_ID = M_Warehouse_ID; - m_M_Locator_ID = M_Locator_ID; - m_M_Product_ID = M_Product_ID; - try - { - jbInit(); - dynInit(C_BPartner_ID); - } - catch (Exception e) - { - log.log(Level.SEVERE, "", e); - } - } // init - - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel northPanel = new CPanel(); - private BorderLayout northLayout = new BorderLayout(); - private JScrollPane centerScrollPane = new JScrollPane(); - private ConfirmPanel confirmPanel = new ConfirmPanel (true); - private CCheckBox showAll = new CCheckBox (Msg.getMsg(Env.getCtx(), "ShowAll")); - // - private MiniTable m_table = new MiniTable(); - // Parameter - private int m_M_Warehouse_ID; - private int m_M_Locator_ID; - private int m_M_Product_ID; - // - private int m_M_AttributeSetInstance_ID = -1; - private String m_M_AttributeSetInstanceName = null; - private String m_sql; - /** Logger */ - private static CLogger log = CLogger.getCLogger(PAttributeInstance.class); - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - mainPanel.setLayout(mainLayout); - this.getContentPane().add(mainPanel, BorderLayout.CENTER); - // North - northPanel.setLayout(northLayout); - northPanel.add(showAll, BorderLayout.EAST); - showAll.addActionListener(this); - mainPanel.add(northPanel, BorderLayout.NORTH); - // Center - mainPanel.add(centerScrollPane, BorderLayout.CENTER); - centerScrollPane.getViewport().add(m_table, null); - // South - mainPanel.add(confirmPanel, BorderLayout.SOUTH); - confirmPanel.addActionListener(this); - } // jbInit - - /** Table Column Layout Info */ - private static ColumnInfo[] s_layout = new ColumnInfo[] - { - new ColumnInfo(" ", "s.M_AttributeSetInstance_ID", IDColumn.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "Description"), "asi.Description", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "Lot"), "asi.Lot", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "SerNo"), "asi.SerNo", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "GuaranteeDate"), "asi.GuaranteeDate", Timestamp.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "M_Locator_ID"), "l.Value", KeyNamePair.class, "s.M_Locator_ID"), - new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOnHand"), "s.QtyOnHand", Double.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "QtyReserved"), "s.QtyReserved", Double.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOrdered"), "s.QtyOrdered", Double.class), - // See RV_Storage - new ColumnInfo(Msg.translate(Env.getCtx(), "GoodForDays"), "(daysbetween(asi.GuaranteeDate, SYSDATE))-p.GuaranteeDaysMin", Integer.class, true, true, null), - new ColumnInfo(Msg.translate(Env.getCtx(), "ShelfLifeDays"), "daysbetween(asi.GuaranteeDate, SYSDATE)", Integer.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "ShelfLifeRemainingPct"), "CASE WHEN p.GuaranteeDays > 0 THEN TRUNC(((daysbetween(asi.GuaranteeDate, SYSDATE))/p.GuaranteeDays)*100) ELSE 0 END", Integer.class), - }; - /** From Clause */ - private static String s_sqlFrom = "M_Storage s" - + " INNER JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)" - + " INNER JOIN M_Product p ON (s.M_Product_ID=p.M_Product_ID)" - + " LEFT OUTER JOIN M_AttributeSetInstance asi ON (s.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID)"; - /** Where Clause */ - private static String s_sqlWhere = "s.M_Product_ID=? AND l.M_Warehouse_ID=?"; - private static String s_sqlWhereWithoutWarehouse = " s.M_Product_ID=?"; - - private String m_sqlNonZero = " AND (s.QtyOnHand<>0 OR s.QtyReserved<>0 OR s.QtyOrdered<>0)"; - private String m_sqlMinLife = ""; - - /** - * Dynamic Init - * @param C_BPartner_ID BP - */ - private void dynInit(int C_BPartner_ID) - { - if (log.isLoggable(Level.CONFIG)) log.config("C_BPartner_ID=" + C_BPartner_ID); - if (C_BPartner_ID != 0) - { - int ShelfLifeMinPct = 0; - int ShelfLifeMinDays = 0; - String sql = "SELECT bp.ShelfLifeMinPct, bpp.ShelfLifeMinPct, bpp.ShelfLifeMinDays " - + "FROM C_BPartner bp " - + " LEFT OUTER JOIN C_BPartner_Product bpp" - + " ON (bp.C_BPartner_ID=bpp.C_BPartner_ID AND bpp.M_Product_ID=?) " - + "WHERE bp.C_BPartner_ID=?"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_M_Product_ID); - pstmt.setInt(2, C_BPartner_ID); - rs = pstmt.executeQuery(); - if (rs.next()) - { - ShelfLifeMinPct = rs.getInt(1); // BP - int pct = rs.getInt(2); // BP_P - if (pct > 0) // overwrite - ShelfLifeMinDays = pct; - ShelfLifeMinDays = rs.getInt(3); - } - } - catch (Exception e) - { - log.log(Level.SEVERE, sql, e); - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - if (ShelfLifeMinPct > 0) - { - m_sqlMinLife = " AND COALESCE(TRUNC(((daysbetween(asi.GuaranteeDate, SYSDATE))/p.GuaranteeDays)*100),0)>=" + ShelfLifeMinPct; - if (log.isLoggable(Level.CONFIG)) log.config( "PAttributeInstance.dynInit - ShelfLifeMinPct=" + ShelfLifeMinPct); - } - if (ShelfLifeMinDays > 0) - { - m_sqlMinLife += " AND COALESCE((daysbetween(asi.GuaranteeDate, SYSDATE)),0)>=" + ShelfLifeMinDays; - if (log.isLoggable(Level.CONFIG)) log.config( "PAttributeInstance.dynInit - ShelfLifeMinDays=" + ShelfLifeMinDays); - } - } // BPartner != 0 - - m_sql = m_table.prepareTable (s_layout, s_sqlFrom, - m_M_Warehouse_ID == 0 ? s_sqlWhereWithoutWarehouse : s_sqlWhere, false, "s") - + " ORDER BY asi.GuaranteeDate, s.QtyOnHand"; // oldest, smallest first - // - m_table.setRowSelectionAllowed(true); - m_table.setMultiSelection(false); - m_table.addMouseListener(this); - m_table.getSelectionModel().addListSelectionListener(this); - // - refresh(); - } // dynInit - - /** - * Refresh Query - */ - private void refresh() - { - String sql = m_sql; - int pos = m_sql.lastIndexOf(" ORDER BY "); - if (!showAll.isSelected()) - { - sql = m_sql.substring(0, pos) - + m_sqlNonZero; - if (m_sqlMinLife.length() > 0) - sql += m_sqlMinLife; - sql += m_sql.substring(pos); - } - // - log.finest(sql); - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_M_Product_ID); - if (m_M_Warehouse_ID != 0) - pstmt.setInt(2, m_M_Warehouse_ID); - rs = pstmt.executeQuery(); - m_table.loadTable(rs); - } - catch (Exception e) - { - log.log(Level.SEVERE, sql, e); - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - enableButtons(); - } // refresh - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - dispose(); - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - dispose(); - m_M_AttributeSetInstance_ID = -1; - m_M_AttributeSetInstanceName = null; - } - else if (e.getSource() == showAll) - { - refresh(); - } - } // actionPerformed - - /** - * Table selection changed - * @param e event - */ - public void valueChanged (ListSelectionEvent e) - { - if (e.getValueIsAdjusting()) - return; - enableButtons(); - } // valueChanged - - /** - * Enable/Set Buttons and set ID - */ - private void enableButtons() - { - m_M_AttributeSetInstance_ID = -1; - m_M_AttributeSetInstanceName = null; - m_M_Locator_ID = 0; - int row = m_table.getSelectedRow(); - boolean enabled = row != -1; - if (enabled) - { - Integer ID = m_table.getSelectedRowKey(); - if (ID != null) - { - m_M_AttributeSetInstance_ID = ID.intValue(); - m_M_AttributeSetInstanceName = (String)m_table.getValueAt(row, 1); - // - Object oo = m_table.getValueAt(row, 5); - if (oo instanceof KeyNamePair) - { - KeyNamePair pp = (KeyNamePair)oo; - m_M_Locator_ID = pp.getKey(); - } - } - } - confirmPanel.getOKButton().setEnabled(enabled); - if (log.isLoggable(Level.FINE)) log.fine("M_AttributeSetInstance_ID=" + m_M_AttributeSetInstance_ID - + " - " + m_M_AttributeSetInstanceName - + "; M_Locator_ID=" + m_M_Locator_ID); - } // enableButtons - - /** - * Mouse Clicked - * @param e event - */ - public void mouseClicked(MouseEvent e) - { - // Double click with selected row => exit - if (e.getClickCount() > 1 && m_table.getSelectedRow() != -1) - { - enableButtons(); - dispose(); - } - } // mouseClicked - - - /** - * Get Attribute Set Instance - * @return M_AttributeSetInstance_ID or -1 - */ - public int getM_AttributeSetInstance_ID() - { - return m_M_AttributeSetInstance_ID; - } // getM_AttributeSetInstance_ID - - /** - * Get Instance Name - * @return Instance Name - */ - public String getM_AttributeSetInstanceName() - { - return m_M_AttributeSetInstanceName; - } // getM_AttributeSetInstanceName - - /** - * Get Locator - * @return M_Locator_ID or 0 - */ - public int getM_Locator_ID() - { - return m_M_Locator_ID; - } // getM_Locator_ID - -} // PAttributeInstance \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/VSchedule.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/VSchedule.java deleted file mode 100644 index 0dc972d3c8..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/VSchedule.java +++ /dev/null @@ -1,180 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.sql.Timestamp; -import java.util.Calendar; -import java.util.GregorianCalendar; -import java.util.logging.Level; - -import javax.swing.JScrollPane; - -import org.compiere.model.MAssignmentSlot; -import org.compiere.model.ScheduleUtil; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.Env; - -/** - * Visual and Control Part of Schedule. - * Contains Time and Schedule Panels - * - * @author Jorg Janke - * @version $Id: VSchedule.java,v 1.3 2006/07/30 00:51:27 jjanke Exp $ - */ -public class VSchedule extends CPanel -{ - /** - * - */ - private static final long serialVersionUID = 604084538933601239L; - - /** - * Constructor - * @param is InfoSchedule for call back - * @param type Type of schedule TYPE_... - */ - public VSchedule (InfoSchedule is, int type) - { - m_type = type; - m_model = new ScheduleUtil (Env.getCtx()); - schedulePanel.setType (m_type); - schedulePanel.setTimePanel (timePanel); - schedulePanel.setInfoSchedule (is); // for callback - try - { - jbInit(); - } - catch(Exception e) - { - log.log(Level.SEVERE, "VSchedule", e); - } - } // VSchedule - - /** Day Display */ - static public final int TYPE_DAY = Calendar.DAY_OF_MONTH; - /** Week Display */ - static public final int TYPE_WEEK = Calendar.WEEK_OF_YEAR; - /** Month Display */ - static public final int TYPE_MONTH = Calendar.MONTH; - - /** Type */ - private int m_type = TYPE_DAY; - /** Model */ - private ScheduleUtil m_model = null; - /** Start Date */ - private Timestamp m_startDate; - /** End Date */ - private Timestamp m_endDate; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VSchedule.class); - - private BorderLayout mainLayout = new BorderLayout(); - private VScheduleTimePanel timePanel = new VScheduleTimePanel(); - private VSchedulePanel schedulePanel = new VSchedulePanel(); - private JScrollPane schedulePane = new JScrollPane(); - - /** - * Static init - *
    -	 * 	timePanel (West)
    -	 *  schedlePanel (in schedulePane - Center)
    -	 *  
    - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setLayout(mainLayout); - this.add(timePanel, BorderLayout.WEST); - // - // schedulePane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); - schedulePane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER); - schedulePane.getViewport().add(schedulePanel, null); - schedulePane.setPreferredSize(new Dimension(200, 200)); - schedulePane.setBorder(null); - this.add(schedulePane, BorderLayout.CENTER); - } // jbInit - - /** - * Recreate View - * @param S_Resource_ID Resource - * @param date Date - */ - public void recreate (int S_Resource_ID, Timestamp date) - { - // Calculate Start Day - GregorianCalendar cal = new GregorianCalendar(); - cal.setTime(date); - cal.set(Calendar.HOUR, 0); - cal.set(Calendar.MINUTE, 0); - cal.set(Calendar.SECOND, 0); - cal.set(Calendar.MILLISECOND, 0); - if (m_type == TYPE_WEEK) - cal.set(Calendar.DAY_OF_WEEK, cal.getFirstDayOfWeek()); - else if (m_type == TYPE_MONTH) - cal.set(Calendar.DAY_OF_MONTH, 1); - m_startDate = new Timestamp(cal.getTimeInMillis()); - // Calculate End Date - cal.add(m_type, 1); - m_endDate = new Timestamp (cal.getTimeInMillis()); - // - if (log.isLoggable(Level.CONFIG)) log.config("(" + m_type + ") Resource_ID=" + S_Resource_ID + ": " + m_startDate + "->" + m_endDate); - // Create Slots - MAssignmentSlot[] mas = m_model.getAssignmentSlots (S_Resource_ID, m_startDate, m_endDate, null, true, null); - MAssignmentSlot[] mts = m_model.getDayTimeSlots (); - // Set Panels - timePanel.setTimeSlots(mts); - schedulePanel.setAssignmentSlots(mas, S_Resource_ID, m_startDate, m_endDate); - // Set Height - schedulePanel.setHeight(timePanel.getPreferredSize().height); - // repaint(); - } // recreate - - /** - * Enable/disable to Create New Assignments - * @param createNew if true, allows to create new Assignments - */ - public void setCreateNew (boolean createNew) - { - schedulePanel.setCreateNew(createNew); - } // setCreateNew - - /** - * Dispose - */ - public void dispose() - { - m_model = null; - timePanel = null; - if (schedulePanel != null) - schedulePanel.dispose(); - schedulePanel = null; - this.removeAll(); - } // dispose - - /** - * Get Start Date - * @return start date - */ - public Timestamp getStartDate() - { - return m_startDate; - } // getStartDate - -} // VSchedule diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/VSchedulePanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/VSchedulePanel.java deleted file mode 100644 index f8fa7484d0..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/VSchedulePanel.java +++ /dev/null @@ -1,426 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Rectangle; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.awt.font.LineBreakMeasurer; -import java.awt.font.TextAttribute; -import java.awt.font.TextLayout; -import java.sql.Timestamp; -import java.text.AttributedCharacterIterator; -import java.text.AttributedString; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.GregorianCalendar; -import java.util.logging.Level; - -import javax.swing.JComponent; - -import org.compiere.apps.AEnv; -import org.compiere.grid.ed.VAssignmentDialog; -import org.compiere.model.MAssignmentSlot; -import org.compiere.model.MResourceAssignment; -import org.compiere.plaf.CompiereUtils; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Language; -import org.compiere.util.TimeUtil; - -/** - * Schedule Panel - * - * @author Jorg Janke - * @version $Id: VSchedulePanel.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class VSchedulePanel extends JComponent implements MouseListener -{ - /** - * - */ - private static final long serialVersionUID = -7779310781236274016L; - - /** - * Constructor - */ - public VSchedulePanel () - { - setHeight(250); - addMouseListener(this); - } // VSchedulePanel - - - /** Number of Days */ - private int m_noDays = 1; - /** Height */ - private int m_height = 250; - - /** Day Slot Width */ - private int m_dayWidth = 170; - - /** TimePanel for layout info */ - private VScheduleTimePanel m_timePanel = null; - - /** Assignment Slots */ - private MAssignmentSlot[] m_slots = null; - /** Position of Slots */ - private Rectangle[] m_where = null; - /** Start Date */ - private Timestamp m_startDate = null; - /** If true creates new assignments */ - private boolean m_createNew = false; - /** Resource ID */ - private int m_S_Resource_ID = 0; - - private InfoSchedule m_infoSchedule = null; - - /** Text Margin */ - private static final int MARGIN = 2; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VSchedulePanel.class); - - /** - * Set Type. - * Calculate number of days and set - * @param type schedule type - see VSchedule.TYPE_... - */ - public void setType (int type) - { - if (type == VSchedule.TYPE_MONTH) - m_noDays = 31; - else if (type == VSchedule.TYPE_WEEK) - m_noDays = 7; - else - m_noDays = 1; - setSize(); - } // setType - - /** - * Set InfoSchedule for callback - * @param is InfoSchedule - */ - public void setInfoSchedule (InfoSchedule is) - { - m_infoSchedule = is; - } - - /** - * Enable/disable to Create New Assignments - * @param createNew if true, allows to create new Assignments - */ - public void setCreateNew (boolean createNew) - { - m_createNew = createNew; - } // setCreateNew - - /** - * From height, Calculate & Set Size - * @param height height in pixels - */ - public void setHeight (int height) - { - m_height = height; - setSize(); - } // setHeight - - /** - * Set Size - */ - public void setSize () - { - // width - FontMetrics fm = null; - Graphics g = getGraphics(); - if (g == null) - g = Env.getGraphics(this); - if (g != null) - fm = g.getFontMetrics(g.getFont()); // the "correct" way - m_dayWidth = 0; - for (int i = 0; i < m_noDays; i++) - { - if (fm != null) - { - String string = getHeading(i); - int width = fm.stringWidth(string); - if (width > m_dayWidth) - m_dayWidth = width; - } - } - m_dayWidth += 20; - if (m_dayWidth < 180) // minimum width - m_dayWidth = 180; - - int w = m_noDays * m_dayWidth; - // - Dimension size = new Dimension(w, m_height); - setPreferredSize(size); - setMinimumSize(size); - setMaximumSize(size); - } // setHeight - - /** - * Set time Panel for info about tile slots - * @param timePanel time panel - */ - public void setTimePanel (VScheduleTimePanel timePanel) - { - m_timePanel = timePanel; - } // setTimePanel - - /************************************************************************** - * Set Slots - * @param mass Assignment Slots - * @param S_Resource_ID resource - * @param startDate start date - * @param endDate end date - */ - public void setAssignmentSlots (MAssignmentSlot[] mass, int S_Resource_ID, - Timestamp startDate, Timestamp endDate) - { - if (log.isLoggable(Level.FINE)) log.fine("S_Resource_ID=" + S_Resource_ID); - m_S_Resource_ID = S_Resource_ID; - m_noDays = TimeUtil.getDaysBetween (startDate, endDate); - m_startDate = startDate; - // - m_slots = mass; - m_where = new Rectangle[m_slots.length]; - // - // Calculate Assignments - for (int i = 0; m_slots != null && i < m_slots.length; i++) - { - MAssignmentSlot mas = m_slots[i]; - int dayIndex = TimeUtil.getDaysBetween (m_startDate, mas.getStartTime()); - if (dayIndex < 0 || dayIndex >= m_noDays) - System.out.println("Assignment " + i + " Invalid DateRange " + mas.getInfo()); - // - int xWidth = m_dayWidth / mas.getXMax(); - int xStart = dayIndex * m_dayWidth; // start day slot - xStart += mas.getXPos() * xWidth; // offset - - int yStart = m_timePanel.getSlotYStart(mas.getYStart()); - int yEnd = m_timePanel.getSlotYEnd(mas.getYEnd()); - // System.out.println("Assignment " + i + ", Xpos=" + mas.getXPos() + ", Xmax=" + mas.getXMax() - // + ", Ystart=" + mas.getYStart() + ", Yend=" + mas.getYEnd() + " " + mas.getInfo()); - m_where[i] = new Rectangle(xStart+1, yStart+1, xWidth-1, yEnd-yStart-1); - } // calculate assignments - - // - setSize(); - repaint(); - } // setAssignmentSlots - - /*************************************************************************/ - - /** - * Paint it - * @param g the Graphics object - */ - public void paint (Graphics g) - { - // log.fine( "VSchedulePanel.paint", g.getClip()); - Graphics2D g2D = (Graphics2D)g; - Dimension size = getPreferredSize(); - Rectangle clipBounds = g2D.getClipBounds(); - int w = size.width; - int h = size.height; - - // Paint Background - g2D.setPaint(Color.white); - g2D.fill3DRect(1, 1, w-2, h-2, true); - - if (m_timePanel == null) // required - return; - int headerHeight = m_timePanel.getHeaderHeight(); - - // horizontal lines - - g2D.setStroke(VScheduleTimePanel.getStroke(true)); - for (int i = 1; i < m_timePanel.getSlotCount(); i++) - { - g2D.setPaint(Color.gray); - int yy = m_timePanel.getSlotYStart(i); - g2D.drawLine(1, yy, w-2, yy); // top horiz line - } - - // heading and right vertical lines | - g2D.setStroke(VScheduleTimePanel.getStroke(false)); - for (int i = 0; i < m_noDays; i++) - { - Rectangle where = new Rectangle(i * m_dayWidth, 0, m_dayWidth, headerHeight); - if (!where.intersects(clipBounds)) - continue; - // Header Background - CompiereUtils.paint3Deffect(g2D, where, false, true); - g2D.setPaint(Color.blue); - TextLayout layout = new TextLayout (getHeading(i), g2D.getFont(), g2D.getFontRenderContext()); - float hh = layout.getAscent() + layout.getDescent(); - layout.draw (g2D, where.x + (m_dayWidth - layout.getAdvance())/2, // center - ((where.height - hh)/2) + layout.getAscent()); // center - // line - g2D.setPaint(Color.black); - int xEnd = (i+1) * m_dayWidth; - g2D.drawLine(xEnd, 1, xEnd, h-1); // right part - } - - // Paint Assignments - for (int i = 0; m_slots != null && i < m_slots.length; i++) - { - if (!m_where[i].intersects(clipBounds)) - continue; - - // Background - g2D.setColor(m_slots[i].getColor(true)); - g2D.fill(m_where[i]); - // Text - String string = m_slots[i].getInfoNameDescription(); - AttributedString as = new AttributedString (string); - as.addAttribute(TextAttribute.FONT, g2D.getFont()); - as.addAttribute(TextAttribute.FOREGROUND, m_slots[i].getColor(false)); - // Italics for Description - int startIt = string.indexOf('('); - int endIt = string.lastIndexOf(')'); - if (startIt != -1 && endIt != -1) - as.addAttribute(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE, startIt, endIt); - // Paint multiple lines if required - AttributedCharacterIterator aci = as.getIterator(); - LineBreakMeasurer measurer = new LineBreakMeasurer (aci, g2D.getFontRenderContext()); - float wrappingWidth = m_where[i].width - (2*MARGIN); - float curY = m_where[i].y + MARGIN; - TextLayout layout = null; - int yEnd = m_where[i].y + m_where[i].height; - while (measurer.getPosition() < aci.getEndIndex() && curY < yEnd) - { - layout = measurer.nextLayout(wrappingWidth); - curY += layout.getAscent(); - if (curY < yEnd) - layout.draw(g2D, m_where[i].x + MARGIN, curY); - } - } // assignments - - // Paint Borders - g2D.setPaint(Color.black); - g2D.setStroke(VScheduleTimePanel.getStroke(false)); - g2D.drawLine(1, 1, 1, h-1); // left - g2D.drawLine(1, 1, w-1, 1); // top - // heading line - g2D.drawLine(1, headerHeight, w-1, headerHeight); - // Final lines - g2D.setStroke(VScheduleTimePanel.getStroke(false)); - g2D.drawLine(w-1, 1, w-1, h-1); // right - g2D.drawLine(1, h-1, w-1, h-1); // bottom line - } // paint - - /** - * Return heading for index - * @param index index - * @return heading - */ - private String getHeading (int index) - { - GregorianCalendar cal = new GregorianCalendar(); - if (m_startDate != null) - cal.setTime(m_startDate); - cal.add(java.util.Calendar.DAY_OF_YEAR, index); - // - SimpleDateFormat format = (SimpleDateFormat)DateFormat.getDateInstance - (DateFormat.FULL, Language.getLoginLanguage().getLocale()); - return format.format(cal.getTime()); - } // getHeading - - /** - * Mouse Clicked. Start AssignmentDialog - * @param e event - */ - public void mouseClicked(MouseEvent e) - { - if (e.getClickCount() < 2) - return; - - if (log.isLoggable(Level.FINER)) log.finer(e.toString()); - Rectangle hitRect = new Rectangle (e.getX()-1, e.getY()-1, 3, 3); - - // Day - int dayIndex = e.getX() / m_dayWidth; - if (dayIndex >= m_noDays) - dayIndex = m_noDays-1; - // System.out.println("DayIndex=" + dayIndex + ": " + TimeUtil.addDays(m_startDate, dayIndex)); - - // Time - int timeIndex = m_timePanel.getTimeSlotIndex(e.getY()); - // System.out.println("TimeIndex=" + timeIndex + ": " + m_timePanel.getTimeSlot(timeIndex)); - - // check if there is an existing assignment - for (int i = 0; i < m_slots.length; i++) - { - if (m_where[i].intersects(hitRect)) - { - MAssignmentSlot mas = m_slots[i]; - System.out.println("Existing=" + mas.getInfo()); - if (!mas.isAssignment()) - return; - // - VAssignmentDialog vad = new VAssignmentDialog (AEnv.getFrame(this), - m_slots[i].getMAssignment(), false, m_createNew); - m_infoSchedule.mAssignmentCallback(vad.getMResourceAssignment()); - return; - } - } - if (m_createNew) - { - MResourceAssignment ma = new MResourceAssignment(Env.getCtx(), 0, null); - ma.setS_Resource_ID(m_S_Resource_ID); - ma.setAssignDateFrom(TimeUtil.getDayTime(TimeUtil.addDays(m_startDate, dayIndex), - m_timePanel.getTimeSlot(timeIndex).getStartTime())); - ma.setQty(Env.ONE); - VAssignmentDialog vad = new VAssignmentDialog (AEnv.getFrame(this), ma, false, m_createNew); - m_infoSchedule.mAssignmentCallback(vad.getMResourceAssignment()); - return; - } - } // mouseClicked - - - public void mousePressed(MouseEvent e) - { - } - public void mouseReleased(MouseEvent e) - { - } - public void mouseEntered(MouseEvent e) - { - } - public void mouseExited(MouseEvent e) - { - } - - /** - * Dispose - */ - public void dispose() - { - m_infoSchedule = null; - m_timePanel = null; - m_where = null; - m_slots = null; - this.removeAll(); - } // dispose - -} // VSchedulePanel diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/VScheduleTimePanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/VScheduleTimePanel.java deleted file mode 100644 index de45de63cf..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/VScheduleTimePanel.java +++ /dev/null @@ -1,310 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.search; - -import java.awt.BasicStroke; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Rectangle; -import java.awt.Stroke; -import java.awt.font.TextLayout; -import java.sql.Timestamp; -import java.util.logging.Level; - -import javax.swing.JComponent; - -import org.compiere.model.MAssignmentSlot; -import org.compiere.plaf.CompiereUtils; -import org.compiere.util.CLogger; -import org.compiere.util.Env; - -/** - * Schedule Time Panel. - * Manages slot layout - * - * @author Jorg Janke - * @version $Id: VScheduleTimePanel.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class VScheduleTimePanel extends JComponent -{ - - /** - * - */ - private static final long serialVersionUID = 2498994787352243360L; - - public VScheduleTimePanel() - { - setOpaque(false); - setSize(); - } - - /** Time Slots */ - private MAssignmentSlot[] m_timeSlots = null; - private String[] m_lines = new String [] {""}; - - - /** Line Height */ - public static int LINE_HEIGHT = 35; - /** Heading Space */ - public static int HEADING = 25; - /** Used Font */ - private Font m_font = new Font("serif", Font.PLAIN, 12); - /** Line Width */ - private int m_width = 120; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VScheduleTimePanel.class); - - /** - * Set Time Slots and calculate width - * @param timeSlots time slots - */ - public void setTimeSlots (MAssignmentSlot[] timeSlots) - { - log.fine( "VScheduleTimePanel.setTimeSlots"); - m_timeSlots = timeSlots; - m_lines = new String[m_timeSlots.length]; - // - FontMetrics fm = null; - Graphics g = getGraphics(); - if (g == null) - g = Env.getGraphics(this); - if (g != null) - fm = g.getFontMetrics(m_font); // the "correct" way - else - { - log.log(Level.SEVERE, "No Graphics"); - // fm = getToolkit().getFontMetrics(m_font); - } - m_width = 0; - for (int i = 0; i < m_lines.length; i++) - { - m_lines[i] = m_timeSlots[i].getInfoTimeFrom(); - int width = 0; - if (fm != null) - width = fm.stringWidth(m_lines[i]); - if (width > m_width) - m_width = width; - } - setSize(); - // repaint(); - } // setTimeSlots - - /** - * Calculate & Set Size - */ - private void setSize() - { - // Width - int width = m_width + 10; // slack - if (width <= 10) - width = 120; // default size - - // Height - int height = LINE_HEIGHT; - int lines = m_lines.length; - if (lines < 2) - height *= 10; // default - else - height *= lines; - height += HEADING; - // - Dimension size = new Dimension(width, height); - setPreferredSize(size); - setMinimumSize(size); - setMaximumSize(size); - } // setSize - - /** - * Get the height of the Header - * @return height of the header - */ - public int getHeaderHeight() - { - return HEADING; - } // getHeaderHeight - - /** - * Get the height of a slot - * @return height of a slot - */ - public int getSlotHeight() - { - int height = getPreferredSize().height; - int part = (height-HEADING) / m_lines.length; - return part; - } // getSlotHeight - - /** - * Get the height of a slot - * @return height of a slot - */ - public int getSlotCount() - { - return m_lines.length; - } // getSlotCount - - /** - * Get Y start position of Slot - * @param slot slot index - * @return y start position - */ - public int getSlotYStart (int slot) - { - int part = getSlotHeight(); - int y = HEADING + (slot * part); - return y; - } // getSlotYStart - - /** - * Get Y end position of Slot - * @param slot slot index - * @return y end position - */ - public int getSlotYEnd (int slot) - { - int part = getSlotHeight(); - int y = HEADING + ((slot+1) * part); - return y; - } // getSlotYEnd - - /** - * Return the Time Slot index for the time. - * Based on start time and not including end time - * @param time time (day is ignored) - * @param endTime if true, the end time is included - * @return slot index - */ - public int getTimeSlotIndex (Timestamp time, boolean endTime) - { - // Just one slot - if (m_timeSlots.length <= 1) - return 0; - // search for it - for (int i = 0; i < m_timeSlots.length; i++) - { - if (m_timeSlots[i].inSlot (time, endTime)) - return i; - } - log.log(Level.SEVERE, "VScheduleTimePanel.getSlotIndex - did not find Slot for " + time + " end=" + endTime); - return 0; - } // getTimeSlotIndex - - /** - * Get Time Slot - * @param index time index - * @return Assignment Slot - */ - public MAssignmentSlot getTimeSlot (int index) - { - if (index < 0 || index > m_timeSlots.length) - return null; - return m_timeSlots[index]; - } // getTimeSlot - - /** - * Get Time Slot Index - * @param yPos Y position - * @return Assignment Slot Index - */ - public int getTimeSlotIndex (int yPos) - { - int index = yPos - getHeaderHeight(); - index /= getSlotHeight(); - if (index < 0) - return 0; - if (index >= m_timeSlots.length) - return m_timeSlots.length-1; - return index; - } // getTimeSlotIndex - - /*************************************************************************/ - - /** - * Paint it - * @param g the Graphics object - */ - public void paint (Graphics g) - { - // log.fine( "VScheduleTimePanel.paint", g.getClip()); - Graphics2D g2D = (Graphics2D)g; - g2D.setFont(m_font); - Dimension size = getPreferredSize(); - int w = size.width; - int h = size.height; - - // Paint Background - g2D.setPaint(Color.white); - g2D.fill3DRect(1, 1, w-2, h-2, true); - - // Header Background - Rectangle where = new Rectangle(0, 0, w, getHeaderHeight()); - CompiereUtils.paint3Deffect(g2D, where, false, true); - - // heading - TextLayout layout = null; - // layout = new TextLayout ("Heading", m_font, g2D.getFontRenderContext()); - // float hh = layout.getAscent() + layout.getDescent(); - // layout.draw (g2D, (w - layout.getAdvance())/2, // center - // ((HEADING - hh)/2) + layout.getAscent()); // center - - // horizontal lines & text - g2D.setStroke(getStroke(true)); - for (int i = 0; i < m_lines.length; i++) - { - int yy = getSlotYStart(i); - if (m_lines[i] != null && m_lines[i].length() > 0) - { - layout = new TextLayout (m_lines[i], m_font, g2D.getFontRenderContext()); - g2D.setPaint(Color.blue); - layout.draw (g2D, w - layout.getAdvance() - 3, // right aligned with 2 pt space - yy + layout.getAscent() + layout.getLeading()); // top aligned with leading space - } - // - g2D.setPaint(Color.gray); - g2D.drawLine(2, yy, w-2, yy); // top horiz line - } - - // Paint Borders - g2D.setPaint(Color.black); - g2D.setStroke(getStroke(false)); - g2D.drawLine(1, 1, 1, h-1); // left - g2D.drawLine(w-1, 1, w-1, h-1); // right - g2D.drawLine(1, 1, w-1, 1); // top - g2D.drawLine(1, getHeaderHeight(), w-1, getHeaderHeight()); // header - g2D.drawLine(1, h-1, w-1, h-1); // bottom line - } // paintComponent - - /** - * Get Stroke - * @param slotLine if true return dashed line - * @return Stroke - */ - public static Stroke getStroke (boolean slotLine) - { - if (slotLine) - return new BasicStroke (1.0f, BasicStroke.CAP_BUTT, - BasicStroke.JOIN_MITER, 1.0f, - new float[] {2.0f, 0.5f}, 0.0f); - return new BasicStroke(1.0f); - } // getStroke - -} // VScheduleTimePanel diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/package.html b/org.adempiere.ui.swing/src/org/compiere/apps/search/package.html deleted file mode 100644 index cb84430e67..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - -

    Package org.compiere.apps.search

    - -Implement Search, Info Viewer, Lookup and Resource Schedule Viewer - -

    Related Documentation

    - -For overviews, tutorials, examples, guides, and tool documentation, please see: - - - - - - diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/wf/NodeMenu.java b/org.adempiere.ui.swing/src/org/compiere/apps/wf/NodeMenu.java deleted file mode 100644 index ff633a6e8b..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/wf/NodeMenu.java +++ /dev/null @@ -1,113 +0,0 @@ -/** - * - */ -package org.compiere.apps.wf; - -import java.awt.Point; - -import javax.swing.JPopupMenu; - -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.wf.MWFNode; -import org.compiere.wf.MWFNodeNext; -import org.compiere.wf.MWorkflow; -import org.netbeans.api.visual.action.PopupMenuProvider; -import org.netbeans.api.visual.widget.Widget; - -/** - * @author hengsin - * - */ -public class NodeMenu implements PopupMenuProvider { - - private WFContentPanel panel; - private MWorkflow m_wf; - - /** - * - */ - public NodeMenu(WFContentPanel panel, MWorkflow wf) { - this.panel = panel; - m_wf = wf; - } - - /* (non-Javadoc) - * @see org.netbeans.api.visual.action.PopupMenuProvider#getPopupMenu(org.netbeans.api.visual.widget.Widget, java.awt.Point) - */ - public JPopupMenu getPopupMenu(Widget w, Point p) { - WFNodeWidget widget = (WFNodeWidget) w; - MWFNode node = widget.getModel(); - JPopupMenu m_LinePopupMenu = new JPopupMenu(node.getName()); - if (node.getAD_Client_ID() == Env.getAD_Client_ID(Env.getCtx())) - { - String title = Msg.getMsg(Env.getCtx(), "DeleteNode") + - ": " + node.getName(); - addMenuItem(m_LinePopupMenu, title, node, -1); - m_LinePopupMenu.addSeparator(); - } - MWFNode[] nodes = m_wf.getNodes(true, Env.getAD_Client_ID(Env.getCtx())); - MWFNodeNext[] lines = node.getTransitions(Env.getAD_Client_ID(Env.getCtx())); - // Add New Line - for (int n = 0; n < nodes.length; n++) - { - MWFNode nn = nodes[n]; - if (nn.getAD_WF_Node_ID() == node.getAD_WF_Node_ID()) - continue; // same - boolean found = false; - for (int i = 0; i < lines.length; i++) - { - MWFNodeNext line = lines[i]; - if (nn.getAD_WF_Node_ID() == line.getAD_WF_Next_ID()) - { - found = true; - break; - } - } - if (!found) - { - String title = Msg.getMsg(Env.getCtx(), "AddLine") - + ": " + node.getName() + " -> " + nn.getName(); - addMenuItem(m_LinePopupMenu, title, node, nn.getAD_WF_Node_ID()); - } - } - m_LinePopupMenu.addSeparator(); - // Delete Lines - for (int i = 0; i < lines.length; i++) - { - MWFNodeNext line = lines[i]; - if (line.getAD_Client_ID() != Env.getAD_Client_ID(Env.getCtx())) - continue; - MWFNode next = MWFNode.get(Env.getCtx(), line.getAD_WF_Next_ID()); - String title = Msg.getMsg(Env.getCtx(), "DeleteLine") - + ": " + node.getName() + " -> " + next.getName(); - addMenuItem(m_LinePopupMenu, title, line); - } - return m_LinePopupMenu; - } - - /** - * Add Menu Item to - add new line to node - * @param menu base menu - * @param title title - */ - private void addMenuItem (JPopupMenu menu, String title, MWFNode node, int AD_WF_NodeTo_ID) - { - WFPopupItem item = new WFPopupItem (title, node, AD_WF_NodeTo_ID); - menu.add(item); - item.addActionListener(panel); - } // addMenuItem - - /** - * Add Menu Item to - delete line - * @param menu base menu - * @param title title - */ - private void addMenuItem (JPopupMenu menu, String title, MWFNodeNext line) - { - WFPopupItem item = new WFPopupItem (title, line); - menu.add(item); - item.addActionListener(panel); - } // addMenuItem - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/wf/SceneMainMenu.java b/org.adempiere.ui.swing/src/org/compiere/apps/wf/SceneMainMenu.java deleted file mode 100644 index be21c54f14..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/wf/SceneMainMenu.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - */ -package org.compiere.apps.wf; - -import java.awt.Point; - -import javax.swing.JPopupMenu; - -import org.compiere.swing.CMenuItem; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.netbeans.api.visual.action.PopupMenuProvider; -import org.netbeans.api.visual.widget.Widget; - -/** - * @author hengsin - * - */ -public class SceneMainMenu implements PopupMenuProvider { - - private JPopupMenu m_NewPopupMenu = new JPopupMenu(); - private CMenuItem m_NewMenuNode = new CMenuItem(Msg.getMsg(Env.getCtx(), "CreateNewNode")); - - public static final String ADD_NEW_NODE_ACTION = "addNewNodeAction"; - - /** - * @param wfContentPanel - * - */ - public SceneMainMenu(WFContentPanel wfContentPanel) { - m_NewMenuNode.setActionCommand(ADD_NEW_NODE_ACTION); - m_NewMenuNode.addActionListener(wfContentPanel); - m_NewPopupMenu.add(m_NewMenuNode); - } - - /* (non-Javadoc) - * @see org.netbeans.api.visual.action.PopupMenuProvider#getPopupMenu(org.netbeans.api.visual.widget.Widget, java.awt.Point) - */ - public JPopupMenu getPopupMenu(Widget arg0, Point arg1) { - return m_NewPopupMenu; - } - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFActivity.java b/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFActivity.java deleted file mode 100644 index a0925a699c..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFActivity.java +++ /dev/null @@ -1,804 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.wf; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.DefaultComboBoxModel; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.event.TableColumnModelEvent; -import javax.swing.event.TableColumnModelListener; -import javax.swing.table.DefaultTableModel; - -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.AMenu; -import org.compiere.apps.AWindow; -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.StatusBar; -import org.compiere.apps.form.FormFrame; -import org.compiere.apps.form.FormPanel; -import org.compiere.grid.ed.VLookup; -import org.compiere.minigrid.IDColumn; -import org.compiere.minigrid.MiniTable; -import org.compiere.model.MColumn; -import org.compiere.model.MQuery; -import org.compiere.model.MRefList; -import org.compiere.model.MRole; -import org.compiere.model.MSysConfig; -import org.compiere.swing.CButton; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CScrollPane; -import org.compiere.swing.CTextArea; -import org.compiere.swing.CTextField; -import org.compiere.swing.CTextPane; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Trx; -import org.compiere.util.ValueNamePair; -import org.compiere.wf.MWFActivity; -import org.compiere.wf.MWFNode; - -/** - * WorkFlow Activities Panel - * - * @author Jorg Janke - * @version $Id: WFActivity.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - BF [ 1748449 ] - * @author victor.perez@e-evolution.com - *
  • BF[2992649] Issue in Workflow Activities when the records are ordered - *
  • https://sourceforge.net/tracker/?func=detail&aid=2992649&group_id=176962&atid=879332 - * @author Compiere - CarlosRuiz integrate code for table selection on workflow present at GPL version of Compiere 3.2.0 - */ -public class WFActivity extends CPanel - implements FormPanel, ActionListener, ListSelectionListener -{ - /** - * - */ - private static final long serialVersionUID = 3900449055030897013L; - - private static final int MAX_ACTIVITIES_IN_LIST = MSysConfig.getIntValue(MSysConfig.MAX_ACTIVITIES_IN_LIST, 200, Env.getAD_Client_ID(Env.getCtx())); - - /** - * WF Activity - */ - public WFActivity() - { - super (); - // needs to call init - } // WFActivity - - /** - * WF Activity - * @param menu AMenu - */ - public WFActivity (AMenu menu) - { - super (); - log.config(""); - try - { - dynInit(0); - jbInit(); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - } - m_menu = menu; - } // WFActivity - - - /** Window No */ - private int m_WindowNo = 0; - /** FormFrame */ - private FormFrame m_frame = null; - /** Menu */ - private AMenu m_menu = null; - /** Current Activity */ - private MWFActivity m_activity = null; - /** Set Column */ - private MColumn m_column = null; - - private int columnValue = -1; - private int columnNewValue = -1; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(WFActivity.class); - - DefaultTableModel selTableModel = new DefaultTableModel( - new String[]{"ID", - Msg.translate(Env.getCtx(), "Priority"), - Msg.translate(Env.getCtx(), "AD_WF_Node_ID"), - Msg.translate(Env.getCtx(), "Summary")}, 0); - private MiniTable selTable = new MiniTable(); - private CScrollPane selPane = new CScrollPane(selTable); - // - private CPanel centerPanel = new CPanel(); - private GridBagLayout centerLayout = new GridBagLayout(); - private CLabel lNode = new CLabel(Msg.translate(Env.getCtx(), "AD_WF_Node_ID")); - private CTextField fNode = new CTextField(); - private CLabel lDesctiption = new CLabel(Msg.translate(Env.getCtx(), "Description")); - private CTextArea fDescription = new CTextArea(); - private CLabel lHelp = new CLabel(Msg.translate(Env.getCtx(), "Help")); - private CTextArea fHelp = new CTextArea(); - private CLabel lHistory = new CLabel(Msg.translate(Env.getCtx(), "History")); - private CTextPane fHistory = new CTextPane(); - private CLabel lAnswer = new CLabel(Msg.getMsg(Env.getCtx(), "Answer")); - private CPanel answers = new CPanel(new FlowLayout(FlowLayout.LEADING)); - private CTextField fAnswerText = new CTextField(); - private CComboBoxfAnswerList = new CComboBox(); - private CButton fAnswerButton = new CButton(); - // private CButton bPrevious = AEnv.getButton("Previous"); - // private CButton bNext = AEnv.getButton("Next"); - private CButton bZoom = AEnv.getButton("Zoom"); - private CLabel lTextMsg = new CLabel(Msg.getMsg(Env.getCtx(), "Messages")); - private CTextArea fTextMsg = new CTextArea(); - private CButton bOK = ConfirmPanel.createOKButton(true); - private VLookup fForward = null; // dynInit - private CLabel lForward = new CLabel(Msg.getMsg(Env.getCtx(), "Forward")); - private CLabel lOptional = new CLabel("(" + Msg.translate(Env.getCtx(), "Optional") + ")"); - private StatusBar statusBar = new StatusBar(); - - /** - * Dynamic Init. - * Called before Static Init - * @param WindowNo window - */ - private void dynInit(int WindowNo) - { - // Forward - fForward = VLookup.createUser(WindowNo); - loadActivities(); - } // dynInit - - /** - * Static Init. - * Called after Dynamic Init - * @throws Exception - */ - private void jbInit () throws Exception - { - int width = 150; - centerPanel.setLayout (centerLayout); - fNode.setReadWrite (false); - fDescription.setReadWrite (false); - fDescription.setPreferredSize(new Dimension (width,40)); - fHelp.setReadWrite (false); - fHelp.setPreferredSize(new Dimension (width,40)); - fHistory.setReadWrite (false); - fHistory.setPreferredSize(new Dimension (width,80)); - fTextMsg.setPreferredSize(new Dimension (width,40)); - // - // bPrevious.addActionListener(this); - // bNext.addActionListener(this); - selTable.setModel(selTableModel); - selTable.setColumnClass(0,IDColumn.class,false, " "); // 0-ID - selTable.setColumnClass(1, Integer.class, true); // 1-Priority - selTable.setColumnClass(2, String.class, true); // 2-AD_WF_Node_ID - selTable.setColumnClass(3, String.class, true); // 3-Summary - selTable.getSelectionModel().addListSelectionListener(this); - - // Listen the Column Move Event - selTable.getColumnModel().addColumnModelListener(new TableColumnModelListener() - { - - public void columnMoved(TableColumnModelEvent e) - { - if (columnValue == -1) - columnValue = e.getFromIndex(); - - columnNewValue = e.getToIndex(); - } - - @Override - public void columnAdded(TableColumnModelEvent e) { - } - - @Override - public void columnMarginChanged(ChangeEvent e) { - } - - @Override - public void columnRemoved(TableColumnModelEvent e) { - } - @Override - public void columnSelectionChanged(ListSelectionEvent e) { - } - }); - - //Listen the mouse released Moved - selTable.getTableHeader().addMouseListener(new MouseAdapter() - { - @Override - public void mouseReleased(MouseEvent e) - { - if (columnValue != -1 && (columnValue == 0 || columnNewValue == 0)) - selTable.moveColumn(columnNewValue, columnValue); - - columnValue = -1; - columnNewValue = -1; - } - }); - - bZoom.addActionListener(this); - bOK.addActionListener(this); - // - this.setLayout(new BorderLayout()); - this.add (centerPanel, BorderLayout.CENTER); - this.add (statusBar, BorderLayout.SOUTH); - // - // answers.setOpaque(false); - answers.add(fAnswerText); - answers.add(fAnswerList); - answers.add(fAnswerButton); - fAnswerButton.addActionListener(this); - // - int row = 0; - selPane.setPreferredSize(new Dimension(width, 60)); - selPane.setMinimumSize(new Dimension(100, 60)); - centerPanel.add (selPane, new GridBagConstraints (0, row, 4, 1, 0.3, 0.3, - GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, - new Insets (5, 10, 5, 10), 0, 0)); - - centerPanel.add (lNode, new GridBagConstraints (0, ++row, 1, 1, 0.0, 0.0, - GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, - new Insets (5, 10, 5, 5), 0, 0)); - centerPanel.add (fNode, new GridBagConstraints (1, row, 3, 2, 0.5, 0.0, - GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, - new Insets (5, 0, 5, 10), 0, 0)); - - centerPanel.add (lDesctiption, new GridBagConstraints (0, ++row, 1, 1, 0.0, 0.0, - GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, - new Insets (5, 10, 5, 5), 0, 0)); - centerPanel.add (fDescription, new GridBagConstraints (1, row, 3, 1, 0.0, 0.0, - GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, - new Insets (5, 0, 5, 10), 0, 0)); - - centerPanel.add (lHelp, new GridBagConstraints (0, ++row, 1, 1, 0.0, 0.0, - GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, - new Insets (2, 10, 5, 5), 0, 0)); - centerPanel.add (fHelp, new GridBagConstraints (1, row, 3, 1, 0.0, 0.0, - GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, - new Insets (2, 0, 5, 10), 0, 0)); - - centerPanel.add (lHistory, new GridBagConstraints (0, ++row, 1, 1, 0.0, 0.0, - GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, - new Insets (5, 10, 5, 5), 0, 0)); - centerPanel.add (fHistory, new GridBagConstraints (1, row, 3, 1, 0.5, 0.5, - GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, - new Insets (5, 0, 5, 10), 0, 0)); - - centerPanel.add (lAnswer, new GridBagConstraints (0, ++row, 1, 1, 0.0, 0.0, - GridBagConstraints.EAST, GridBagConstraints.NONE, - new Insets (10, 10, 5, 5), 0, 0)); - centerPanel.add (answers, new GridBagConstraints (1, row, 2, 1, 0.0, 0.0, - GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, - new Insets (10, 0, 5, 5), 0, 0)); - centerPanel.add (bZoom, new GridBagConstraints (3, row, 1, 1, 0.0, 0.0, - GridBagConstraints.EAST, GridBagConstraints.NONE, - new Insets (10, 0, 10, 10), 0, 0)); - - centerPanel.add (lTextMsg, new GridBagConstraints (0, ++row, 1, 1, 0.0, 0.0, - GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, - new Insets (5, 10, 5, 5), 0, 0)); - centerPanel.add (fTextMsg, new GridBagConstraints (1, row, 3, 1, 0.5, 0.0, - GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, - new Insets (5, 0, 5, 10), 0, 0)); - - centerPanel.add (lForward, new GridBagConstraints (0, ++row, 1, 1, 0.0, 0.0, - GridBagConstraints.EAST, GridBagConstraints.NONE, - new Insets (10, 10, 5, 5), 0, 0)); - centerPanel.add (fForward, new GridBagConstraints (1, row, 1, 1, 0.0, 0.0, - GridBagConstraints.WEST, GridBagConstraints.NONE, - new Insets (10, 0, 5, 0), 0, 0)); - centerPanel.add (lOptional, new GridBagConstraints (2, row, 1, 1, 0.0, 0.0, - GridBagConstraints.WEST, GridBagConstraints.NONE, - new Insets (10, 5, 5, 5), 0, 0)); - centerPanel.add (bOK, new GridBagConstraints (3, row, 1, 1, 0.0, 0.0, - GridBagConstraints.EAST, GridBagConstraints.NONE, - new Insets (10, 5, 5, 10), 0, 0)); - } // jbInit - - /** - * Initialize Panel for FormPanel - * @param WindowNo window - * @param frame frame - * @see org.compiere.apps.form.FormPanel#init(int, FormFrame) - */ - public void init (int WindowNo, FormFrame frame) - { - m_WindowNo = WindowNo; - m_frame = frame; - // - log.info(""); - try - { - dynInit(WindowNo); - jbInit(); - // - // this.setPreferredSize(new Dimension (400,400)); - frame.getContentPane().add(this, BorderLayout.CENTER); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - } - } // init - - /** - * Dispose - * @see org.compiere.apps.form.FormPanel#dispose() - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** - * Get active activities count - * @return int - */ - public int getActivitiesCount() - { - int count = 0; - - String sql = "SELECT COUNT(*) FROM AD_WF_Activity a " - + "WHERE " + getWhereActivities(); - int AD_User_ID = Env.getAD_User_ID(Env.getCtx()); - int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); - MRole role = MRole.get(Env.getCtx(), Env.getAD_Role_ID(Env.getCtx())); - sql = role.addAccessSQL(sql, "a", true, false); - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement (sql, null); - pstmt.setInt (1, AD_User_ID); - pstmt.setInt (2, AD_User_ID); - pstmt.setInt (3, AD_User_ID); - pstmt.setInt (4, AD_User_ID); - pstmt.setInt (5, AD_Client_ID); - rs = pstmt.executeQuery (); - if (rs.next ()) { - count = rs.getInt(1); - } - } - catch (Exception e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - - return count; - - } - - /** - * Load Activities - * @return int - */ - public int loadActivities() - { - while (selTableModel.getRowCount() > 0) - selTableModel.removeRow(0); - long start = System.currentTimeMillis(); - ArrayList list = new ArrayList(); - String sql = "SELECT * FROM AD_WF_Activity a " - + "WHERE " + getWhereActivities() - + " ORDER BY a.Priority DESC, Created"; - int AD_User_ID = Env.getAD_User_ID(Env.getCtx()); - int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); - MRole role = MRole.get(Env.getCtx(), Env.getAD_Role_ID(Env.getCtx())); - sql = role.addAccessSQL(sql, "a", true, false); - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement (sql, null); - pstmt.setInt (1, AD_User_ID); - pstmt.setInt (2, AD_User_ID); - pstmt.setInt (3, AD_User_ID); - pstmt.setInt (4, AD_User_ID); - pstmt.setInt (5, AD_Client_ID); - rs = pstmt.executeQuery (); - while (rs.next ()) - { - MWFActivity activity = new MWFActivity(Env.getCtx(), rs, null); - - Object[] rowData = new Object[4]; - rowData[0] = new IDColumn(activity.get_ID()); - rowData[1] = activity.getPriority(); - rowData[2] = activity.getNodeName(); - rowData[3] = activity.getSummary(); - - selTableModel.addRow(rowData); - if (list.size() > MAX_ACTIVITIES_IN_LIST) - { - log.warning("More than " + MAX_ACTIVITIES_IN_LIST + " Activities - ignored"); - break; - } - } - } - catch (Exception e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - selTable.autoSize(false); - display(null); - - if (log.isLoggable(Level.FINE)) log.fine("#" + selTable.getModel().getRowCount() - + "(" + (System.currentTimeMillis()-start) + "ms)"); - return selTable.getModel().getRowCount(); - } // loadActivities - - private String getWhereActivities() { - final String where = - "a.Processed='N' AND a.WFState='OS' AND (" - // Owner of Activity - + " a.AD_User_ID=?" // #1 - // Invoker (if no invoker = all) - + " OR EXISTS (SELECT * FROM AD_WF_Responsible r WHERE a.AD_WF_Responsible_ID=r.AD_WF_Responsible_ID" - + " AND r.ResponsibleType='H' AND COALESCE(r.AD_User_ID,0)=0 AND COALESCE(r.AD_Role_ID,0)=0 AND (a.AD_User_ID=? OR a.AD_User_ID IS NULL))" // #2 - // Responsible User - + " OR EXISTS (SELECT * FROM AD_WF_Responsible r WHERE a.AD_WF_Responsible_ID=r.AD_WF_Responsible_ID" - + " AND r.ResponsibleType='H' AND r.AD_User_ID=?)" // #3 - // Responsible Role - + " OR EXISTS (SELECT * FROM AD_WF_Responsible r INNER JOIN AD_User_Roles ur ON (r.AD_Role_ID=ur.AD_Role_ID)" - + " WHERE a.AD_WF_Responsible_ID=r.AD_WF_Responsible_ID AND r.ResponsibleType='R' AND ur.AD_User_ID=?)" // #4 - // - + ") AND a.AD_Client_ID=?"; // #5 - return where; - } - - /** - * Display. - * @param index index of table - * Fill Editors - */ - public void display(IDColumn id) - { - if (log.isLoggable(Level.FINE)) log.fine("ID=" + id); - m_activity = resetDisplay(id); - // - if (m_menu != null) - { - m_menu.updateActivities(selTable.getModel().getRowCount()); - } - if (m_activity == null) - return; - - // Display Activity - fNode.setText (m_activity.getNodeName()); - fDescription.setText (m_activity.getNodeDescription()); - fHelp.setText (m_activity.getNodeHelp()); - // - fHistory.setText (m_activity.getHistoryHTML()); - - // User Actions - MWFNode node = m_activity.getNode(); - if (MWFNode.ACTION_UserChoice.equals(node.getAction())) - { - if (m_column == null) - m_column = node.getColumn(); - if (m_column != null && m_column.get_ID() != 0) - { - int dt = m_column.getAD_Reference_ID(); - if (dt == DisplayType.YesNo) - { - ValueNamePair[] values = MRefList.getList(Env.getCtx(), 319, false); // _YesNo - fAnswerList.setModel(new DefaultComboBoxModel(values)); - fAnswerList.setVisible(true); - } - else if (dt == DisplayType.List) - { - ValueNamePair[] values = MRefList.getList(Env.getCtx(), m_column.getAD_Reference_Value_ID(), false); - fAnswerList.setModel(new DefaultComboBoxModel(values)); - fAnswerList.setVisible(true); - } - else // other display types come here - { - fAnswerText.setText (""); - fAnswerText.setVisible(true); - } - } - } - // -- - else if (MWFNode.ACTION_UserWindow.equals(node.getAction()) - || MWFNode.ACTION_UserForm.equals(node.getAction())) - { - fAnswerButton.setText(node.getName()); - fAnswerButton.setToolTipText(node.getDescription()); - fAnswerButton.setVisible(true); - } - /* - else if (MWFNode.ACTION_UserWorkbench.equals(node.getAction())) - log.log(Level.SEVERE, "Workflow Action not implemented yet"); */ - else - log.log(Level.SEVERE, "Unknown Node Action: " + node.getAction()); - - statusBar.setStatusDB(String.valueOf(selTable.getSelectedRow()+1) + "/" + selTable.getRowCount()); - statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), "WFActivities")); - } // display - - /** - * Reset Display - * @param selIndex select index - * @return selected activity - */ - private MWFActivity resetDisplay(IDColumn id) - { - fAnswerText.setVisible(false); - fAnswerList.setVisible(false); - fAnswerButton.setVisible(false); - fTextMsg.setReadWrite(id != null); - bZoom.setEnabled(id != null); - bOK.setEnabled(id != null); - fForward.setValue(null); - fForward.setEnabled(id != null); - // - statusBar.setStatusDB(String.valueOf(selTable.getSelectedRow()+1) + "/" + selTable.getRowCount()); - m_activity = null; - m_column = null; - - if (id != null) - m_activity = new MWFActivity(Env.getCtx(),id.getRecord_ID(),null); - - if (m_activity == null) - { - fNode.setText (""); - fDescription.setText (""); - fHelp.setText (""); - fHistory.setText (""); - statusBar.setStatusDB("0/0"); - statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), "WFNoActivities")); - } - return m_activity; - } // resetDisplay - - - /** - * Selection Listener - * @param e event - */ - public void valueChanged(ListSelectionEvent e) - { - if(selTable.getSelectedRow()>=0) - { - IDColumn id = (IDColumn)selTable.getValueAt(selTable.getSelectedRow(),0); - if (id != null) - display(id); - } - } // valueChanged - - - /** - * Action Listener - * @param e event - * @see java.awt.event.ActionListener#actionPerformed(ActionEvent) - */ - public void actionPerformed (ActionEvent e) - { - this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - // - if (e.getSource() == bZoom) - cmd_zoom(); - else if (e.getSource() == bOK) { - bOK.setEnabled(false); - cmd_OK(); - bOK.setEnabled(true); - } - else if (e.getSource() == fAnswerButton) - cmd_button(); - // - this.setCursor(Cursor.getDefaultCursor()); - } // actionPerformed - - - /** - * Zoom - */ - private void cmd_zoom() - { - if (log.isLoggable(Level.CONFIG)) log.config("Activity=" + m_activity); - if (m_activity == null) - return; - AEnv.zoom(m_activity.getAD_Table_ID(), m_activity.getRecord_ID()); - } // cmd_zoom - - /** - * Answer Button - */ - private void cmd_button() - { - if (log.isLoggable(Level.CONFIG)) log.config("Activity=" + m_activity); - if (m_activity == null) - return; - // - MWFNode node = m_activity.getNode(); - if (MWFNode.ACTION_UserWindow.equals(node.getAction())) - { - int AD_Window_ID = node.getAD_Window_ID(); // Explicit Window - String ColumnName = m_activity.getPO().get_TableName() + "_ID"; - int Record_ID = m_activity.getRecord_ID(); - MQuery query = MQuery.getEqualQuery(ColumnName, Record_ID); - boolean IsSOTrx = m_activity.isSOTrx(); - // - if (log.isLoggable(Level.INFO)) log.info("Zoom to AD_Window_ID=" + AD_Window_ID - + " - " + query + " (IsSOTrx=" + IsSOTrx + ")"); - AWindow frame = new AWindow(null); - if (!frame.initWindow(AD_Window_ID, query)) - return; - AEnv.addToWindowManager(frame); - AEnv.showCenterScreen(frame); - frame = null; - } - else if (MWFNode.ACTION_UserForm.equals(node.getAction())) - { - int AD_Form_ID = node.getAD_Form_ID(); - FormFrame ff = new FormFrame(null); - ff.openForm(AD_Form_ID); - ff.pack(); - AEnv.addToWindowManager(ff); - AEnv.showCenterScreen(ff); - } - /* - else if (MWFNode.ACTION_UserWorkbench.equals(node.getAction())) - { - - }*/ - else - log.log(Level.SEVERE, "No User Action:" + node.getAction()); - } // cmd_button - - - /** - * Save - */ - private void cmd_OK() - { - if (log.isLoggable(Level.CONFIG)) log.config("Activity=" + m_activity); - if (m_activity == null) - return; - int AD_User_ID = Env.getAD_User_ID(Env.getCtx()); - String textMsg = fTextMsg.getText(); - // - MWFNode node = m_activity.getNode(); - - Object forward = fForward.getValue(); - - // ensure activity is ran within a transaction - [ 1953628 ] - Trx trx = Trx.get(Trx.createTrxName("FWFA"), true); - m_activity.set_TrxName(trx.getTrxName()); - - if (forward != null) - { - if (log.isLoggable(Level.CONFIG)) log.config("Forward to " + forward); - int fw = ((Integer)forward).intValue(); - if (fw == AD_User_ID || fw == 0) - { - log.log(Level.SEVERE, "Forward User=" + fw); - trx.rollback(); - trx.close(); - return; - } - if (!m_activity.forwardTo(fw, textMsg)) - { - ADialog.error(m_WindowNo, this, "CannotForward"); - trx.rollback(); - trx.close(); - return; - } - } - // User Choice - Answer - else if (MWFNode.ACTION_UserChoice.equals(node.getAction())) - { - if (m_column == null) - m_column = node.getColumn(); - // Do we have an answer? - int dt = m_column.getAD_Reference_ID(); - String value = fAnswerText.getText(); - if (dt == DisplayType.YesNo || dt == DisplayType.List) - { - ValueNamePair pp = (ValueNamePair)fAnswerList.getSelectedItem(); - value = pp.getValue(); - } - if (value == null || value.length() == 0) - { - ADialog.error(m_WindowNo, this, "FillMandatory", Msg.getMsg(Env.getCtx(), "Answer")); - trx.rollback(); - trx.close(); - return; - } - // - if (log.isLoggable(Level.CONFIG)) log.config("Answer=" + value + " - " + textMsg); - try - { - m_activity.setUserChoice(AD_User_ID, value, dt, textMsg); - } - catch (Exception e) - { - log.log(Level.SEVERE, node.getName(), e); - ADialog.error(m_WindowNo, this, "Error", e.toString()); - trx.rollback(); - trx.close(); - return; - } - } - // User Action - else - { - if (log.isLoggable(Level.CONFIG)) log.config("Action=" + node.getAction() + " - " + textMsg); - try - { - // ensure activity is ran within a transaction - m_activity.setUserConfirmation(AD_User_ID, textMsg); - } - catch (Exception e) - { - log.log(Level.SEVERE, node.getName(), e); - ADialog.error(m_WindowNo, this, "Error", e.toString()); - trx.rollback(); - trx.close(); - return; - } - - } - - trx.commit(); - trx.close(); - - // Next - loadActivities(); - } // cmd_OK - - -} // WFActivity diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFContentPanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFContentPanel.java deleted file mode 100644 index 0c135014f3..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFContentPanel.java +++ /dev/null @@ -1,221 +0,0 @@ -package org.compiere.apps.wf; - - -import java.awt.Point; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.HashMap; -import java.util.Map; - -import javax.swing.JOptionPane; - -import org.compiere.model.X_AD_Workflow; -import org.compiere.swing.CPanel; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Util; -import org.compiere.wf.MWFNode; -import org.compiere.wf.MWFNodeNext; -import org.compiere.wf.MWorkflow; -import org.netbeans.api.visual.action.ActionFactory; -import org.netbeans.api.visual.action.MoveProvider; -import org.netbeans.api.visual.action.WidgetAction; -import org.netbeans.api.visual.graph.layout.GraphLayout; -import org.netbeans.api.visual.layout.LayoutFactory; -import org.netbeans.api.visual.layout.SceneLayout; -import org.netbeans.api.visual.widget.Widget; - -public class WFContentPanel extends CPanel implements ActionListener, MoveProvider { - - /** - * - */ - private static final long serialVersionUID = 4589292821059374372L; - - private WidgetAction moveAction = ActionFactory.createMoveAction(new WFNodeMoveStrategy(), this); - - private WorkflowGraphScene graphScene = new WorkflowGraphScene(); - private WFPanel m_parent; - private int currentRow = 1; - private int currentColumn = 0; - private int noOfColumns = 4; - - private MWorkflow m_wf; - private boolean readWrite = false; - - public final static int NODE_WIDTH = 180; - public final static int NODE_HEIGHT = 120; - - private Map matrix = null; - - public WFContentPanel (WFPanel parent) { - super(); - m_parent = parent; - matrix = new HashMap(); - } - - public void setReadWrite(boolean readWrite) { - this.readWrite = readWrite; - } - - public void setWorkflow(MWorkflow mWf) { - m_wf = mWf; - } - - public void addNode(MWFNode node) { - int oldRow = currentRow; - int oldColumn = currentColumn; - if (node.getXPosition() > 0 && node.getYPosition() > 0) { - currentColumn = node.getXPosition(); - currentRow = node.getYPosition(); - if (currentColumn > noOfColumns) { - currentColumn = 1; - currentRow ++; - } - } else if (currentColumn == noOfColumns) { - currentColumn = 1; - if (m_wf.getWorkflowType().equals(X_AD_Workflow.WORKFLOWTYPE_General)) { - currentRow++; - } else { - currentRow = currentRow + 2; - } - } else { - if (m_wf.getWorkflowType().equals(X_AD_Workflow.WORKFLOWTYPE_General) || currentColumn == 0) { - currentColumn++; - } else { - currentColumn = currentColumn + 2; - if (currentColumn > noOfColumns) { - currentColumn = 1; - currentRow = currentRow + 2; - } - } - } - Integer[] nodes = matrix.get(currentRow); - if (nodes == null) { - nodes = new Integer[noOfColumns]; - matrix.put(currentRow, nodes); - } else { - //detect collision - while (nodes[currentColumn - 1] != null) { - if (nodes[currentColumn - 1] == node.getAD_WF_Node_ID()) { - break; - } else if (currentColumn == noOfColumns) { - currentColumn = 1; - currentRow ++; - nodes = matrix.get(currentRow); - if (nodes == null) { - nodes = new Integer[noOfColumns]; - matrix.put(currentRow, nodes); - } - } else { - currentColumn ++; - } - } - } - - WFNodeWidget w = (WFNodeWidget) graphScene.addNode(node.getAD_WF_Node_ID()); - w.setColumn(currentColumn); - w.setRow(currentRow); - - nodes[currentColumn - 1] = node.getAD_WF_Node_ID(); - - if (readWrite && node.getAD_Client_ID() == Env.getAD_Client_ID(Env.getCtx())) { - w.getActions().addAction(ActionFactory.createPopupMenuAction(new NodeMenu(this, m_wf))); - w.getActions().addAction(moveAction); - } - - if (currentRow < oldRow) { - currentRow = oldRow; - currentColumn = oldColumn; - } else if ( currentRow == oldRow && currentColumn < oldColumn) { - currentColumn = oldColumn; - } - } - - public void addEdge(MWFNodeNext edge) { - graphScene.addEdge(edge); - graphScene.setEdgeSource(edge, edge.getAD_WF_Node_ID()); - graphScene.setEdgeTarget(edge, edge.getAD_WF_Next_ID()); - } - - public void relayout() { - GraphLayout graphLayout = new WFGraphLayout(); - graphLayout.setAnimated(false); - SceneLayout sceneGraphLayout = LayoutFactory.createSceneGraphLayout (graphScene, graphLayout); - sceneGraphLayout.invokeLayout (); - - this.add(graphScene.createView()); - - if (readWrite) { - graphScene.getActions().addAction(ActionFactory.createPopupMenuAction(new SceneMainMenu(this))); - } - } - - @Override - public void removeAll() { - super.removeAll(); - graphScene = new WorkflowGraphScene(); - currentColumn = 0; - currentRow = 1; - matrix = new HashMap(); - } - - public WorkflowGraphScene getGraphScene() { - return graphScene; - } - - private void createNewNode() { - String nameLabel = Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Name")); - String name = JOptionPane.showInputDialog(this, - nameLabel, // message - Msg.getMsg(Env.getCtx(), "CreateNewNode"), // title - JOptionPane.QUESTION_MESSAGE); - if (name != null && name.length() > 0) - { - int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); - MWFNode node = new MWFNode(m_wf, name, name); - node.setClientOrg(AD_Client_ID, 0); - node.saveEx(); - m_parent.load(m_wf.getAD_Workflow_ID(), true); - } - } - - public void actionPerformed(ActionEvent e) { - if (e.getActionCommand().equals(SceneMainMenu.ADD_NEW_NODE_ACTION)) - { - createNewNode(); - } - //Add/Delete Line - else if (e.getSource() instanceof WFPopupItem) - { - WFPopupItem item = (WFPopupItem)e.getSource(); - item.execute(m_parent); - } - } - - public Point getOriginalLocation(Widget widget) { - return widget.getLocation(); - } - - public void movementFinished(Widget widget) { - WFNodeWidget nodeWidget = (WFNodeWidget) widget; - Point location = widget.getPreferredLocation(); - int x = location.x / WFGraphLayout.COLUMN_WIDTH + 1; - int y = location.y / WFGraphLayout.ROW_HEIGHT + 1; - Integer[] nodes = matrix.get(y); - if (nodes == null || nodes[x - 1] == null || - nodes[x - 1] == nodeWidget.getModel().getAD_WF_Node_ID()) { - nodeWidget.getModel().setXPosition(x); - nodeWidget.getModel().setYPosition(y); - nodeWidget.getModel().saveEx(); - } - m_parent.load(m_wf.getAD_Workflow_ID(), true); - } - - public void movementStarted(Widget widget) { - } - - public void setNewLocation(Widget widget, Point point) { - widget.setPreferredLocation(point); - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFNodeMoveStrategy.java b/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFNodeMoveStrategy.java deleted file mode 100644 index 9679a2e872..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFNodeMoveStrategy.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.compiere.apps.wf; - -import java.awt.Point; - -import org.netbeans.api.visual.action.MoveStrategy; -import org.netbeans.api.visual.widget.Widget; - -public class WFNodeMoveStrategy implements MoveStrategy { - - public Point locationSuggested(Widget widget, Point originalLocation, Point suggestedLocation) { - return new Point (suggestedLocation.x - suggestedLocation.x % WFGraphLayout.COLUMN_WIDTH , - suggestedLocation.y - suggestedLocation.y % WFGraphLayout.ROW_HEIGHT); - } - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFPanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFPanel.java deleted file mode 100644 index 737c2b6974..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFPanel.java +++ /dev/null @@ -1,577 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.apps.wf; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Insets; -import java.awt.Point; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; -import java.util.Set; -import java.util.logging.Level; - -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JScrollPane; -import javax.swing.JTextPane; - -import org.adempiere.exceptions.AdempiereException; -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.AEnv; -import org.compiere.apps.AMenu; -import org.compiere.apps.AMenuStartItem; -import org.compiere.apps.AWindow; -import org.compiere.apps.form.FormFrame; -import org.compiere.apps.form.FormPanel; -import org.compiere.model.MQuery; -import org.compiere.model.MRole; -import org.compiere.model.MTable; -import org.compiere.plaf.CompiereColor; -import org.compiere.swing.CButton; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; -import org.compiere.util.Util; -import org.compiere.wf.MWFNode; -import org.compiere.wf.MWFNodeNext; -import org.compiere.wf.MWorkflow; -import org.netbeans.api.visual.model.ObjectSceneEvent; -import org.netbeans.api.visual.model.ObjectSceneEventType; -import org.netbeans.api.visual.model.ObjectSceneListener; -import org.netbeans.api.visual.model.ObjectState; -import org.netbeans.api.visual.widget.Widget; - -/** - * WorkFlow Panel - * - * @author Jorg Janke - * @version $Id: WFPanel.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - * - * @author Teo Sarca, www.arhipac.ro - *
  • FR [ 2048081 ] Mf. Workflow editor should display only mf. workflows - */ -public class WFPanel extends CPanel - implements ActionListener, FormPanel, ObjectSceneListener -{ - /** - * - */ - private static final long serialVersionUID = 4478193785606693055L; - - - /** - * Create Workflow Panel. - * FormPanel - */ - public WFPanel() - { - this (null, null, -1); - } // WFPanel - - /** - * Create Workflow Panel - * @param menu menu - */ - public WFPanel (AMenu menu) - { - this(menu, null, -1); - } - - /** - * Create Workflow Panel - * @param menu menu - */ - public WFPanel (AMenu menu, String wfWhereClause, int wfWindow_ID) - { - m_menu = menu; - m_readWrite = (menu == null); - m_WF_whereClause = wfWhereClause; - m_WF_Window_ID = wfWindow_ID; - if (log.isLoggable(Level.INFO)) log.info("RW=" + m_readWrite); - try - { - jbInit(); - } - catch(Exception e) - { - log.log(Level.SEVERE, "WFPanel", e); - } - } // WFPanel - - /** Menu Link */ - private AMenu m_menu = null; - /** Window No */ - @SuppressWarnings("unused") - private int m_WindowNo = 0; - /** FormFrame */ - private FormFrame m_frame; - - - /** Workflow Model */ - private MWorkflow m_wf = null; - /** Context */ - private Properties m_ctx = Env.getCtx(); - /** Active Node */ - private MWFNode m_activeNode = null; - /** ReadWrite Mode (see WFNode) */ - private boolean m_readWrite = false; - - /** Workflows List Where Clause */ - private String m_WF_whereClause = null; - /** Workflow Window ID */ - private int m_WF_Window_ID = -1; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(WFPanel.class); - - // UI - private BorderLayout mainLayout = new BorderLayout(); - private CPanel southPanel = new CPanel(); - private WFContentPanel centerPanel = new WFContentPanel(this); - private BorderLayout southLayout = new BorderLayout(); - private JScrollPane infoScrollPane = new JScrollPane(); - private JTextPane infoTextPane = new JTextPane(); - private CPanel buttonPanel = new CPanel(); - private JButton wfStart = new JButton(); - private JButton wfBack = new JButton(); - private JButton wfNext = new JButton(); - private JButton wfEnd = new JButton(); - // - private CPanel loadPanel = new CPanel(new FlowLayout(FlowLayout.LEADING)); - private CComboBoxworkflow = new CComboBox(); - private CButton bResetLayout = AEnv.getButton("Reset"); - private CButton bSaveLayout = AEnv.getButton ("Save"); - private CButton bZoom = AEnv.getButton("Zoom"); - private CButton bIgnore = AEnv.getButton("Ignore"); - private WFNodeWidget selectedWidget; - - - /** - * Static Init - *
    -	 * 		centerScrollPane
    -	 * 			centerPanel
    -	 * 		south Panel
    -	 * 			infoScrollPane
    -	 * 			buttonPanel
    -	 * 	
    - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setLayout(mainLayout); - CompiereColor.setBackground(this); - southPanel.setLayout(southLayout); - // Center - this.add(new JScrollPane(centerPanel), BorderLayout.CENTER); - // Info - infoScrollPane.getViewport().add(infoTextPane, null); - infoScrollPane.setPreferredSize(new Dimension(200, 140)); - infoTextPane.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - infoTextPane.setEditable(false); - infoTextPane.setRequestFocusEnabled(false); - infoTextPane.setContentType("text/html"); - // South - this.add(southPanel, BorderLayout.SOUTH); - southPanel.add(infoScrollPane, BorderLayout.CENTER); - southPanel.add(buttonPanel, BorderLayout.SOUTH); - // - wfStart.setIcon(Env.getImageIcon("wfStart24.gif")); - wfStart.setMargin(new Insets(0, 10, 0, 10)); - wfStart.setRequestFocusEnabled(false); - wfStart.addActionListener(this); - wfStart.setToolTipText(Msg.getMsg(m_ctx, "WFStart")); - wfBack.setIcon(Env.getImageIcon("wfBack24.gif")); - wfBack.setMargin(new Insets(0, 15, 0, 15)); - wfBack.setRequestFocusEnabled(false); - wfBack.addActionListener(this); - wfBack.setToolTipText(Msg.getMsg(m_ctx, "WFPrevious")); - wfNext.setIcon(Env.getImageIcon("wfNext24.gif")); - wfNext.setMargin(new Insets(0, 15, 0, 15)); - wfNext.setRequestFocusEnabled(false); - wfNext.addActionListener(this); - wfNext.setToolTipText(Msg.getMsg(m_ctx, "WFNext")); - wfEnd.setIcon(Env.getImageIcon("wfEnd24.gif")); - wfEnd.setMargin(new Insets(0, 10, 0, 10)); - wfEnd.setRequestFocusEnabled(false); - wfEnd.addActionListener(this); - wfEnd.setToolTipText(Msg.getMsg(m_ctx, "WFExit")); - buttonPanel.add(wfStart, null); - buttonPanel.add(wfBack, null); - buttonPanel.add(wfNext, null); - buttonPanel.add(wfEnd, null); - } // jbInit - - /** - * Initialize Panel for FormPanel - * @param WindowNo window - * @param frame frame - * @see org.compiere.apps.form.FormPanel#init(int, FormFrame) - */ - public void init (int WindowNo, FormFrame frame) - { - m_WindowNo = WindowNo; - m_frame = frame; - // - if (log.isLoggable(Level.FINE)) log.fine("WindowNo=" + WindowNo); - try - { - loadPanel(); - frame.getContentPane().add(loadPanel, BorderLayout.NORTH); - this.setPreferredSize(new Dimension (500,500)); - frame.getContentPane().add(this, BorderLayout.CENTER); - } - catch(Exception e) - { - log.log(Level.SEVERE, "init", e); - } - } // init - - /** - * Dispose - * @see org.compiere.apps.form.FormPanel#dispose() - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** - * Workflow Add & Load Panel - */ - private void loadPanel() - { - String sql = MRole.getDefault().addAccessSQL( - "SELECT AD_Workflow_ID, Name FROM AD_Workflow " - +(!Util.isEmpty(m_WF_whereClause, true) ? " WHERE "+m_WF_whereClause : "") - +" ORDER BY 2", - "AD_Workflow", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); // all - KeyNamePair[] pp = DB.getKeyNamePairs(sql, true); - // - workflow = new CComboBox(pp); - loadPanel.add(workflow); - workflow.addActionListener(this); - // - loadPanel.add(bIgnore); - bIgnore.addActionListener(this); - loadPanel.add(bResetLayout); - bResetLayout.addActionListener(this); - loadPanel.add(bSaveLayout); - bSaveLayout.addActionListener(this); - loadPanel.add(bZoom); - bZoom.addActionListener(this); - } // loadPanel - - - /************************************************************************** - * Load Workflow & Nodes - * @param readWrite if true, you can move nodes - */ - private void load (boolean readWrite) - { - KeyNamePair pp = (KeyNamePair)workflow.getSelectedItem(); - if (pp == null) - return; - load (pp.getKey(), readWrite); - } // load - - /** - * Load Workflow & Nodes - * @param AD_Workflow_ID ID - * @param readWrite if true nodes can be moved - */ - public void load (int AD_Workflow_ID, boolean readWrite) - { - if (log.isLoggable(Level.FINE)) log.fine("RW=" + readWrite + " - AD_Workflow_ID=" + AD_Workflow_ID); - if (AD_Workflow_ID == 0) - return; - int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); - // Get Workflow - m_wf = new MWorkflow (Env.getCtx(), AD_Workflow_ID, null); - centerPanel.removeAll(); - centerPanel.setReadWrite(readWrite); - centerPanel.getGraphScene().addObjectSceneListener(this, ObjectSceneEventType.OBJECT_SELECTION_CHANGED); - centerPanel.setWorkflow(m_wf); - - // Add Nodes - MWFNode[] nodes = m_wf.getNodes(true, AD_Client_ID); - List added = new ArrayList(); - for (int i = 0; i < nodes.length; i++) - { - //boolean rw = readWrite // in editor mode & owned - // && (AD_Client_ID == nodes[i].getAD_Client_ID()); - if (!added.contains(nodes[i].getAD_WF_Node_ID())) - centerPanel.addNode(nodes[i]); - } - - // Add Lines - for (int i = 0; i < nodes.length; i++) - { - MWFNodeNext[] nexts = nodes[i].getTransitions(AD_Client_ID); - for (int j = 0; j < nexts.length; j++) - { - centerPanel.addEdge(nexts[j]); - } - } - - // Info Text - StringBuilder msg = new StringBuilder(""); - msg.append("

    ").append(m_wf.getName(true)).append("

    "); - String s = m_wf.getDescription(true); - if (s != null && s.length() > 0) - msg.append("").append(s).append(""); - s = m_wf.getHelp(true); - if (s != null && s.length() > 0) - msg.append("
    ").append(s); - msg.append(""); - infoTextPane.setText (msg.toString()); - infoTextPane.setCaretPosition(0); - - // Layout - centerPanel.relayout(); - validate(); - } // load - - /** - * Action Listener - * @param e event - * @see java.awt.event.ActionListener#actionPerformed(ActionEvent) - */ - public void actionPerformed (ActionEvent e) - { - if (m_wf == null && e.getSource() != workflow) - return; - - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); - // Editing - if (e.getSource() == bZoom) - zoom(); - else if (e.getSource() == bIgnore) - load(m_wf.getAD_Workflow_ID(), true); - else if (e.getSource() == workflow) - load(true); - else if (e.getSource() == bSaveLayout) - { - if (m_wf.getAD_Client_ID() == AD_Client_ID) - m_wf.saveEx(); - MWFNode[] nodes = m_wf.getNodes(false, AD_Client_ID); - for (int i = 0; i < nodes.length; i++) - { - if (nodes[i].getAD_Client_ID() == AD_Client_ID) - nodes[i].saveEx(); - } - } - else if (e.getSource() == bResetLayout) - resetLayout(); - // Buttons - else if (e.getSource() == wfStart || m_activeNode == null) - start (m_wf.getAD_WF_Node_ID()); - else if (e.getSource() == wfBack) - start (m_wf.getPrevious (m_activeNode.getAD_WF_Node_ID(), AD_Client_ID)); - else if (e.getSource() == wfNext) - start (m_wf.getNext (m_activeNode.getAD_WF_Node_ID(), AD_Client_ID)); - else if (e.getSource() == wfEnd) - start (m_wf.getLast (m_activeNode.getAD_WF_Node_ID(), AD_Client_ID)); - // - setCursor(Cursor.getDefaultCursor()); - } // actionPerformed - - - /************************************************************************** - * Start Node - * @param node node - */ - public void start (MWFNode node) - { - if (log.isLoggable(Level.FINE)) log.fine("Node=" + node); - // Info Text - StringBuilder msg = new StringBuilder(""); - msg.append("

    ").append(node.getName(true)).append("

    "); - String s = node.getDescription(true); - if (s != null && s.length() > 0) - msg.append("").append(s).append(""); - s = node.getHelp(true); - if (s != null && s.length() > 0) - msg.append("
    ").append(s); - msg.append(""); - infoTextPane.setText (msg.toString()); - infoTextPane.setCaretPosition(0); - - // Load Window - if (m_menu != null) - (new AMenuStartItem(node.getAD_WF_Node_ID(), false, node.getName(true), m_menu)).start(); // async load - // - m_activeNode = node; - // - int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); - boolean first = m_wf.isFirst(m_activeNode.getAD_WF_Node_ID(), AD_Client_ID); - boolean last = m_wf.isLast(m_activeNode.getAD_WF_Node_ID(), AD_Client_ID); - wfStart.setEnabled(!first); - wfBack.setEnabled(!first); - wfNext.setEnabled(!last); - wfEnd.setEnabled(!last); - } // start - - /** - * Start Node - * @param AD_WF_Node_ID node id - */ - public void start (int AD_WF_Node_ID) - { - if (AD_WF_Node_ID == 0) - return; - // - Object object = centerPanel.getGraphScene().findWidget(AD_WF_Node_ID); - if (object != null) { - WFNodeWidget widget = (WFNodeWidget) object; - widget.setBackground (Color.CYAN); - if (selectedWidget != null) - selectedWidget.setBackground(Color.WHITE); - selectedWidget = widget; - start(widget.getModel()); - } - } // start - - /** - * Reset Layout - */ - public void resetLayout() - { - Point p0 = new Point (0,0); - for (int i = 0; i < centerPanel.getComponentCount(); i++) - { - Component comp = centerPanel.getComponent(i); - comp.setLocation(p0); - } - centerPanel.validate(); - } // resetLayout - - /** - * Zoom to WorkFlow - */ - private void zoom() - { - if (m_WF_Window_ID <= 0) { - m_WF_Window_ID = MTable.get(m_ctx, MWorkflow.Table_ID).getAD_Window_ID(); - } - if (m_WF_Window_ID <= 0) { - throw new AdempiereException("@NotFound@ @AD_Window_ID@"); - } - - MQuery query = null; - if (m_wf != null) - query = MQuery.getEqualQuery("AD_Workflow_ID", m_wf.getAD_Workflow_ID()); - AWindow frame = new AWindow(null); - if (!frame.initWindow (m_WF_Window_ID, query)) - return; - AEnv.addToWindowManager(frame); - AEnv.showCenterScreen(frame); - frame = null; - } // zoom - - /** - * String Representation - * @return info - */ - public String toString() - { - StringBuilder sb = new StringBuilder("WFPanel["); - if (m_wf != null) - sb.append(m_wf.getAD_Workflow_ID()); - sb.append("]"); - return sb.toString(); - } // toString - - /************************************************************************** - * Test - * @param args ignored - */ - public static void main (String[] args) - { - org.compiere.Adempiere.startupEnvironment(true); - JFrame jf = new JFrame ("WF"); - WFPanel pp = new WFPanel(null); - pp.load(101, true); - jf.getContentPane().add (pp); - jf.pack(); - jf.setVisible(true); - } // main - - - //ObjectSceneListener - public void focusChanged(ObjectSceneEvent arg0, Object arg1, Object arg2) { - // TODO Auto-generated method stub - - } - - public void highlightingChanged(ObjectSceneEvent arg0, Set arg1, - Set arg2) { - // TODO Auto-generated method stub - - } - - public void hoverChanged(ObjectSceneEvent arg0, Object arg1, Object arg2) { - // TODO Auto-generated method stub - - } - - public void objectAdded(ObjectSceneEvent arg0, Object arg1) { - // TODO Auto-generated method stub - - } - - public void objectRemoved(ObjectSceneEvent arg0, Object arg1) { - // TODO Auto-generated method stub - - } - - public void objectStateChanged(ObjectSceneEvent event, Object changedObject, - ObjectState previousState, ObjectState newState) { - Widget w = (Widget) changedObject; - System.out.println("location="+w.getLocation()); - } - - public void selectionChanged(ObjectSceneEvent event, Set prevSelection, - Set selection) { - if (selection != null && selection.size() > 0) { - Object selected = selection.toArray()[selection.size() - 1]; - WFNodeWidget widget = (WFNodeWidget) centerPanel.getGraphScene().findWidget(selected); - widget.setBackground (Color.CYAN); - if (selectedWidget != null) - selectedWidget.setBackground(Color.WHITE); - selectedWidget = widget; - start(widget.getModel()); - } - } - - -} // WFPanel diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFPopupItem.java b/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFPopupItem.java deleted file mode 100644 index 77d6fab24d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFPopupItem.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.compiere.apps.wf; - -import java.util.logging.Level; - -import javax.swing.JMenuItem; - -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.wf.MWFNode; -import org.compiere.wf.MWFNodeNext; - -public class WFPopupItem extends JMenuItem { - - /** - * - */ - private static final long serialVersionUID = 4634863991042969718L; - private int m_AD_Workflow_ID; - - private static final CLogger log = CLogger.getCLogger(WFPopupItem.class); - - /** - * Add Line Item - * @param title title - * @param node node - * @param AD_WF_NodeTo_ID line to - */ - public WFPopupItem (String title, MWFNode node, int AD_WF_NodeTo_ID) - { - super (title); - m_node = node; - m_AD_WF_NodeTo_ID = AD_WF_NodeTo_ID; - m_AD_Workflow_ID = node.getAD_Workflow_ID(); - } // WFPopupItem - - /** - * Delete Line Item - * @param title title - * @param line line to be deleted - */ - public WFPopupItem (String title, MWFNodeNext line) - { - super (title); - m_line = line; - } // WFPopupItem - - /** The Node */ - private MWFNode m_node; - /** The Line */ - private MWFNodeNext m_line; - /** The Next Node ID */ - private int m_AD_WF_NodeTo_ID; - - /** - * Execute - */ - public void execute(final WFPanel wfp) - { - // Add Line - if (m_node != null && m_AD_WF_NodeTo_ID > 0) - { - int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); - MWFNodeNext newLine = new MWFNodeNext(m_node, m_AD_WF_NodeTo_ID); - newLine.setClientOrg(AD_Client_ID, 0); - newLine.saveEx(); - if (log.isLoggable(Level.INFO)) log.info("Add Line to " + m_node + " -> " + newLine); - wfp.load(m_AD_Workflow_ID, true); - } - // Delete Node - else if (m_node != null && m_AD_WF_NodeTo_ID == -1) - { - if (log.isLoggable(Level.INFO)) log.info("Delete Node: " + m_node); - m_node.delete(false); - wfp.load(m_AD_Workflow_ID, true); - } - // Delete Line - else if (m_line != null) - { - if (log.isLoggable(Level.INFO)) log.info("Delete Line: " + m_line); - m_line.delete(false); - wfp.load(m_AD_Workflow_ID, true); - } - else - log.warning("No Action??"); - } // execute -} diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/wf/package.html b/org.adempiere.ui.swing/src/org/compiere/apps/wf/package.html deleted file mode 100644 index ac121c4ab5..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/apps/wf/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - -

    Package org.compiere.apps.wf

    - -Classes for Workflow UI - -

    Related Documentation

    - -For overviews, tutorials, examples, guides, and tool documentation, please see: - - - - - - diff --git a/org.adempiere.ui.swing/src/org/compiere/db/CConnectionDialog.java b/org.adempiere.ui.swing/src/org/compiere/db/CConnectionDialog.java deleted file mode 100644 index b6b3b0d842..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/db/CConnectionDialog.java +++ /dev/null @@ -1,429 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.db; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.FlowLayout; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ResourceBundle; -import java.util.logging.Level; - -import javax.swing.Icon; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPasswordField; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.swing.CButton; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; - -/** - * Connection Dialog. - * - * @author Jorg Janke - * @author Marek Mosiewicz - support for RMI over HTTP - * @version $Id: CConnectionDialog.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ - */ -public class CConnectionDialog extends CDialog implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 9132784527503780794L; - - /** - * Connection Dialog using current Connection - */ - public CConnectionDialog() - { - this (null); - } // CConnectionDialog - - /** - * Connection Dialog - * @param cc Adempiere Connection - */ - public CConnectionDialog(CConnection cc) - { - super((Frame)null, true); - try - { - jbInit(); - setConnection (cc); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - } - AdempierePLAF.showCenterScreen(this); - } // CConnection - - /** Resources */ - private static ResourceBundle res = ResourceBundle.getBundle("org.compiere.db.DBRes"); - - /** Default HTTP Port */ - public static final String APPS_PORT_HTTP = "80"; - /** Default SSL Port */ - public static final String APPS_PORT_SSL = "443"; - /** Connection */ - private CConnection m_cc = null; - private CConnection m_ccResult = null; - private boolean m_updating = false; - - /** Logger */ - private static CLogger log = CLogger.getCLogger (CConnectionDialog.class); - - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel centerPanel = new CPanel(); - private CPanel southPanel = new CPanel(); - private CButton bOK = AdempierePLAF.getOKButton(); - private CButton bCancel = AdempierePLAF.getCancelButton(); - private FlowLayout southLayout = new FlowLayout(); - private GridBagLayout centerLayout = new GridBagLayout(); - private CLabel nameLabel = new CLabel(); - private CTextField nameField = new CTextField(); - private CLabel hostLabel = new CLabel(); - private CTextField hostField = new CTextField(); - private CLabel portLabel = new CLabel(); - private CTextField dbPortField = new CTextField(); - private CLabel sidLabel = new CLabel(); - private CTextField sidField = new CTextField(); - private CCheckBox cbFirewall = new CCheckBox(); - private CLabel fwHostLabel = new CLabel(); - private CTextField fwHostField = new CTextField(); - private CLabel fwPortLabel = new CLabel(); - private CTextField fwPortField = new CTextField(); - private CButton bTestDB = new CButton(); - private CLabel dbTypeLabel = new CLabel(); - private CComboBox dbTypeField = new CComboBox(Database.getDatabaseNames()); - private CCheckBox cbBequeath = new CCheckBox(); - private CLabel dbUidLabel = new CLabel(); - private CTextField dbUidField = new CTextField(); - private JPasswordField dbPwdField = new JPasswordField(); - - private boolean isCancel = true; - - /** - * Static Layout - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setTitle(res.getString("CConnectionDialog")); - mainPanel.setLayout(mainLayout); - southPanel.setLayout(southLayout); - southLayout.setAlignment(FlowLayout.RIGHT); - centerPanel.setLayout(centerLayout); - nameLabel.setText(res.getString("Name")); - nameField.setColumns(30); - nameField.setReadWrite(false); - hostLabel.setText(res.getString("DBHost")); - hostField.setColumns(30); - portLabel.setText(res.getString("DBPort")); - dbPortField.setColumns(10); - sidLabel.setText(res.getString("DBName")); - cbFirewall.setToolTipText(""); - cbFirewall.setText(res.getString("ViaFirewall")); - fwHostLabel.setText(res.getString("FWHost")); - fwHostField.setColumns(30); - fwPortLabel.setText(res.getString("FWPort")); - bTestDB.setText(res.getString("TestConnection")); - bTestDB.setHorizontalAlignment(JLabel.LEFT); - dbTypeLabel.setText(res.getString("Type")); - sidField.setColumns(30); - fwPortField.setColumns(10); - cbBequeath.setText(res.getString("BequeathConnection")); - //cbOverwrite.setText(res.getString("Overwrite")); - dbUidLabel.setText(res.getString("DBUidPwd")); - dbUidField.setColumns(10); - this.getContentPane().add(mainPanel, BorderLayout.CENTER); - mainPanel.add(centerPanel, BorderLayout.CENTER); - mainPanel.add(southPanel, BorderLayout.SOUTH); - southPanel.add(bCancel, null); - southPanel.add(bOK, null); - // - centerPanel.add(nameLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - centerPanel.add(nameField, new GridBagConstraints(1, 0, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); - // DB - centerPanel.add(dbTypeLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); - centerPanel.add(dbTypeField, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 0), 0, 0)); - centerPanel.add(cbBequeath, new GridBagConstraints(2, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 12), 0, 0)); - centerPanel.add(hostLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); - centerPanel.add(hostField, new GridBagConstraints(1, 5, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 12), 0, 0)); - centerPanel.add(portLabel, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - centerPanel.add(dbPortField, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0)); - centerPanel.add(sidLabel, new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - centerPanel.add(sidField, new GridBagConstraints(1, 7, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0)); - centerPanel.add(dbUidLabel, new GridBagConstraints(0, 8, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - centerPanel.add(dbUidField, new GridBagConstraints(1, 8, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0)); - centerPanel.add(dbPwdField, new GridBagConstraints(2, 8, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 12), 0, 0)); - centerPanel.add(cbFirewall, new GridBagConstraints(1, 9, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 12), 0, 0)); - centerPanel.add(fwHostLabel, new GridBagConstraints(0, 10, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - centerPanel.add(fwHostField, new GridBagConstraints(1, 10, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0)); - centerPanel.add(fwPortLabel, new GridBagConstraints(0, 11, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); - centerPanel.add(fwPortField, new GridBagConstraints(1, 11, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0)); - centerPanel.add(bTestDB, new GridBagConstraints(1, 12, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 12, 0), 0, 0)); - // - nameField.addActionListener(this); - // - dbTypeField.addActionListener(this); - hostField.addActionListener(this); - dbPortField.addActionListener(this); - sidField.addActionListener(this); - cbBequeath.addActionListener(this); - cbFirewall.addActionListener(this); - fwHostField.addActionListener(this); - fwPortField.addActionListener(this); - bTestDB.addActionListener(this); - bOK.addActionListener(this); - bCancel.addActionListener(this); - } // jbInit - - /** - * Set Busy - lock UI - * @param busy busy - */ - private void setBusy (boolean busy) - { - if (busy) - this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - else - this.setCursor(Cursor.getDefaultCursor()); - m_updating = busy; - } // setBusy - - /** - * Set Connection - * @param cc - if null use current connection - */ - public void setConnection (CConnection cc) - { - m_cc = cc; - if (m_cc == null) - { - m_cc = CConnection.get(); - m_cc.setName(); - } - // Should copy values - try { - m_ccResult = (CConnection)m_cc.clone(); - } catch (CloneNotSupportedException e) { - // should not happen - e.printStackTrace(); - } - // - String type = m_cc.getType(); - if (type == null || type.length() == 0) - dbTypeField.setSelectedItem(null); - else - m_cc.setType(m_cc.getType()); // sets defaults - updateInfo(); - } // setConnection - - /** - * Get Connection - * @return CConnection - */ - public CConnection getConnection() - { - return m_ccResult; - } // getConnection; - - /** - * ActionListener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (m_updating) - return; - Object src = e.getSource(); - - if (src == bOK) - { - updateCConnection(); - m_cc.setName(); - m_ccResult = m_cc; - dispose(); - isCancel = false; - return; - } - else if (src == bCancel) - { - m_cc.setName(); - dispose(); - return; - } - else if (src == dbTypeField) - { - if (dbTypeField.getSelectedItem() == null) - return; - } - - - updateCConnection(); - // Database Selection Changed - if (src == dbTypeField) - { - m_cc.setType((String)dbTypeField.getSelectedItem()); - dbPortField.setText(String.valueOf(m_cc.getDbPort())); - cbBequeath.setSelected(m_cc.isBequeath()); - fwPortField.setText(String.valueOf(m_cc.getFwPort())); - } - // - else if (src == bTestDB) - cmd_testDB(); - - // Name - if (src == nameField) - m_cc.setName(nameField.getText()); - - updateInfo(); - } // actionPerformed - - private void updateCConnection() { - m_cc.setAppsHost("localhost"); - // - m_cc.setType((String)dbTypeField.getSelectedItem()); - m_cc.setDbHost(hostField.getText()); - m_cc.setDbPort(dbPortField.getText()); - m_cc.setDbName(sidField.getText()); - m_cc.setDbUid(dbUidField.getText()); - m_cc.setDbPwd(String.valueOf(dbPwdField.getPassword())); - m_cc.setBequeath(cbBequeath.isSelected()); - m_cc.setViaFirewall(cbFirewall.isSelected()); - m_cc.setFwHost(fwHostField.getText()); - m_cc.setFwPort(fwPortField.getText()); - } - - /** - * Update Fields from Connection - */ - private void updateInfo() - { - m_updating = true; - nameField.setText(m_cc.getName()); - // - boolean rw = true; - // - dbTypeLabel.setReadWrite(rw); - dbTypeField.setReadWrite(rw); - dbTypeField.setSelectedItem(m_cc.getType()); - // - hostLabel.setReadWrite(rw); - hostField.setReadWrite(rw); - hostField.setText(m_cc.getDbHost()); - portLabel.setReadWrite(rw); - dbPortField.setReadWrite(rw); - dbPortField.setText(String.valueOf(m_cc.getDbPort())); - sidLabel.setReadWrite(rw); - sidField.setReadWrite(rw); - sidField.setText(m_cc.getDbName()); - // - dbUidLabel.setReadWrite(rw); - dbUidField.setReadWrite(rw); - dbUidField.setText(m_cc.getDbUid()); - dbPwdField.setEditable(rw); - dbPwdField.setText(m_cc.getDbPwd()); - // - cbBequeath.setReadWrite(rw); - cbBequeath.setEnabled(m_cc.isOracle()); - cbBequeath.setSelected(m_cc.isBequeath()); - // - boolean fwEnabled = rw && m_cc.isViaFirewall() && m_cc.isOracle(); - cbFirewall.setReadWrite(rw && m_cc.isOracle()); - cbFirewall.setSelected(m_cc.isViaFirewall()); - fwHostLabel.setReadWrite(fwEnabled); - fwHostField.setReadWrite(fwEnabled); - fwHostField.setText(m_cc.getFwHost()); - fwPortLabel.setReadWrite(fwEnabled); - fwPortField.setReadWrite(fwEnabled); - fwPortField.setText(String.valueOf(m_cc.getFwPort())); - // - bTestDB.setToolTipText(m_cc.getConnectionURL()); - bTestDB.setIcon(getStatusIcon(m_cc.isDatabaseOK())); - m_updating = false; - } // updateInfo - - /** - * Get Status Icon - ok or not - * @param ok ok - * @return Icon - */ - private Icon getStatusIcon (boolean ok) - { - if (ok) - return bOK.getIcon(); - else - return bCancel.getIcon(); - } // getStatusIcon - - /** - * Test Database connection - */ - private void cmd_testDB() - { - setBusy (true); - Exception e = m_cc.testDatabase(true); - if (e != null) - { - JOptionPane.showMessageDialog(this, - e, // message - res.getString("ConnectionError") + ": " + m_cc.getConnectionURL(), - JOptionPane.ERROR_MESSAGE); - } - setBusy (false); - } // cmd_testDB - - public boolean isCancel() { - return isCancel; - } - -} // CConnectionDialog diff --git a/org.adempiere.ui.swing/src/org/compiere/db/CConnectionEditor.java b/org.adempiere.ui.swing/src/org/compiere/db/CConnectionEditor.java deleted file mode 100644 index f9c48710bf..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/db/CConnectionEditor.java +++ /dev/null @@ -1,298 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.db; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; - -import javax.swing.ImageIcon; -import javax.swing.JComponent; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JTextField; -import javax.swing.LookAndFeel; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.swing.CEditor; -import org.compiere.util.DB; - -/** - * Connection Editor. - * A combo box and a button - * - * @author Jorg Janke - * @version $Id: CConnectionEditor.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ - */ -public class CConnectionEditor extends JComponent - implements CEditor -{ - /** - * - */ - private static final long serialVersionUID = 259945316129032408L; - - /** - * Connection Editor creating new Connection - */ - public CConnectionEditor() - { - super(); - setName("ConnectionEditor"); - CConnectionEditor_MouseListener ml = new CConnectionEditor_MouseListener(); - // Layout - m_text.setEditable(false); - m_text.setBorder(null); - m_text.addMouseListener(ml); - m_db.setIcon(new ImageIcon(getClass().getResource("Database16.gif"))); - m_db.setFocusable(false); - m_db.setBorder(null); - m_db.setOpaque(true); - m_db.addMouseListener(ml); - LookAndFeel.installBorder(this, "TextField.border"); - // - setLayout(new BorderLayout(0,0)); - add(m_text, BorderLayout.CENTER); - add(m_db, BorderLayout.EAST); - } // CConnectionEditor - - /** Text Element */ - private JTextField m_text = new JTextField(10); - /** DB Button Element */ - private JLabel m_db = new JLabel (); - /** The Value */ - private CConnection m_value = null; - /** ReadWrite */ - private boolean m_rw = true; - /** Mandatory */ - private boolean m_mandatory = false; - - /** - * Enable Editor - * @param rw true, if you can enter/select data - */ - public void setReadWrite (boolean rw) - { - m_rw = rw; - setBackground(false); - } // setReadWrite - - /** - * Is it possible to edit - * @return true, if editable - */ - public boolean isReadWrite() - { - return m_rw; - } // isReadWrite - - /** - * Set Editor Mandatory - * @param mandatory true, if you have to enter data - */ - public void setMandatory (boolean mandatory) - { - m_mandatory = mandatory; - } // setMandatory - - /** - * Is Field mandatory - * @return true, if mandatory - */ - public boolean isMandatory() - { - return m_mandatory; - } // isMandatory - - /** - * Set Background based on editable / mandatory / error - * @param error if true, set background to error color, otherwise mandatory/editable - */ - public void setBackground (boolean error) - { - Color c = null; - if (error) - c = AdempierePLAF.getFieldBackground_Error(); - else if (!m_rw) - c = AdempierePLAF.getFieldBackground_Inactive(); - else if (m_mandatory) - c = AdempierePLAF.getFieldBackground_Mandatory(); - else - c = AdempierePLAF.getFieldBackground_Normal(); - setBackground(c); - } // setBackground - - /** - * Set Background color - * @param color - */ - public void setBackground (Color color) - { - m_text.setBackground(color); - m_db.setBackground(color); - } // setBackground - - /** - * Set Visible - * @param visible true if field is to be shown - */ - public void setVisible (boolean visible) - { - super.setVisible(visible); - } - - /** - * Set Editor to value - * @param value value of the editor - */ - public void setValue (Object value) - { - if (value != null && value instanceof CConnection) - m_value = (CConnection)value; - setDisplay(); - } // setValue - - /** - * Return Editor value - * @return current value - */ - public Object getValue() - { - return m_value; - } // getValue - - /** - * Return Display Value - * @return displayed String value - */ - public String getDisplay() - { - if (m_value == null) - return ""; - return m_value.getName(); - } // getDisplay - - /** - * Update Display with Connection info - */ - public void setDisplay() - { - m_text.setText(getDisplay()); - if (m_value == null) - return; - // Text - if (m_value.isDatabaseOK()) - { - m_text.setForeground(AdempierePLAF.getTextColor_OK()); - setBackground(false); - if (!m_value.isDatabaseOK()) - m_db.setBackground(AdempierePLAF.getFieldBackground_Error()); - } - else - { - m_text.setForeground(AdempierePLAF.getTextColor_Issue()); - setBackground(true); - } - } // setDisplay - - - /************************************************************************** - * Remove Action Listener - * @param l - */ - public synchronized void removeActionListener(ActionListener l) - { - listenerList.remove(ActionListener.class, l); - } // removeActionListener - - /** - * Add Action Listener - * @param l - */ - public synchronized void addActionListener(ActionListener l) - { - listenerList.add(ActionListener.class, l); - } // addActionListener - - /** - * Fire Action Performed - */ - private void fireActionPerformed() - { - ActionEvent e = null; - ActionListener[] listeners = listenerList.getListeners(ActionListener.class); - for (int i = 0; i < listeners.length; i++) - { - if (e == null) - e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "actionPerformed"); - listeners[i].actionPerformed(e); - } - } // fireActionPerformed - - - /************************************************************************** - * Test Method - * @param args - */ - public static void main(String[] args) - { - // System.out.println("CConnectionEditor"); - JFrame frame = new JFrame("CConnectionEditor"); - frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - frame.getRootPane().getContentPane().add(new CConnectionEditor()); - AdempierePLAF.showCenterScreen(frame); - } // main - - - /** - * MouseListener - */ - public class CConnectionEditor_MouseListener extends MouseAdapter - { - /** - * Mouse Clicked - Open Dialog - * @param e - */ - public void mouseClicked(MouseEvent e) - { - if (!isEnabled() || !m_rw || m_active) - return; - m_active = true; - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - // - CConnectionDialog cd = new CConnectionDialog(m_value); - setValue(cd.getConnection()); - if (!cd.isCancel()) - fireActionPerformed(); - else { - DB.closeTarget(); - DB.setDBTarget(m_value); - } - - // - setCursor(Cursor.getDefaultCursor()); - m_active = false; - } // mouseClicked - - private boolean m_active = false; - } // CConnectionExitor_MouseListener - -} // CConnectionEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/dbPort/ConvertDialog.java b/org.adempiere.ui.swing/src/org/compiere/dbPort/ConvertDialog.java deleted file mode 100644 index 36147e74a8..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/dbPort/ConvertDialog.java +++ /dev/null @@ -1,360 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.dbPort; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.sql.Connection; - -import javax.swing.Box; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JFileChooser; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; - -import org.compiere.Adempiere; -import org.compiere.db.CConnection; -import org.compiere.db.CConnectionEditor; -import org.compiere.db.Database; -import org.compiere.swing.CFrame; - -/** - * Conversion Dialog - * - * @author Jorg Janke - * @version $Id: ConvertDialog.java,v 1.2 2006/07/30 00:55:04 jjanke Exp $ - */ -public class ConvertDialog extends CFrame implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 4748833703849693696L; - - /** - * Convert Dialog - */ - public ConvertDialog() - { - try - { - jbInit(); - // - fSelectFile.addItem("D:\\adempiere\\db\\database\\create\\views.sql"); - fSelectFile.addItem("D:\\adempiere\\db\\database\\create\\temporary.sql"); - fSelectFile.addItem("D:\\adempiere\\db\\database\\create\\sequences.sql"); - fSelectFile.addItem("D:\\adempiere\\db\\database\\create\\adempiere.sql"); - // Set up environment - fConnect.setValue(CConnection.get(Database.DB_POSTGRESQL, - "linux", Database.DB_POSTGRESQL_DEFAULT_PORT, "adempiere")); - fTarget.setSelectedItem(Database.DB_POSTGRESQL); - fExecute.setSelected(true); - - cmd_execute(); // set UI - // - pack(); - setVisible(true); - } - catch(Exception e) - { - System.err.println(e); - } - } // ConvertDialog - - private JPanel parameterPanel = new JPanel(); - private GridBagLayout gridBagLayout1 = new GridBagLayout(); - private JLabel lSelectFile = new JLabel(); - private JComboBox fSelectFile = new JComboBox(); - private JButton bSelectFile = new JButton(); - private JCheckBox fExecute = new JCheckBox(); - private JLabel lConnect = new JLabel(); - private CConnectionEditor fConnect = new CConnectionEditor(); - private JButton bStart = new JButton(); - private JScrollPane scrollPane = new JScrollPane(); - private JTextArea infoPane = new JTextArea(); - private Component component1; - private Component component2; - private Component component3; - private Component component4; - private JLabel lTarget = new JLabel(); - private JComboBox fTarget = new JComboBox(Database.getDatabaseNames()); - private JCheckBox fVerbose = new JCheckBox(); - - /** - * Static Layout - * @throws Exception - */ - private void jbInit() throws Exception - { - component1 = Box.createHorizontalStrut(8); - component2 = Box.createHorizontalStrut(8); - component3 = Box.createVerticalStrut(8); - component4 = Box.createVerticalStrut(8); - this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - this.setTitle("DB Convert Dialog"); - // - parameterPanel.setLayout(gridBagLayout1); - lSelectFile.setText("Select File"); - fSelectFile.setEditable(true); - bSelectFile.setText("add file"); - bSelectFile.addActionListener(this); - fExecute.setText("Execute Directly"); - fExecute.addActionListener(this); - lConnect.setText("Connection"); - bStart.setText("Start"); - bStart.addActionListener(this); - // - infoPane.setBackground(Color.lightGray); - infoPane.setEditable(false); - scrollPane.setPreferredSize(new Dimension(200, 200)); - lTarget.setText("Target"); - fVerbose.setText("Verbose"); - // - this.getContentPane().add(parameterPanel, BorderLayout.NORTH); - parameterPanel.add(lSelectFile, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); - parameterPanel.add(fSelectFile, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterPanel.add(bSelectFile, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterPanel.add(fExecute, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterPanel.add(lConnect, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); - parameterPanel.add(fConnect, new GridBagConstraints(2, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); - parameterPanel.add(bStart, new GridBagConstraints(3, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterPanel.add(component1, new GridBagConstraints(5, 0, 1, 2, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); - parameterPanel.add(component2, new GridBagConstraints(0, 0, 1, 2, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); - parameterPanel.add(component3, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); - parameterPanel.add(component4, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); - parameterPanel.add(lTarget, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - this.getContentPane().add(scrollPane, BorderLayout.CENTER); - scrollPane.getViewport().add(infoPane, null); - parameterPanel.add(fTarget, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterPanel.add(fVerbose, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - } // jbInit - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - // - if (e.getSource() == bStart) - { - bStart.setEnabled(false); - cmd_start(); - bStart.setEnabled(true); - } - else if (e.getSource() == bSelectFile) - cmd_selectFile(); - - else if (e.getSource() == fExecute) - cmd_execute(); - // - setCursor(Cursor.getDefaultCursor()); - } // actionListener - - /** - * Execute toggle - */ - private void cmd_execute() - { - lConnect.setEnabled(fExecute.isSelected()); - fConnect.setReadWrite(fExecute.isSelected()); - lTarget.setEnabled(!fExecute.isSelected()); - fTarget.setEnabled(!fExecute.isSelected()); - } // cmd_execute - - /** - * Select File and add to selection - */ - private void cmd_selectFile() - { - JFileChooser fc = new JFileChooser(); - fc.setMultiSelectionEnabled(false); - if (fc.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) - return; - File f = fc.getSelectedFile(); - if (f == null || !f.isFile()) - return; - String fileName = f.getAbsolutePath(); - // - fSelectFile.addItem(fileName); - fSelectFile.setSelectedItem(fileName); - } // cmd_selectFile - - - /************************************************************************** - * Start Pressed - */ - private void cmd_start() - { - // Open and read File - File file = new File ((String)fSelectFile.getSelectedItem()); - if (!file.exists() || file.isDirectory()) - { - infoPane.append("File does not exist or a directory: " + file + "\n"); - return; - } - infoPane.append("Opening file: " + file + "\n"); - StringBuilder sb = new StringBuilder (1000); - // - try - { - FileReader fr = new FileReader(file); - BufferedReader in = new BufferedReader(fr); - - String line = null; - int lines = 0; - while((line = in.readLine()) != null) - { - lines++; - sb.append(line).append('\n'); - } - in.close(); - fr.close(); - infoPane.append("- Read lines: " + lines + ", size: " + sb.length() + "\n"); - } - catch (FileNotFoundException fnf) - { - infoPane.append("Error: " + fnf + "\n"); - return; - } - catch (IOException ioe) - { - infoPane.append("Error: " + ioe + "\n"); - return; - } - - // Target system - if (fExecute.isSelected()) - { - CConnection cc = (CConnection)fConnect.getValue(); - Convert convert = cc.getDatabase().getConvert(); - convert.setVerbose(fVerbose.isSelected()); - // - Connection conn = cc.getConnection (true, Connection.TRANSACTION_READ_COMMITTED); - convert.execute(sb.toString(), conn); - if (convert.hasError()) - { - StringBuilder sbb = new StringBuilder ("- Error: "); - if (convert.getConversionError() != null) - sbb.append(convert.getConversionError()).append(' '); - if (convert.getException() != null) - { - sbb.append(convert.getException()); - convert.getException().printStackTrace(); - } - sbb.append("\n"); - infoPane.append(sbb.toString()); - } - else - infoPane.append("- OK\n"); - } - else - { - String target = (String)fTarget.getSelectedItem(); - if (Database.DB_ORACLE.equals(target)) - { - infoPane.append("No conversion needed.\n"); - return; - } - Convert convert = null; - try { - convert = Database.getDatabase(target).getConvert(); - } catch (Exception e) { - infoPane.append("Error: " + e + "\n"); - return; - } - // - String cc = convert.convertAll(sb.toString()); - - // Output file name - String fileName = file.getAbsolutePath(); - int pos = fileName.lastIndexOf('.'); - if (pos == -1) - fileName += target; - else - fileName = fileName.substring(0, pos) + target + fileName.substring(pos); - infoPane.append("Writing to: " + fileName + "\n"); - // Write to file - try - { - FileWriter fw = new FileWriter(fileName, false); - BufferedWriter out = new BufferedWriter (fw); - out.write("-- Adempiere dbPort - Convert Oracle to " + target); - out.newLine(); - out.write("-- " + Adempiere.getSummary()); - out.newLine(); - // - out.write(cc); - // - out.close(); - fw.close(); - } - catch (IOException ioe) - { - infoPane.append("Error: " + ioe + "\n"); - } - infoPane.append("- Written: " + cc.length() + "\n"); - } - } // cmd_start - - - /*************************************************************************/ - - /** - * Start Dialog - * @param args ignored - */ - public static void main(String[] args) - { - new ConvertDialog(); - } // main -} // ConvertDialog diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/APanelTab.java b/org.adempiere.ui.swing/src/org/compiere/grid/APanelTab.java deleted file mode 100644 index dc0fc2f2ed..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/APanelTab.java +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid; - -import org.compiere.apps.APanel; - -/** - * Application Panel Tab Interface. - * Interface for CPanels displayed as a Tab in APanel - * - * @author Jorg Janke - * @version $Id: APanelTab.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public interface APanelTab -{ - /** - * Load Data - * Called when tab is displayed. - */ - public void loadData(); - - /** - * Save Data - * Called when tab is swiched to another tab. - */ - public void saveData(); - - /** - * Register APanel - * @param panel panel - */ - public void registerAPanel (APanel panel); - - /** - * Unregister APanel - */ - public void unregisterPanel (); - -} // APanelTab diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/DefaultCreateFromFactory.java b/org.adempiere.ui.swing/src/org/compiere/grid/DefaultCreateFromFactory.java deleted file mode 100644 index 9afa919b8b..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/DefaultCreateFromFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2013 Elaine Tan * - * Copyright (C) 2013 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import org.compiere.model.GridTab; -import org.compiere.model.I_C_BankStatement; -import org.compiere.model.I_C_Invoice; -import org.compiere.model.I_M_InOut; -import org.compiere.model.I_M_PackageMPS; -import org.compiere.model.I_M_RMA; -import org.compiere.model.I_C_DepositBatch; - -/** - * - * @author Elaine - * - */ -public class DefaultCreateFromFactory implements ICreateFromFactory -{ - - @Override - public ICreateFrom create(GridTab mTab) - { - String tableName = mTab.getTableName(); - if (tableName.equals(I_C_Invoice.Table_Name)) - return new VCreateFromInvoiceUI(mTab); - else if (tableName.equals(I_C_BankStatement.Table_Name)) - return new VCreateFromStatementUI(mTab); - else if (tableName.equals(I_M_InOut.Table_Name)) - return new VCreateFromShipmentUI(mTab); - else if (tableName.equals(I_M_RMA.Table_Name)) - return new VCreateFromRMAUI(mTab); - else if (tableName.equals(I_M_PackageMPS.Table_Name)) - return new VCreateFromPackageShipmentUI(mTab); - else if (tableName.equals(I_C_DepositBatch.Table_Name)) - return new VCreateFromDepositBatchUI(mTab); - return null; - } - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/DefaultPaymentFormFactory.java b/org.adempiere.ui.swing/src/org/compiere/grid/DefaultPaymentFormFactory.java deleted file mode 100644 index 02b0283a5e..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/DefaultPaymentFormFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2012 Elaine Tan * - * Copyright (C) 2012 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import org.compiere.model.GridTab; -import org.compiere.model.MInvoice; - -/** - * - * @author Elaine - * - */ -public class DefaultPaymentFormFactory implements IPaymentFormFactory { - - public IPaymentForm create(int windowNo, GridTab mTab, String paymentRule) - { - if (paymentRule.equals(MInvoice.PAYMENTRULE_Cash)) - return new VPaymentFormCash(windowNo, mTab); - else if (paymentRule.equals(MInvoice.PAYMENTRULE_Check)) - return new VPaymentFormCheck(windowNo, mTab); - else if (paymentRule.equals(MInvoice.PAYMENTRULE_CreditCard)) - return new VPaymentFormCreditCard(windowNo, mTab); - else if (paymentRule.equals(MInvoice.PAYMENTRULE_DirectDebit)) - return new VPaymentFormDirectDebit(windowNo, mTab); - else if (paymentRule.equals(MInvoice.PAYMENTRULE_DirectDeposit)) - return new VPaymentFormDirectDeposit(windowNo, mTab); - else if (paymentRule.equals(MInvoice.PAYMENTRULE_MixedPOSPayment)) - return new VPaymentFormMixedPOS(windowNo, mTab); - else if (paymentRule.equals(MInvoice.PAYMENTRULE_OnCredit)) - return new VPaymentFormOnCredit(windowNo, mTab); - return null; - } -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/GridController.java b/org.adempiere.ui.swing/src/org/compiere/grid/GridController.java deleted file mode 100644 index dd1af42d7c..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/GridController.java +++ /dev/null @@ -1,1506 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - * @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ] * - * @contributor fer_luck @ centuryon * - *****************************************************************************/ -package org.compiere.grid; - -import java.awt.AWTEvent; -import java.awt.BorderLayout; -import java.awt.CardLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.KeyboardFocusManager; -import java.awt.event.KeyEvent; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.beans.PropertyVetoException; -import java.beans.VetoableChangeListener; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Properties; -import java.util.Set; -import java.util.logging.Level; - -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JScrollPane; -import javax.swing.JSplitPane; -import javax.swing.KeyStroke; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableColumn; -import javax.swing.table.TableColumnModel; - -import org.adempiere.base.Core; -import org.adempiere.base.IColumnCallout; -import org.adempiere.plaf.AdempiereLookAndFeel; -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ADialog; -import org.compiere.apps.APanel; -import org.compiere.apps.AppsAction; -import org.compiere.grid.ed.VCellEditor; -import org.compiere.grid.ed.VCellRenderer; -import org.compiere.grid.ed.VChart; -import org.compiere.grid.ed.VEditor; -import org.compiere.grid.ed.VEditorFactory; -import org.compiere.grid.ed.VHeaderRenderer; -import org.compiere.grid.ed.VManagedEditor; -import org.compiere.grid.ed.VRowIDEditor; -import org.compiere.grid.ed.VRowIDRenderer; -import org.compiere.grid.ed.VString; -import org.compiere.grid.tree.VTreePanel; -import org.compiere.model.DataStatusEvent; -import org.compiere.model.DataStatusListener; -import org.compiere.model.GridField; -import org.compiere.model.GridTab; -import org.compiere.model.GridTable; -import org.compiere.model.GridWindow; -import org.compiere.model.MColumn; -import org.compiere.model.MTree; -import org.compiere.model.MTreeNode; -import org.compiere.swing.CPanel; -import org.compiere.swing.CScrollPane; -import org.compiere.swing.CollapsiblePanel; -import org.compiere.swing.TableCellNone; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Evaluatee; -import org.compiere.util.Trx; - -/** - * The Grid Controller is the panel for single and multi-row presentation - * and links to the Model Tab. - * - *
    - *  UI Structure:
    - *  this    (BorderLayout)
    - *      splitPane (JSplitPane)
    - *          left
    - *              graphicPanel
    - *          right
    - *              cardPanel   JPanel  (CardLayout)
    - *                  srPane  JSplitPane
    - * 						vPane	JScrollPane
    - *              	        vPanel  VPanel (GridBagLayout)
    - * 						vIncludedGC	GridController
    - *                  mrPane  JScrollPane
    - *                      vTable  VTable
    - *
    - *  DataBinding:
    - *  - MultiRow - is automatic between VTable and MTable
    - *  - SingleRow
    - *		- from VEditors via fireVetoableChange(m_columnName, null, getText());
    - *			(vetoableChange)
    - *		- to VEditors via updateSingleRow -> Editor.setValue(object)
    - *
    - *  Event Chains
    - *  -- Navigation --
    - *  (VTable selection -> GridController.valueChanged)
    - *  (APanel selection)
    - *      + MTab.navivate
    - *          + MTab.setCurrentRow
    - *              + Update all MFields
    - *                  + MField.setValue
    - *                      + setContext
    - *                      + fire PropertyChange "Value"
    - *                          + VEditor.propertyChange
    - *                              + VEditor.setValue
    - *              + MTab.fireProperyChange "CurrentRow"
    - *                  + VTable.propertyChange (setRowSelectionInterval)
    - *                      + GridController.valueChange
    - *                          + GridController.dynamicDisplay(complete)
    - *              + MTab.fireDataStatusChanged
    - *                  + APanel.statusChanged
    - *
    - *  -- ValueChanges --
    - *  VEditor.fireVetoableChange
    - *      + (VCellEditor.vetoableChange/getCellEditorValue)   -- multi-row source
    - *      + (GridController.vetoableChange)                   -- single-row source
    - *          + MTable.setValueAt
    - *              + MField.setValue
    - *                  + setContext
    - *                  + fire PropertyChange "Value"
    - *                      + VEditor.setValue
    - *              + MTable.fireDataStatusChanged
    - *                  + MTab.dataStatusChanged
    - *                      + MTab.fireDataStatusChanged
    - *                          + APanel.statusChanged
    - *                  + GridController.dataStatusChanged
    - *                      + GridController.dynamicDisplay(selective)
    - *  
    - * @author Jorg Janke - * @version $Id: GridController.java,v 1.8 2006/09/25 00:59:52 jjanke Exp $ - * - * @author Teo Sarca - BF [ 1742159 ], BF [ 1707876 ] - * @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ] - * @contributor fer_luck @ centuryon FR [ 1757088 ] - */ -public class GridController extends CPanel - implements DataStatusListener, ListSelectionListener, Evaluatee, - VetoableChangeListener, PropertyChangeListener, MouseListener -{ - /** - * - */ - private static final long serialVersionUID = -2830833057882006196L; - - /** - * Constructor - you need to call initGrid for instanciation - */ - public GridController() - { - try - { - jbInit(); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - } - } // GridController - - /** - * toString - * @return string representation - */ - public String toString() - { - return "GridController for " + m_mTab; - } // toString - - /** Logger */ - private static CLogger log = CLogger.getCLogger(GridController.class); - - /** - * The Layout - */ - private BorderLayout mainLayout = new BorderLayout(); - private JSplitPane splitPane = new JSplitPane(); - private CPanel graphPanel = new CPanel(); - private BorderLayout graphLayout = new BorderLayout(); - private CPanel cardPanel = new CPanel(); - private CardLayout cardLayout = new CardLayout(); - //private JSplitPane srPane = new JSplitPane(); - - private JScrollPane vPane = new JScrollPane(); - private CScrollPane mrPane = new CScrollPane(); - private CPanel xPanel = new CPanel(); - private BorderLayout xLayout = new BorderLayout(); - private VTable vTable = new VTable(); - //FR [ 1757088 ] - private VPanel vPanel = null; - private boolean detailGrid = false; - - /** - * Static Layout init - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setLayout(mainLayout); - this.add(splitPane, BorderLayout.CENTER); - splitPane.setOpaque(false); - graphPanel.setLayout(graphLayout); - // - splitPane.add(graphPanel, JSplitPane.LEFT); - splitPane.add(cardPanel, JSplitPane.RIGHT); - splitPane.setBorder(null); - splitPane.setName("gc_splitPane"); - // - cardPanel.setLayout(cardLayout); - cardPanel.add(vPane, "vPane"); // Sequence Important! - cardPanel.add(mrPane, "mrPane"); - cardPanel.setBorder(null); - cardPanel.setName("gc_cardPanel"); - // single row (w/o xPane it would be centered) - /* - srPane.setBorder(null); - srPane.setName("gc_srPane"); - srPane.setOrientation(JSplitPane.VERTICAL_SPLIT); - srPane.add(vPane, JSplitPane.TOP); - srPane.setTopComponent(vPane); - srPane.setBottomComponent(null); // otherwise a button is created/displayed - */ - //FR [ 1757088 ] vPane.getViewport().add(xPanel, null); - //FR [ 1757088 ] xPanel.add(vPanel); - xPanel.setLayout(xLayout); - xPanel.setName("gc_xPanel"); - xPanel.setBorder(BorderFactory.createEmptyBorder()); - //xLayout.setAlignment(FlowLayout.LEFT); - xLayout.setHgap(0); - xLayout.setVgap(0); - // multi-row - mrPane.setBorder(null); - mrPane.getViewport().add(vTable, null); - mrPane.setName("gc_mrPane"); - // - graphPanel.setBorder(null); - graphPanel.setName("gc_graphPanel"); - //srPane.setDividerLocation(200); - - vPane.setBorder(BorderFactory.createEmptyBorder()); - } // jbInit - - /** - * Displose - */ - public void dispose() - { - if (log.isLoggable(Level.CONFIG)) log.config( "(" + m_mTab.toString() + ")"); - // clear info - stopEditor(false); - if (m_mTab.isLoadComplete()) - { - if (m_mTab.needSave(true, false)) - m_mTab.dataIgnore(); - } - //FR [ 1757088 ] vIncludedGC = null; - - // Listeners - if (m_mTab.isLoadComplete()) - { - m_mTab.getTableModel().removeDataStatusListener(this); - m_mTab.getTableModel().removeVetoableChangeListener(this); - } - vTable.getSelectionModel().removeListSelectionListener(this); - m_mTab.removePropertyChangeListener(vTable); - - // editors - Component[] comp = vPanel.getComponentsRecursive(); - for (int i = 0; i < comp.length; i++) - { - if (comp[i] instanceof VEditor) - { - VEditor vEditor = (VEditor)comp[i]; - vEditor.removeVetoableChangeListener(this); - String columnName = comp[i].getName(); - GridField mField = m_mTab.getField(columnName); - if (mField != null) - mField.removePropertyChangeListener(vEditor); - vEditor.dispose(); - } - } - /** @todo Remove APanel Button listeners */ - - vTable.removeAll(); - vTable.setModel(new DefaultTableModel()); // remove reference - vTable = null; - vPanel.removeAll(); - vPanel = null; - //srPane.removeAll(); - //srPane = null; - splitPane.removeAll(); - splitPane = null; - m_mTab = null; - m_tree = null; - this.removeAll(); - } // dispose - - /** Model Tab */ - private GridTab m_mTab = null; - /** Window */ - private int m_WindowNo; - /** Only Multi-Row exist */ - private boolean m_onlyMultiRow = false; - /** Single/Multi Row indicator */ - private boolean m_singleRow = true; - /** Veto Active */ - private boolean m_vetoActive = false; - /** Tree Panel (optional) */ - private VTreePanel m_tree; - - private APanel m_aPanel; - - private boolean init; - - private ArrayList synchronizerList = new ArrayList(); - - public boolean initGrid (GridTab mTab, boolean onlyMultiRow, - int WindowNo, APanel aPanel, GridWindow mWindow) - { - return initGrid(mTab, onlyMultiRow, WindowNo, aPanel, mWindow, false); - } - - /************************************************************************** - * Init Grid. - *
    -	 *  - Map table to model
    -	 *  - Update (multi-row) table info with renderers/editors
    -	 *  - build single-row panel
    -	 *  - initialize display
    -	 *  
    - * @param mTab tab - * @param onlyMultiRow only table - * @param WindowNo window no - * @param aPanel optional Application Panel for adding button listeners - * @param mWindow parent Window Model - * @return true if initialized - */ - public boolean initGrid (GridTab mTab, boolean onlyMultiRow, - int WindowNo, APanel aPanel, GridWindow mWindow, boolean lazy) - { - if (log.isLoggable(Level.CONFIG)) log.config( "(" + mTab.toString() + ")"); - m_mTab = mTab; - m_WindowNo = WindowNo; - m_onlyMultiRow = onlyMultiRow; - m_aPanel = aPanel; - setName("GC-" + mTab); - //FR [ 1757088 ] - vPanel = new VPanel(mTab.getName(), m_WindowNo); - vPanel.putClientProperty(AdempiereLookAndFeel.HIDE_IF_ONE_TAB, Boolean.TRUE); - if (this.isDetailGrid()) - { - vPanel.setBorder(BorderFactory.createLineBorder(AdempierePLAF.getPrimary2())); - } - vPane.getVerticalScrollBar().setUnitIncrement(16); // IDEMPIERE-572 - tbayen 2013-01-20 - vPane.getViewport().add(xPanel, null); - xPanel.add(vPanel, BorderLayout.CENTER); - - setTabLevel(m_mTab.getTabLevel()); - - if (!lazy) - init(); - else - { - //Load tab meta data, needed for includeTab to work - m_mTab.initTab(false); - } - - - // log.config( "GridController.dynInit (" + mTab.toString() + ") - fini"); - return true; - } // initGrid - - private void init() - { - // Set up Multi Row Table - vTable.setModel(m_mTab.getTableModel()); - - // Update Table Info ------------------------------------------------- - int size = setupVTable (m_aPanel, m_mTab, vTable); - - // Set Color on Tab Level - // this.setBackgroundColor (mTab.getColor()); - - // Single Row ------------------------------------------------------- - if (!m_onlyMultiRow) - { - // Set Softcoded Mnemonic &x - for (int i = 0; i < size; i++) - { - GridField mField = m_mTab.getField(i); - if (mField.isDisplayed()) - vPanel.setMnemonic(mField); - } // for all fields - - // Add Fields - for (int i = 0; i < size; i++) - { - GridField mField = m_mTab.getField(i); - if (mField.isDisplayed() - // IDEMPIERE-587 Swing: Toolbar Button to start Process from button fields - && !( - mField.getDisplayType()==DisplayType.Button - && mField.isToolbarOnlyButton()) - ) - { - VEditor vEditor = VEditorFactory.getEditor(m_mTab, mField, false); - if (vEditor == null) - { - log.warning("Editor not created for " + mField.getColumnName()); - continue; - } - // MField => VEditor - New Field value to be updated to editor - mField.addPropertyChangeListener(vEditor); - // VEditor => this - New Editor value to be updated here (MTable) - vEditor.addVetoableChangeListener(this); - // Add to VPanel - vPanel.addFieldBuffered(vEditor, mField); - // APanel Listen to buttons - if (mField.getDisplayType() == DisplayType.Button && m_aPanel != null) - ((JButton)vEditor).addActionListener (m_aPanel); - } - } // for all fields - vPanel.addFieldBuffered(null, null); // flush the last one through - - // No Included Grid Controller - /* - srPane.setResizeWeight(1); // top part gets all - srPane.setDividerSize (0); - srPane.setDividerLocation (9999); - */ - // Use SR to size MR - mrPane.setPreferredSize(vPanel.getPreferredSize()); - } // Single-Row - - // Tree Graphics Layout - int AD_Tree_ID = 0; - if (m_mTab.isTreeTab()) - AD_Tree_ID = MTree.getDefaultAD_Tree_ID ( - Env.getAD_Client_ID(Env.getCtx()), m_mTab.getKeyColumnName()); - if (m_mTab.isTreeTab() && AD_Tree_ID != 0) - { - m_tree = new VTreePanel(m_WindowNo, false, true); - if (m_mTab.getTabNo() == 0) // initialize other tabs later - m_tree.initTree(AD_Tree_ID); - m_tree.addPropertyChangeListener(VTreePanel.NODE_SELECTION, this); - graphPanel.add(m_tree, BorderLayout.CENTER); - splitPane.setDividerLocation(250); - // splitPane.resetToPreferredSizes(); - } - else // No Graphics - hide - { - graphPanel.setPreferredSize(new Dimension(0,0)); - splitPane.setDividerSize(0); - splitPane.setDividerLocation(0); - } - - // Receive DataStatusChanged info from MTab - m_mTab.addDataStatusListener(this); - // Receive vetoableChange info from MTable when saving - m_mTab.getTableModel().addVetoableChangeListener(this); - // Selection Listener -> valueChanged - vTable.getSelectionModel().addListSelectionListener(this); - // Navigation (RowChanged) - m_mTab.addPropertyChangeListener(vTable); - - // Update UI - vTable.autoSize(true); - - // Set initial presentation - if (m_onlyMultiRow || !m_mTab.isSingleRow()) - switchMultiRow(); - else - switchSingleRow(); - - init = true; - } - - /** - * - * @return boolean - */ - public boolean isInit() - { - return init; - } - - /** - * Include Tab - * @param gc grid controller to add - * @return GridSynchronizer - */ - - //FR [ 1757088 ] - public boolean includeTab (GridController gc , APanel aPanel, GridSynchronizer sync) - { - GridController detail = gc; - detail.setDetailGrid(true); - detail.addMouseListener(detail); - detail.enableEvents(AWTEvent.HIERARCHY_EVENT_MASK + AWTEvent.MOUSE_EVENT_MASK); - - vPanel.includeTab(detail); - //BEGIN - [FR 1953734] - gc.setGCParent(this); - //END - [FR 1953734] - gc.getGCParent().setPreferredSize(vPanel.getPreferredSize()); - synchronizerList.add(sync); - return true; - } // IncludeTab - - //FR [ 1757088 ] - public void setDetailGrid(boolean value){ - detailGrid = value; - if (detailGrid && vPanel != null) - vPanel.setBorder(BorderFactory.createLineBorder(AdempierePLAF.getPrimary2())); - } - - public boolean isDetailGrid(){ - return detailGrid; - } - /** - * Get Title - * @return title - */ - public String getTitle () - { - return m_mTab.getName(); - } // getTitle - - /** - * Setup Multi-Row Table (add fields) - * @param aPanel Panel - * @param mTab Model Tab - * @param table JTable - * @return size - */ - private int setupVTable (APanel aPanel, GridTab mTab, VTable table) - { - if (!mTab.isDisplayed()) - return 0; - int size = mTab.getFieldCount (); - TableColumnModel tcm = table.getColumnModel(); - if (size != tcm.getColumnCount()) - throw new IllegalStateException("TableColumn Size <> TableModel"); - - for (int i = 0; i < size; i++) - { - GridField mField = mTab.getField (i); - TableColumn tc = tcm.getColumn(i); - tc.setMinWidth(30); - // - if (mField.getColumnName().equals(tc.getIdentifier().toString())) - { - //don't show included tab field in grid - if (mField.getIncluded_Tab_ID() > 0) - { - TableCellNone tcn = new TableCellNone(mField.getColumnName()); - tc.setCellRenderer (tcn); - tc.setCellEditor (tcn); - tc.setHeaderValue (null); - tc.setMinWidth (0); - tc.setMaxWidth (0); - tc.setPreferredWidth (0); - } - else if (mField.getDisplayType () == DisplayType.RowID) - { - tc.setCellRenderer (new VRowIDRenderer (false)); - tc.setCellEditor (new VRowIDEditor (false)); - tc.setHeaderValue (""); - tc.setMaxWidth (2); - } - else - { - // need to set CellEditor explicitly as default editor based on class causes problem (YesNo-> Boolean) - if (mField.isDisplayedGrid()) - { - tc.setCellRenderer (new VCellRenderer (mField)); - VCellEditor ce = new VCellEditor (mField); - tc.setCellEditor (ce); - // - tc.setHeaderValue (mField.getHeader ()); - tc.setPreferredWidth (Math.max (mField.getDisplayLength (), 30)); - tc.setHeaderRenderer (new VHeaderRenderer (mField.getDisplayType ())); - - // Enable Button actions in grid - if (mField.getDisplayType () == DisplayType.Button) - { - ce.setActionListener(aPanel); - } - } - else // column not displayed - { - TableCellNone tcn = new TableCellNone(mField.getColumnName()); - tc.setCellRenderer (tcn); - tc.setCellEditor (tcn); - tc.setHeaderValue (null); - tc.setMinWidth (0); - tc.setMaxWidth (0); - tc.setPreferredWidth (0); - } - } - // System.out.println ("TableColumnID " + tc.getIdentifier () - // + " Renderer=" + tc.getCellRenderer () - // + mField.getHeader ()); - - } // found field - else - log.log(Level.SEVERE, "TableColumn " + tc.getIdentifier () - + " <> MField " + mField.getColumnName() + mField.getHeader()); - } // for all fields - return size; - } // setupVTable - - /** - * Activate Grid Controller. - * Called by APanel when GridController is displayed (foreground) - */ - public void activate () - { - if (!init) init(); - - // Tree to be initiated on second/.. tab - if (m_mTab.isTreeTab() && m_mTab.getTabNo() != 0) - { - String keyColumnName = m_mTab.getKeyColumnName(); - String treeName = "AD_Tree_ID"; - if (keyColumnName.startsWith("CM")) - { - if (keyColumnName.equals("CM_Container_ID")) - treeName = "AD_TreeCMC_ID"; - else if (keyColumnName.equals("CM_CStage_ID")) - treeName = "AD_TreeCMS_ID"; - else if (keyColumnName.equals("CM_Template_ID")) - treeName = "AD_TreeCMT_ID"; - else if (keyColumnName.equals("CM_Media_ID")) - treeName = "AD_TreeCMM_ID"; - } - int AD_Tree_ID = Env.getContextAsInt (Env.getCtx(), m_WindowNo, treeName, true); - if (log.isLoggable(Level.CONFIG)) log.config(keyColumnName + " -> " + treeName + " = " + AD_Tree_ID); - if (AD_Tree_ID == 0) - AD_Tree_ID = MTree.getDefaultAD_Tree_ID ( - Env.getAD_Client_ID(Env.getCtx()), m_mTab.getKeyColumnName()); - int linkColId = MTree.get(Env.getCtx(), AD_Tree_ID, null).getParent_Column_ID(); - String linkColName = null; - int linkID = 0; - if (linkColId > 0) { - linkColName = MColumn.getColumnName(Env.getCtx(), linkColId); - linkID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, linkColName, true); - } - if (m_tree != null) - m_tree.initTree (AD_Tree_ID, linkColName, linkID); - } - - activateChilds(); - } // activate - - /** - * activate child grid controller ( included tab ) - */ - private void activateChilds() - { - for (GridSynchronizer s : synchronizerList ) - { - s.activateChild(); - } - } - - public GridController findChild(GridTab gTab) - { - GridController gc = null; - for (GridSynchronizer s : synchronizerList ) - { - if (s.getChild().getMTab().equals(gTab)) - { - gc = s.getChild(); - break; - } - } - return gc; - } - - /** - * Register ESC Actions - * - overwrite VTable's Keystrokes assignment for ESC - * @param aIgnore ignore - */ - public void registerESCAction (AppsAction aIgnore) - { - int c = VTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT; - vTable.getInputMap(c).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), aIgnore.getName()); - vTable.getActionMap().put(aIgnore.getName(), aIgnore); - - // AEnv.printActionInputMap(vTable); - } // registerESCAction - - /** - * Query Tab and resize Table - * (called from APanel) - * @param onlyCurrentRows only current rows - * @param onlyCurrentDays how many days back - * @param maxRows maximim rows or 0 for all - */ - public void query (boolean onlyCurrentRows, int onlyCurrentDays, int maxRows) - { - // start loading while building screen - m_mTab.query(onlyCurrentRows, onlyCurrentDays, maxRows); - - //make sure value from previous query is clear from window context - if (m_mTab.getRowCount() == 0) - { - if (getGCParent() != null) - { - ArrayList parentColumnNames = new ArrayList(); - GridField[] parentFields = getGCParent().getMTab().getFields(); - for (GridField parentField : parentFields) - parentColumnNames.add(parentField.getColumnName()); - - GridField[] fields = m_mTab.getFields(); - for (GridField field : fields) - { - if (!parentColumnNames.contains(field.getColumnName())) - Env.setContext(Env.getCtx(), field.getWindowNo(), field.getColumnName(), ""); - } - } - } - // Update UI - if (!isSingleRow()) - vTable.autoSize(true); - activateChilds(); - } // query - - /* - public boolean isNeedToSaveParent() - { - return m_mTab.isNeedToSaveParent(); - }*/ - - /************************************************************************** - * Switch from single to multi & vice versa - */ - public void switchRowPresentation() - { - stopEditor(true); - if (m_singleRow) - switchMultiRow(); - else - switchSingleRow(); - } // switchRowPresentation - - /** - * Switch to SingleRow Presentation - */ - public void switchSingleRow() - { - if (m_onlyMultiRow) - return; - cardLayout.first(cardPanel); - m_singleRow = true; - dynamicDisplay(0); - // vPanel.requestFocus(); - } // switchSingleRow - - /** - * Switch to MultiRow Presentation - */ - public void switchMultiRow() - { - cardLayout.last(cardPanel); - m_singleRow = false; - vTable.autoSize(true); // resizes - // vTable.requestFocus(); - } // switchSingleRow - - /** - * Is Single Row presentation - * @return true if Single Row is displayed - */ - public boolean isSingleRow() - { - return m_singleRow; - } // isSingleRow - - - /************************************************************************** - * Remove Listener - pass on to MTab - * @param l listener - */ - public synchronized void removeDataStatusListener(DataStatusListener l) - { - m_mTab.removeDataStatusListener(l); - } // removeDataStatusListener - - /** - * Add Data Status Listener - pass on to MTab - * @param l listener - */ - public synchronized void addDataStatusListener(DataStatusListener l) - { - m_mTab.addDataStatusListener(l); - } - - /** - * Data Status Listener - for MTab events. - *

    - * Callouts are processed here for GUI changes - * - same as in MTab.setValue for batch changes - *

    - * calls dynamicDisplay - * @param e event - */ - public void dataStatusChanged(DataStatusEvent e) - { - // if (e.getChangedColumn() == 0) - // return; - int col = e.getChangedColumn(); - if (log.isLoggable(Level.CONFIG)) log.config("(" + m_mTab + ") Col=" + col + ": " + e.toString()); - - // Process Callout - GridField mField = m_mTab.getField(col); - if (mField != null) { - List callouts = Core.findCallout(m_mTab.getTableName(), mField.getColumnName()); - if (mField.getCallout().length() > 0 || callouts.size()>0 || m_mTab.hasDependants(mField.getColumnName())) - { - String msg = m_mTab.processFieldChange(mField); // Dependencies & Callout - if (msg.length() > 0) - ADialog.error(m_WindowNo, this, msg); - } - } - //if (col >= 0) - dynamicDisplay(col); - } // dataStatusChanged - - - /************************************************************************** - * List Selection Listener (VTable) - row changed - * @param e event - */ - public void valueChanged(ListSelectionEvent e) - { - // no rows - if (m_mTab.getRowCount() == 0) - return; - - // vTable.stopEditor(graphPanel); - int rowTable = vTable.getSelectedRow(); - int rowCurrent = m_mTab.getCurrentRow(); - if (log.isLoggable(Level.CONFIG)) log.config("(" + m_mTab.toString() + ") Row in Table=" + rowTable + ", in Model=" + rowCurrent); - /* BT [ 1972495 ] Multirow Automatic New Record loses context - // FR [ 1757088 ] - if(rowCurrent + 1 == vTable.getRowCount() && !isSingleRow() && Env.isAutoNew(Env.getCtx()) && m_mTab.getRecord_ID() != -1) - { - //stopEditor(true); - vTable.getSelectionModel().removeListSelectionListener(this); - m_mTab.dataNew(false); - dynamicDisplay(0); - vTable.getSelectionModel().addListSelectionListener(this); - return; - } */ - if (rowTable == -1) // nothing selected - { - if (rowCurrent >= 0) - { - vTable.setRowSelectionInterval(rowCurrent, rowCurrent); // causes this method to be called again - return; - } - } - else - { - if (rowTable != rowCurrent) { - //make sure table selection is consistent with model - int t = m_mTab.navigate(rowTable); - if (t != rowTable) { - rowTable = t; - vTable.setRowSelectionInterval(rowTable, rowTable); - } - } - dynamicDisplay(0); - } - - // TreeNavigation - Synchronize -- select node in tree - if (m_tree != null) - m_tree.setSelectedNode (m_mTab.getRecord_ID()); // ignores new (-1) - - // log.config( "GridController.valueChanged (" + m_mTab.toString() + ") - fini", - // "Row in Table=" + rowTable + ", in Model=" + rowCurrent); - - } // valueChanged - - /** - * PropertyChange Listener - Tree Panel - node selection - * @param e event - */ - public void propertyChange(PropertyChangeEvent e) - { - // System.out.println("propertyChange"); - // System.out.println(e); - if (e == null) - return; - Object value = e.getNewValue(); - if (value == null) - return; - if (log.isLoggable(Level.CONFIG)) log.config(e.getPropertyName() + "=" + value - + " - " + value.getClass().toString()); - if (!(value instanceof MTreeNode)) - return; - - // We Have a TreeNode - int nodeID = ((MTreeNode)value).getNode_ID(); - // root of tree selected - ignore - //if (nodeID == 0) - //return; - - // Search all rows for mode id - int size = m_mTab.getRowCount(); - int row = -1; - for (int i = 0; i < size; i++) - { - if (m_mTab.getKeyID(i) == nodeID) - { - row = i; - break; - } - } - if (row == -1) - { - if (nodeID > 0) - log.log(Level.WARNING, "Tab does not have ID with Node_ID=" + nodeID); - return; - } - - // Navigate to node row - m_mTab.navigate(row); - } // propertyChange - - /** - * Dynamic Display. - * - Single Row Screen layout and update of dynamic Lookups - *

    - * Single Row layout: - * the components's name is the ColumnName; if it matches, the - * MField.isDisplayed(true) is used to determine if it is visible - * if the component is a VEditor, setEnabled is set from the MField - *

    - * Multi Row layout is not changed: - * VCellRenderer calls JTable.isCellEditable -> checks MField.isEditable (Active, isDisplayed) - * VCellEditor.isCellEditable calls MField.isEditable(true)
    - * If a column is not displayed, the width is set to 0 in dynInit - *

    - * Dynamic update of data is handeled in VLookup.focusGained/Lost. - * When focus is gained the model is temporarily updated with the - * specific validated data, if lost, it is switched back to the - * unvalidated data (i.e. everything). This allows that the display - * methods have a lookup to display.
    - * Here: if the changed field has dependents and the dependent - * is a Lookup and this lookup has a dynamic dependence of the changed field, - * the value of that field is set to null (in MTab.processDependencies - - * otherwise it would show an invalid value). - * As Editors listen for value changed of their MField, the display is updated. - *

    - * Called from GridController.valueChanged/dataStatusChanged, APane;.stateChanged/unlock/cmd_... - * @param col selective column number or 0 if all - */ - public void dynamicDisplay (int col) - { - // log.config( "GridController.dynamicDisplay (" + m_mTab.toString() + ") SingleRow=" + isSingleRow() + ", OnlyMultiRow=" + m_onlyMultiRow); - // Don't update if multi-row - if (!isSingleRow() || m_onlyMultiRow) - return; - if (!m_mTab.isOpen()) - return; - // Selective - if (col > 0) - { - GridField changedField = m_mTab.getField(col); - String columnName = changedField.getColumnName(); - ArrayList dependants = m_mTab.getDependantFields(columnName); - if (log.isLoggable(Level.CONFIG)) log.config("(" + m_mTab.toString() + ") " - + columnName + " - Dependents=" + dependants.size()); - // No Dependents and no Callout - Set just Background - if ( ! ( dependants.size() > 0 - || changedField.getCallout().length() > 0 - || Core.findCallout(m_mTab.getTableName(), columnName).size() > 0)) { - Component[] comp = vPanel.getComponentsRecursive(); - for (int i = 0; i < comp.length; i++) - { - if (columnName.equals(comp[i].getName ()) && comp[i] instanceof VEditor) - { - VEditor ve = (VEditor)comp[i]; - boolean manMissing = false; - boolean noValue = changedField.getValue() == null || changedField.getValue().toString().length() == 0; - if (noValue && changedField.isEditable(true) && changedField.isMandatory(true)) // check context - manMissing = true; - ve.setBackground(manMissing || changedField.isError()); - break; - } - } - return; - } - } // selective - - - // complete single row re-display - boolean noData = m_mTab.getRowCount() == 0; - if (log.isLoggable(Level.CONFIG)) log.config(m_mTab.toString() + " - Rows=" + m_mTab.getRowCount()); - // All Components in vPanel (Single Row) - - Set hiddens = new HashSet(); - Component[] comps = vPanel.getComponentsRecursive(); - for (int i = 0; i < comps.length; i++) - { - Component comp = comps[i]; - String columnName = comp.getName(); - - if ( comp instanceof VChart && isSingleRow()) - { - ((VChart) comp).createChart(); - } - - if (columnName != null && columnName.length() > 0) - { - GridField mField = m_mTab.getField(columnName); - if (mField != null) - { - if (mField.isDisplayed(true)) // check context - { - if (!comp.isVisible()) - comp.setVisible(true); // visibility - /** - * Feature Request [1707462] - * Enable runtime change of VFormat - * @author fer_luck - */ - if (comp instanceof VString){ - VString vs = (VString)comp; - if ((vs.getVFormat() != null && vs.getVFormat().length() > 0 && mField.getVFormat() == null) - || (vs.getVFormat() == null && mField.getVFormat() != null && mField.getVFormat().length() > 0) - || (vs.getVFormat() != null && mField.getVFormat() != null && !vs.getVFormat().equals(mField.getVFormat()))) { - vs.setVFormat(mField.getVFormat()); - } - } - //End Feature Request [1707462] - if (comp instanceof VEditor) - { - VEditor ve = (VEditor)comp; - if (noData) - ve.setReadWrite(false); - else - { - boolean rw = mField.isEditable(true); // r/w - check Context - ve.setReadWrite(rw); - // log.log(Level.FINEST, "RW=" + rw + " " + mField); - boolean manMissing = false; - // least expensive operations first // missing mandatory - if (rw && mField.getValue() == null && mField.isMandatory(true)) // check context - manMissing = true; - ve.setBackground(manMissing || mField.isError()); - } - } - } - else - { - if (comp.isVisible()) - comp.setVisible(false); - hiddens.add(columnName); - } - } - } - } // all components - - // hide empty field group based on the environment - for (int i = 0; i < comps.length; i++) { - Component comp = comps[i]; - - if (comp instanceof CollapsiblePanel) - { - if (comp.getName() == null || comp.getName().startsWith("IncludedTab#")) - continue; - else - { - boolean hasVisible = false; - Component[] childs = ((CollapsiblePanel)comp).getCollapsiblePane().getContentPane().getComponents(); - for (int j = 0; j < childs.length; j++) { - if (childs[j].isVisible()) - { - String columnName = childs[j].getName(); - if (columnName != null && columnName.length() > 0) - { - GridField mField = m_mTab.getField(columnName); - if (mField != null) - { - hasVisible = true; - break; - } - } - } - } - if (comp.isVisible() != hasVisible) - comp.setVisible(hasVisible); - } - } - } - - // - - if (log.isLoggable(Level.CONFIG)) log.config(m_mTab.toString() + " - fini - " - + (col <= 0 ? "complete" : "seletive")); - } // dynamicDisplay - - /** - * Row Changed - synchronize with Tree - * - * @param save true the row was saved (changed/added), false if the row was deleted - * @param keyID the ID of the row changed - */ - public void rowChanged (boolean save, int keyID) - { - if (m_tree == null || keyID <= 0) - return; - String name = (String)m_mTab.getValue("Name"); - String description = (String)m_mTab.getValue("Description"); - Boolean IsSummary = (Boolean)m_mTab.getValue("IsSummary"); - boolean summary = IsSummary != null && IsSummary.booleanValue(); - String imageIndicator = (String)m_mTab.getValue("Action"); // Menu - Action - // - m_tree.nodeChanged(save, keyID, name, description, - summary, imageIndicator); - } // rowChanged - - - /************************************************************************** - * Save Multiple records - Clone a record and assign new values to each - * clone for a specific column. - * @param ctx context - * @param tableName Table Name - * @param columnName Column for which value need to be changed - * @param recordId Record to clone - * @param values Values to be assigned to clones for the specified column - * @param trxName Transaction - * @throws Exception If error is occured when loading the PO or saving clones - * - * @author ashley - */ - protected void saveMultipleRecords(Properties ctx, String tableName, - String columnName, int recordId, Integer[] values, - String trxName) throws Exception - { - if (values == null) - { - return ; - } - - int oldRow = m_mTab.getCurrentRow(); - GridField lineField = m_mTab.getField("Line"); - - for (int i = 0; i < values.length; i++) - { - if (!m_mTab.dataNew(true)) - { - throw new IllegalStateException("Could not clone tab"); - } - - m_mTab.setValue(columnName, values[i]); - - if (lineField != null) - { - m_mTab.setValue(lineField, 0); - } - - if (!m_mTab.dataSave(false)) - { - throw new IllegalStateException("Could not update tab"); - } - - m_mTab.setCurrentRow(oldRow); - } - } - - /************************************************************************** - * Vetoable Change Listener. - * Called from VEditor - *

    -	 *  - for Save Confirmation dialog
    -	 *  - for Single Row from VEditor: Update MTable
    -	 *  
    - * @param e event - * @throws PropertyVetoException - */ - public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException - { - if (m_mTab.isProcessed() || !m_mTab.isActive()) // only active records - { - Object source = e.getSource(); - if (source instanceof VEditor) - { - if (!((VEditor)source).isReadWrite()) - { - if (log.isLoggable(Level.CONFIG)) log.config("(" + m_mTab.toString() + ") " + e.getPropertyName()); - return; - } - } - else - { - if (log.isLoggable(Level.CONFIG)) log.config("(" + m_mTab.toString() + ") " + e.getPropertyName()); - return; - } - } // processed - if (log.isLoggable(Level.CONFIG)) log.config("(" + m_mTab.toString() + ") " - + e.getPropertyName() + "=" + e.getNewValue() + " (" + e.getOldValue() + ") " - + (e.getOldValue() == null ? "" : e.getOldValue().getClass().getName())); - - - // Save Confirmation dialog MTable-RowSave - if (e.getPropertyName().equals(GridTable.PROPERTY)) - { - // throw new PropertyVetoException will call this listener again to revert to old value - if (m_vetoActive) - { - //ignore - m_vetoActive = false; - return; - } - if (!Env.isAutoCommit(Env.getCtx(), m_WindowNo) || m_mTab.getCommitWarning().length() > 0) - { - if (!ADialog.ask(m_WindowNo, this, "SaveChanges?", m_mTab.getCommitWarning())) - { - m_vetoActive = true; - throw new PropertyVetoException ("UserDeniedSave", e); - } - } - return; - } // saveConfirmation - - - // Get Row/Col Info - GridTable mTable = m_mTab.getTableModel(); - int row = m_mTab.getCurrentRow(); - int col = mTable.findColumn(e.getPropertyName()); - // - if (e.getNewValue() == null && e.getOldValue() != null - && e.getOldValue().toString().length() > 0) { // some editors return "" instead of null - mTable.setChanged (true); - mTable.setValueAt (e.getNewValue(), row, col, true); - } - else - { - // mTable.setValueAt (e.getNewValue(), row, col, true); - /* - * Changes: Added the logic below to handle multiple values for a single field - * due to multiple selection in Lookup (Info). - * @author ashley - */ - Object newValue = e.getNewValue(); - Integer newValues[] = null; - - if (newValue instanceof Integer[]) - { - newValues = ((Integer[])newValue); - newValue = newValues[0]; - - if (newValues.length > 1) - { - Integer valuesCopy[] = new Integer[newValues.length - 1]; - System.arraycopy(newValues, 1, valuesCopy, 0, valuesCopy.length); - newValues = valuesCopy; - } - else - { - newValues = null; - } - } - else if (newValue instanceof Object[]) - { - log.severe("Multiple values can only be processed for IDs (Integer)"); - throw new PropertyVetoException("Multiple Selection values not available for this field", e); - } - - mTable.setValueAt (newValue, row, col); // -> dataStatusChanged -> dynamicDisplay - - // Force Callout - if (e.getPropertyName().equals("S_ResourceAssignment_ID")) - { - GridField mField = m_mTab.getField(col); - if (mField != null && (mField.getCallout().length() > 0 - || Core.findCallout(m_mTab.getTableName(), mField.getColumnName()).size()>0)) { - m_mTab.processFieldChange(mField); // Dependencies & Callout - } - } - - if (newValues != null && newValues.length > 0) - { - // Save data, since record need to be used for generating clones. - if (!m_mTab.dataSave(false)) - { - throw new PropertyVetoException("SaveError", e); - } - - // Retrieve the current record ID - int recordId = m_mTab.getKeyID(m_mTab.getCurrentRow()); - - Trx trx = Trx.get(Trx.createTrxName(), true); - trx.start(); - try - { - saveMultipleRecords(Env.getCtx(), mTable.getTableName(), e.getPropertyName(), recordId, newValues, trx.getTrxName()); - trx.commit(); - m_mTab.dataRefreshAll(); - } - catch(Exception ex) - { - trx.rollback(); - log.severe(ex.getMessage()); - throw new PropertyVetoException("SaveError", e); - } - finally - { - trx.close(); - } - } - } - - // log.config( "GridController.vetoableChange (" + m_mTab.toString() + ") - fini", e.getPropertyName() + "=" + e.getNewValue()); - } // vetoableChange - - - /************************************************************************** - * Get Model Tab - * @return Model Tab - */ - public GridTab getMTab() - { - return m_mTab; - } // getMTab - - /** - * Get Display Logic - * @return Display Logic - */ - public String getDisplayLogic() - { - return m_mTab.getDisplayLogic(); - } // getDisplayLogic - - /** - * Get VTable - * @return VTable - */ - public VTable getTable() - { - return vTable; - } // getTable - - - /** - * Set Window level Mnemonics - * @param set true if set otherwise unregiser - */ - public void setMnemonics (boolean set) - { - if (vPanel != null) - vPanel.setMnemonics(set); - } // setMnemonics - - /** - * Stop Table & SR Editors and move focus to graphPanel - * @param saveValue save value - */ - public void stopEditor (boolean saveValue) - { - if (log.isLoggable(Level.CONFIG)) log.config("(" + m_mTab.toString() + ") TableEditing=" + vTable.isEditing()); - - // MultiRow - remove editors - vTable.stopEditor(saveValue); - - // SingleRow - stop editors by changing focus - if (m_singleRow) - vPanel.transferFocus(); - // graphPanel.requestFocus(); - // - // log.config( "GridController.stopEditor (" + m_mTab.toString() + ") - fini", - // "Editing=" + vTable.isEditing()); - } // stopEditors - - /** - * Mouse Clicked - * @param e event - */ - public void mouseClicked(MouseEvent e) - { - if (log.isLoggable(Level.FINEST)) log.finest("" + this + " - " + e); - } - /** - * Mouse Pressed - * @param e event - */ - public void mousePressed(MouseEvent e) - { - if (log.isLoggable(Level.FINEST)) log.finest("" + this + " - " + e); - } - /** - * Mouse Released - * @param e event - */ - public void mouseReleased(MouseEvent e) - { - if (log.isLoggable(Level.FINEST)) log.finest("" + this + " - " + e); - } - /** - * Mouse Entered - * @param e event - */ - public void mouseEntered(MouseEvent e) - { - if (log.isLoggable(Level.FINEST)) log.finest("" + this + " - " + e); - } - /** - * Mouse Exited - * @param e event - */ - public void mouseExited(MouseEvent e) - { - if (log.isLoggable(Level.FINEST)) log.finest("" + this + " - " + e); - } - - /** - * Get Variable Value - * @param variableName name - * @return value - */ - public String get_ValueAsString (String variableName) - { - return Env.getContext(Env.getCtx(), m_WindowNo, variableName); - } // get_ValueAsString - - /** - * Is controller data not stale - * @return boolean - */ - public boolean isCurrent() - { - return m_mTab != null ? m_mTab.isCurrent() : false; - } - - //FR [ 1757088 ] - public VPanel getvPanel() - { - return vPanel; - } - - //BEGIN - [FR 1953734] - GridController m_Parent; - public void setGCParent(GridController gc){ - m_Parent = gc; - } - public GridController getGCParent(){ - return m_Parent; - } - public void refreshMTab(GridController includedTab){ - int m_CurrentRowBeforeSave = includedTab.m_mTab.getCurrentRow(); - m_mTab.dataRefresh(m_mTab.getCurrentRow()); - includedTab.m_mTab.setCurrentRow(m_CurrentRowBeforeSave); - } - //END - [FR 1953734] - - /** - * Accept pending editor changes. - */ - public void acceptEditorChanges() - { - if (isSingleRow()) - { - Component c = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); - if (c != null && this.isAncestorOf(c)) - { - Component t = c; - while (t != null && t != this) - { - if (t instanceof VManagedEditor) - { - ((VManagedEditor)t).commitChanges(); - return; - } - t = t.getParent(); - } - } - } - } -} // GridController diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/GridSynchronizer.java b/org.adempiere.ui.swing/src/org/compiere/grid/GridSynchronizer.java deleted file mode 100644 index 7ec5fef1f6..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/GridSynchronizer.java +++ /dev/null @@ -1,80 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2007 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; - -import org.compiere.model.GridWindow; -import org.compiere.model.MRole; -import org.compiere.model.StateChangeEvent; -import org.compiere.model.StateChangeListener; - -/** - * - * @author Low Heng Sin - * - */ -public class GridSynchronizer implements PropertyChangeListener, StateChangeListener { - - @SuppressWarnings("unused") - private GridController parent; - private GridController child; - private GridWindow window; - - /** - * - * @param window - * @param parent - * @param child - */ - public GridSynchronizer(GridWindow window, GridController parent, GridController child) { - this.window = window; - this.parent = parent; - this.child = child; - - parent.getMTab().addPropertyChangeListener(this); - parent.getMTab().addStateChangeListener(this); - } - - /** - * @param evt - */ - public void propertyChange(PropertyChangeEvent evt) { - MRole role = MRole.getDefault(); - child.query (false, 0, role.getMaxQueryRecords()); - } - - /** - * @param event - */ - public void stateChange(StateChangeEvent event) { - MRole role = MRole.getDefault(); - child.query (false, 0, role.getMaxQueryRecords()); - } - - /** - * trigger when parent gc activate - */ - public void activateChild() { - window.initTab(window.getTabIndex(child.getMTab())); - child.activate(); - MRole role = MRole.getDefault(); - child.query (false, 0, role.getMaxQueryRecords()); - } - - public GridController getChild() { - return child; - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/RecordAccessDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/RecordAccessDialog.java deleted file mode 100644 index ddc5047640..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/RecordAccessDialog.java +++ /dev/null @@ -1,351 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.JFrame; -import javax.swing.JLabel; - -import org.compiere.apps.AEnv; -import org.compiere.apps.ALayout; -import org.compiere.apps.ALayoutConstraint; -import org.compiere.apps.ConfirmPanel; -import org.compiere.model.MRecordAccess; -import org.compiere.model.MRole; -import org.compiere.swing.CButton; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - - -/** - * Record Access Dialog - * - * @author Jorg Janke - * @version $Id: RecordAccessDialog.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $ - */ -public class RecordAccessDialog extends CDialog -{ - /** - * - */ - private static final long serialVersionUID = -5208621373205009190L; - - /** - * Record Access Dialog - * @param owner owner - * @param AD_Table_ID table - * @param Record_ID record - */ - public RecordAccessDialog(JFrame owner, int AD_Table_ID, int Record_ID) - { - super(owner, Msg.translate(Env.getCtx(), "RecordAccessDialog")); - if (log.isLoggable(Level.INFO)) log.info("AD_Table_ID=" + AD_Table_ID + ", Record_ID=" + Record_ID); - m_AD_Table_ID = AD_Table_ID; - m_Record_ID = Record_ID; - try - { - dynInit(); - jbInit(); - } - catch (Exception e) - { - log.log(Level.SEVERE, "", e); - } - AEnv.showCenterWindow(owner, this); - } // RecordAccessDialog - - private int m_AD_Table_ID; - private int m_Record_ID; - private ArrayList m_recordAccesss = new ArrayList(); - private int m_currentRow = 0; - private MRecordAccess m_currentData = null; - private CLogger log = CLogger.getCLogger(getClass()); - - private CPanel centerPanel = new CPanel(new ALayout()); - private BorderLayout mainLayout = new BorderLayout(); - - private CLabel roleLabel = new CLabel(Msg.translate(Env.getCtx(), "AD_Role_ID")); - private CComboBoxroleField = null; - private CCheckBox cbActive = new CCheckBox(Msg.translate(Env.getCtx(), "IsActive")); - private CCheckBox cbExclude = new CCheckBox(Msg.translate(Env.getCtx(), "IsExclude")); - private CCheckBox cbReadOnly = new CCheckBox(Msg.translate(Env.getCtx(), "IsReadOnly")); - private CCheckBox cbDependent = new CCheckBox(Msg.translate(Env.getCtx(), "IsDependentEntities")); - private CButton bDelete = AEnv.getButton("Delete"); - private CButton bNew = AEnv.getButton("New"); - private JLabel rowNoLabel = new JLabel(); - - private CButton bUp = AEnv.getButton("Previous"); - private CButton bDown = AEnv.getButton("Next"); - - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - - /** - * Dynamic Init - */ - private void dynInit() - { - // Load Roles - String sql = MRole.getDefault().addAccessSQL( - "SELECT AD_Role_ID, Name FROM AD_Role ORDER BY 2", - "AD_Role", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - roleField = new CComboBox(DB.getKeyNamePairs(sql, false)); - - // Load Record Access for all roles - sql = "SELECT * FROM AD_Record_Access " - + "WHERE AD_Table_ID=? AND Record_ID=? AND AD_Client_ID=?"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_AD_Table_ID); - pstmt.setInt(2, m_Record_ID); - pstmt.setInt(3, Env.getAD_Client_ID(Env.getCtx())); - rs = pstmt.executeQuery(); - while (rs.next()) - m_recordAccesss.add(new MRecordAccess(Env.getCtx(), rs, null)); - } - catch (Exception e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - if (log.isLoggable(Level.FINE)) log.fine("#" + m_recordAccesss.size()); - setLine(0, false); - } // dynInit - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - this.getContentPane().setLayout(mainLayout); - this.getContentPane().add(centerPanel, BorderLayout.CENTER); - this.getContentPane().add(confirmPanel, BorderLayout.SOUTH); - // - centerPanel.add(bUp, new ALayoutConstraint(0,0)); - centerPanel.add(bNew, new ALayoutConstraint(0,6)); - centerPanel.add(roleLabel, new ALayoutConstraint(1,0)); - centerPanel.add(roleField, null); - centerPanel.add(cbActive, null); - centerPanel.add(cbExclude, null); - centerPanel.add(cbReadOnly, null); - centerPanel.add(cbDependent, null); - centerPanel.add(bDelete, null); - centerPanel.add(bDown, new ALayoutConstraint(2,0)); - centerPanel.add(rowNoLabel, new ALayoutConstraint(2,6)); - // - Dimension size = centerPanel.getPreferredSize(); - size.width = 600; - centerPanel.setPreferredSize(size); - // - bUp.addActionListener(this); - bDown.addActionListener(this); - bDelete.addActionListener(this); - bNew.addActionListener(this); - confirmPanel.addActionListener(this); - } // jbInit - - /** - * Set Line - * @param rowDelta delta to current row - * @param newRecord new - */ - private void setLine (int rowDelta, boolean newRecord) - { - if (log.isLoggable(Level.FINE)) log.fine("delta=" + rowDelta + ", new=" + newRecord - + " - currentRow=" + m_currentRow + ", size=" + m_recordAccesss.size()); - int maxIndex = 0; - // nothing defined - if (m_recordAccesss.size() == 0) - { - m_currentRow = 0; - maxIndex = 0; - newRecord = true; - setLine(null); - } - else if (newRecord) - { - m_currentRow = m_recordAccesss.size(); - maxIndex = m_currentRow; - setLine(null); - } - else - { - m_currentRow += rowDelta; - maxIndex = m_recordAccesss.size() - 1; - if (m_currentRow < 0) - m_currentRow = 0; - else if (m_currentRow > maxIndex) - m_currentRow = maxIndex; - // - MRecordAccess ra = (MRecordAccess)m_recordAccesss.get(m_currentRow); - setLine(ra); - } - // Label - StringBuilder txt = new StringBuilder(); - if (newRecord) - txt.append("+"); - txt.append(m_currentRow+1).append("/").append(maxIndex+1); - rowNoLabel.setText(txt.toString()); - // set up/down - bUp.setEnabled(m_currentRow > 0); - bDown.setEnabled(m_currentRow < maxIndex); - } // setLine - - /** - * Set Selection - * @param ra record access - */ - private void setLine (MRecordAccess ra) - { - int AD_Role_ID = 0; - boolean active = true; - boolean exclude = true; - boolean readonly = false; - boolean dependent = false; - // - if (ra != null) - { - AD_Role_ID = ra.getAD_Role_ID(); - active = ra.isActive(); - exclude = ra.isExclude(); - readonly = ra.isReadOnly(); - dependent = ra.isDependentEntities(); - } - cbActive.setSelected(active); - cbExclude.setSelected(exclude); - cbReadOnly.setSelected(readonly); - cbDependent.setSelected(dependent); - bDelete.setEnabled(ra != null); - // - KeyNamePair selection = null; - for (int i = 0; i < roleField.getItemCount(); i++) - { - KeyNamePair pp = (KeyNamePair)roleField.getItemAt(i); - if (pp.getKey() == AD_Role_ID) - selection = pp; - } - if (selection != null && ra != null) - { - roleField.setSelectedItem(selection); - m_currentData = ra; - if (log.isLoggable(Level.FINE)) log.fine("" + ra); - } - else - m_currentData = null; - } // setLine - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (e.getSource() == bUp) - setLine(-1, false); - else if (e.getSource() == bDown) - setLine(+1, false); - else if (e.getSource() == bNew) - setLine(0, true); - else - { - if (e.getSource() == bDelete) - cmd_delete(); - else if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - if (!cmd_save()) - return; - } - dispose(); - } - } // actionPerformed - - /** - * Save Command - * @return true if saved - */ - private boolean cmd_save() - { - KeyNamePair pp = (KeyNamePair)roleField.getSelectedItem(); - roleField.setBackground(pp == null); - if (pp == null) - return false; - int AD_Role_ID = pp.getKey(); - // - boolean isActive = cbActive.isSelected(); - boolean isExclude = cbExclude.isSelected(); - boolean isReadOnly = cbReadOnly.isSelected(); - boolean isDependentEntities = cbDependent.isSelected(); - // - if (m_currentData == null) - { - m_currentData = new MRecordAccess (Env.getCtx(), AD_Role_ID, m_AD_Table_ID, m_Record_ID, null); - m_recordAccesss.add(m_currentData); - m_currentRow = m_recordAccesss.size()-1; - } - m_currentData.setIsActive(isActive); - m_currentData.setIsExclude(isExclude); - m_currentData.setIsReadOnly(isReadOnly); - m_currentData.setIsDependentEntities(isDependentEntities); - boolean success = m_currentData.save(); - // - if (log.isLoggable(Level.FINE)) log.fine("Success=" + success); - return success; - } // cmd_save - - /** - * Delete Command - * @return true if deleted - */ - private boolean cmd_delete() - { - boolean success = false; - if (m_currentData == null) - log.log(Level.SEVERE, "No data"); - else - { - success = m_currentData.delete(true); - m_currentData = null; - m_recordAccesss.remove(m_currentRow); - if (log.isLoggable(Level.FINE)) log.fine("Success=" + success); - } - return success; - } // cmd_delete - -} // RecordAccessDialog diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromDepositBatchUI.java b/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromDepositBatchUI.java deleted file mode 100644 index 8f07f32ab6..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromDepositBatchUI.java +++ /dev/null @@ -1,337 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2013 Elaine Tan * - * Copyright (C) 2013 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import static org.compiere.model.SystemIDs.COLUMN_C_BANKSTATEMENT_C_BANKACCOUNT_ID; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.sql.Timestamp; -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.JLabel; -import javax.swing.table.DefaultTableModel; - -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VLookup; -import org.compiere.grid.ed.VNumber; -import org.compiere.grid.ed.VString; -import org.compiere.model.GridTab; -import org.compiere.model.MBankStatement; -import org.compiere.model.MColumn; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MPayment; -import org.compiere.swing.CButton; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * - * @author Elaine - * - */ -public class VCreateFromDepositBatchUI extends CreateFromDepositBatch implements ActionListener -{ - private VCreateFromDialog dialog; - - public VCreateFromDepositBatchUI(GridTab mTab) - { - super(mTab); - if (log.isLoggable(Level.INFO)) log.info(getGridTab().toString()); - - dialog = new VCreateFromDialog(this, getGridTab().getWindowNo(), true); - - p_WindowNo = getGridTab().getWindowNo(); - - try - { - if (!dynInit()) - return; - jbInit(); - - setInitOK(true); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - setInitOK(false); - } - AEnv.positionCenterWindow(AEnv.getWindow(p_WindowNo), dialog); - } // VCreateFrom - - /** Window No */ - private int p_WindowNo; - - /** Logger */ - private CLogger log = CLogger.getCLogger(getClass()); - - private JLabel bankAccountLabel = new JLabel(); - protected VLookup bankAccountField; - - private CLabel documentNoLabel = new CLabel(Msg.translate(Env.getCtx(), "DocumentNo")); - protected CTextField documentNoField = new CTextField(10); - - private JLabel documentTypeLabel = new JLabel(); - protected VLookup documentTypeField; - - private JLabel authorizationLabel = new JLabel(); - protected VString authorizationField = new VString(); - - private JLabel tenderTypeLabel = new JLabel(); - protected VLookup tenderTypeField; - - private CLabel amtFromLabel = new CLabel(Msg.translate(Env.getCtx(), "PayAmt")); - protected VNumber amtFromField = new VNumber("AmtFrom", false, false, true, DisplayType.Amount, Msg.translate(Env.getCtx(), "AmtFrom")); - private CLabel amtToLabel = new CLabel("-"); - protected VNumber amtToField = new VNumber("AmtTo", false, false, true, DisplayType.Amount, Msg.translate(Env.getCtx(), "AmtTo")); - - protected CLabel BPartner_idLabel = new CLabel(Msg.translate(Env.getCtx(), "BPartner")); - protected VLookup bPartnerLookup; - - private CLabel dateFromLabel = new CLabel(Msg.translate(Env.getCtx(), "DateTrx")); - protected VDate dateFromField = new VDate("DateFrom", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateFrom")); - private CLabel dateToLabel = new CLabel("-"); - protected VDate dateToField = new VDate("DateTo", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateTo")); - - - /** - * Dynamic Init - * @throws Exception if Lookups cannot be initialized - * @return true if initialized - */ - public boolean dynInit() throws Exception - { - log.config(""); - - super.dynInit(); - - //Refresh button - CButton refreshButton = ConfirmPanel.createRefreshButton(false); - refreshButton.setMargin(new Insets (1, 10, 0, 10)); - refreshButton.setDefaultCapable(true); - refreshButton.addActionListener(this); - dialog.getConfirmPanel().addButton(refreshButton); - dialog.getRootPane().setDefaultButton(refreshButton); - - if (getGridTab().getValue("C_DepositBatch_ID") == null) - { - ADialog.error(0, dialog, "SaveErrorRowNotFound"); - return false; - } - - dialog.setTitle(getTitle()); - - int AD_Column_ID = COLUMN_C_BANKSTATEMENT_C_BANKACCOUNT_ID; // C_BankStatement.C_BankAccount_ID - MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir); - bankAccountField = new VLookup ("C_BankAccount_ID", true, true, true, lookup); - // Set Default - int C_BankAccount_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "C_BankAccount_ID"); - bankAccountField.setValue(Integer.valueOf(C_BankAccount_ID)); - bankAccountField.addActionListener(this); - // initial Loading - authorizationField = new VString ("authorization", false, false, true, 10, 30, null, null); - authorizationField.addActionListener(this); - - MLookup lookupDocument = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_C_DocType_ID), DisplayType.TableDir); - documentTypeField = new VLookup (MPayment.COLUMNNAME_C_DocType_ID,false,false,true,lookupDocument); - int C_DocType_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "C_DocType_ID"); - documentTypeField.setValue(Integer.valueOf(C_DocType_ID)); - documentTypeField.addActionListener(this); - - MLookup lookupTender = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_TenderType), DisplayType.List); - tenderTypeField = new VLookup (MPayment.COLUMNNAME_TenderType,false,false,true,lookupTender); - tenderTypeField.addActionListener(this); - - bPartnerLookup = new VLookup("C_BPartner_ID", false, false, true, - MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, 3499, DisplayType.Search)); - BPartner_idLabel.setLabelFor(bPartnerLookup); - bPartnerLookup.addActionListener(this); - - Timestamp date = Env.getContextAsDate(Env.getCtx(), p_WindowNo, MBankStatement.COLUMNNAME_StatementDate); - dateToField.setValue(date); - - documentNoField.addActionListener(this); - dateFromField.addActionListener(this); - dateToField.addActionListener(this); - amtFromField.addActionListener(this); - amtToField.addActionListener(this); - - loadBankAccount(); - - return true; - } // dynInit - - /** - * Static Init. - *
    -	 *  parameterPanel
    -	 *      parameterBankPanel
    -	 *      parameterStdPanel
    -	 *          bPartner/order/invoice/shopment/licator Label/Field
    -	 *  dataPane
    -	 *  southPanel
    -	 *      confirmPanel
    -	 *      statusBar
    -	 *  
    - * @throws Exception - */ - private void jbInit() throws Exception - { - bankAccountLabel.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID")); - authorizationLabel.setText(Msg.translate(Env.getCtx(), "R_AuthCode")); - - documentTypeLabel.setText(Msg.translate(Env.getCtx(), "C_DocType_ID")); - tenderTypeLabel.setText(Msg.translate(Env.getCtx(), "TenderType")); - - documentNoLabel.setLabelFor(documentNoField); - dateFromLabel.setLabelFor(dateFromField); - dateFromField.setToolTipText(Msg.translate(Env.getCtx(), "DateFrom")); - dateToLabel.setLabelFor(dateToField); - dateToField.setToolTipText(Msg.translate(Env.getCtx(), "DateTo")); - amtFromLabel.setLabelFor(amtFromField); - amtFromField.setToolTipText(Msg.translate(Env.getCtx(), "AmtFrom")); - amtToLabel.setLabelFor(amtToField); - amtToField.setToolTipText(Msg.translate(Env.getCtx(), "AmtTo")); - - CPanel parameterPanel = dialog.getParameterPanel(); - parameterPanel.setLayout(new BorderLayout()); - - CPanel parameterBankPanel = new CPanel(); - parameterBankPanel.setLayout(new GridBagLayout()); - parameterPanel.add(parameterBankPanel, BorderLayout.CENTER); - - parameterBankPanel.add(bankAccountLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - if (bankAccountField != null) - parameterBankPanel.add(bankAccountField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(documentTypeLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - if(documentTypeField!= null) - parameterBankPanel.add(documentTypeField, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(tenderTypeLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - if(tenderTypeField!=null) - parameterBankPanel.add(tenderTypeField, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(BPartner_idLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(bPartnerLookup, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(documentNoLabel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(documentNoField, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(authorizationLabel, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(authorizationField, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(amtFromLabel, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(amtFromField, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - parameterBankPanel.add(amtToLabel, new GridBagConstraints(4, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(amtToField, new GridBagConstraints(5, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(dateFromLabel, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(dateFromField, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - parameterBankPanel.add(dateToLabel, new GridBagConstraints(4, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(dateToField, new GridBagConstraints(5, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - } // jbInit - - /*************************************************************************/ - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (log.isLoggable(Level.CONFIG)) log.config("Action=" + e.getActionCommand()); -// Object source = e.getSource(); - if(e.getActionCommand().equals(ConfirmPanel.A_REFRESH)) - { - Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR); - loadBankAccount(); - dialog.tableChanged(null); - Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR); - } - } // actionPerformed - - protected void loadBankAccount() - { - loadTableOIS(getBankAccountData(bankAccountField.getValue(), bPartnerLookup.getValue(), - documentNoField.getText(), dateFromField.getValue(), dateToField.getValue(), - amtFromField.getValue(), amtToField.getValue(), - documentTypeField.getValue(), tenderTypeField.getValue(), authorizationField.getText())); - } - - protected void loadTableOIS (Vector data) - { - // Remove previous listeners - dialog.getMiniTable().getModel().removeTableModelListener(dialog); - // Set Model - DefaultTableModel model = new DefaultTableModel(data, getOISColumnNames()); - model.addTableModelListener(dialog); - dialog.getMiniTable().setModel(model); - // - - configureMiniTable(dialog.getMiniTable()); - } - - public void showWindow() - { - dialog.setVisible(true); - } - - public void closeWindow() - { - dialog.dispose(); - } - - @Override - public Object getWindow() - { - return dialog; - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromDialog.java deleted file mode 100644 index 73b8f42026..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromDialog.java +++ /dev/null @@ -1,227 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2009 Low Heng Sin * - * Copyright (C) 2009 Idalica Corporation * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import java.awt.BorderLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.JScrollPane; -import javax.swing.event.TableModelEvent; -import javax.swing.event.TableModelListener; -import javax.swing.table.TableModel; - -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.AppsAction; -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.StatusBar; -import org.compiere.minigrid.MiniTable; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.swing.CToggleButton; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Trx; -import org.compiere.util.TrxRunnable; - -public class VCreateFromDialog extends CDialog implements ActionListener, TableModelListener -{ - - /** - * - */ - private static final long serialVersionUID = -8242250391030501785L; - private CreateFrom createFrom; - private int windowNo; - - private CPanel parameterPanel = new CPanel(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - private StatusBar statusBar = new StatusBar(); - private MiniTable dataTable = new MiniTable(); - - private static final String SELECT_DESELECT_ALL = "SelectAll"; - protected AppsAction selectDeselectAllAction = new AppsAction (SELECT_DESELECT_ALL, null, Msg.getMsg(Env.getCtx(), SELECT_DESELECT_ALL), true); - - public VCreateFromDialog(CreateFrom createFrom, int windowNo, boolean modal) - { - super(AEnv.getWindow(windowNo), modal); - - this.createFrom = createFrom; - this.windowNo = windowNo; - - try - { - jbInit(); - confirmPanel.addActionListener(this); - - statusBar.setStatusDB(""); - tableChanged(null); - createFrom.setInitOK(true); - } - catch(Exception e) - { - createFrom.setInitOK(false); - } - } - - protected void jbInit() throws Exception - { - getContentPane().add(parameterPanel, BorderLayout.NORTH); - - JScrollPane dataPane = new JScrollPane(); - getContentPane().add(dataPane, BorderLayout.CENTER); - dataPane.getViewport().add(dataTable, null); - - CToggleButton selectAllButton = (CToggleButton)selectDeselectAllAction.getButton(); - selectAllButton.setMargin(ConfirmPanel.s_insets); - selectAllButton.addActionListener(this); - confirmPanel.addComponent(selectAllButton); - - CPanel southPanel = new CPanel(); - getContentPane().add(southPanel, BorderLayout.SOUTH); - BorderLayout southLayout = new BorderLayout(); - southPanel.setLayout(southLayout); - southPanel.add(confirmPanel, BorderLayout.CENTER); - southPanel.add(statusBar, BorderLayout.SOUTH); - } - - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - try - { - Trx.run(new TrxRunnable() - { - public void run(String trxName) - { - if (save(trxName)) - { - dispose(); - } - } - }); - } - catch (Exception ex) - { - ADialog.error(windowNo, this, "Error", ex.getLocalizedMessage()); - } - } - // Cancel - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - dispose(); - } - // Select All - // Trifon - else if (e.getActionCommand().equals(SELECT_DESELECT_ALL)) - { - TableModel model = dataTable.getModel(); - model.removeTableModelListener(this); - - // select or deselect all as required - int rows = model.getRowCount(); - Boolean selectAll = selectDeselectAllAction.isPressed() ? Boolean.FALSE : Boolean.TRUE; - for (int i = 0; i < rows; i++) - model.setValueAt(selectAll, i, 0); - - model.addTableModelListener(this); - - info(); - } - } - - public boolean save(String trxName) - { - dataTable.stopEditor(true); - - TableModel model = dataTable.getModel(); - int rows = model.getRowCount(); - if (rows == 0) - return false; - - return createFrom.save(dataTable, trxName); - } - - public void tableChanged (TableModelEvent e) - { - int type = -1; - if (e != null) - { - type = e.getType(); - if (type != TableModelEvent.UPDATE) - return; - - if (e.getColumn() == 0) - { - TableModel model = dataTable.getModel(); - Boolean isPressed = (Boolean)model.getValueAt(0, 0); - int rows = model.getRowCount(); - boolean equals = true; - for (int i = 1; equals && i < rows; i++) - { - equals = isPressed.equals(model.getValueAt(i, 0)); - } - - if (equals) { - selectDeselectAllAction.setPressed(isPressed); - } - } - } - info(); - dataTable.repaint(); - } - - public void info() - { - TableModel model = dataTable.getModel(); - int rows = model.getRowCount(); - int count = 0; - for (int i = 0; i < rows; i++) - { - if (((Boolean)model.getValueAt(i, 0)).booleanValue()) - count++; - } - setStatusLine(count, null); - - createFrom.info(dataTable, statusBar); - } - - public void setStatusLine(int selectedRowCount, String text) - { - StringBuilder sb = new StringBuilder(String.valueOf(selectedRowCount)); - if (text != null && text.trim().length() > 0) { - sb.append(" - ").append(text); - } - statusBar.setStatusLine(sb.toString()); - // - confirmPanel.getOKButton().setEnabled(selectedRowCount > 0); - } - - public MiniTable getMiniTable() - { - return dataTable; - } - - public CPanel getParameterPanel() - { - return parameterPanel; - } - - public ConfirmPanel getConfirmPanel() - { - return confirmPanel; - } -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromFactory.java b/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromFactory.java deleted file mode 100644 index 2eb8f4e4f4..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2009 Low Heng Sin * - * Copyright (C) 2009 Idalica Corporation * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import java.util.List; - -import org.adempiere.base.Service; -import org.compiere.model.GridTab; - -public class VCreateFromFactory -{ - public static ICreateFrom create (GridTab mTab) - { - ICreateFrom createFrom = null; - List factories = Service.locator().list(ICreateFromFactory.class).getServices(); - for (ICreateFromFactory factory : factories) - { - createFrom = factory.create(mTab); - if (createFrom != null) - break; - } - return createFrom; - } -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromInvoiceUI.java b/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromInvoiceUI.java deleted file mode 100644 index 71ee9e351b..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromInvoiceUI.java +++ /dev/null @@ -1,396 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2009 Low Heng Sin * - * Copyright (C) 2009 Idalica Corporation * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import java.awt.BorderLayout; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.VetoableChangeListener; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.table.DefaultTableModel; - -import org.compiere.apps.AEnv; -import org.compiere.grid.ed.VLookup; -import org.compiere.model.GridTab; -import org.compiere.model.MDocType; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import static org.compiere.model.SystemIDs.*; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -public class VCreateFromInvoiceUI extends CreateFromInvoice implements ActionListener, VetoableChangeListener -{ - - private VCreateFromDialog dialog; - - public VCreateFromInvoiceUI(GridTab mTab) - { - super(mTab); - if (log.isLoggable(Level.INFO)) log.info(getGridTab().toString()); - - dialog = new VCreateFromDialog(this, getGridTab().getWindowNo(), true); - - p_WindowNo = getGridTab().getWindowNo(); - - try - { - if (!dynInit()) - return; - jbInit(); - - setInitOK(true); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - setInitOK(false); - } - AEnv.positionCenterWindow(AEnv.getWindow(p_WindowNo), dialog); - } // VCreateFrom - - /** Window No */ - private int p_WindowNo; - - /** Logger */ - private CLogger log = CLogger.getCLogger(getClass()); - - // - private JLabel bPartnerLabel = new JLabel(); - private VLookup bPartnerField; - - private JLabel orderLabel = new JLabel(); - private JComboBox orderField = new JComboBox(); - - private JLabel shipmentLabel = new JLabel(); - private JComboBox shipmentField = new JComboBox(); - - /** Label for the rma selection */ - private JLabel rmaLabel = new JLabel(); - /** Combo box for selecting RMA document */ - private JComboBox rmaField = new JComboBox(); - - private boolean isCreditMemo = false; - - /** - * Dynamic Init - * @throws Exception if Lookups cannot be initialized - * @return true if initialized - */ - public boolean dynInit() throws Exception - { - log.config(""); - - super.dynInit(); - - dialog.setTitle(getTitle()); - - // RMA Selection option should only be available for AP Credit Memo - Integer docTypeId = (Integer)getGridTab().getValue("C_DocTypeTarget_ID"); - MDocType docType = MDocType.get(Env.getCtx(), docTypeId); - if (!MDocType.DOCBASETYPE_APCreditMemo.equals(docType.getDocBaseType())) - { - rmaLabel.setVisible(false); - rmaField.setVisible(false); - } - - isCreditMemo = MDocType.DOCBASETYPE_APCreditMemo.equals(docType.getDocBaseType()) - || MDocType.DOCBASETYPE_ARCreditMemo.equals(docType.getDocBaseType()); - - initBPartner(true); - bPartnerField.addVetoableChangeListener(this); - - return true; - } // dynInit - - /** - * Static Init. - *
    -	 *  parameterPanel
    -	 *      parameterBankPanel
    -	 *      parameterStdPanel
    -	 *          bPartner/order/invoice/shopment/licator Label/Field
    -	 *  dataPane
    -	 *  southPanel
    -	 *      confirmPanel
    -	 *      statusBar
    -	 *  
    - * @throws Exception - */ - private void jbInit() throws Exception - { - bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID")); - orderLabel.setText(Msg.getElement(Env.getCtx(), "C_Order_ID", false)); - shipmentLabel.setText(Msg.getElement(Env.getCtx(), "M_InOut_ID", false)); - rmaLabel.setText(Msg.translate(Env.getCtx(), "M_RMA_ID")); - - CPanel parameterPanel = dialog.getParameterPanel(); - parameterPanel.setLayout(new BorderLayout()); - - CPanel parameterStdPanel = new CPanel(new GridBagLayout()); - - parameterPanel.add(parameterStdPanel, BorderLayout.CENTER); - - parameterStdPanel.add(bPartnerLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - if (bPartnerField != null) - parameterStdPanel.add(bPartnerField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterStdPanel.add(orderLabel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterStdPanel.add(orderField, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - parameterStdPanel.add(shipmentLabel, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterStdPanel.add(shipmentField, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - // Add RMA document selection to panel - parameterStdPanel.add(rmaLabel, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterStdPanel.add(rmaField, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - } // jbInit - - /*************************************************************************/ - - private boolean m_actionActive = false; - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (log.isLoggable(Level.CONFIG)) log.config("Action=" + e.getActionCommand()); - - if (m_actionActive) - return; - m_actionActive = true; - if (log.isLoggable(Level.CONFIG)) log.config("Action=" + e.getActionCommand()); - // Order - if (e.getSource().equals(orderField)) - { - KeyNamePair pp = (KeyNamePair)orderField.getSelectedItem(); - int C_Order_ID = 0; - if (pp != null) - C_Order_ID = pp.getKey(); - // set Invoice, RMA and Shipment to Null - rmaField.setSelectedIndex(-1); - shipmentField.setSelectedIndex(-1); - loadOrder(C_Order_ID, true); - } - // Shipment - else if (e.getSource().equals(shipmentField)) - { - KeyNamePair pp = (KeyNamePair)shipmentField.getSelectedItem(); - int M_InOut_ID = 0; - if (pp != null) - M_InOut_ID = pp.getKey(); - // set Order, RMA and Invoice to Null - orderField.setSelectedIndex(-1); - rmaField.setSelectedIndex(-1); - loadShipment(M_InOut_ID); - } - // RMA - else if (e.getSource().equals(rmaField)) - { - KeyNamePair pp = (KeyNamePair)rmaField.getSelectedItem(); - int M_RMA_ID = 0; - if (pp != null) - M_RMA_ID = pp.getKey(); - // set Order and Invoice to Null - orderField.setSelectedIndex(-1); - shipmentField.setSelectedIndex(-1); - loadRMA(M_RMA_ID); - } - m_actionActive = false; - } // actionPerformed - - /** - * Change Listener - * @param e event - */ - public void vetoableChange (PropertyChangeEvent e) - { - if (log.isLoggable(Level.CONFIG)) log.config(e.getPropertyName() + "=" + e.getNewValue()); - - // BPartner - load Order/Invoice/Shipment - if (e.getPropertyName().equals("C_BPartner_ID")) - { - int C_BPartner_ID = ((Integer)e.getNewValue()).intValue(); - initBPOrderDetails (C_BPartner_ID, true); - } - dialog.tableChanged(null); - } // vetoableChange - - /************************************************************************** - * Load BPartner Field - * @param forInvoice true if Invoices are to be created, false receipts - * @throws Exception if Lookups cannot be initialized - */ - protected void initBPartner (boolean forInvoice) throws Exception - { - // load BPartner - int AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID - MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.Search); - bPartnerField = new VLookup ("C_BPartner_ID", true, false, true, lookup); - // - int C_BPartner_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "C_BPartner_ID"); - bPartnerField.setValue(Integer.valueOf(C_BPartner_ID)); - - // initial loading - initBPOrderDetails(C_BPartner_ID, forInvoice); - } // initBPartner - - /** - * Load PBartner dependent Order/Invoice/Shipment Field. - * @param C_BPartner_ID BPartner - * @param forInvoice for invoice - */ - protected void initBPOrderDetails (int C_BPartner_ID, boolean forInvoice) - { - if (log.isLoggable(Level.CONFIG)) log.config("C_BPartner_ID=" + C_BPartner_ID); - KeyNamePair pp = new KeyNamePair(0,""); - // load PO Orders - Closed, Completed - orderField.removeActionListener(this); - orderField.removeAllItems(); - orderField.addItem(pp); - - ArrayList list = loadOrderData(C_BPartner_ID, forInvoice, false, isCreditMemo); - for(KeyNamePair knp : list) - orderField.addItem(knp); - - orderField.setSelectedIndex(0); - orderField.addActionListener(this); - dialog.pack(); - - initBPDetails(C_BPartner_ID); - } // initBPartnerOIS - - public void initBPDetails(int C_BPartner_ID) - { - initBPShipmentDetails(C_BPartner_ID); - initBPRMADetails(C_BPartner_ID); - } - - /** - * Load PBartner dependent Order/Invoice/Shipment Field. - * @param C_BPartner_ID - */ - private void initBPShipmentDetails(int C_BPartner_ID) - { - if (log.isLoggable(Level.CONFIG)) log.config("C_BPartner_ID" + C_BPartner_ID); - - // load Shipments (Receipts) - Completed, Closed - shipmentField.removeActionListener(this); - shipmentField.removeAllItems(); - // None - KeyNamePair pp = new KeyNamePair(0,""); - shipmentField.addItem(pp); - - ArrayList list = loadShipmentData(C_BPartner_ID); - for(KeyNamePair knp : list) - shipmentField.addItem(knp); - - shipmentField.setSelectedIndex(0); - shipmentField.addActionListener(this); - } - - /** - * Load RMA that are candidates for shipment - * @param C_BPartner_ID BPartner - */ - private void initBPRMADetails(int C_BPartner_ID) - { - rmaField.removeActionListener(this); - rmaField.removeAllItems(); - // None - KeyNamePair pp = new KeyNamePair(0,""); - rmaField.addItem(pp); - - ArrayList list = loadRMAData(C_BPartner_ID); - for(KeyNamePair knp : list) - rmaField.addItem(knp); - - rmaField.setSelectedIndex(0); - rmaField.addActionListener(this); - } - - /** - * Load Data - Order - * @param C_Order_ID Order - * @param forInvoice true if for invoice vs. delivery qty - */ - protected void loadOrder (int C_Order_ID, boolean forInvoice) - { - loadTableOIS(getOrderData(C_Order_ID, forInvoice, isCreditMemo)); - } // LoadOrder - - protected void loadRMA (int M_RMA_ID) - { - loadTableOIS(getRMAData(M_RMA_ID)); - } - - protected void loadShipment (int M_InOut_ID) - { - loadTableOIS(getShipmentData(M_InOut_ID)); - } - - /** - * Load Order/Invoice/Shipment data into Table - * @param data data - */ - protected void loadTableOIS (Vector data) - { - // Remove previous listeners - dialog.getMiniTable().getModel().removeTableModelListener(dialog); - // Set Model - DefaultTableModel model = new DefaultTableModel(data, getOISColumnNames()); - model.addTableModelListener(dialog); - dialog.getMiniTable().setModel(model); - // - - configureMiniTable(dialog.getMiniTable()); - } // loadOrder - - public void showWindow() - { - dialog.setVisible(true); - } - - public void closeWindow() - { - dialog.dispose(); - } - - @Override - public Object getWindow() { - return dialog; - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromPackageShipmentUI.java b/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromPackageShipmentUI.java deleted file mode 100644 index 277aa3e9ca..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromPackageShipmentUI.java +++ /dev/null @@ -1,111 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2012 Elaine Tan * - * Copyright (C) 2012 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.table.DefaultTableModel; - -import org.compiere.apps.AEnv; -import org.compiere.model.GridTab; -import org.compiere.model.MPackage; -import org.compiere.model.MPackageMPS; -import org.compiere.util.CLogger; -import org.compiere.util.Env; - -/** - * - * @author Elaine - * - */ -public class VCreateFromPackageShipmentUI extends CreateFromPackageShipment -{ - private VCreateFromDialog dialog; - - public VCreateFromPackageShipmentUI(GridTab mTab) - { - super(mTab); - if (log.isLoggable(Level.INFO)) log.info(mTab.toString()); - - dialog = new VCreateFromDialog(this, getGridTab().getWindowNo(), true); - - p_WindowNo = getGridTab().getWindowNo(); - - try - { - if (!dynInit()) - return; - - setInitOK(true); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - setInitOK(false); - } - AEnv.positionCenterWindow(AEnv.getWindow(p_WindowNo), dialog); - } - - /** Window No */ - private int p_WindowNo; - - /** Logger */ - private CLogger log = CLogger.getCLogger(getClass()); - - public boolean dynInit() throws Exception - { - log.config(""); - - super.dynInit(); - - dialog.setTitle(getTitle()); - - int M_PackageMPS_ID = (Integer) getGridTab().getValue(MPackageMPS.COLUMNNAME_M_PackageMPS_ID); - MPackageMPS packageMPS = new MPackageMPS(Env.getCtx(), M_PackageMPS_ID, null); - MPackage mPackage = new MPackage(Env.getCtx(), packageMPS.getM_Package_ID(), null); - loadTableOIS(getShipmentData(mPackage.getM_InOut_ID())); - - return true; - } - - protected void loadTableOIS (Vector data) - { - // Remove previous listeners - dialog.getMiniTable().getModel().removeTableModelListener(dialog); - // Set Model - DefaultTableModel model = new DefaultTableModel(data, getOISColumnNames()); - model.addTableModelListener(dialog); - dialog.getMiniTable().setModel(model); - // - - configureMiniTable(dialog.getMiniTable()); - } - - public void showWindow() - { - dialog.setVisible(true); - } - - public void closeWindow() - { - dialog.dispose(); - } - - @Override - public Object getWindow() - { - return dialog; - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromRMAUI.java b/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromRMAUI.java deleted file mode 100644 index e489214b3d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromRMAUI.java +++ /dev/null @@ -1,202 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2009 Low Heng Sin * - * Copyright (C) 2009 Idalica Corporation * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import java.awt.BorderLayout; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.beans.PropertyChangeEvent; -import java.beans.VetoableChangeListener; -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.JLabel; -import javax.swing.table.DefaultTableModel; - -import org.compiere.apps.AEnv; -import org.compiere.grid.ed.VLookup; -import org.compiere.model.GridTab; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import static org.compiere.model.SystemIDs.*; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -public class VCreateFromRMAUI extends CreateFromRMA implements VetoableChangeListener -{ - - private VCreateFromDialog dialog; - - public VCreateFromRMAUI(GridTab mTab) - { - super(mTab); - if (log.isLoggable(Level.INFO)) log.info(getGridTab().toString()); - - dialog = new VCreateFromDialog(this, getGridTab().getWindowNo(), true); - - p_WindowNo = getGridTab().getWindowNo(); - - try - { - if (!dynInit()) - return; - jbInit(); - - setInitOK(true); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - setInitOK(false); - } - AEnv.positionCenterWindow(AEnv.getWindow(p_WindowNo), dialog); - } // VCreateFrom - - /** Window No */ - private int p_WindowNo; - - /** Logger */ - private CLogger log = CLogger.getCLogger(getClass()); - - // - private JLabel bPartnerLabel = new JLabel(); - private VLookup bPartnerField; - - /** - * Dynamic Init - * @throws Exception if Lookups cannot be initialized - * @return true if initialized - */ - public boolean dynInit() throws Exception - { - log.config(""); - - super.dynInit(); - - dialog.setTitle(getTitle()); - - initBPartner(true); - bPartnerField.addVetoableChangeListener(this); - - loadRMA(); - - return true; - } // dynInit - - /** - * Static Init. - *
    -	 *  parameterPanel
    -	 *      parameterBankPanel
    -	 *      parameterStdPanel
    -	 *          bPartner/order/invoice/shopment/licator Label/Field
    -	 *  dataPane
    -	 *  southPanel
    -	 *      confirmPanel
    -	 *      statusBar
    -	 *  
    - * @throws Exception - */ - private void jbInit() throws Exception - { - bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID")); - - CPanel parameterPanel = dialog.getParameterPanel(); - parameterPanel.setLayout(new BorderLayout()); - - CPanel parameterStdPanel = new CPanel(new GridBagLayout()); - - parameterPanel.add(parameterStdPanel, BorderLayout.CENTER); - - parameterStdPanel.add(bPartnerLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - if (bPartnerField != null) - parameterStdPanel.add(bPartnerField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - } // jbInit - - /*************************************************************************/ - /** - * Change Listener - * @param e event - */ - public void vetoableChange (PropertyChangeEvent e) - { - if (log.isLoggable(Level.CONFIG)) log.config(e.getPropertyName() + "=" + e.getNewValue()); - - // BPartner - load Order/Invoice/Shipment - if (e.getPropertyName().equals("C_BPartner_ID")) - { - loadRMA(); - } - dialog.tableChanged(null); - } // vetoableChange - - /************************************************************************** - * Load BPartner Field - * @param forInvoice true if Invoices are to be created, false receipts - * @throws Exception if Lookups cannot be initialized - */ - protected void initBPartner (boolean forInvoice) throws Exception - { - // load BPartner - int AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID - MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.Search); - bPartnerField = new VLookup ("C_BPartner_ID", true, false, true, lookup); - // - int C_BPartner_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "C_BPartner_ID"); - bPartnerField.setValue(Integer.valueOf(C_BPartner_ID)); - } // initBPartner - - protected void loadRMA() - { - loadTableOIS(getRMAData()); - } - - /** - * Load Order/Invoice/Shipment data into Table - * @param data data - */ - protected void loadTableOIS (Vector data) - { - // Remove previous listeners - dialog.getMiniTable().getModel().removeTableModelListener(dialog); - // Set Model - DefaultTableModel model = new DefaultTableModel(data, getOISColumnNames()); - model.addTableModelListener(dialog); - dialog.getMiniTable().setModel(model); - // - - configureMiniTable(dialog.getMiniTable()); - } // loadOrder - - public void showWindow() - { - dialog.setVisible(true); - } - - public void closeWindow() - { - dialog.dispose(); - } - - @Override - public Object getWindow() { - return dialog; - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromShipmentUI.java b/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromShipmentUI.java deleted file mode 100644 index a5993a16d1..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VCreateFromShipmentUI.java +++ /dev/null @@ -1,555 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2009 Low Heng Sin * - * Copyright (C) 2009 Idalica Corporation * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ - -package org.compiere.grid; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.VetoableChangeListener; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.AbstractCellEditor; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JTable; -import javax.swing.JTextField; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableCellEditor; -import javax.swing.table.TableColumn; - -import org.compiere.apps.AEnv; -import org.compiere.grid.ed.VLocator; -import org.compiere.grid.ed.VLookup; -import org.compiere.minigrid.IMiniTable; -import org.compiere.minigrid.MiniTable; -import org.compiere.model.GridTab; -import org.compiere.model.MLocator; -import org.compiere.model.MLocatorLookup; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MProduct; -import org.compiere.model.Query; -import static org.compiere.model.SystemIDs.*; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -public class VCreateFromShipmentUI extends CreateFromShipment implements ActionListener, VetoableChangeListener -{ - - private VCreateFromDialog dialog; - - public VCreateFromShipmentUI(GridTab mTab) - { - super(mTab); - if (log.isLoggable(Level.INFO)) log.info(getGridTab().toString()); - - dialog = new VCreateFromDialog(this, getGridTab().getWindowNo(), true); - - p_WindowNo = getGridTab().getWindowNo(); - - try - { - if (!dynInit()) - return; - jbInit(); - - setInitOK(true); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - setInitOK(false); - } - AEnv.positionCenterWindow(AEnv.getWindow(p_WindowNo), dialog); - } // VCreateFrom - - /** Window No */ - private int p_WindowNo; - - /** Logger */ - private CLogger log = CLogger.getCLogger(getClass()); - - // - private JLabel bPartnerLabel = new JLabel(); - private VLookup bPartnerField; - - private JLabel orderLabel = new JLabel(); - private JComboBox orderField = new JComboBox(); - - private JLabel invoiceLabel = new JLabel(); - private JComboBox invoiceField = new JComboBox(); - - /** Label for the rma selection */ - private JLabel rmaLabel = new JLabel(); - /** Combo box for selecting RMA document */ - private JComboBox rmaField = new JComboBox(); - - private JLabel upcLabel = new JLabel(); - private JTextField upcField = new JTextField(); - - private JCheckBox sameWarehouseCb = new JCheckBox(); - private JLabel locatorLabel = new JLabel(); - private VLocator locatorField = new VLocator(); - - /** - * Dynamic Init - * @throws Exception if Lookups cannot be initialized - * @return true if initialized - */ - public boolean dynInit() throws Exception - { - log.config(""); - - super.dynInit(); - - dialog.setTitle(getTitle()); - - // load Locator - MLocatorLookup locator = new MLocatorLookup(Env.getCtx(), p_WindowNo); - locatorField = new VLocator ("M_Locator_ID", true, false, true, locator, p_WindowNo); - sameWarehouseCb.setSelected(true); - sameWarehouseCb.addActionListener(this); - - initBPartner(false); - bPartnerField.addVetoableChangeListener(this); - - return true; - } // dynInit - - /** - * Static Init. - *
    -	 *  parameterPanel
    -	 *      parameterBankPanel
    -	 *      parameterStdPanel
    -	 *          bPartner/order/invoice/shopment/licator Label/Field
    -	 *  dataPane
    -	 *  southPanel
    -	 *      confirmPanel
    -	 *      statusBar
    -	 *  
    - * @throws Exception - */ - private void jbInit() throws Exception - { - boolean isRMAWindow = ((getGridTab().getAD_Window_ID() == WINDOW_RETURNTOVENDOR) || (getGridTab().getAD_Window_ID() == WINDOW_CUSTOMERRETURN)); - - bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID")); - orderLabel.setText(Msg.getElement(Env.getCtx(), "C_Order_ID", false)); - locatorLabel.setText(Msg.translate(Env.getCtx(), "M_Locator_ID")); - invoiceLabel.setText(Msg.getElement(Env.getCtx(), "C_Invoice_ID", false)); - sameWarehouseCb.setText(Msg.getMsg(Env.getCtx(), "FromSameWarehouseOnly", true)); - sameWarehouseCb.setToolTipText(Msg.getMsg(Env.getCtx(), "FromSameWarehouseOnly", false)); - rmaLabel.setText(Msg.translate(Env.getCtx(), "M_RMA_ID")); - upcLabel.setText(Msg.getElement(Env.getCtx(), "UPC", false)); - - CPanel parameterPanel = dialog.getParameterPanel(); - parameterPanel.setLayout(new BorderLayout()); - CPanel parameterStdPanel = new CPanel(new GridBagLayout()); - parameterPanel.add(parameterStdPanel, BorderLayout.CENTER); - - parameterStdPanel.add(bPartnerLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - if (bPartnerField != null) - parameterStdPanel.add(bPartnerField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - if (! isRMAWindow) { - parameterStdPanel.add(orderLabel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterStdPanel.add(orderField, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterStdPanel.add(invoiceLabel, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterStdPanel.add(invoiceField, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - } - - parameterStdPanel.add(locatorLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterStdPanel.add(locatorField, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - parameterStdPanel.add(sameWarehouseCb, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - parameterStdPanel.add(upcLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterStdPanel.add(upcField, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - if (isRMAWindow) { - // Add RMA document selection to panel - parameterStdPanel.add(rmaLabel, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterStdPanel.add(rmaField, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - } - } // jbInit - - /*************************************************************************/ - - private boolean m_actionActive = false; - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (log.isLoggable(Level.CONFIG)) log.config("Action=" + e.getActionCommand()); - - if (m_actionActive) - return; - m_actionActive = true; - if (log.isLoggable(Level.CONFIG)) log.config("Action=" + e.getActionCommand()); - // Order - if (e.getSource().equals(orderField)) - { - KeyNamePair pp = (KeyNamePair)orderField.getSelectedItem(); - int C_Order_ID = 0; - if (pp != null) - C_Order_ID = pp.getKey(); - // set Invoice, RMA and Shipment to Null - rmaField.setSelectedIndex(-1); - invoiceField.setSelectedIndex(-1); - loadOrder(C_Order_ID, false, locatorField.getValue()!=null?((Integer)locatorField.getValue()).intValue():0); - } - // Invoice - else if (e.getSource().equals(invoiceField)) - { - KeyNamePair pp = (KeyNamePair)invoiceField.getSelectedItem(); - int C_Invoice_ID = 0; - if (pp != null) - C_Invoice_ID = pp.getKey(); - // set Order, RMA to Null - orderField.setSelectedIndex(-1); - rmaField.setSelectedIndex(-1); - loadInvoice(C_Invoice_ID, locatorField.getValue()!=null?((Integer)locatorField.getValue()).intValue():0); - } - // RMA - else if (e.getSource().equals(rmaField)) - { - KeyNamePair pp = (KeyNamePair)rmaField.getSelectedItem(); - int M_RMA_ID = 0; - if (pp != null) - M_RMA_ID = pp.getKey(); - // set Order and Invoice to Null - orderField.setSelectedIndex(-1); - invoiceField.setSelectedIndex(-1); - loadRMA(M_RMA_ID, locatorField.getValue()!=null?((Integer)locatorField.getValue()).intValue():0); - } - //sameWarehouseCb - else if (e.getSource().equals(sameWarehouseCb)) - { - initBPOrderDetails(((Integer)bPartnerField.getValue()).intValue(), false); - } - else if (e.getSource().equals(upcField)) - { - checkProductUsingUPC(); - } - m_actionActive = false; - } // actionPerformed - - /** - * Change Listener - * @param e event - */ - public void vetoableChange (PropertyChangeEvent e) - { - if (log.isLoggable(Level.CONFIG)) log.config(e.getPropertyName() + "=" + e.getNewValue()); - - // BPartner - load Order/Invoice/Shipment - if (e.getPropertyName().equals("C_BPartner_ID")) - { - int C_BPartner_ID = ((Integer)e.getNewValue()).intValue(); - initBPOrderDetails (C_BPartner_ID, false); - } - dialog.tableChanged(null); - } // vetoableChange - - /************************************************************************** - * Load BPartner Field - * @param forInvoice true if Invoices are to be created, false receipts - * @throws Exception if Lookups cannot be initialized - */ - protected void initBPartner (boolean forInvoice) throws Exception - { - // load BPartner - int AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID - MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.Search); - bPartnerField = new VLookup ("C_BPartner_ID", true, false, true, lookup); - // - int C_BPartner_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "C_BPartner_ID"); - bPartnerField.setValue(Integer.valueOf(C_BPartner_ID)); - - // initial loading - initBPOrderDetails(C_BPartner_ID, forInvoice); - } // initBPartner - - /** - * Load PBartner dependent Order/Invoice/Shipment Field. - * @param C_BPartner_ID BPartner - * @param forInvoice for invoice - */ - protected void initBPOrderDetails (int C_BPartner_ID, boolean forInvoice) - { - if (log.isLoggable(Level.CONFIG)) log.config("C_BPartner_ID=" + C_BPartner_ID); - KeyNamePair pp = new KeyNamePair(0,""); - // load PO Orders - Closed, Completed - orderField.removeActionListener(this); - orderField.removeAllItems(); - orderField.addItem(pp); - - ArrayList list = loadOrderData(C_BPartner_ID, forInvoice, sameWarehouseCb.isSelected()); - for(KeyNamePair knp : list) - orderField.addItem(knp); - - orderField.setSelectedIndex(0); - orderField.addActionListener(this); - dialog.pack(); - - initBPDetails(C_BPartner_ID); - } // initBPartnerOIS - - public void initBPDetails(int C_BPartner_ID) - { - initBPInvoiceDetails(C_BPartner_ID); - initBPRMADetails(C_BPartner_ID); - } - - /** - * Init Details - load invoices not shipped - * @param C_BPartner_ID BPartner - */ - private void initBPInvoiceDetails(int C_BPartner_ID) - { - if (log.isLoggable(Level.CONFIG)) log.config("C_BPartner_ID" + C_BPartner_ID); - - // load Shipments (Receipts) - Completed, Closed - invoiceField.removeActionListener(this); - invoiceField.removeAllItems(); - // None - KeyNamePair pp = new KeyNamePair(0,""); - invoiceField.addItem(pp); - - ArrayList list = loadInvoiceData(C_BPartner_ID); - for(KeyNamePair knp : list) - invoiceField.addItem(knp); - - invoiceField.setSelectedIndex(0); - invoiceField.addActionListener(this); - upcField.addActionListener(this); - } - - /** - * Load RMA that are candidates for shipment - * @param C_BPartner_ID BPartner - */ - private void initBPRMADetails(int C_BPartner_ID) - { - rmaField.removeActionListener(this); - rmaField.removeAllItems(); - // None - KeyNamePair pp = new KeyNamePair(0,""); - rmaField.addItem(pp); - - ArrayList list = loadRMAData(C_BPartner_ID); - for(KeyNamePair knp : list) - rmaField.addItem(knp); - - rmaField.setSelectedIndex(0); - rmaField.addActionListener(this); - } - - /** - * Load Data - Order - * @param C_Order_ID Order - * @param forInvoice true if for invoice vs. delivery qty - * @param M_Locator_ID - */ - protected void loadOrder (int C_Order_ID, boolean forInvoice, int M_Locator_ID) - { - loadTableOIS(getOrderData(C_Order_ID, forInvoice, M_Locator_ID)); - } // LoadOrder - - /** - * Load Data - RMA - * @param M_RMA_ID RMA - * @param M_Locator_ID - */ - protected void loadRMA (int M_RMA_ID, int M_Locator_ID) - { - loadTableOIS(getRMAData(M_RMA_ID, M_Locator_ID)); - } - - /** - * Load Data - Invoice - * @param C_Invoice_ID Invoice - * @param M_Locator_ID - */ - protected void loadInvoice (int C_Invoice_ID, int M_Locator_ID) - { - loadTableOIS(getInvoiceData(C_Invoice_ID, M_Locator_ID)); - } - - /** - * Load Order/Invoice/Shipment data into Table - * @param data data - */ - protected void loadTableOIS (Vector data) - { - // Remove previous listeners - dialog.getMiniTable().getModel().removeTableModelListener(dialog); - // Set Model - DefaultTableModel model = new DefaultTableModel(data, getOISColumnNames()); - model.addTableModelListener(dialog); - dialog.getMiniTable().setModel(model); - // - - configureMiniTable(dialog.getMiniTable()); - } // loadOrder - - public void showWindow() - { - dialog.setVisible(true); - } - - public void closeWindow() - { - dialog.dispose(); - } - - /** - * Checks the UPC value and checks if the UPC matches any of the products in the - * list. - */ - private void checkProductUsingUPC() - { - String upc = upcField.getText(); - DefaultTableModel model = (DefaultTableModel)dialog.getMiniTable().getModel(); - // Lookup UPC - List products = MProduct.getByUPC(Env.getCtx(), upc, null); - for (MProduct product : products) - { - int row = findProductRow(product.get_ID()); - if (row >= 0) - { - BigDecimal qty = (BigDecimal)model.getValueAt(row, 1); - model.setValueAt(qty, row, 1); - model.setValueAt(Boolean.TRUE, row, 0); - model.fireTableRowsUpdated(row, row); - } - } - upcField.setText(""); - upcField.requestFocusInWindow(); - } - - /** - * Finds the row where a given product is. If the product is not found - * in the table -1 is returned. - * @param M_Product_ID - * @return Row of the product or -1 if non existing. - * - */ - private int findProductRow(int M_Product_ID) - { - DefaultTableModel model = (DefaultTableModel)dialog.getMiniTable().getModel(); - KeyNamePair kp; - for (int i=0; i - * parameterPanel - * parameterBankPanel - * parameterStdPanel - * bPartner/order/invoice/shopment/licator Label/Field - * dataPane - * southPanel - * confirmPanel - * statusBar - * - * @throws Exception - */ - private void jbInit() throws Exception - { - bankAccountLabel.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID")); - authorizationLabel.setText(Msg.translate(Env.getCtx(), "R_AuthCode")); - - documentTypeLabel.setText(Msg.translate(Env.getCtx(), "C_DocType_ID")); - tenderTypeLabel.setText(Msg.translate(Env.getCtx(), "TenderType")); - - documentNoLabel.setLabelFor(documentNoField); - dateFromLabel.setLabelFor(dateFromField); - dateFromField.setToolTipText(Msg.translate(Env.getCtx(), "DateFrom")); - dateToLabel.setLabelFor(dateToField); - dateToField.setToolTipText(Msg.translate(Env.getCtx(), "DateTo")); - amtFromLabel.setLabelFor(amtFromField); - amtFromField.setToolTipText(Msg.translate(Env.getCtx(), "AmtFrom")); - amtToLabel.setLabelFor(amtToField); - amtToField.setToolTipText(Msg.translate(Env.getCtx(), "AmtTo")); - - CPanel parameterPanel = dialog.getParameterPanel(); - parameterPanel.setLayout(new BorderLayout()); - - CPanel parameterBankPanel = new CPanel(); - parameterBankPanel.setLayout(new GridBagLayout()); - parameterPanel.add(parameterBankPanel, BorderLayout.CENTER); - - parameterBankPanel.add(bankAccountLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - if (bankAccountField != null) - parameterBankPanel.add(bankAccountField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(documentTypeLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - if(documentTypeField!= null) - parameterBankPanel.add(documentTypeField, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(tenderTypeLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - if(tenderTypeField!=null) - parameterBankPanel.add(tenderTypeField, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(BPartner_idLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(bPartnerLookup, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(documentNoLabel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(documentNoField, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(authorizationLabel, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(authorizationField, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(amtFromLabel, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(amtFromField, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - parameterBankPanel.add(amtToLabel, new GridBagConstraints(4, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(amtToField, new GridBagConstraints(5, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - parameterBankPanel.add(dateFromLabel, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(dateFromField, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - parameterBankPanel.add(dateToLabel, new GridBagConstraints(4, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - parameterBankPanel.add(dateToField, new GridBagConstraints(5, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); - - } // jbInit - - /*************************************************************************/ - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (log.isLoggable(Level.CONFIG)) log.config("Action=" + e.getActionCommand()); -// Object source = e.getSource(); - if(e.getActionCommand().equals(ConfirmPanel.A_REFRESH)) - { - Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR); - loadBankAccount(); - dialog.tableChanged(null); - Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR); - } - } // actionPerformed - - protected void loadBankAccount() - { - loadTableOIS(getBankAccountData(bankAccountField.getValue(), bPartnerLookup.getValue(), - documentNoField.getText(), dateFromField.getValue(), dateToField.getValue(), - amtFromField.getValue(), amtToField.getValue(), - documentTypeField.getValue(), tenderTypeField.getValue(), authorizationField.getText())); - } - - protected void loadTableOIS (Vector data) - { - // Remove previous listeners - dialog.getMiniTable().getModel().removeTableModelListener(dialog); - // Set Model - DefaultTableModel model = new DefaultTableModel(data, getOISColumnNames()); - model.addTableModelListener(dialog); - dialog.getMiniTable().setModel(model); - // - - configureMiniTable(dialog.getMiniTable()); - } - - public void showWindow() - { - dialog.setVisible(true); - } - - public void closeWindow() - { - dialog.dispose(); - } - - @Override - public Object getWindow() - { - return dialog; - } -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VOnlyCurrentDays.java b/org.adempiere.ui.swing/src/org/compiere/grid/VOnlyCurrentDays.java deleted file mode 100644 index 86d9f06531..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VOnlyCurrentDays.java +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid; - -import java.awt.BorderLayout; -import java.awt.Frame; -import java.awt.Insets; -import java.awt.Point; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.util.logging.Level; - -import javax.swing.WindowConstants; - -import org.compiere.swing.CButton; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Queries how many days back history is displayed as current - * - * @author Jorg Janke - * @version $Id: VOnlyCurrentDays.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *
  • BF [ 1824621 ] History button can't be canceled - */ -public class VOnlyCurrentDays extends CDialog - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 2619306709535014989L; - - /** - * Constructor - * @param parent parent frame - * @param buttonLocation lower left corner of the button - */ - public VOnlyCurrentDays(Frame parent, Point buttonLocation) - { - // How long back in History? - super (parent, Msg.getMsg(Env.getCtx(), "VOnlyCurrentDays", true), true); - try - { - jbInit(); - } - catch(Exception e) - { - log.log(Level.SEVERE, "VOnlyCurrentDays", e); - } - this.pack(); - buttonLocation.x -= (int)getPreferredSize().getWidth()/2; - this.setLocation(buttonLocation); - this.setVisible(true); - } // VOnlyCurrentDays - - private CPanel mainPanel = new CPanel(); - private CButton bShowAll = new CButton(); - private CButton bShowMonth = new CButton(); - private CButton bShowWeek = new CButton(); - private CButton bShowDay = new CButton(); - private CButton bShowYear = new CButton(); - - /** Days (0=all) */ - private int m_days = 0; - /** Is cancel */ - private boolean m_isCancel = false; - /** Margin */ - private static Insets s_margin = new Insets (2, 2, 2, 2); - /** Logger */ - private static CLogger log = CLogger.getCLogger(VOnlyCurrentDays.class); - - /** - * Static Initializer - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); - bShowAll.setText(Msg.getMsg(Env.getCtx(), "All")); - bShowAll.addActionListener(this); - bShowAll.setMargin(s_margin); - bShowYear.setText(Msg.getMsg(Env.getCtx(), "Year")); - bShowYear.addActionListener(this); - bShowYear.setMargin(s_margin); - bShowMonth.setText(Msg.getMsg(Env.getCtx(), "Month")); - bShowMonth.addActionListener(this); - bShowMonth.setMargin(s_margin); - bShowWeek.setText(Msg.getMsg(Env.getCtx(), "Week")); - bShowWeek.addActionListener(this); - bShowWeek.setMargin(s_margin); - bShowDay.setText(Msg.getMsg(Env.getCtx(), "Day")); - bShowDay.addActionListener(this); - bShowDay.setMargin(s_margin); - bShowDay.setDefaultCapable(true); - // - mainPanel.add(bShowDay, null); - mainPanel.add(bShowWeek, null); - mainPanel.add(bShowMonth, null); - mainPanel.add(bShowYear, null); - mainPanel.add(bShowAll, null); - // - mainPanel.setToolTipText(Msg.getMsg(Env.getCtx(), "VOnlyCurrentDays", false)); - this.getContentPane().add(mainPanel, BorderLayout.CENTER); - this.getRootPane().setDefaultButton(bShowDay); - // - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent e) { - m_isCancel = true; - } - }); - } // jbInit - - /** - * Action Listener - * @param e evant - */ - public void actionPerformed(ActionEvent e) - { - if (e.getSource() == bShowDay) - m_days = 1; - else if (e.getSource() == bShowWeek) - m_days = 7; - else if (e.getSource() == bShowMonth) - m_days = 31; - else if (e.getSource() == bShowYear) - m_days = 365; - else - m_days = 0; // all - dispose(); - } // actionPerformed - - /** - * Get selected number of days - * @return days or -1 for all - */ - public int getCurrentDays() - { - return m_days; - } // getCurrentDays - - /** - * @return true if user has canceled this form - */ - public boolean isCancel() { - return m_isCancel; - } -} // VOnlyCurrentDays diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VPanel.java b/org.adempiere.ui.swing/src/org/compiere/grid/VPanel.java deleted file mode 100644 index fc12ae08e5..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VPanel.java +++ /dev/null @@ -1,770 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - * @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ] - *****************************************************************************/ -package org.compiere.grid; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.FocusTraversalPolicy; -import java.awt.Font; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.logging.Level; - -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.JPanel; -import javax.swing.JSeparator; - -import net.miginfocom.layout.BoundSize; -import net.miginfocom.layout.ComponentWrapper; -import net.miginfocom.layout.ConstraintParser; -import net.miginfocom.layout.LayoutCallback; -import net.miginfocom.swing.MigLayout; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.AFocusTraversalPolicy; -import org.compiere.apps.APanel; -import org.compiere.grid.ed.VButton; -import org.compiere.grid.ed.VCheckBox; -import org.compiere.grid.ed.VEditor; -import org.compiere.grid.ed.VEditorFactory; -import org.compiere.model.GridField; -import org.compiere.model.X_AD_FieldGroup; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTabbedPane; -import org.compiere.swing.CollapsiblePanel; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Language; -import org.compiere.util.Util; -import org.jdesktop.swingx.JXCollapsiblePane; -import org.jdesktop.swingx.border.DropShadowBorder; - - -/** - * Single Row Panel. - * Called from GridController - * - * Uses MigLayout - * - * @author Jorg Janke - * @version $Id: VPanel.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $ - * @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ] - * Carlos Ruiz - globalqss / Fix bug 2307133 - Swing client hiding fields incorrectly - */ -public final class VPanel extends CTabbedPane -{ - - /** - * - */ - private static final long serialVersionUID = 8227080366665213627L; - - private int m_WindowNo; - // show layout grid - private boolean debug = false; - private String defaultLayoutConstraints; - private int labelMinWidth = 0; - private int fieldMinWidth = 0; - - public VPanel(String Name) - { - this(Name, 0); - } - - /** - * - * @param Name - * @param WindowNo - */ - public VPanel(String Name, int WindowNo) - { - m_WindowNo = WindowNo; - - defaultLayoutConstraints = "hidemode 3"; // hidden fields take no part in grid - defaultLayoutConstraints += debug ? ", debug" : ""; - - //[ 1757088 ] - m_main.setName(Name); - String constraints = defaultLayoutConstraints; - MigLayout mainLayout = new MigLayout(constraints); - mainLayout.addLayoutCallback(callback); - m_main.setLayout(mainLayout); - - m_tablist.put("main", m_main); - this.setBorder(marginBorder); - - CPanel dummy = new CPanel(); - dummy.setLayout(new BorderLayout()); - dummy.add(m_main, BorderLayout.NORTH); - dummy.setName(m_main.getName()); - this.add(dummy); - - } // VPanel - - /** Orientation */ - @SuppressWarnings("unused") - private final boolean m_leftToRight = Language.getLoginLanguage().isLeftToRight(); - /** Previous Field Group Header */ - private String m_oldFieldGroup = null; - /** Previous Field Group Type */ - private String m_oldFieldGroupType = null; - /** DefaultFocusField */ - private VEditor m_defaultFocusField = null; - /** Focus Traversal Policy */ - private static FocusTraversalPolicy s_focusPolicy = null; - //[ 1757088 ] - private java.util.Hashtable m_tablist = new java.util.Hashtable(); - private java.util.Hashtable m_tabincludelist = new java.util.Hashtable(); - private CPanel m_main = new CPanel(org.compiere.plaf.CompiereColor.getDefaultBackground()); - private DropShadowBorder marginBorder = new DropShadowBorder(); - - - /** - * Use layout callback to implement size groups across panels - * and to shrink hidden components vertically. - */ - private LayoutCallback callback = new LayoutCallback() { - - // Set the min and preferred sizes to match the largest component - public BoundSize[] getSize(ComponentWrapper comp) - { - if (comp.getComponent() instanceof CLabel) { - Component c = (Component) comp.getComponent(); - int w = labelMinWidth; - int h = c.getPreferredSize().height; - BoundSize width = ConstraintParser.parseBoundSize(w + ":" + w, false, true); // min:pref - BoundSize height = ConstraintParser.parseBoundSize(h + ":" + h, false, false); - - return new BoundSize[] {width, height}; - } - else - { - Component c = (Component) comp.getComponent(); - int w = fieldMinWidth; - int h = c.getPreferredSize().height; - BoundSize width = ConstraintParser.parseBoundSize(w + ":" + w, false, true); - BoundSize height = ConstraintParser.parseBoundSize(h + ":" + h, false, false); - - return new BoundSize[] {width, height}; - } - - }// - - public void correctBounds(ComponentWrapper comp) - { - } - }; - - private VEditor prevEditor = null; - private GridField prevField = null; - private boolean wrap = false; - - /** Logger */ - private static CLogger log = CLogger.getCLogger (VPanel.class); - - - /** - * Set Field Mnemonic - * @param mField field - */ - public void setMnemonic (GridField mField) - { - if (mField.isCreateMnemonic()) - return; - String text = mField.getHeader(); - int pos = text.indexOf('&'); - if (pos != -1 && text.length() > pos) // We have a mnemonic - creates Ctrl_Shift_ - { - char mnemonic = text.toUpperCase().charAt(pos+1); - if (mnemonic != ' ') - { - if (!m_mnemonics.contains(mnemonic)) - { - mField.setMnemonic(mnemonic); - m_mnemonics.add(mnemonic); - } - else - log.warning(mField.getColumnName() - + " - Conflict - Already exists: " + mnemonic + " (" + text + ")"); - } - } - } // setMnemonic - - /** - * Add Field and Label to buffer and push buffered field to Panel - * @param editor editor - * @param mField field model - */ - public void addFieldBuffered (VEditor editor, GridField mField) - { - wrap = mField != null ? !mField.isSameLine() : false; - - if ( prevEditor != null && prevField != null) - addField(prevEditor, prevField); - prevEditor = editor; - prevField = mField; - } - /** - * Add the previous Field and Label to Panel - * @param editor editor - * @param mField field model - * @param wrap move to next line after this field - */ - public void addField (VEditor editor, GridField mField) - { - //[ 1757088 ] - int AD_Tab_ID = mField.getIncluded_Tab_ID(); - if(AD_Tab_ID != 0 ) - { - CollapsiblePanel m_tab = new CollapsiblePanel(""); - m_tabincludelist.put(AD_Tab_ID, m_tab); - m_main.add(m_tab,"newline, spanx, growx"); - m_tab.setName("IncludedTab#"+AD_Tab_ID); - - if (includedTabList.containsKey(AD_Tab_ID)) - { - includeTab(includedTabList.get(AD_Tab_ID)); - } - return; - } - - CLabel label = VEditorFactory.getLabel(mField); - if (label == null && editor == null) - return; - - boolean sameLine = mField.isSameLine(); - - //[ 1757088 ] // sets top - String fieldGroup = mField.getFieldGroup(); - String fieldGroupType = mField.getFieldGroupType(); - if (Util.isEmpty(fieldGroup)) - { - fieldGroup = m_oldFieldGroup; - fieldGroupType = m_oldFieldGroupType; - } - - if (addGroup(fieldGroup, fieldGroupType)) // sets top - { - if (X_AD_FieldGroup.FIELDGROUPTYPE_Collapse.equals(fieldGroupType)) - { - CollapsiblePanel panel = (CollapsiblePanel) m_tablist.get(fieldGroup); - panel.getCollapsiblePane().setCollapsed(mField.getIsCollapsedByDefault()); - } - sameLine = false; - } - else - { - fieldGroup = m_oldFieldGroup; - fieldGroupType = m_oldFieldGroupType; - } - - // label constraints - String constraints = "align trailing"; - if ( !sameLine ) - { - constraints += ", newline"; - } - - // *** The Label *** - if ( label == null) - { - label = new CLabel(""); - label.setName(mField.getColumnName()); - } - // - if (mField.isCreateMnemonic()) - setMnemonic(label, mField.getMnemonic()); - - if (fieldGroupType.equals(X_AD_FieldGroup.FIELDGROUPTYPE_Tab)) - { - CPanel m_tab = (CPanel)m_tablist.get(fieldGroup); - m_tab.add(label, constraints); - } - else if (fieldGroupType.equals(X_AD_FieldGroup.FIELDGROUPTYPE_Collapse)) - { - CollapsiblePanel m_tab = (CollapsiblePanel) m_tablist.get(fieldGroup); - m_tab.getCollapsiblePane().getContentPane().add(label, constraints); - } - else // Label - { - m_main.add(label, constraints); - } - - int currentWidth = label.getPreferredSize().width; - labelMinWidth = currentWidth > labelMinWidth ? currentWidth : labelMinWidth; - - // *** The Field *** - if (editor != null) - { - Component field = (Component)editor; - // field constraints - // long fields span all remaining columns - constraints = "growx, pushx"; - if ( mField.isLongField() ) - { - constraints += mField.isLongField() ? ",spanx" : ""; - } - if ( wrap ) - { - // Vertical Spacing in Swing Client - // - https://sourceforge.net/tracker/?func=detail&aid=3073406&group_id=176962&atid=883808 - constraints += ", wrap 0"; - } - - // Add Field - //[ 1757088 ] - if (fieldGroupType.equals(X_AD_FieldGroup.FIELDGROUPTYPE_Tab)) - { - CPanel m_tab = (CPanel)m_tablist.get(fieldGroup); - m_tab.add(field, constraints); - } - else if (fieldGroupType.equals(X_AD_FieldGroup.FIELDGROUPTYPE_Collapse)) - { - CollapsiblePanel m_tab = (CollapsiblePanel) m_tablist.get(fieldGroup); - Component comp = (Component) editor; - comp.setMinimumSize(comp.getPreferredSize()); - if (mField.getDisplayType() == DisplayType.Text - || mField.getDisplayType() == DisplayType.Memo - ||mField.getDisplayType() == DisplayType.TextLong ) - { - Component component = (Component) editor; - component.setMinimumSize(component.getPreferredSize()); - } - if (!mField.isLongField()) - fieldMinWidth = field.getPreferredSize().width > fieldMinWidth ? field.getPreferredSize().width : fieldMinWidth; - m_tab.getCollapsiblePane().getContentPane().add(field, constraints); - } - else // Label or null - { - m_main.add(field, constraints); - if (!mField.isLongField()) - fieldMinWidth = field.getPreferredSize().width > fieldMinWidth ? field.getPreferredSize().width : fieldMinWidth; - } - // Link Label to Field - //if (label != null) - label.setLabelFor(field); - //else if (mField.isCreateMnemonic()) - //setMnemonic(editor, mField.getMnemonic()); - - // Default Focus - if (m_defaultFocusField == null && mField.isDefaultFocus()) - { - m_defaultFocusField = editor; - if (s_focusPolicy == null) - s_focusPolicy = new AFocusTraversalPolicy(); - setFocusTraversalPolicy(s_focusPolicy); - setFocusTraversalPolicyProvider(true); - } - } - } // addField - - /** - * Add Group - * @param fieldGroup field group - * @param fieldGroupType - * @return true if group added - */ - private boolean addGroup(String fieldGroup, String fieldGroupType) - { - // First time - add top - if (m_oldFieldGroup == null) - { - m_oldFieldGroup = ""; - m_oldFieldGroupType = ""; - } - - if (fieldGroup == null || fieldGroup.length() == 0 || fieldGroup.equals(m_oldFieldGroup)) - return false; - - //[ 1757088 ] - if (m_tablist.get(fieldGroup) != null) - { - return false; - } - - //[ 1757088 ] - if (fieldGroupType.equals(X_AD_FieldGroup.FIELDGROUPTYPE_Tab)) - { - - CPanel m_tab = new CPanel(); - m_tab.setBackground(AdempierePLAF.getFormBackground()); - String tpConstraints = defaultLayoutConstraints ; - MigLayout layout = new MigLayout(tpConstraints); - layout.addLayoutCallback(callback); - m_tab.setLayout(layout); - m_tab.setName(fieldGroup); - CPanel dummy = new CPanel(); - dummy.setLayout(new BorderLayout()); - dummy.add(m_tab, BorderLayout.NORTH); - dummy.setName(m_tab.getName()); - dummy.setBorder(BorderFactory.createEmptyBorder(10,12,0,12)); - this.add(dummy); - m_tablist.put(fieldGroup, m_tab); - } - else if (fieldGroupType.equals(X_AD_FieldGroup.FIELDGROUPTYPE_Collapse)) - { - CollapsiblePanel collapsibleSection = new CollapsiblePanel(fieldGroup); - JXCollapsiblePane m_tab = collapsibleSection.getCollapsiblePane(); - m_tab.setAnimated(false); - m_tab.getContentPane().setBackground(AdempierePLAF.getFormBackground()); - - String cpConstraints = defaultLayoutConstraints; - // 0 inset left and right as this is a nested panel - // 0 inset top because of the struts added below - cpConstraints += ", ins 0 0 n 0"; - - MigLayout layout = new MigLayout(cpConstraints); - layout.addLayoutCallback(callback); - - collapsibleSection.setName(fieldGroup); - m_main.add(collapsibleSection, "newline, spanx, growx"); - m_tab.setLayout(layout); - /* for compatibility with old layout, force collapsible field groups - * to have a minimum of two columns by inserting invisible components - */ - Component strut1 = Box.createVerticalStrut(1); - strut1.setName("vstrut1"+fieldGroup); - Component strut2 = Box.createVerticalStrut(1); - strut2.setName("vstrut2"+fieldGroup); - m_tab.add(new CLabel(""), "gap 0 0 0 0"); - m_tab.add(strut1, "pushx, growx, gap 0 0 0 0"); - m_tab.add(new CLabel(""), ""); - m_tab.add(strut2, "pushx, growx, gap 0 0 0 0, wrap"); - m_tablist.put(fieldGroup, collapsibleSection); - } - else // Label or null - { - CLabel label = new CLabel(fieldGroup, CLabel.LEADING); - label.setFont(AdempierePLAF.getFont_Label().deriveFont(Font.BOLD | Font.ITALIC, AdempierePLAF.getFont_Label().getSize2D())); - m_main.add(label, "newline, spanx, growx"); - m_main.add(new JSeparator(), "newline, spanx, growx"); - // reset - } - m_oldFieldGroup = fieldGroup; - m_oldFieldGroupType = fieldGroupType; - return true; - } // addGroup - - /** - * Set Mnemonic for Label CTRL_SHIFT_x - * @param label label - * @param predefinedMnemonic predefined Mnemonic - */ - private void setMnemonic (CLabel label, char predefinedMnemonic) - { - String text = label.getText(); - int pos = text.indexOf('&'); - if (pos != -1 && predefinedMnemonic != 0) - { - text = text.substring(0, pos) + text.substring(pos+1); - label.setText(text); - label.setSavedMnemonic(predefinedMnemonic); - m_fields.add(label); - if (log.isLoggable(Level.FINEST)) log.finest(predefinedMnemonic + " - " + label.getName()); - } - else - { - char mnemonic = getMnemonic(text, label); - if (mnemonic != 0) - label.setSavedMnemonic(mnemonic); - // label.setDisplayedMnemonic(mnemonic); - } - } // setMnemonic - - /** - * Set Mnemonic for Check Box or Button - * @param editor check box or button - other ignored - * @param predefinedMnemonic predefined Mnemonic - */ - /* - private void setMnemonic (VEditor editor, char predefinedMnemonic) - { - if (editor instanceof VCheckBox) - { - VCheckBox cb = (VCheckBox)editor; - String text = cb.getText(); - int pos = text.indexOf('&'); - if (pos != -1 && predefinedMnemonic != 0) - { - text = text.substring(0, pos) + text.substring(pos+1); - cb.setText(text); - cb.setSavedMnemonic(predefinedMnemonic); - m_fields.add(cb); - if (log.isLoggable(Level.FINEST)) log.finest(predefinedMnemonic + " - " + cb.getName()); - } - else - { - char mnemonic = getMnemonic(text, cb); - if (mnemonic != 0) - cb.setSavedMnemonic(mnemonic); - // cb.setMnemonic(mnemonic); - } - } - // Button - else if (editor instanceof VButton) - { - VButton b = (VButton)editor; - String text = b.getText(); - int pos = text.indexOf('&'); - if (pos != -1 && predefinedMnemonic != 0) - { - text = text.substring(0, pos) + text.substring(pos+1); - b.setText(text); - b.setSavedMnemonic(predefinedMnemonic); - m_fields.add(b); - if (log.isLoggable(Level.FINEST)) log.finest(predefinedMnemonic + " - " + b.getName()); - } - else if (b.getColumnName().equals("DocAction")) - { - b.getInputMap(WHEN_IN_FOCUSED_WINDOW) - .put(KeyStroke.getKeyStroke(KeyEvent.VK_F4, Event.SHIFT_MASK, false), "pressed"); - b.getInputMap(WHEN_IN_FOCUSED_WINDOW) - .put(KeyStroke.getKeyStroke(KeyEvent.VK_F4, Event.SHIFT_MASK, true), "released"); - // Util.printActionInputMap(b); - } - else if (b.getColumnName().equals("Posted")) - { - b.getInputMap(WHEN_IN_FOCUSED_WINDOW) - .put(KeyStroke.getKeyStroke(KeyEvent.VK_F5, Event.SHIFT_MASK, false), "pressed"); - b.getInputMap(WHEN_IN_FOCUSED_WINDOW) - .put(KeyStroke.getKeyStroke(KeyEvent.VK_F5, Event.SHIFT_MASK, true), "released"); - // Util.printActionInputMap(b); - } - else - { - char mnemonic = getMnemonic(text, b); - if (mnemonic != 0) - b.setSavedMnemonic(mnemonic); - } - } - } // setMnemonic - */ - - /** - * Get Mnemonic from text - * @param text text - * @param source component - * @return Mnemonic or 0 if not unique - */ - private char getMnemonic (String text, Component source) - { - if (text == null || text.length() == 0) - return 0; - String oText = text; - text = text.trim().toUpperCase(); - char mnemonic = text.charAt(0); - if (m_mnemonics.contains(mnemonic)) - { - mnemonic = 0; - // Beginning new word - int index = text.indexOf(' '); - while (index != -1 && text.length() > index) - { - char c = text.charAt(index+1); - if (Character.isLetterOrDigit(c) && !m_mnemonics.contains(c)) - { - mnemonic = c; - break; - } - index = text.indexOf(' ', index+1); - } - // Any character - if (mnemonic == 0) - { - for (int i = 1; i < text.length(); i++) - { - char c = text.charAt(i); - if (Character.isLetterOrDigit(c) && !m_mnemonics.contains(c)) - { - mnemonic = c; - break; - } - } - } - // Nothing found - if (mnemonic == 0) - { - if (log.isLoggable(Level.FINEST)) log.finest("None for: " + oText); - return 0; // if first char would be returned, the first occurrence is invalid. - } - } - m_mnemonics.add(mnemonic); - m_fields.add(source); - if (log.isLoggable(Level.FINEST)) log.finest(mnemonic + " - " + source.getName()); - return mnemonic; - } // getMnemonic - - /** Used Mnemonics */ - private ArrayList m_mnemonics = new ArrayList(30); - /** Mnemonic Fields */ - private ArrayList m_fields = new ArrayList(30); - - private HashMap includedTabList = new HashMap(); - - /** - * Set Window level Mnemonics - * @param set true if set otherwise unregister - */ - public void setMnemonics (boolean set) - { - int size = m_fields.size(); - for (int i = 0; i < size; i++) - { - Component c = m_fields.get(i); - if (c instanceof CLabel) - { - CLabel l = (CLabel)c; - if (set) - l.setDisplayedMnemonic(l.getSavedMnemonic()); - else - l.setDisplayedMnemonic(0); - } - else if (c instanceof VCheckBox) - { - VCheckBox cb = (VCheckBox)c; - if (set) - cb.setMnemonic(cb.getSavedMnemonic()); - else - cb.setMnemonic(0); - } - else if (c instanceof VButton) - { - VButton b = (VButton)c; - if (set) - b.setMnemonic(b.getSavedMnemonic()); - else - b.setMnemonic(0); - } - } - } // setMnemonics - - /************************************************************************** - * Set Background to AD_Color_ID (nop) - * @param AD_Color_ID Color - */ - public void setBackground (int AD_Color_ID) - { - } // setBackground - - - private void findChildComponents(CPanel container, List list) - { - Component[] comp = container.getComponents(); - for (int c = 0; c < comp.length; c++) - { - list.add(comp[c]); - if ( comp [c] instanceof CollapsiblePanel) - { - CollapsiblePanel collapsiblePanel = (CollapsiblePanel)comp [c]; - - Component[] nestedComps = collapsiblePanel.getCollapsiblePane() - .getContentPane().getComponents(); - - for (int y = 0; y < nestedComps.length; y++) - { - - if ( nestedComps [y] instanceof CPanel) - { - CPanel nestedPanel = (CPanel)nestedComps[y]; - Component[] nestedPanelComps = nestedPanel.getComponents(); - - for (int x = 0; x < nestedPanelComps.length; x++) - { - list.add(nestedPanelComps[x]); - } - } - else - { - list.add(nestedComps[y]); - } - } - } else if (comp[c] instanceof CPanel) - { - - findChildComponents((CPanel)comp[c], list); - } - } - } - - //[ 1757088 ] - public Component[] getComponentsRecursive() - { - java.util.ArrayList list = new java.util.ArrayList(); - - for (int i = 0; i < this.getTabCount(); i++) - { - list.add(this.getComponentAt(i)); - if (this.getComponentAt(i) instanceof CPanel) - { - CPanel panel = (CPanel)this.getComponentAt(i); - findChildComponents(panel, list); - } - } - - Component[] result = new Component[list.size ()]; - list.toArray (result); - return result; - } - - /** - * - * @param detail - */ - public void includeTab(GridController detail) { - CollapsiblePanel section = m_tabincludelist.get(detail.getMTab().getAD_Tab_ID()); - if(section != null) - { - APanel panel = new APanel(detail, m_WindowNo); - String name = detail.getMTab().getName() + ""; - section.setTitle(name); - section.getCollapsiblePane().getContentPane().setLayout(new BorderLayout()); - section.getCollapsiblePane().getContentPane().add(panel, BorderLayout.CENTER); - } - - //this can be call before addField - if (!includedTabList.containsKey(detail.getMTab().getAD_Tab_ID())) - includedTabList.put(detail.getMTab().getAD_Tab_ID(), detail); - } - - /** - * Get Default Focus Field - * @return field if defined - */ - public VEditor getDefaultFocus() - { - return m_defaultFocusField; - } // getDefaultFocus - - /** - * Request Focus In Window - * @return focus request - */ - @Override - public boolean requestFocusInWindow() - { - if (m_defaultFocusField != null) - { - if (m_defaultFocusField.isReadWrite()) - return m_defaultFocusField.getFocusableComponent().requestFocusInWindow(); - } - return super.requestFocusInWindow(); - } -} // VPanel diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormCash.java b/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormCash.java deleted file mode 100644 index 8c7c75db74..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormCash.java +++ /dev/null @@ -1,250 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2012 Elaine Tan * - * Copyright (C) 2012 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Enumeration; - -import org.compiere.apps.ADialog; -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VNumber; -import org.compiere.model.GridTab; -import org.compiere.model.MConversionRate; -import org.compiere.model.MInvoice; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CLabel; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -/** - * - * @author Elaine - * - */ -public class VPaymentFormCash extends PaymentFormCash implements ActionListener { - - private VPaymentFormDialog dialog; - - private CLabel bBankAccountLabel = new CLabel(); - private CComboBoxbBankAccountCombo = new CComboBox(); - private CLabel bCashBookLabel = new CLabel(); - private CComboBoxbCashBookCombo = new CComboBox(); - private CLabel bCurrencyLabel = new CLabel(); - private CComboBoxbCurrencyCombo = new CComboBox(); - private VDate bDateField; - private CLabel bDateLabel = new CLabel(); - private CLabel bAmountLabel = new CLabel(); - private VNumber bAmountField = new VNumber(); - - public VPaymentFormCash(int windowNo, GridTab mTab) { - super(windowNo, mTab); - bDateField = new VDate("DateAcct", false, false, true, DisplayType.Date, "DateAcct"); - dialog = new VPaymentFormDialog(this, windowNo); - init(); - - //Bojana&Daniel - //If Invoice is Vendor invoice then Cash has to be created by negative amount - int C_Invoice_ID = Env.getContextAsInt(Env.getCtx(), windowNo, "C_Invoice_ID"); - MInvoice invoice_tmp = new MInvoice (Env.getCtx(), C_Invoice_ID, null); - if (! invoice_tmp.isSOTrx()) - { - bAmountField.setValue(m_Amount.negate()); - }else { - bAmountField.setValue(m_Amount); - } - invoice_tmp = null; - } - - public void init() { - GridBagLayout bPanelLayout = new GridBagLayout(); - bBankAccountLabel.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID")); - bCurrencyLabel.setText(Msg.translate(Env.getCtx(), "C_Currency_ID")); - dialog.getPanel().setLayout(bPanelLayout); - bAmountLabel.setText(Msg.getMsg(Env.getCtx(), "Amount")); - //bAmountField.setText(""); - bDateLabel.setText(Msg.translate(Env.getCtx(), "DateAcct")); - - if (m_Cash_As_Payment){ - dialog.getPanel().add(bBankAccountLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 0, 2, 0), 0, 0)); - dialog.getPanel().add(bBankAccountCombo, new GridBagConstraints(1, 0, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0)); - - } else { - bCashBookLabel.setText(Msg.translate(Env.getCtx(), "C_CashBook_ID")); - dialog.getPanel().add(bCashBookLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 0, 2, 0), 0, 0)); - dialog.getPanel().add(bCashBookCombo, new GridBagConstraints(1, 0, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0)); - - } - - dialog.getPanel().add(bCurrencyLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 0, 2, 0), 0, 0)); - dialog.getPanel().add(bCurrencyCombo, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0)); - dialog.getPanel().add(bDateLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 0, 2, 0), 0, 0)); - dialog.getPanel().add(bDateField, new GridBagConstraints(1, 2, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0)); - dialog.getPanel().add(bAmountLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 0, 2, 0), 0, 0)); - dialog.getPanel().add(bAmountField, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0)); - } - - @Override - public void loadData() { - super.loadData(); - - bAmountField.setValue(m_Amount); - - if (m_C_Payment_ID != 0) - bAmountField.setValue(m_mPayment.getPayAmt()); - - // Existing Cashbook entry - if (m_C_CashLine_ID != 0) - bAmountField.setValue(m_cashLine.getAmount()); - - // Accounting Date - bDateField.setValue(m_DateAcct); - - // Is the currency an EMU currency? - Integer C_Currency_ID = Integer.valueOf(m_C_Currency_ID); - if (s_Currencies.containsKey(C_Currency_ID)) { - Enumeration en = s_Currencies.keys(); - while (en.hasMoreElements()) { - Object key = en.nextElement(); - bCurrencyCombo.addItem(s_Currencies.get(key)); - } - bCurrencyCombo.addActionListener(this); - bCurrencyCombo.setSelectedItem(s_Currencies.get(C_Currency_ID)); - } - else // No EMU Currency - { - bCurrencyLabel.setVisible(false); // Cash - bCurrencyCombo.setVisible(false); - } - - ArrayList list = getBankAccountList(); - for (KeyNamePair pp : list) - bBankAccountCombo.addItem(pp); - - // Set Selection - if (selectedBankAccount != null) - bBankAccountCombo.setSelectedItem(selectedBankAccount); - - - list = getCashBookList(); - for (KeyNamePair pp : list) - bCashBookCombo.addItem(pp); - - // Set Selection - if (selectedCashBook != null) - bCashBookCombo.setSelectedItem(selectedCashBook); - } - - public void actionPerformed(ActionEvent e) - { - if (e.getSource() == bCurrencyCombo) - { - KeyNamePair pp = (KeyNamePair)bCurrencyCombo.getSelectedItem(); - BigDecimal amt = MConversionRate.convert(Env.getCtx(), - m_Amount, m_C_Currency_ID, pp.getKey(), m_AD_Client_ID, m_AD_Org_ID); - bAmountField.setValue(amt); - } - } - - @Override - public boolean checkMandatory() { - int C_BankAccount_ID = 0; - /*********************** - * Mandatory Data Check - */ - boolean dataOK = true; - if (m_Cash_As_Payment) - { - KeyNamePair kp = (KeyNamePair)bBankAccountCombo.getSelectedItem(); - if (kp != null) - C_BankAccount_ID = kp.getKey(); - } - - // find Bank Account if not qualified yet - if (m_Cash_As_Payment && C_BankAccount_ID == 0) - { - // Check & Cash (Payment) must have a bank account - if (C_BankAccount_ID == 0 && m_Cash_As_Payment) - { - ADialog.error(getWindowNo(), dialog, "FillMandatory", bBankAccountLabel.getText()); - dataOK = false; - } - } - - return dataOK; - } - - @Override - public boolean saveChangesInTrx(String trxName) { - int newC_CashBook_ID = m_C_CashBook_ID; - int newC_BankAccount_ID = 0; - if (m_Cash_As_Payment){ - // get bank account - KeyNamePair kp = (KeyNamePair)bBankAccountCombo.getSelectedItem(); - if (kp != null) - newC_BankAccount_ID = kp.getKey(); - } else { - // get cash book - KeyNamePair kp = (KeyNamePair)bCashBookCombo.getSelectedItem(); - if (kp != null) - newC_CashBook_ID = kp.getKey(); - } - - Timestamp newDateAcct = (Timestamp)bDateField.getValue(); - - boolean ok = save(newC_BankAccount_ID,newC_CashBook_ID, newDateAcct, (BigDecimal) bAmountField.getValue(), trxName); - - if (!ok) - ADialog.error(getWindowNo(), dialog, "PaymentError", processMsg); - else if (processMsg != null) - ADialog.info(getWindowNo(), dialog, "PaymentCreated", processMsg); - - return ok; - } - - @Override - public void showWindow() - { - dialog.setVisible(true); - } - - @Override - public void closeWindow() - { - dialog.dispose(); - } - - @Override - public Object getWindow() { - return dialog; - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormCheck.java b/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormCheck.java deleted file mode 100644 index ed7400b1ea..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormCheck.java +++ /dev/null @@ -1,294 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2012 Elaine Tan * - * Copyright (C) 2012 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Enumeration; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ADialog; -import org.compiere.grid.ed.VNumber; -import org.compiere.model.GridTab; -import org.compiere.model.MBankAccountProcessor; -import org.compiere.model.MConversionRate; -import org.compiere.model.MPaymentValidate; -import org.compiere.swing.CButton; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CTextField; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -/** - * - * @author Elaine - * - */ -public class VPaymentFormCheck extends PaymentFormCheck implements ActionListener, FocusListener { - - private VPaymentFormDialog dialog; - - private CLabel sBankAccountLabel = new CLabel(); - private CComboBoxsBankAccountCombo = new CComboBox(); - private CLabel sCurrencyLabel = new CLabel(); - private CComboBoxsCurrencyCombo = new CComboBox(); - private CLabel sAmountLabel = new CLabel(); - private VNumber sAmountField = new VNumber(); - private CLabel sRoutingLabel = new CLabel(); - private CTextField sRoutingField = new CTextField(); - private CLabel sNumberLabel = new CLabel(); - private CTextField sNumberField = new CTextField(); - private CLabel sCheckLabel = new CLabel(); - private CTextField sCheckField = new CTextField(); - private CButton sOnline = new CButton(); - private CLabel sStatus = new CLabel(); - - public VPaymentFormCheck(int windowNo, GridTab mTab) { - super(windowNo, mTab); - dialog = new VPaymentFormDialog(this, windowNo); - init(); - } - - public void init() { - GridBagLayout sPanelLayout = new GridBagLayout(); - dialog.getPanel().setLayout(sPanelLayout); - sBankAccountLabel.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID")); - sAmountLabel.setText(Msg.getMsg(Env.getCtx(), "Amount")); - //sAmountField.setText(""); - sRoutingLabel.setText(Msg.translate(Env.getCtx(), "RoutingNo")); - sNumberLabel.setText(Msg.translate(Env.getCtx(), "AccountNo")); - sCheckLabel.setText(Msg.translate(Env.getCtx(), "CheckNo")); - sCheckField.setColumns(8); - sCurrencyLabel.setText(Msg.translate(Env.getCtx(), "C_Currency_ID")); - sNumberField.setPreferredSize(new Dimension(100, 21)); - sRoutingField.setPreferredSize(new Dimension(70, 21)); - sOnline.setText(Msg.getMsg(Env.getCtx(), "Online")); - sOnline.addActionListener(this); - dialog.getPanel().add(sBankAccountLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 0, 2, 0), 0, 0)); - dialog.getPanel().add(sBankAccountCombo, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0)); - dialog.getPanel().add(sCurrencyLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 0, 2, 0), 0, 0)); - dialog.getPanel().add(sCurrencyCombo, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0)); - dialog.getPanel().add(sAmountLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 0, 5, 0), 0, 0)); - dialog.getPanel().add(sAmountField, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 5, 5, 5), 0, 0)); - sAmountField.addFocusListener(this); - dialog.getPanel().add(sRoutingLabel, new GridBagConstraints(0, 3, 1, 2, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 2, 0), 0, 0)); - dialog.getPanel().add(sRoutingField, new GridBagConstraints(1, 3, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 2, 0), 0, 0)); - dialog.getPanel().add(sNumberLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 0, 2, 0), 0, 0)); - dialog.getPanel().add(sNumberField, new GridBagConstraints(1, 5, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 2, 0), 0, 0)); - dialog.getPanel().add(sCheckLabel, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 0, 2, 0), 0, 0)); - dialog.getPanel().add(sCheckField, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 5, 2, 0), 0, 0)); - dialog.getPanel().add(sOnline, new GridBagConstraints(3, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - dialog.getPanel().add(sStatus, new GridBagConstraints(0, 7, 3, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - } - - @Override - public void loadData() { - super.loadData(); - - sAmountField.setValue(m_Amount); - - if (m_C_Payment_ID != 0) - { - sRoutingField.setText(m_mPayment.getRoutingNo()); - sNumberField.setText(m_mPayment.getAccountNo()); - sCheckField.setText(m_mPayment.getCheckNo()); - sStatus.setText(m_mPayment.getR_PnRef()); - sAmountField.setValue(m_mPayment.getPayAmt()); - } - - // Is the currency an EMU currency? - Integer C_Currency_ID = Integer.valueOf(m_C_Currency_ID); - if (s_Currencies.containsKey(C_Currency_ID)) - { - Enumeration en = s_Currencies.keys(); - while (en.hasMoreElements()) - { - Object key = en.nextElement(); - sCurrencyCombo.addItem(s_Currencies.get(key)); - } - sCurrencyCombo.addActionListener(this); - sCurrencyCombo.setSelectedItem(s_Currencies.get(C_Currency_ID)); - } - else // No EMU Currency - { - sCurrencyLabel.setVisible(false); // Check - sCurrencyCombo.setVisible(false); - } - - ArrayList list = getBankAccountList(); - for (KeyNamePair pp : list) - sBankAccountCombo.addItem(pp); - - // Set Selection - if (selectedBankAccount != null) - sBankAccountCombo.setSelectedItem(selectedBankAccount); - - boolean exist = isBankAccountProcessorExist(m_C_Currency_ID, (BigDecimal) sAmountField.getValue()); - sOnline.setVisible(exist); - - if (exist) - updateOnlineButton(); - } - - public void actionPerformed(ActionEvent e) - { - if (e.getSource() == sCurrencyCombo) - { - int C_Currency_ID = 0; - KeyNamePair pp = (KeyNamePair)sCurrencyCombo.getSelectedItem(); - if (pp != null) - C_Currency_ID = pp.getKey(); - - BigDecimal amt = MConversionRate.convert(Env.getCtx(), - m_Amount, m_C_Currency_ID, C_Currency_ID, m_AD_Client_ID, m_AD_Org_ID); - sAmountField.setValue(amt); - - updateOnlineButton(); - } - else if (e.getSource() == sOnline) - processOnline(); - } - - @Override - public void focusGained(FocusEvent e) { - } - - @Override - public void focusLost(FocusEvent e) { - if (e.getSource() == sAmountField) - updateOnlineButton(); - } - - private void updateOnlineButton() - { - int C_Currency_ID = 0; - KeyNamePair pp = (KeyNamePair)sCurrencyCombo.getSelectedItem(); - if (pp != null) - C_Currency_ID = pp.getKey(); - - BigDecimal PayAmt = (BigDecimal) sAmountField.getValue(); - - if (C_Currency_ID > 0 && PayAmt != null) - { - MBankAccountProcessor bankAccountProcessor = getBankAccountProcessor(C_Currency_ID, PayAmt); - sOnline.setEnabled(bankAccountProcessor != null); - setBankAccountProcessor(bankAccountProcessor); - } - else - { - sOnline.setEnabled(false); - setBankAccountProcessor(null); - } - } - - @Override - public boolean checkMandatory() { - int C_BankAccount_ID = 0; - /*********************** - * Mandatory Data Check - */ - boolean dataOK = true; - KeyNamePair kp = (KeyNamePair)sBankAccountCombo.getSelectedItem(); - if (kp != null) - C_BankAccount_ID = kp.getKey(); - String error = MPaymentValidate.validateRoutingNo(sRoutingField.getText()); - if (error.length() != 0) - { - sRoutingField.setBackground(AdempierePLAF.getFieldBackground_Error()); - ADialog.error(getWindowNo(), dialog, error); - dataOK = false; - } - error = MPaymentValidate.validateAccountNo(sNumberField.getText()); - if (error.length() != 0) - { - sNumberField.setBackground(AdempierePLAF.getFieldBackground_Error()); - ADialog.error(getWindowNo(), dialog, error); - dataOK = false; - } - error = MPaymentValidate.validateCheckNo(sCheckField.getText()); - if (error.length() != 0) - { - sCheckField.setBackground(AdempierePLAF.getFieldBackground_Error()); - ADialog.error(getWindowNo(), dialog, error); - dataOK = false; - } - - // Check & Cash (Payment) must have a bank account - if (C_BankAccount_ID == 0) - { - ADialog.error(getWindowNo(), dialog, "FillMandatory", sBankAccountLabel.getText()); - dataOK = false; - } - - return dataOK; - } - - @Override - public boolean saveChangesInTrx(String trxName) { - int newC_BankAccount_ID = 0; - KeyNamePair kp = (KeyNamePair)sBankAccountCombo.getSelectedItem(); - if (kp != null) - newC_BankAccount_ID = kp.getKey(); - - boolean ok = save(newC_BankAccount_ID, sRoutingField.getText(), sNumberField.getText(), - sCheckField.getText(), (BigDecimal) sAmountField.getValue(), trxName); - if (!ok) - ADialog.error(getWindowNo(), dialog, "PaymentError", processMsg); - else if (processMsg != null) - ADialog.info(getWindowNo(), dialog, "PaymentCreated", m_mPayment.getDocumentNo()); - - return ok; - } - - @Override - public void showWindow() - { - dialog.setVisible(true); - } - - @Override - public void closeWindow() - { - dialog.dispose(); - } - - @Override - public Object getWindow() { - return dialog; - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormCreditCard.java b/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormCreditCard.java deleted file mode 100644 index acc8dcea2f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormCreditCard.java +++ /dev/null @@ -1,304 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2012 Elaine Tan * - * Copyright (C) 2012 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.math.BigDecimal; - -import org.adempiere.util.PaymentUtil; -import org.compiere.apps.ADialog; -import org.compiere.grid.ed.VNumber; -import org.compiere.model.GridTab; -import org.compiere.model.MBankAccountProcessor; -import org.compiere.model.MInvoice; -import org.compiere.swing.CButton; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CTextField; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.ValueNamePair; - -/** - * - * @author Elaine - * - */ -public class VPaymentFormCreditCard extends PaymentFormCreditCard implements ActionListener, FocusListener { - - private VPaymentFormDialog dialog; - - private CLabel kTypeLabel = new CLabel(); - private CComboBoxkTypeCombo = new CComboBox(); - private CLabel kNumberLabel = new CLabel(); - private CTextField kNumberField = new CTextField(); - private CLabel kNameLabel = new CLabel(); - private CTextField kNameField = new CTextField(); - private CLabel kExpLabel = new CLabel(); - private CTextField kExpField = new CTextField(); - private CLabel kAmountLabel = new CLabel(); - private VNumber kAmountField = new VNumber(); - private CLabel kApprovalLabel = new CLabel(); - private CTextField kApprovalField = new CTextField(); - private CButton kOnline = new CButton(); - private CLabel kStatus = new CLabel(); - - - public VPaymentFormCreditCard(int windowNo, GridTab mTab) { - super(windowNo, mTab); - dialog = new VPaymentFormDialog(this, windowNo); - init(); - } - - public void init() { - GridBagLayout kLayout = new GridBagLayout(); - dialog.getPanel().setLayout(kLayout); - kNumberField.setPreferredSize(new Dimension(160, 21)); - kNameField.setPreferredSize(new Dimension(160, 21)); - kExpField.setPreferredSize(new Dimension(40, 21)); - kApprovalField.setPreferredSize(new Dimension(120, 21)); - kTypeLabel.setText(Msg.translate(Env.getCtx(), "CreditCardType")); - kNumberLabel.setText(Msg.translate(Env.getCtx(), "CreditCardNumber")); - kNameLabel.setText(Msg.translate(Env.getCtx(),"Name")); - kExpLabel.setText(Msg.getMsg(Env.getCtx(), "Expires")); - kApprovalLabel.setText(Msg.translate(Env.getCtx(), "VoiceAuthCode")); - kAmountLabel.setText(Msg.getMsg(Env.getCtx(), "Amount")); - kOnline.setText(Msg.getMsg(Env.getCtx(), "Online")); - kOnline.addActionListener(this); - dialog.getPanel().add(kTypeLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 0, 2, 0), 0, 0)); - dialog.getPanel().add(kTypeCombo, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0)); - kTypeCombo.addActionListener(this); - dialog.getPanel().add(kNumberLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 0, 2, 0), 0, 0)); - dialog.getPanel().add(kNumberField, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(2, 5, 2, 5), 0, 0)); - dialog.getPanel().add(kNameLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 0, 2, 0), 0, 0)); - dialog.getPanel().add(kNameField, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(2, 5, 2, 5), 0, 0)); - dialog.getPanel().add(kExpLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 0, 2, 0), 0, 0)); - dialog.getPanel().add(kExpField, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0)); - dialog.getPanel().add(kAmountLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 0, 5, 0), 0, 0)); - dialog.getPanel().add(kAmountField, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 5, 5, 5), 0, 0)); - kAmountField.addFocusListener(this); - dialog.getPanel().add(kApprovalLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 0), 0, 0)); - dialog.getPanel().add(kApprovalField, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - dialog.getPanel().add(kStatus, new GridBagConstraints(0, 6, 2, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - dialog.getPanel().add(kOnline, new GridBagConstraints(2, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - } - - @Override - public void loadData() { - super.loadData(); - - kAmountField.setValue(m_Amount); - - if (m_C_Payment_ID != 0) - { - m_CCType = m_mPayment.getCreditCardType(); - kNumberField.setText(m_mPayment.getCreditCardNumber()); - kNameField.setText(m_mPayment.getA_Name()); - kExpField.setText(m_mPayment.getCreditCardExp(null)); - kApprovalField.setText(m_mPayment.getVoiceAuthCode()); - kStatus.setText(m_mPayment.getR_PnRef()); - kAmountField.setValue(m_mPayment.getPayAmt()); - - // if approved/paid, don't let it change - kTypeCombo.setReadWrite(!(m_mPayment.isApproved() && m_DocStatus.equals(MInvoice.DOCSTATUS_Completed))); - kNumberField.setReadWrite(!(m_mPayment.isApproved() && m_DocStatus.equals(MInvoice.DOCSTATUS_Completed))); - kNameField.setReadWrite(!(m_mPayment.isApproved() && m_DocStatus.equals(MInvoice.DOCSTATUS_Completed))); - kExpField.setReadWrite(!(m_mPayment.isApproved() && m_DocStatus.equals(MInvoice.DOCSTATUS_Completed))); - kApprovalField.setReadWrite(!(m_mPayment.isApproved() && m_DocStatus.equals(MInvoice.DOCSTATUS_Completed))); - kOnline.setReadWrite(!(m_mPayment.isApproved() && m_DocStatus.equals(MInvoice.DOCSTATUS_Completed))); - kAmountField.setReadWrite(!(m_mPayment.isApproved() && m_DocStatus.equals(MInvoice.DOCSTATUS_Completed))); - } - else if (m_mPaymentTransaction != null) - { - m_CCType = m_mPaymentTransaction.getCreditCardType(); - kNumberField.setText(m_mPaymentTransaction.getCreditCardNumber()); - kNameField.setText(m_mPaymentTransaction.getA_Name()); - kExpField.setText(PaymentUtil.getCreditCardExp(m_mPaymentTransaction.getCreditCardExpMM(), m_mPaymentTransaction.getCreditCardExpYY(), null)); - kApprovalField.setText(m_mPaymentTransaction.getVoiceAuthCode()); - kStatus.setText(m_mPaymentTransaction.getR_PnRef()); - kAmountField.setValue(m_mPaymentTransaction.getPayAmt()); - - // if approved/paid, don't let it change - kTypeCombo.setReadWrite(!(m_mPaymentTransaction.isApproved() && m_DocStatus.equals(MInvoice.DOCSTATUS_Completed))); - kNumberField.setReadWrite(!(m_mPaymentTransaction.isApproved() && m_DocStatus.equals(MInvoice.DOCSTATUS_Completed))); - kNameField.setReadWrite(!(m_mPaymentTransaction.isApproved() && m_DocStatus.equals(MInvoice.DOCSTATUS_Completed))); - kExpField.setReadWrite(!(m_mPaymentTransaction.isApproved() && m_DocStatus.equals(MInvoice.DOCSTATUS_Completed))); - kApprovalField.setReadWrite(!(m_mPaymentTransaction.isApproved() && m_DocStatus.equals(MInvoice.DOCSTATUS_Completed))); - kOnline.setReadWrite(!(m_mPaymentTransaction.isApproved() && m_DocStatus.equals(MInvoice.DOCSTATUS_Completed))); - kAmountField.setReadWrite(!(m_mPaymentTransaction.isApproved() && m_DocStatus.equals(MInvoice.DOCSTATUS_Completed))); - } - - /** - * Load Credit Cards - */ - kTypeCombo.removeAllItems(); - - ValueNamePair[] ccs = getCreditCardList(); - for (int i = 0; i < ccs.length; i++) - kTypeCombo.addItem(ccs[i]); - - // Set Selection - if (selectedCreditCard != null) - kTypeCombo.setSelectedItem(selectedCreditCard); - - if (m_mPayment.isApproved() && m_DocStatus.equals(MInvoice.DOCSTATUS_Completed)) - { - kOnline.setVisible(m_mPayment.isOnline()); - kOnline.setEnabled(false); - - MBankAccountProcessor bankAccountProcessor = new MBankAccountProcessor(m_mPayment.getCtx(), m_mPayment.getC_BankAccount_ID(), m_mPayment.getC_PaymentProcessor_ID(), null); - setBankAccountProcessor(bankAccountProcessor); - } - else if (m_mPaymentTransaction != null) - { - kOnline.setVisible(m_mPaymentTransaction.isOnline()); - kOnline.setEnabled(false); - - MBankAccountProcessor bankAccountProcessor = new MBankAccountProcessor(m_mPaymentTransaction.getCtx(), m_mPaymentTransaction.getC_BankAccount_ID(), m_mPaymentTransaction.getC_PaymentProcessor_ID(), null); - setBankAccountProcessor(bankAccountProcessor); - } - else - { - boolean exist = isBankAccountProcessorExist("", (BigDecimal) kAmountField.getValue()); - kOnline.setVisible(exist); - - if (exist) - updateOnlineButton(); - } - } - - public void actionPerformed(ActionEvent e) - { - if (e.getSource() == kOnline) - processOnline(); - else if (e.getSource() == kTypeCombo) - updateOnlineButton(); - } - - @Override - public void focusGained(FocusEvent e) { - } - - @Override - public void focusLost(FocusEvent e) { - if (e.getSource() == kAmountField) - updateOnlineButton(); - } - - private void updateOnlineButton() - { - String CCType = null; - ValueNamePair vp = (ValueNamePair)kTypeCombo.getSelectedItem(); - if (vp != null) - CCType = vp.getValue(); - - BigDecimal PayAmt = (BigDecimal) kAmountField.getValue(); - - if (CCType != null && PayAmt != null) - { - MBankAccountProcessor bankAccountProcessor = getBankAccountProcessor(CCType, PayAmt); - kOnline.setEnabled(bankAccountProcessor != null); - setBankAccountProcessor(bankAccountProcessor); - - if (bankAccountProcessor != null) - kApprovalField.setReadWrite(bankAccountProcessor.isRequireVV()); - else - kApprovalField.setReadWrite(true); - } - else - { - kOnline.setEnabled(false); - setBankAccountProcessor(null); - } - } - - @Override - public boolean checkMandatory() { - return true; - } - - @Override - public boolean saveChangesInTrx(String trxName) { - String newCCType = m_CCType; - ValueNamePair vp = (ValueNamePair)kTypeCombo.getSelectedItem(); - if (vp != null) - newCCType = vp.getValue(); - - boolean ok = save(newCCType, kNumberField.getText(), kExpField.getText(), (BigDecimal) kAmountField.getValue(), trxName); - if(!ok) - ADialog.error(getWindowNo(), dialog, "PaymentError", processMsg); - else if (processMsg != null) - ADialog.info(getWindowNo(), dialog, "PaymentCreated", processMsg); - - return ok; - - } - - /************************************************************************** - * Process Online (sales only) - if approved - exit - */ - public void processOnline() - { - ValueNamePair vp = (ValueNamePair)kTypeCombo.getSelectedItem(); - String CCType = vp.getValue(); - - boolean ok = processOnline(CCType, kNumberField.getText(), kApprovalField.getText(), kExpField.getText()); - if (!ok) - ADialog.error(getWindowNo(), dialog, "PaymentError", processMsg); - else - { - loadData(); - if (processMsg != null) - ADialog.info(getWindowNo(), dialog, "PaymentProcessed", processMsg); - } - } // online - - @Override - public void showWindow() - { - dialog.setVisible(true); - } - - @Override - public void closeWindow() - { - dialog.dispose(); - } - - @Override - public Object getWindow() { - return dialog; - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormDialog.java deleted file mode 100644 index bcbc37b4c9..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormDialog.java +++ /dev/null @@ -1,115 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2012 Elaine Tan * - * Copyright (C) 2012 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.BorderFactory; - -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * - * @author Elaine - * - */ -public class VPaymentFormDialog extends CDialog implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 6249016140530436885L; - private PaymentForm paymentForm; -// private int windowNo; - - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel centerPanel = new CPanel(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - - private boolean initOK = false; - - public VPaymentFormDialog(PaymentForm paymentForm, int windowNo) - { - super(AEnv.getWindow(windowNo), Msg.getMsg(Env.getCtx(), "Payment"), true); - - this.paymentForm = paymentForm; -// this.windowNo = windowNo; - - try { - jbInit(); - initOK = dynInit(); // Null Pointer if order/invoice not saved yet - } catch (Exception ex) { - ADialog.error(windowNo, this, ex.getMessage()); - initOK = false; - } - - setPreferredSize(new Dimension(500, 400)); - pack(); - } - - private void jbInit() throws Exception - { - getContentPane().add(mainPanel); - mainPanel.setLayout(mainLayout); - centerPanel.setBorder(BorderFactory.createRaisedBevelBorder()); - mainPanel.add(centerPanel, BorderLayout.CENTER); - mainPanel.add(confirmPanel, BorderLayout.SOUTH); - confirmPanel.addActionListener(this); - } - - private boolean dynInit() throws Exception - { - boolean isInitOK = paymentForm.dynInit(); - centerPanel.setVisible(!paymentForm.isOnlyRule()); - return isInitOK; - } - - public CPanel getPanel() { - return centerPanel; - } - - /************************************************************************** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - // Finish - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - if (paymentForm.checkMandatory()) - { - paymentForm.saveChanges(); // cannot recover - dispose (); - } - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - dispose(); - } - - public boolean isInitOK() - { - return initOK; - } -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormDirect.java b/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormDirect.java deleted file mode 100644 index 7824e54231..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormDirect.java +++ /dev/null @@ -1,159 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2012 Elaine Tan * - * Copyright (C) 2012 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.logging.Level; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ADialog; -import org.compiere.model.GridTab; -import org.compiere.model.MBankAccountProcessor; -import org.compiere.swing.CButton; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CTextField; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -/** - * - * @author Elaine - * - */ -public abstract class VPaymentFormDirect extends PaymentFormDirect implements ActionListener { - - private VPaymentFormDialog dialog; - - private CLabel tAccountLabel = new CLabel(); - private CComboBoxtAccountCombo = new CComboBox(); - private CButton tOnline = new CButton(); - private CTextField tRoutingField = new CTextField(); - private CTextField tNumberField = new CTextField(); - private CLabel tStatus = new CLabel(); - private CLabel tRoutingText = new CLabel(); - private CLabel tNumberText = new CLabel(); - - public VPaymentFormDirect(int windowNo, GridTab mTab, boolean isDebit) { - super(windowNo, mTab, isDebit); - dialog = new VPaymentFormDialog(this, windowNo); - init(); - } - - public void init() { - GridBagLayout tPanelLayout = new GridBagLayout(); - dialog.getPanel().setLayout(tPanelLayout); - tAccountLabel.setText(Msg.translate(Env.getCtx(), "C_BP_BankAccount_ID")); - tRoutingField.setColumns(8); - tNumberField.setColumns(10); - tRoutingText.setText(Msg.translate(Env.getCtx(), "RoutingNo")); - tNumberText.setText(Msg.translate(Env.getCtx(), "AccountNo")); - tOnline.setText(Msg.getMsg(Env.getCtx(), "Online")); - tOnline.addActionListener(this); - dialog.getPanel().add(tAccountLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 0), 0, 0)); - dialog.getPanel().add(tAccountCombo, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - dialog.getPanel().add(tRoutingField, new GridBagConstraints(1, 1, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - dialog.getPanel().add(tNumberField, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - dialog.getPanel().add(tStatus, new GridBagConstraints(0, 3, 2, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - dialog.getPanel().add(tRoutingText, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); - dialog.getPanel().add(tNumberText, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); - dialog.getPanel().add(tOnline, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - } - - @Override - public void loadData() { - if (m_C_Payment_ID != 0) - { - tRoutingField.setText(m_mPayment.getRoutingNo()); - tNumberField.setText(m_mPayment.getAccountNo()); - tStatus.setText(m_mPayment.getR_PnRef()); - } - - ArrayList list = getBPBankAccountList(); - for (KeyNamePair pp : list) - tAccountCombo.addItem(pp); - - boolean exist = isBankAccountProcessorExist(); - tOnline.setVisible(exist); - - MBankAccountProcessor bankAccountProcessor = getBankAccountProcessor(); - setBankAccountProcessor(bankAccountProcessor); - } - - public void actionPerformed(ActionEvent e) - { - if (e.getSource() == tOnline) - processOnline(); - } - - @Override - public boolean checkMandatory() { - /*********************** - * Mandatory Data Check - */ - boolean dataOK = true; - KeyNamePair bpba = (KeyNamePair)tAccountCombo.getSelectedItem(); - if (bpba == null) - { - tAccountCombo.setBackground(AdempierePLAF.getFieldBackground_Error()); - ADialog.error(getWindowNo(), dialog, "PaymentBPBankNotFound"); - dataOK = false; - } - // - if (log.isLoggable(Level.CONFIG)) log.config("OK=" + dataOK); - return dataOK; - } - - @Override - public boolean saveChangesInTrx(String trxName) { - boolean ok = save(0, tRoutingField.getText(), tNumberField.getText(), trxName); - if (!ok) - ADialog.error(getWindowNo(), dialog, "PaymentError", processMsg); - else if (processMsg != null) - ADialog.info(getWindowNo(), dialog, "PaymentCreated", m_mPayment.getDocumentNo()); - - return ok; - } - - @Override - public void showWindow() - { - dialog.setVisible(true); - } - - @Override - public void closeWindow() - { - dialog.dispose(); - } - - @Override - public Object getWindow() { - return dialog; - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormDirectDebit.java b/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormDirectDebit.java deleted file mode 100644 index 0b537ad20f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormDirectDebit.java +++ /dev/null @@ -1,30 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2012 Elaine Tan * - * Copyright (C) 2012 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import org.compiere.model.GridTab; - - -/** - * - * @author Elaine - * - */ -public class VPaymentFormDirectDebit extends VPaymentFormDirect { - - public VPaymentFormDirectDebit(int windowNo, GridTab mTab) { - super(windowNo, mTab, true); - } - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormDirectDeposit.java b/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormDirectDeposit.java deleted file mode 100644 index 83d2e145e1..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormDirectDeposit.java +++ /dev/null @@ -1,29 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2012 Elaine Tan * - * Copyright (C) 2012 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import org.compiere.model.GridTab; - - -/** - * - * @author Elaine - * - */ -public class VPaymentFormDirectDeposit extends VPaymentFormDirect { - - public VPaymentFormDirectDeposit(int windowNo, GridTab mTab) { - super(windowNo, mTab, false); - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormFactory.java b/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormFactory.java deleted file mode 100644 index 2c0be9a692..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormFactory.java +++ /dev/null @@ -1,39 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2012 Elaine Tan * - * Copyright (C) 2012 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import java.util.List; - -import org.adempiere.base.Service; -import org.compiere.model.GridTab; - -/** - * - * @author Elaine - * - */ -public class VPaymentFormFactory { - - public static IPaymentForm create(int windowNo, GridTab mTab, String paymentRule) - { - IPaymentForm paymentForm = null; - List factories = Service.locator().list(IPaymentFormFactory.class).getServices(); - for (IPaymentFormFactory factory : factories) { - paymentForm = factory.create(windowNo, mTab, paymentRule); - if (paymentForm != null) - break; - } - return paymentForm; - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormMixedPOS.java b/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormMixedPOS.java deleted file mode 100644 index 7ad7c2a286..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormMixedPOS.java +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2012 Elaine Tan * - * Copyright (C) 2012 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import org.compiere.model.GridTab; - -/** - * - * @author Elaine - * - */ -public class VPaymentFormMixedPOS extends PaymentFormMixedPOS { - private VPaymentFormDialog dialog; - - public VPaymentFormMixedPOS(int windowNo, GridTab mTab) { - super(windowNo, mTab); - dialog = new VPaymentFormDialog(this, windowNo); - } - - @Override - public void loadData() { - } - - @Override - public boolean checkMandatory() { - return true; - } - - @Override - public boolean saveChangesInTrx(String trxName) { - return true; - } - - @Override - public void showWindow() - { - dialog.setVisible(true); - } - - @Override - public void closeWindow() - { - dialog.dispose(); - } - - @Override - public Object getWindow() { - return dialog; - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormOnCredit.java b/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormOnCredit.java deleted file mode 100644 index 6fdf0cbcfb..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormOnCredit.java +++ /dev/null @@ -1,100 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2012 Elaine Tan * - * Copyright (C) 2012 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid; - -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.util.ArrayList; - -import org.compiere.model.GridTab; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CLabel; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -/** - * - * @author Elaine - * - */ -public class VPaymentFormOnCredit extends PaymentFormOnCredit { - - private VPaymentFormDialog dialog; - - private CLabel pTermLabel = new CLabel(); - private CComboBoxpTermCombo = new CComboBox(); - - public VPaymentFormOnCredit(int windowNo, GridTab mTab) { - super(windowNo, mTab); - dialog = new VPaymentFormDialog(this, windowNo); - init(); - } - - public void init() { - GridBagLayout pPanelLayout = new GridBagLayout(); - dialog.getPanel().setLayout(pPanelLayout); - pTermLabel.setText(Msg.translate(Env.getCtx(), "C_PaymentTerm_ID")); - dialog.getPanel().add(pTermLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 0), 0, 0)); - dialog.getPanel().add(pTermCombo, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0)); - } - - @Override - public void loadData() { - super.loadData(); - - ArrayList list = getPaymentTermList(); - for (KeyNamePair pp : list) - pTermCombo.addItem(pp); - - // Set Selection - if (selectedPaymentTerm != null) - pTermCombo.setSelectedItem(selectedPaymentTerm); - } - - @Override - public boolean checkMandatory() { - return true; - } - - @Override - public boolean saveChangesInTrx(String trxName) { - int newC_PaymentTerm_ID = 0; - KeyNamePair kp = (KeyNamePair)pTermCombo.getSelectedItem(); - if (kp != null) - newC_PaymentTerm_ID = kp.getKey(); - - return save(newC_PaymentTerm_ID); - } - - @Override - public void showWindow() - { - dialog.setVisible(true); - } - - @Override - public void closeWindow() - { - dialog.dispose(); - } - - @Override - public Object getWindow() { - return dialog; - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VSortTab.java b/org.adempiere.ui.swing/src/org/compiere/grid/VSortTab.java deleted file mode 100644 index b5702475b6..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VSortTab.java +++ /dev/null @@ -1,921 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid; - -import java.awt.AWTEvent; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Image; -import java.awt.Insets; -import java.awt.Point; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.awt.event.MouseMotionAdapter; -import java.awt.event.MouseMotionListener; -import java.net.URL; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Arrays; -import java.util.List; -import java.util.logging.Level; - -import javax.swing.DefaultListCellRenderer; -import javax.swing.DefaultListModel; -import javax.swing.JList; -import javax.swing.JScrollPane; -import javax.swing.ListSelectionModel; -import javax.swing.SwingUtilities; -import javax.swing.event.MouseInputAdapter; -import javax.swing.event.MouseInputListener; - -import org.compiere.apps.ADialog; -import org.compiere.apps.APanel; -import org.compiere.model.MRole; -import org.compiere.swing.CButton; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.NamePair; - -/** - * Tab to maintain Order/Sequence - * - * @author Jorg Janke - * @version $Id: VSortTab.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - * FR [ 1779410 ] VSortTab: display ID for not visible columns - * @author victor.perez@e-evolution.com, e-Evolution - * FR [ 2826406 ] The Tab Sort without parent column - *
  • https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2826406&group_id=176962 - */ -public class VSortTab extends CPanel implements APanelTab -{ - /** - * - */ - private static final long serialVersionUID = -2133358506913610514L; - - /** - * Tab Order Constructor - * - * @param WindowNo Window No - * @param AD_Table_ID Table No - * @param AD_ColumnSortOrder_ID Sort Column - * @param AD_ColumnSortYesNo_ID YesNo Column - */ - public VSortTab(int WindowNo, int AD_Table_ID, int AD_ColumnSortOrder_ID, int AD_ColumnSortYesNo_ID) - { - if (log.isLoggable(Level.CONFIG)) log.config("SortOrder=" + AD_ColumnSortOrder_ID + ", SortYesNo=" + AD_ColumnSortYesNo_ID); - m_WindowNo = WindowNo; - - try - { - jbInit(); - dynInit (AD_Table_ID, AD_ColumnSortOrder_ID, AD_ColumnSortYesNo_ID); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - } - } // VSortTab - - /** Logger */ - static CLogger log = CLogger.getCLogger(VSortTab.class); - private int m_WindowNo; - private int m_AD_Table_ID; - private String m_TableName = null; - private String m_ColumnSortName= null; - private String m_ColumnYesNoName = null; - private String m_KeyColumnName = null; - private String m_IdentifierSql = null; - private boolean m_IdentifierTranslated = false; - - private String m_ParentColumnName = null; - private APanel m_aPanel = null; - - // UI variables - private GridBagLayout mainLayout = new GridBagLayout(); - private CLabel noLabel = new CLabel(); - private CLabel yesLabel = new CLabel(); - private CButton bAdd = new CButton(); - private CButton bRemove = new CButton(); - private CButton bUp = new CButton(); - private CButton bDown = new CButton(); - // - DefaultListModel noModel = new DefaultListModel() - { - /** - * - */ - private static final long serialVersionUID = 2171680655634744697L; - @Override - public void addElement(Object obj) { - Object[] elements = toArray(); - Arrays.sort(elements); - int index = Arrays.binarySearch(elements, obj); - if (index < 0) - index = -1 * index - 1; - if (index > elements.length) - super.addElement(obj); - else - super.add(index, obj); - } - @Override - public void add(int index, Object obj) { - addElement(obj); - } - }; - DefaultListModel yesModel = new DefaultListModel(); - DefaultListCellRenderer listRenderer = new DefaultListCellRenderer() { - /** - * - */ - private static final long serialVersionUID = -101524191283634472L; - - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - if (value != null && value instanceof ListItem && !((ListItem)value).isUpdateable()) { - Font f = c.getFont(); - c.setFont(f.deriveFont(f.getStyle() | Font.ITALIC)); - c.setFocusable(false); - } - return c; - } - - }; - JList noList = new JList(noModel); - JList yesList = new JList(yesModel); - private JScrollPane noPane = new JScrollPane(noList); - private JScrollPane yesPane = new JScrollPane(yesList); - - /** - * Dyanamic Init - * @param AD_Table_ID Table No - * @param AD_ColumnSortOrder_ID Sort Column - * @param AD_ColumnSortYesNo_ID YesNo Column - */ - private void dynInit (int AD_Table_ID, int AD_ColumnSortOrder_ID, int AD_ColumnSortYesNo_ID) - { - m_AD_Table_ID = AD_Table_ID; - int identifiersCount = 0; - StringBuilder identifierSql = new StringBuilder(); - String sql = "SELECT t.TableName, c.AD_Column_ID, c.ColumnName, e.Name," // 1..4 - + "c.IsParent, c.IsKey, c.IsIdentifier, c.IsTranslated " // 4..8 - + "FROM AD_Table t, AD_Column c, AD_Element e " - + "WHERE t.AD_Table_ID=?" // #1 - + " AND t.AD_Table_ID=c.AD_Table_ID" - + " AND (c.AD_Column_ID=? OR AD_Column_ID=?" // #2..3 - + " OR c.IsParent='Y' OR c.IsKey='Y' OR c.IsIdentifier='Y')" - + " AND c.AD_Element_ID=e.AD_Element_ID"; - boolean trl = !Env.isBaseLanguage(Env.getCtx(), "AD_Element"); - if (trl) - sql = "SELECT t.TableName, c.AD_Column_ID, c.ColumnName, et.Name," // 1..4 - + "c.IsParent, c.IsKey, c.IsIdentifier, c.IsTranslated " // 4..8 - + "FROM AD_Table t, AD_Column c, AD_Element_Trl et " - + "WHERE t.AD_Table_ID=?" // #1 - + " AND t.AD_Table_ID=c.AD_Table_ID" - + " AND (c.AD_Column_ID=? OR AD_Column_ID=?" // #2..3 - + " OR c.IsParent='Y' OR c.IsKey='Y' OR c.IsIdentifier='Y')" - + " AND c.AD_Element_ID=et.AD_Element_ID" - + " AND et.AD_Language=?"; // #4 - sql += " ORDER BY c.SeqNo"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, AD_Table_ID); - pstmt.setInt(2, AD_ColumnSortOrder_ID); - pstmt.setInt(3, AD_ColumnSortYesNo_ID); - if (trl) - pstmt.setString(4, Env.getAD_Language(Env.getCtx())); - rs = pstmt.executeQuery(); - while (rs.next()) - { - m_TableName = rs.getString(1); - // Sort Column - if (AD_ColumnSortOrder_ID == rs.getInt(2)) - { - if (log.isLoggable(Level.FINE)) log.fine("Sort=" + rs.getString(1) + "." + rs.getString(3)); - m_ColumnSortName = rs.getString(3); - yesLabel.setText(rs.getString(4)); - } - // Optional YesNo - else if (AD_ColumnSortYesNo_ID == rs.getInt(2)) - { - if (log.isLoggable(Level.FINE)) log.fine("YesNo=" + rs.getString(1) + "." + rs.getString(3)); - m_ColumnYesNoName = rs.getString(3); - } - // Parent2 - else if (rs.getString(5).equals("Y")) - { - if (log.isLoggable(Level.FINE)) log.fine("Parent=" + rs.getString(1) + "." + rs.getString(3)); - m_ParentColumnName = rs.getString(3); - } - // KeyColumn - else if (rs.getString(6).equals("Y")) - { - if (log.isLoggable(Level.FINE)) log.fine("Key=" + rs.getString(1) + "." + rs.getString(3)); - m_KeyColumnName = rs.getString(3); - } - // Identifier - else if (rs.getString(7).equals("Y")) - { - if (log.isLoggable(Level.FINE)) log.fine("Identifier=" + rs.getString(1) + "." + rs.getString(3)); - boolean isTranslated = trl && "Y".equals(rs.getString(8)); - if (identifierSql.length() > 0) - identifierSql.append(","); - identifierSql.append(isTranslated ? "tt." : "t.").append(rs.getString(3)); - identifiersCount++; -// m_IdentifierColumnName = rs.getString(3); - if (isTranslated) - m_IdentifierTranslated = true; - } - else - if (log.isLoggable(Level.FINE)) log.fine("??NotUsed??=" + rs.getString(1) + "." + rs.getString(3)); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql.toString(), e); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - // - if (identifiersCount == 0) - m_IdentifierSql = "NULL"; - else if (identifiersCount == 1) - m_IdentifierSql = identifierSql.toString(); - else - m_IdentifierSql = identifierSql.insert(0, "COALESCE(").append(")").toString(); - // - noLabel.setText(Msg.getMsg(Env.getCtx(), "Available")); - log.fine(m_ColumnSortName); - } // dynInit - - /** - * Static Layout - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setLayout(mainLayout); - // - noLabel.setText("No"); - yesLabel.setText("Yes"); - - for (MouseMotionListener mml : noList.getMouseMotionListeners()) - noList.removeMouseMotionListener(mml); - - for (MouseMotionListener mml : yesList.getMouseMotionListeners()) - yesList.removeMouseMotionListener(mml); - - MouseListener mouseListener = new MouseAdapter() - { - public void mouseClicked(MouseEvent me) - { - if (me.getClickCount() > 1) - { - JList list = (JList)me.getComponent(); - Point p = me.getPoint(); - int index = list.locationToIndex(p); - if (index > -1 && list.getCellBounds(index, index).contains(p)) - migrateValueAcrossLists(me); - } - } - }; - yesList.addMouseListener(mouseListener); - noList.addMouseListener(mouseListener); - // - yesList.setCellRenderer(listRenderer); - noList.setCellRenderer(listRenderer); - - ActionListener actionListener = new ActionListener() - { - public void actionPerformed(ActionEvent ae) - { - migrateValueAcrossLists(ae); - } - }; - - bAdd.setIcon(Env.getImageIcon("Detail24.gif")); - bAdd.setMargin(new Insets(2, 2, 2, 2)); - bAdd.addActionListener(actionListener); - - bRemove.setIcon(Env.getImageIcon("Parent24.gif")); - bRemove.setMargin(new Insets(2, 2, 2, 2)); - bRemove.addActionListener(actionListener); - - MouseInputListener crossListMouseListener = new DragListener(); - yesList.addMouseListener(crossListMouseListener); - yesList.addMouseMotionListener(crossListMouseListener); - noList.addMouseListener(crossListMouseListener); - noList.addMouseMotionListener(crossListMouseListener); - - actionListener = new ActionListener() - { - public void actionPerformed(ActionEvent ae) - { - migrateValueWithinYesList(ae); - } - }; - - bUp.setIcon(Env.getImageIcon("Previous24.gif")); - bUp.setMargin(new Insets(2, 2, 2, 2)); - bUp.addActionListener(actionListener); - - bDown.setIcon(Env.getImageIcon("Next24.gif")); - bDown.setMargin(new Insets(2, 2, 2, 2)); - bDown.addActionListener(actionListener); - - MouseMotionListener yesListMouseMotionListener = new MouseMotionAdapter() - { - public void mouseDragged(MouseEvent me) - { - JList list = (JList)me.getComponent(); - Point p = me.getPoint(); - int index = list.locationToIndex(p); - if (index > -1 && list.getCellBounds(index, index).contains(p)) - migrateValueWithinYesList(me); - } - }; - yesList.addMouseMotionListener(yesListMouseMotionListener); - - yesPane.setPreferredSize(new Dimension(200, 300)); - yesList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); - - noPane.setPreferredSize(new Dimension(200, 300)); - noList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); - - this.add(noLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); - this.add(yesLabel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); - this.add(bDown, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(4, 4, 4, 4), 0, 0)); - this.add(noPane, new GridBagConstraints(0, 1, 1, 3, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(4, 4, 4, 4), 0, 0)); - this.add(yesPane, new GridBagConstraints(2, 1, 1, 3, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(4, 4, 4, 4), 0, 0)); - this.add(bUp, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(4, 4, 4, 4), 0, 0)); - this.add(bAdd, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(4, 4, 4, 4), 0, 0)); - this.add(bRemove, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(4, 4, 4, 4), 0, 0)); - } // jbInit - - /* (non-Javadoc) - * @see org.compiere.grid.APanelTab#loadData() - */ - public void loadData() - { - yesModel.removeAllElements(); - noModel.removeAllElements(); - - boolean isReadWrite = true; - // SELECT t.AD_Field_ID,t.Name,t.SeqNo,t.IsDisplayed FROM AD_Field t WHERE t.AD_Tab_ID=? ORDER BY 4 DESC,3,2 - // SELECT t.AD_PrintFormatItem_ID,t.Name,t.SeqNo,t.IsPrinted FROM AD_PrintFormatItem t WHERE t.AD_PrintFormat_ID=? ORDER BY 4 DESC,3,2 - // SELECT t.AD_PrintFormatItem_ID,t.Name,t.SortNo,t.IsOrderBy FROM AD_PrintFormatItem t WHERE t.AD_PrintFormat_ID=? ORDER BY 4 DESC,3,2 - StringBuilder sql = new StringBuilder(); - // Columns - sql.append("SELECT t.").append(m_KeyColumnName) // 1 - .append(",").append(m_IdentifierSql) // 2 - .append(",t.").append(m_ColumnSortName) // 3 - .append(", t.AD_Client_ID, t.AD_Org_ID"); // 4, 5 - if (m_ColumnYesNoName != null) - sql.append(",t.").append(m_ColumnYesNoName); // 6 - // Tables - sql.append(" FROM ").append(m_TableName).append( " t"); - if (m_IdentifierTranslated) - sql.append(", ").append(m_TableName).append("_Trl tt"); - // Where - //FR [ 2826406 ] - if(m_ParentColumnName != null) - { - sql.append(" WHERE t.").append(m_ParentColumnName).append("=?"); - } - else - { - sql.append(" WHERE 1=?"); - } - - int reportView_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "AD_ReportView_ID"); - if (reportView_ID > 0) - sql.append(" AND (t.AD_Column_ID IN (SELECT AD_Column_ID FROM AD_ReportView_Column WHERE AD_ReportView_ID=") - .append(reportView_ID).append(" AND IsActive='Y')") - .append(" OR ((SELECT COUNT(*) FROM AD_ReportView_Column WHERE AD_ReportView_ID=").append(reportView_ID).append(" AND IsActive='Y') = 0))"); - - if (m_IdentifierTranslated) - sql.append(" AND t.").append(m_KeyColumnName).append("=tt.").append(m_KeyColumnName) - .append(" AND tt.AD_Language=?"); - // Order - sql.append(" ORDER BY "); - if (m_ColumnYesNoName != null) - sql.append("6 DESC,"); // t.IsDisplayed DESC - sql.append("3,2"); // t.SeqNo, tt.Name - //FR [ 2826406 ] - int ID = 0; - if(m_ParentColumnName != null) - { - ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, m_ParentColumnName); - if (log.isLoggable(Level.FINE)) log.fine(sql.toString() + " - ID=" + ID); - } - else - { - ID = 1; - } - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql.toString(), null); - pstmt.setInt(1, ID); - - if (m_IdentifierTranslated) - pstmt.setString(2, Env.getAD_Language(Env.getCtx())); - - rs = pstmt.executeQuery(); - while (rs.next()) - { - int key = rs.getInt(1); - String name = rs.getString(2); - int seq = rs.getInt(3); - boolean isYes = seq != 0; - int AD_Client_ID = rs.getInt(4); - int AD_Org_ID = rs.getInt(5); - if (m_ColumnYesNoName != null) - isYes = rs.getString(6).equals("Y"); - - // - ListItem pp = new ListItem(key, name, seq, isYes, AD_Client_ID, AD_Org_ID); - if (isYes) - yesModel.addElement(pp); - else - noModel.addElement(pp); - // If the one item from "Yes" list is readonly make entire tab readonly - if (isYes && !pp.isUpdateable()) { - isReadWrite = false; - } - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql.toString(), e); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - - setIsChanged(false); - bAdd.setEnabled(isReadWrite); - bRemove.setEnabled(isReadWrite); - bUp.setEnabled(isReadWrite); - bDown.setEnabled(isReadWrite); - yesList.setEnabled(isReadWrite); - noList.setEnabled(isReadWrite); - } // loadData - - /** - * Set tab change status. - * @param value - */ - private void setIsChanged(boolean value) { - if (m_aPanel != null) { - m_aPanel.aSave.setEnabled(value); - m_aPanel.aIgnore.setEnabled(value); - } - } - - /** - * @param event - */ - void migrateValueAcrossLists (AWTEvent event) - { - Object source = event.getSource(); - List selObjects = (source == bAdd || source == noList) ? - noList.getSelectedValuesList() : yesList.getSelectedValuesList(); - for (int i = 0; i < selObjects.size(); i++) - { - ListItem selObject = (ListItem)selObjects.get(i); - if (selObject == null || !selObject.isUpdateable()) - continue; - - DefaultListModel lmFrom = (source == bAdd || source == noList) ? - noModel : yesModel; - DefaultListModel lmTo = (lmFrom == yesModel) ? noModel : yesModel; - lmFrom.removeElement(selObject); - lmTo.addElement(selObject); - - JList list = (source == bAdd || source == noList) ? - yesList : noList; - list.setSelectedValue(selObject, true); - - // Enable explicit Save - setIsChanged(true); - } - } // migrateValueAcrossLists - - /** - * Move within Yes List - * @param event event - */ - void migrateValueWithinYesList (AWTEvent event) - { - List selObjects = yesList.getSelectedValuesList(); - if (selObjects == null) - return; - int length = selObjects.size(); - if (length == 0) - return; -// Object selObject = selObjects[0]; -// if (selObject == null) -// return; - // - int[] indices = yesList.getSelectedIndices(); - // - boolean change = false; - // - Object source = event.getSource(); - if (source == bUp) - { - for (int i = 0; i < length; i++) { - ListItem selObject = (ListItem)selObjects.get(i); - int index = indices[i]; - if (index == 0) - break; - ListItem newObject = (ListItem)yesModel.getElementAt(index - 1); - if (!selObject.isUpdateable() || !newObject.isUpdateable()) - break; - yesModel.setElementAt(newObject, index); - yesModel.setElementAt(selObject, index - 1); - indices[i] = index - 1; - change = true; - } - } // up - - else if (source == bDown) - { - for (int i = length - 1; i >= 0; i--) { - ListItem selObject = (ListItem)selObjects.get(i); - int index = indices[i]; - if (index >= yesModel.size () - 1) - break; - ListItem newObject = (ListItem)yesModel.getElementAt(index + 1); - if (!selObject.isUpdateable() || !newObject.isUpdateable()) - break; - yesModel.setElementAt(newObject, index); - yesModel.setElementAt(selObject, index + 1); - yesList.setSelectedIndex(index + 1); - indices[i] = index + 1; - change = true; - } - } // down - - else if (source == yesList) - { - // see org.compiere.grid.VSortTab.DragListener#mouseReleased(MouseEvent) - } - else - log.severe("Unknown source: " + source); - // - if (change) { - yesList.setSelectedIndices(indices); - setIsChanged(true); - } - } // migrateValueWithinYesList - - /* (non-Javadoc) - * @see org.compiere.grid.APanelTab#registerAPanel(APanel) - */ - public void registerAPanel (APanel panel) - { - m_aPanel = panel; - } // registerAPanel - - - /** (non-Javadoc) - * @see org.compiere.grid.APanelTab#saveData() - */ - public void saveData() - { - if (!m_aPanel.aSave.isEnabled()) - return; - log.fine(""); - boolean ok = true; - StringBuilder info = new StringBuilder(); - StringBuffer sql = null; - // noList - Set SortColumn to null and optional YesNo Column to 'N' - for (int i = 0; i < noModel.getSize(); i++) - { - ListItem pp = (ListItem)noModel.getElementAt(i); - if (!pp.isUpdateable()) - continue; - if(pp.getSortNo() == 0 && (m_ColumnYesNoName == null || !pp.isYes())) - continue; // no changes - // - sql = new StringBuffer(); - sql.append("UPDATE ").append(m_TableName) - .append(" SET ").append(m_ColumnSortName).append("=0"); - if (m_ColumnYesNoName != null) - sql.append(",").append(m_ColumnYesNoName).append("='N'"); - sql.append(" WHERE ").append(m_KeyColumnName).append("=").append(pp.getKey()); - if (DB.executeUpdate(sql.toString(), null) == 1) { - pp.setSortNo(0); - pp.setIsYes(false); - } - else { - ok = false; - if (info.length() > 0) - info.append(", "); - info.append(pp.getName()); - log.log(Level.SEVERE, "NoModel - Not updated: " + m_KeyColumnName + "=" + pp.getKey()); - } - } - // yesList - Set SortColumn to value and optional YesNo Column to 'Y' - int index = 0; - for (int i = 0; i < yesModel.getSize(); i++) - { - ListItem pp = (ListItem)yesModel.getElementAt(i); - if (!pp.isUpdateable()) - continue; - index += 10; - if(pp.getSortNo() == index && (m_ColumnYesNoName == null || pp.isYes())) - continue; // no changes - // - sql = new StringBuffer(); - sql.append("UPDATE ").append(m_TableName) - .append(" SET ").append(m_ColumnSortName).append("=").append(index); - if (m_ColumnYesNoName != null) - sql.append(",").append(m_ColumnYesNoName).append("='Y'"); - sql.append(" WHERE ").append(m_KeyColumnName).append("=").append(pp.getKey()); - if (DB.executeUpdate(sql.toString(), null) == 1) { - pp.setSortNo(index); - pp.setIsYes(true); - } - else { - ok = false; - if (info.length() > 0) - info.append(", "); - info.append(pp.getName()); - log.log(Level.SEVERE, "YesModel - Not updated: " + m_KeyColumnName + "=" + pp.getKey()); - } - } - // - if (ok) { - setIsChanged(false); - } - else { - ADialog.error(m_WindowNo, null, "SaveError", info.toString()); - } - } // saveData - - /* (non-Javadoc) - * @see org.compiere.grid.APanelTab#unregisterPanel() - */ - public void unregisterPanel () - { - saveData(); - m_aPanel = null; - } // dispoase - - /** - * List Item - * @author Teo Sarca - */ - private class ListItem extends NamePair { - /** - * - */ - private static final long serialVersionUID = 5399675004361331697L; - private int m_key; - private int m_AD_Client_ID; - private int m_AD_Org_ID; - /** Initial seq number */ - private int m_sortNo; - /** Initial selection flag */ - private boolean m_isYes; - private boolean m_updateable; - - public ListItem(int key, String name, int sortNo, boolean isYes, int AD_Client_ID, int AD_Org_ID) { - super(name); - this.m_key = key; - this.m_AD_Client_ID = AD_Client_ID; - this.m_AD_Org_ID = AD_Org_ID; - this.m_sortNo = sortNo; - this.m_isYes = isYes; - this.m_updateable = MRole.getDefault().canUpdate(m_AD_Client_ID, m_AD_Org_ID, m_AD_Table_ID, m_key, false); - } - public int getKey() { - return m_key; - } - public void setSortNo(int sortNo) { - m_sortNo = sortNo; - } - public int getSortNo() { - return m_sortNo; - } - public void setIsYes(boolean value) { - m_isYes = value; - } - public boolean isYes() { - return m_isYes; - } - public int getAD_Client_ID() { - return m_AD_Client_ID; - } - public int getAD_Org_ID() { - return m_AD_Org_ID; - } - public boolean isUpdateable() { - return m_updateable; - } - @Override - public String getID() { - return m_key != -1 ? String.valueOf(m_key) : null; - } - @Override - public int hashCode() { - return m_key; - } - @Override - public boolean equals(Object obj) - { - if (obj instanceof ListItem) - { - ListItem li = (ListItem)obj; - return - li.getKey() == m_key - && li.getName() != null - && li.getName().equals(getName()) - && li.getAD_Client_ID() == m_AD_Client_ID - && li.getAD_Org_ID() == m_AD_Org_ID; - } - return false; - } // equals - @Override - public String toString() { - String s = super.toString(); - if (s == null || s.trim().length() == 0) - s = "<" + getKey() + ">"; - return s; - } - } - - /** - * @author eslatis - * - */ - private class DragListener extends MouseInputAdapter - { - - /** - * Creates a VSortTab.DragListener. - */ - public DragListener() - { - URL url = VSortTab.class.getResource(cursorName); - Toolkit toolkit = Toolkit.getDefaultToolkit(); - Image image = toolkit.getImage(url); - customCursor = toolkit.createCustomCursor(image, new Point(0, 0), "Howdy"); - } - - /** The cursorName. */ - private String cursorName = "/org/compiere/images/DragCursor32.gif"; - - /** StartList */ - private JList startList = null; - - /** The startModel. */ - private DefaultListModel startModel = null; - - /** The selObject. */ - private Object selObject = null; - - private boolean moved = false; - - /** The customCursor. */ - private Cursor customCursor; - - /* (non-Javadoc) - * @see javax.swing.event.MouseInputAdapter#mousePressed(java.awt.event.MouseEvent) - */ - public void mousePressed(MouseEvent me) - { - JList list = (JList)me.getComponent(); - Point p = me.getPoint(); - int index = list.locationToIndex(p); - if (index > -1 && list.getCellBounds(index, index).contains(p)) - { - startList = list; - startModel = (list == noList) ? noModel : yesModel; - selObject = list.getModel().getElementAt(index); - } - if (list == noList) - yesList.clearSelection(); - else - noList.clearSelection(); - moved = false; - } // mousePressed - - /* (non-Javadoc) - * @see javax.swing.event.MouseInputAdapter#mouseDragged(java.awt.event.MouseEvent) - */ - public void mouseDragged(MouseEvent me) - { - if (selObject == null || !((ListItem)selObject).isUpdateable()) { - moved = false; - return; - } - moved = true; - if (getCursor() != customCursor) - setCursor(customCursor); - } // mouseDragged - - /* (non-Javadoc) - * @see javax.swing.event.MouseInputAdapter#mouseReleased(java.awt.event.MouseEvent) - */ - public void mouseReleased(MouseEvent me) - { - if (startModel != null && moved) - { - Point p = me.getPoint(); - - JList endList = yesList; - DefaultListModel endModel = yesModel; - - if (me.getComponent() == yesList) - { - if (!yesList.contains (p)) - { - endList = noList; - endModel = noModel; - } - } - else - { - if (noList.contains (p)) - { - setCursor(Cursor.getDefaultCursor()); - moved = false; - return; // move within noList - } - p = SwingUtilities.convertPoint (noList, p, yesList); - } - int index = endList.locationToIndex(p); - if (index > -1) // && endList.getCellBounds(index, index).contains(p)) - { - startModel.removeElement(selObject); - endModel.add(index, selObject); - // - startList.clearSelection(); - endList.clearSelection(); - endList.setSelectedValue(selObject, true); - // - setIsChanged(true); - } - } - - startList = null; - startModel = null; - selObject = null; - moved = false; - setCursor(Cursor.getDefaultCursor()); - } // mouseReleased - } - -} // VSortTab - diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VTabbedPane.java b/org.adempiere.ui.swing/src/org/compiere/grid/VTabbedPane.java deleted file mode 100644 index 7000a12fc4..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VTabbedPane.java +++ /dev/null @@ -1,367 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid; - -import java.awt.Component; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.Icon; -import javax.swing.JTabbedPane; - -import org.compiere.apps.ADialog; -import org.compiere.apps.APanel; -import org.compiere.model.DataStatusEvent; -import org.compiere.model.GridTab; -import org.compiere.model.MTable; -import org.compiere.swing.CTabbedPane; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Evaluator; -import org.compiere.util.Language; -import org.compiere.util.Util; - -/** - * Tabbed Pane - either Workbench or Window Tab - * - * @author Jorg Janke - * @version $Id: VTabbedPane.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VTabbedPane extends CTabbedPane -{ - /** - * - */ - private static final long serialVersionUID = 716455372513747084L; - - /** - * Constructor - * @param isWorkbench is this a workbench tab (tabs on the left side) - */ - public VTabbedPane (boolean isWorkbench) - { - super(); - setTabLayoutPolicy (JTabbedPane.SCROLL_TAB_LAYOUT); - setWorkbench (isWorkbench); - setFocusable(false); - } // VTabbedPane - - /** Logger */ - private static CLogger log = CLogger.getCLogger (VTabbedPane.class); - /** Workbench */ - private boolean m_workbenchTab = false; - /** List of dependent Variables */ - private ArrayList m_dependents = new ArrayList(); - /** Disabled Icon */ - private static Icon s_disabledIcon = null; - - private ArrayList components = new ArrayList(); - private ArrayList gTabs = new ArrayList(); - private ArrayList tabNames = new ArrayList(); - - /** - * toString - * @return info - */ - public String toString() - { - return (m_workbenchTab ? "WorkbenchTab" : "WindowTab") - + " - selected " + getSelectedIndex() + " of " + getTabCount(); - } // toString - - /** - * Add Tab - * @param tabName name - * @param gTab grid tab model - * @param tabElement GridController or VSortTab - */ - public void addTab(String tabName, GridTab gTab, Component tabElement) - { - int index = getTabCount(); - tabNames.add(tabName); - gTabs.add(gTab); - components.add(tabElement); - - super.addTab (tabName, gTab.getIcon(), - tabElement, gTab.getDescription()); - - ArrayList dependents = gTab.getDependentOn(); - for (int i = 0; i < dependents.size(); i++) - { - String name = dependents.get(i); - if (!m_dependents.contains(name)) - m_dependents.add(name); - } - if (s_disabledIcon == null) - s_disabledIcon = Env.getImageIcon("Cancel10.gif"); - setDisabledIconAt(index, s_disabledIcon); - } // addTab - - private void hideTab(String tabName) { - - int tabIndex = indexOfTab(tabName); - - if ( tabIndex != -1 ) - removeTabAt(tabIndex); - } - - private void showTab(String tabName) { - int insertAt = 0; - - if ( indexOfTab(tabName) != -1 ) // already visible - return; - - for ( int i = 0; i < tabNames.size(); i++ ) - { - String name = tabNames.get(i); - if ( name.equals(tabName)) - { - insertTab (tabName, gTabs.get(i).getIcon(), - components.get(i), gTabs.get(i).getDescription(), insertAt); - break; - } - - if ( indexOfTab(name) != -1 ) // tab is visible, insert after - insertAt ++; - } - - } - - /** - * @param gridTab - * @return tab index or -1 if not found - */ - public int findTabindex(GridTab gridTab) - { - for (int i = 0; i < gTabs.size(); i++) - { - if (gTabs.get(i) == gridTab) - { - return indexOfTab(tabNames.get(i)); - } - } - return -1; - } - - /** - * Set Workbench - or Window - * @param isWorkbench - */ - public void setWorkbench (boolean isWorkbench) - { - m_workbenchTab = isWorkbench; - if (m_workbenchTab) - super.setTabPlacement(JTabbedPane.BOTTOM); - else - super.setTabPlacement(Language.getLoginLanguage().isLeftToRight() - ? JTabbedPane.LEFT : JTabbedPane.RIGHT); - } // setWorkbench - - /** - * Tab is Workbench (not Window) - * @return true if Workbench - */ - public boolean isWorkbench() - { - return m_workbenchTab; - } // toString - - /** - * Set Tab Placement. - * Do not use - set via setWorkBench - * @param notUsed - */ - public void setTabPlacement (int notUsed) - { - new java.lang.IllegalAccessError("Do not use VTabbedPane.setTabPlacement directly"); - } // setTabPlacement - - /** - * Dispose all contained VTabbedPanes and GridControllers - * @param aPanel - */ - public void dispose (APanel aPanel) - { - Component[] comp = getComponents(); - for (int i = 0; i < comp.length; i++) - { - if (comp[i] instanceof VTabbedPane) - { - VTabbedPane tp = (VTabbedPane)comp[i]; - tp.removeChangeListener(aPanel); - tp.dispose(aPanel); - } - else if (comp[i] instanceof GridController) - { - GridController gc = (GridController)comp[i]; - gc.removeDataStatusListener(aPanel); - gc.dispose(); - } - } - removeAll(); - } // dispose - - @Override - //hengsin, bug [ 1637763 ] - public boolean isEnabledAt(int index) { - boolean enabled = super.isEnabledAt(index); - if (!enabled) return enabled; - Component comp = getComponentAt(index); - GridController gc = null; - if (comp instanceof GridController) - gc = (GridController)comp; - // Display - if (gc != null) - { - enabled = isDisplay(gc); - } - return enabled; - } - - //hengsin, bug [ 1637763 ] - private boolean isDisplay(GridController gc) - { - String logic = gc.getDisplayLogic(); - if (logic != null && logic.length() > 0) - { - boolean display = Evaluator.evaluateLogic(gc, logic); - if (!display) - { - if (log.isLoggable(Level.INFO)) log.info("Not displayed - " + logic); - return false; - } - } - return true; - } - - /** - * Set Selected Index. - * Register/Unregister Mnemonics - * @param index index - */ - public void setSelectedIndex (int index) - { - Component newC = getComponentAt(index); - GridController newGC = null; - if (newC instanceof GridController) - newGC = (GridController)newC; - // Display - if (newGC != null) - { - //hengsin, bug [ 1637763 ] - if(isDisplay(newGC) == false) - return; - } - - // - int oldIndex = getSelectedIndex(); - if (newGC != null && oldIndex >= 0 && index != oldIndex) - { - Component oldC = getComponentAt(oldIndex); - if (oldC != null && oldC instanceof GridController) - { - GridController oldGC = (GridController)oldC; - int zeroValid = (MTable.isZeroIDTable(oldGC.getMTab().getTableName()) ? 1 : 0); - if ((newGC.getTabLevel() > oldGC.getTabLevel()+1) - || (newGC.getTabLevel() > oldGC.getTabLevel() && oldGC.getMTab().getRecord_ID()+zeroValid <=0)) // TabLevel increase and parent ID <=0 IDEMPIERE 382 - { - // validate - // Search for right tab - GridController rightGC = null; - //boolean canJump = true; - boolean canJump = oldGC.getMTab().getRecord_ID()+zeroValid <=0 ? false : true; // IDEMPIERE 382 - // IDEMPIERE-651 Allow navigating to a detail when parent doesn't have ID - if (! canJump && Util.isEmpty(oldGC.getMTab().getKeyColumnName())) - canJump = true; - int currentLevel = newGC.getTabLevel(); - for (int i = index-1; i >=0; i--) - { - Component rightC = getComponentAt(i); - if (rightC instanceof GridController) - { - GridController gc = (GridController)rightC; - //can only skip level if all parent data are not stale - if (gc.getTabLevel() < currentLevel) - { - if (gc.getTabLevel() == oldGC.getTabLevel()+1) - { - rightGC = gc; - } - if (!gc.isCurrent()) - canJump = false; - currentLevel = gc.getTabLevel(); - } - } - } - if (canJump == false) - { - if (rightGC != null ) - ADialog.warn(0, this, "TabSwitchJumpGo", rightGC.getTitle()); - else - ADialog.warn(0, this, "TabSwitchJump"); - return; - } - } - oldGC.setMnemonics(false); - } - } - // Switch - super.setSelectedIndex (index); - if (newGC != null) - newGC.setMnemonics(true); - } // setSelectedIndex - - /** - * Evaluate Tab Logic - * @param e event - */ - public void evaluate (DataStatusEvent e) - { - boolean process = e == null; - String columnName = null; - if (!process) - { - columnName = e.getColumnName(); - if (columnName != null) - process = m_dependents.contains(columnName); - else - process = true; - } - - if (process) - { - if (log.isLoggable(Level.CONFIG)) log.config(columnName == null ? "" : columnName); - for (int i = 0; i < components.size(); i++) - { - Component c = components.get(i); - if (c instanceof GridController) - { - GridController gc = (GridController)c; - if (!gc.isDetailGrid()) //ignore included tabs - { - boolean display = isDisplay(gc); - if ( display ) - showTab(tabNames.get(i)); - else - hideTab(tabNames.get(i)); - } - } - } - } - } // evaluate - -} // VTabbdPane diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VTable.java b/org.adempiere.ui.swing/src/org/compiere/grid/VTable.java deleted file mode 100644 index 18f4d98751..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VTable.java +++ /dev/null @@ -1,210 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid; - -import java.awt.Component; -import java.awt.Rectangle; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.util.logging.Level; - -import javax.swing.Action; -import javax.swing.table.TableModel; - -import org.compiere.grid.ed.VCellEditor; -import org.compiere.grid.ed.VEditor; -import org.compiere.model.GridTab; -import org.compiere.model.GridTable; -import org.compiere.swing.CColumnControlButton; -import org.compiere.swing.CTable; -import org.compiere.util.CLogger; -import org.jdesktop.swingx.action.BoundAction; - -/** - * Table Grid based on CTable. - * Used in GridController - * - * @author Jorg Janke - * @version $Id: VTable.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - FR [ 1753943 ] - */ -public final class VTable extends CTable - implements PropertyChangeListener -{ - /** - * - */ - private static final long serialVersionUID = -3878986086328742243L; - - private final static String PACK_ALL_COMMAND = CColumnControlButton.COLUMN_CONTROL_MARKER + "packAll"; - - /** - * Default Constructor - */ - public VTable() - { - super(); - setAutoscrolls(true); - putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); - new VTableExcelAdapter(this); // teo_sarca - FR [ 1753943 ] - - getActionMap().put(PACK_ALL_COMMAND, createPackAllAction()); - } // VTable - - - private Action createPackAllAction() - { - //TODO: localization - BoundAction action = new BoundAction("Size All Column", PACK_ALL_COMMAND); - action.setLongDescription("Size all column to fit content"); - action.registerCallback(this, "packAll"); - return action; - } - - /** - * Size all column to fit content. - */ - public void packAll() - { - autoSize(true); - } - - /** Logger */ - private static CLogger log = CLogger.getCLogger(VTable.class); - - /** - * Property Change Listener for CurrentRow. - * - Selects the current row if not already selected - * - Required when navigating via Buttons - * @param evt event - */ - public void propertyChange(PropertyChangeEvent evt) - { - // log.config(evt); - if (evt.getPropertyName().equals(GridTab.PROPERTY)) - { - int row = ((Integer)evt.getNewValue()).intValue(); - int selRow = getSelectedRow(); - if (row == selRow) - return; - if (log.isLoggable(Level.CONFIG)) log.config(GridTab.PROPERTY + "=" + row + " from " + selRow); - setRowSelectionInterval(row,row); - setColumnSelectionInterval(0, 0); - Rectangle cellRect = getCellRect(row, 0, false); - if (cellRect != null) - scrollRectToVisible(cellRect); - if (log.isLoggable(Level.CONFIG)) log.config(GridTab.PROPERTY + "=" + row + " from " + selRow); - } - } // propertyChange - - /** - * Get ColorCode for Row. - *
    -	 *	If numerical value in compare column is
    -	 *		negative = -1,
    -	 *      positive = 1,
    -	 *      otherwise = 0
    -	 *  
    - * @param row row - * @return color code - */ - public int getColorCode (int row) - { - return ((GridTable)getModel()).getColorCode(row); - } // getColorCode - - /** - * Sort Table - * @param modelColumnIndex model column sort index - */ - protected void sort (int modelColumnIndex) - { - int rows = getRowCount(); - if (rows == 0) - return; - // - TableModel model = getModel(); - if (!(model instanceof GridTable)) - { - super.sort(modelColumnIndex); - return; - } - - sorting = true; - // other sort column - if (modelColumnIndex != p_lastSortIndex) - p_asc = true; - else - p_asc = !p_asc; - - p_lastSortIndex = modelColumnIndex; - // - if (log.isLoggable(Level.CONFIG)) log.config("#" + modelColumnIndex - + " - rows=" + rows + ", asc=" + p_asc); - - ((GridTable)model).sort(modelColumnIndex, p_asc); - - sorting = false; - // table model fires "Sorted" DataStatus event which causes MTab to position to row 0 - } // sort - - /** - * Transfer focus explicitly to editor due to editors with multiple components - * - * @param row row - * @param column column - * @param e event - * @return true if cell is editing - */ - public boolean editCellAt (int row, int column, java.util.EventObject e) - { - if (!super.editCellAt(row, column, e)) - return false; - // log.fine( "VTable.editCellAt", "r=" + row + ", c=" + column); - - Object ed = getCellEditor(); - if (ed instanceof VEditor) - ((Component)ed).requestFocus(); - else if (ed instanceof VCellEditor) - { - ed = ((VCellEditor)ed).getEditor(); - ((Component)ed).requestFocus(); - } - return true; - } // editCellAt - - /** - * toString - * @return String representation - */ - public String toString() - { - return new StringBuffer("VTable[") - .append(getModel()).append("]").toString(); - } // toString - - /** - * Sets the row selection interval. If the index is out of bounds we decrement it before setting the JTables row selection interval - */ - @Override - public void setRowSelectionInterval(int index0, int index1) { - super.setRowSelectionInterval( index0 == getRowCount() && index0 > 0 ? --index0 : index0, - index1 == getRowCount() && index1 > 0 ? --index1 : index1); - } - -} // VTable diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VTableExcelAdapter.java b/org.adempiere.ui.swing/src/org/compiere/grid/VTableExcelAdapter.java deleted file mode 100644 index 1657215f78..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VTableExcelAdapter.java +++ /dev/null @@ -1,213 +0,0 @@ -/********************************************************************** -* This file is part of Adempiere ERP Bazaar * -* http://www.adempiere.org * -* * -* Copyright (C) Teo Sarca. * -* Copyright (C) Contributors * -* * -* This program is free software; you can redistribute it and/or * -* modify it under the terms of the GNU General Public License * -* as published by the Free Software Foundation; either version 2 * -* of the License, or (at your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License for more details. * -* * -* You should have received a copy of the GNU General Public License * -* along with this program; if not, write to the Free Software * -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * -* MA 02110-1301, USA. * -* * -* Contributors: * -* - Teo Sarca (teo.sarca@gmail.com) * -* * -* Sponsors: * -* - SC ARHIPAC SERVICE SRL (http://www.arhipac.ro) * -***********************************************************************/ -package org.compiere.grid; - -import java.awt.Toolkit; -import java.awt.datatransfer.Clipboard; -import java.awt.datatransfer.StringSelection; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.math.BigDecimal; -import java.text.DateFormat; -import java.text.NumberFormat; -import java.util.Date; -import java.util.Locale; -import java.util.logging.Level; - -import javax.swing.JComponent; -import javax.swing.KeyStroke; - -import org.compiere.model.GridField; -import org.compiere.model.GridTable; -import org.compiere.model.Lookup; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * VTableExcelAdapter enables Copy Clipboard functionality on VTables. - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - FR [ 1753943 ] - */ -public class VTableExcelAdapter - implements ActionListener -{ - public static final String CMD_Copy = "VTable.copyPaste"; - public static final String CMD_CopyWithHeaders = "VTable.copyPasteH"; - - private static KeyStroke KS_copy = KeyStroke.getKeyStroke(KeyEvent.VK_C,ActionEvent.CTRL_MASK,false); - private static KeyStroke KS_copyWithHeader = KeyStroke.getKeyStroke(KeyEvent.VK_C,ActionEvent.CTRL_MASK | ActionEvent.SHIFT_MASK,false); - - /** Logger */ - private CLogger log = CLogger.getCLogger(getClass()); - - /** System clipboard */ - private Clipboard system; - /** Source table */ - private VTable table; - - /** System locale */ - private static Locale sysLocale = new Locale( - System.getProperty("user.language"), - System.getProperty("user.country") - ); - /** System number formater */ - private static NumberFormat sysNumberFormat = NumberFormat.getNumberInstance(sysLocale); - /** System date formater */ - private static DateFormat sysDateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM, sysLocale); - - /** - * The Excel Adapter is constructed with a - * VTable on which it enables Copy-Paste and acts - * as a Clipboard listener. - * - * @param table - */ - public VTableExcelAdapter(VTable table) - { - this.table = table; - table.registerKeyboardAction(this,CMD_Copy,KS_copy,JComponent.WHEN_FOCUSED); - table.registerKeyboardAction(this,CMD_CopyWithHeaders,KS_copyWithHeader,JComponent.WHEN_FOCUSED); - system = Toolkit.getDefaultToolkit().getSystemClipboard(); - } - - /** - * This method is activated on the Keystrokes we are listening to - * in this implementation. Here it listens for Copy and Paste ActionCommands. - * - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - // Only GridTable model is supported - if (!(table.getModel() instanceof GridTable)) { - if (log.isLoggable(Level.FINE)) log.fine("Not supported - " + table.getModel()); - return; - } - - boolean isCopy = CMD_Copy.equals(e.getActionCommand()); - boolean isCopyWithHeaders = CMD_CopyWithHeaders.equals(e.getActionCommand()); - - if (isCopy || isCopyWithHeaders) - { - try { - int[] selectedRows = table.getSelectedRows(); - if (selectedRows == null || selectedRows.length == 0) { - return; - } - - int colscount = table.getColumnCount(); - StringBuilder sb = new StringBuilder(); - GridTable model = (GridTable)table.getModel(); - GridField[] fields = model.getFields(); - - // Header - if (isCopyWithHeaders) { - for (int col = 0; col < colscount; col++) { - String value = ""; - try { - GridField field = fields[col]; - if (!field.isDisplayed(false)) { - continue; - } - value = field.getHeader(); - } catch(Exception ex) { - log.log(Level.WARNING, "Copy-headers", ex); - } - value = fixString(value); - sb.append(value).append("\t"); - } - sb.append(Env.NL); - } - - // Selected rows - for (int row : selectedRows) { - for (int col = 0; col < colscount; col++) { - Lookup lookup = null; - String value = null; - Object key = null; - GridField field = null; - try { - key = table.getValueAt(row,col); - field = fields[col]; - if (!field.isDisplayed(false)) - continue; - if (field.isEncryptedColumn() || field.isEncryptedField()) { - value = "*"; - } - else if (key instanceof Boolean) { - value = Msg.getMsg(Env.getCtx(), ((Boolean)key).booleanValue() ? "Yes":"No"); - } - else if (key instanceof BigDecimal) { - try { - value = sysNumberFormat.format(key != null ? key : Env.ZERO); - } catch (Exception ex) {} - } - else if (key instanceof Date) { - try { - value = sysDateFormat.format(key); - } catch (Exception ex) {} - } - else { - lookup = (field != null ? field.getLookup() : null); - value = (lookup != null && key != null ? lookup.getDisplay(key) : null); - if (value == null && key != null) - value = key.toString(); - } - } catch(Exception ex) { - log.log(Level.WARNING, "Copy-rows", ex); - } - value = fixString(value); - sb.append(value).append("\t"); - if (log.isLoggable(Level.FINEST)) log.finest("col=" + col + ", row=" + row + ": key=" + key + " => value=" + value + ", " + field + ", " + lookup); - } - sb.append(Env.NL); - } - StringSelection stsel = new StringSelection(sb.toString()); - system = Toolkit.getDefaultToolkit().getSystemClipboard(); - system.setContents(stsel,stsel); - } catch (Exception ex) { - log.log(Level.WARNING, "Copy", ex); - } - } - } // actionPerformed - - /** - * Fix Cell String - * @param s string - * @return fixed string - */ - private String fixString(String s) { - if (s == null || s.length() == 0) - return ""; - String s2 = s.replaceAll("[\t\n\f\r]+", " "); - return s2; - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/XLookup.java b/org.adempiere.ui.swing/src/org/compiere/grid/XLookup.java deleted file mode 100644 index c46a8cc952..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/XLookup.java +++ /dev/null @@ -1,173 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid; - -import java.util.ArrayList; -import java.util.Collections; - -import org.compiere.model.Lookup; -import org.compiere.util.DisplayType; -import org.compiere.util.KeyNamePair; -import org.compiere.util.NamePair; -import org.compiere.util.ValueNamePair; - -/** - * Manual Lookup (Model)- loaded by the put method - * - * @author Jorg Janke - * @version $Id: XLookup.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class XLookup extends Lookup -{ - /** - * - */ - private static final long serialVersionUID = -1960941688071305272L; - - /** - * Manual Lookup - * @param keyColumn key Column - */ - public XLookup(String keyColumn) - { - super(DisplayType.TableDir, 0); - m_keyColumn = keyColumn; - } // XLookup - - - /** Key Column - as identifier */ - private String m_keyColumn; - - /** - * Get Display String of key value - * @param key key - * @return display - */ - public String getDisplay (Object key) - { - // linear search in m_data - for (int i = 0; i < p_data.size(); i++) - { - Object oo = p_data.get(i); - if (oo != null && oo instanceof NamePair) - { - NamePair pp = (NamePair)oo; - if (pp.getID().equals(key)) - return pp.getName(); - } - } - return "<" + key + ">"; - } // getDisplay - - /** - * The Lookup contains the key - * @param key key - * @return true if contains key - */ - public boolean containsKey (Object key) - { - // linear search in p_data - for (int i = 0; i < p_data.size(); i++) - { - Object oo = p_data.get(i); - if (oo != null && oo instanceof NamePair) - { - NamePair pp = (NamePair)oo; - if (pp.getID().equals(key)) - return true; - } - } - return false; - } // containsKey - - public boolean containsKeyNoDirect (Object key) - { - return containsKey(key); - } - - /** - * Get Object of Key Value - * @param key key - * @return Object or null - */ - public NamePair get (Object key) - { - // linear search in m_data - for (int i = 0; i < p_data.size(); i++) - { - Object oo = p_data.get(i); - if (oo != null && oo instanceof NamePair) - { - NamePair pp = (NamePair)oo; - if (pp.getID().equals(key)) - return pp; - } - } - return null; - } // get - - - /** - * Return data as sorted Array - * @param mandatory mandatory - * @param onlyValidated only validated - * @param onlyActive only active - * @param temporary force load for temporary display - * @return list of data - */ - public ArrayList getData (boolean mandatory, - boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortlist) // IDEMPIERE 90 - { - ArrayList list = new ArrayList(p_data); - - // Sort Data - if (m_keyColumn.endsWith("_ID")) - { - KeyNamePair p = new KeyNamePair (-1, ""); - if (!mandatory) - list.add (p); - Collections.sort (list, p); - } - else - { - ValueNamePair p = new ValueNamePair (null, ""); - if (!mandatory) - list.add (p); - Collections.sort (list, p); - } - return list; - } // getArray - - /** - * Refresh Values (nop) - * @return number of cache - */ - public int refresh() - { - return p_data.size(); - } // refresh - - /** - * Get underlying fully qualified Table.Column Name - * @return column name - */ - public String getColumnName() - { - return m_keyColumn; - } // getColumnName - -} // XLookup diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/ADempiereAutoCompleteDecorator.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/ADempiereAutoCompleteDecorator.java deleted file mode 100755 index 623286e20d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/ADempiereAutoCompleteDecorator.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * $Id: AutoCompleteDecorator.java,v 1.9 2007/01/29 08:52:45 Bierhance Exp $ - * - * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle, - * Santa Clara, California 95054, U.S.A. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -package org.compiere.grid.ed; - -import java.awt.event.ActionEvent; -import java.awt.event.FocusAdapter; -import java.awt.event.FocusEvent; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.swing.Action; -import javax.swing.ActionMap; -import javax.swing.InputMap; -import javax.swing.KeyStroke; -import javax.swing.UIManager; -import javax.swing.text.DefaultEditorKit; -import javax.swing.text.JTextComponent; -import javax.swing.text.TextAction; - -import org.jdesktop.swingx.autocomplete.AbstractAutoCompleteAdaptor; -import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator; -import org.jdesktop.swingx.autocomplete.AutoCompleteDocument; -import org.jdesktop.swingx.autocomplete.ObjectToStringConverter; -import org.jdesktop.swingx.autocomplete.TextComponentAdaptor; - -/** - * Adds Ctrl+Tab invoked action to run through all potential auto completion values. - */ -public class ADempiereAutoCompleteDecorator extends AutoCompleteDecorator{ - - /** - * Enables automatic completion for the given JTextComponent based on the - * items contained in the given List. - * @param textComponent the text component that will be used for automatic - * completion. - * @param items contains the items that are used for autocompletion - * @param strictMatching true, if only given items should be allowed to be entered - */ - public static void decorate(JTextComponent textComponent, List items, boolean strictMatching) { - decorate(textComponent, items, strictMatching, ObjectToStringConverter.DEFAULT_IMPLEMENTATION); - } - - /** - * Enables automatic completion for the given JTextComponent based on the - * items contained in the given List. - * @param items contains the items that are used for autocompletion - * @param textComponent the text component that will be used for automatic - * completion. - * @param strictMatching true, if only given items should be allowed to be entered - * @param stringConverter the converter used to transform items to strings - */ - public static void decorate(JTextComponent textComponent, List items, boolean strictMatching, ObjectToStringConverter stringConverter) { - AbstractAutoCompleteAdaptor adaptor = new TextComponentAdaptor(textComponent, items); - AutoCompleteDocument document = new AutoCompleteDocument(adaptor, strictMatching, stringConverter); - decorate(textComponent, document, adaptor); - } - - /** - * Decorates a given text component for automatic completion using the - * given AutoCompleteDocument and AbstractAutoCompleteAdaptor. - * - * - * @param textComponent a text component that should be decorated - * @param document the AutoCompleteDocument to be installed on the text component - * @param adaptor the AbstractAutoCompleteAdaptor to be used - */ - public static void decorate(JTextComponent textComponent, AutoCompleteDocument document, final AbstractAutoCompleteAdaptor adaptor) { - // install the document on the text component - textComponent.setDocument(document); - - // mark entire text when the text component gains focus - // otherwise the last mark would have been retained which is quiet confusing - textComponent.addFocusListener(new FocusAdapter() { - public void focusGained(FocusEvent e) { - @SuppressWarnings("unused") - JTextComponent textComponent = (JTextComponent) e.getSource(); - adaptor.markEntireText(); - } - }); - - // Tweak some key bindings - InputMap editorInputMap = textComponent.getInputMap(); - if (document.isStrictMatching()) { - // move the selection to the left on VK_BACK_SPACE - editorInputMap.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_BACK_SPACE, 0), DefaultEditorKit.selectionBackwardAction); - // ignore VK_DELETE and CTRL+VK_X and beep instead when strict matching - editorInputMap.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_DELETE, 0), errorFeedbackAction); - editorInputMap.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.CTRL_DOWN_MASK), errorFeedbackAction); - } else { - ActionMap editorActionMap = textComponent.getActionMap(); - // leave VK_DELETE and CTRL+VK_X as is - // VK_BACKSPACE will move the selection to the left if the selected item is in the list - // it will delete the previous character otherwise - editorInputMap.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_BACK_SPACE, 0), "nonstrict-backspace"); - editorActionMap.put("nonstrict-backspace", new NonStrictBackspaceAction( - editorActionMap.get(DefaultEditorKit.deletePrevCharAction), - editorActionMap.get(DefaultEditorKit.selectionBackwardAction), - adaptor)); - editorInputMap.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_TAB, java.awt.event.KeyEvent.CTRL_DOWN_MASK), "NextMatchAction"); - editorActionMap.put("NextMatchAction", new NextMatchAction(textComponent, document, adaptor)); - } - } - - static class NonStrictBackspaceAction extends TextAction { - /** - * - */ - private static final long serialVersionUID = 7260685268274438388L; - Action backspace; - Action selectionBackward; - AbstractAutoCompleteAdaptor adaptor; - - public NonStrictBackspaceAction(Action backspace, Action selectionBackward, AbstractAutoCompleteAdaptor adaptor) { - super("nonstrict-backspace"); - this.backspace = backspace; - this.selectionBackward = selectionBackward; - this.adaptor = adaptor; - } - - public void actionPerformed(ActionEvent e) { - if (adaptor.listContainsSelectedItem()) { - selectionBackward.actionPerformed(e); - } else { - backspace.actionPerformed(e); - } - } - } - - static class NextMatchAction extends TextAction { - /** - * - */ - private static final long serialVersionUID = 2987063701364646859L; - JTextComponent textComponent; - AutoCompleteDocument document; - final AbstractAutoCompleteAdaptor adaptor; - final List items; - int currentIndex = 0; - - public NextMatchAction(JTextComponent textComponent, AutoCompleteDocument document, final AbstractAutoCompleteAdaptor adaptor) { - super("NextMatchAction"); - this.textComponent = textComponent; - this.document = document; - this.adaptor = adaptor; - items = new ArrayList(adaptor.getItemCount()); - for (int i = 0; i < adaptor.getItemCount(); i++) { - Object o = adaptor.getItem(i); - items.add((o!=null)?(String) adaptor.getItem(i):""); - } - Collections.sort(items); - } - - private String getNextMatch(String start) { - for (int i = currentIndex; i < items.size(); i++) { - if(items.get(i).toLowerCase().startsWith(start.toLowerCase())) { - currentIndex = i+1; - return items.get(i); - } - } - currentIndex=0; - return start; - } - - /** - * Shows the next match. - * - * @param e the action event - */ - public void actionPerformed(ActionEvent e) { - JTextComponent target = getTextComponent(e); - if ((target != null) && (e != null)) { - if ((! target.isEditable()) || (! target.isEnabled())) { - UIManager.getLookAndFeel().provideErrorFeedback(target); - return; - } - String content = target.getText(); - if (content != null && target.getSelectionStart()>0) { - content = content.substring(0,target.getSelectionStart()); - } - if (content != null) { - target.setText(getNextMatch(content)); - adaptor.markText(content.length()); - } - } - } - } - - /** - * A TextAction that provides an error feedback for the text component that invoked - * the action. The error feedback is most likely a "beep". - */ - static Object errorFeedbackAction = new TextAction("provide-error-feedback") { - /** - * - */ - private static final long serialVersionUID = 6251452041316544686L; - - public void actionPerformed(ActionEvent e) { - UIManager.getLookAndFeel().provideErrorFeedback(getTextComponent(e)); - } - }; - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/AutoCompleter.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/AutoCompleter.java deleted file mode 100644 index b5839fbfa7..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/AutoCompleter.java +++ /dev/null @@ -1,288 +0,0 @@ -package org.compiere.grid.ed; - -import java.awt.Color; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.event.MouseListener; - -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.BorderFactory; -import javax.swing.JComponent; -import javax.swing.JList; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.JTextField; -import javax.swing.KeyStroke; -import javax.swing.ListModel; -import javax.swing.Timer; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import javax.swing.event.PopupMenuEvent; -import javax.swing.event.PopupMenuListener; -import javax.swing.text.BadLocationException; -import javax.swing.text.JTextComponent; - -import org.compiere.util.CLogger; - -/** - * @author Santhosh Kumar T - santhosh@in.fiorano.com - *
  • Initial contribution - http://www.jroller.com/santhosh/date/20050620#file_path_autocompletion - * @author Teo Sarca , www.arhipac.ro - *
  • added timed triggering - *
  • refactored - * @author Cristina Ghita , www.arhipac.ro - *
  • refactored - */ -public abstract class AutoCompleter implements MouseListener -{ - private static final String AUTOCOMPLETER = "AUTOCOMPLETER"; //NOI18N - private static final int PopupDelayMillis = 500; - - protected final CLogger log = CLogger.getCLogger(getClass()); - - final JList listBox = new JList(); - final JTextComponent textBox; - final private JPopupMenu popup = new JPopupMenu(); - private boolean m_empty = false; - - private final Timer timer = new Timer(PopupDelayMillis, new ActionListener(){ - public void actionPerformed(ActionEvent e) - { - showPopup(); - } - }); - - public AutoCompleter(JTextComponent comp) - { - textBox = comp; - textBox.putClientProperty(AUTOCOMPLETER, this); - - JScrollPane scroll = new JScrollPane(listBox); - scroll.setBorder(null); - - listBox.setFocusable( false ); - listBox.addMouseListener(this); - scroll.getVerticalScrollBar().setFocusable( false ); - scroll.getHorizontalScrollBar().setFocusable( false ); - - popup.setBorder(BorderFactory.createLineBorder(Color.black)); - popup.add(scroll); - - if(textBox instanceof JTextField) - { - textBox.registerKeyboardAction(showAction, KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), JComponent.WHEN_FOCUSED); - textBox.getDocument().addDocumentListener(documentListener); - } - - textBox.registerKeyboardAction(upAction, KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), JComponent.WHEN_FOCUSED); - textBox.registerKeyboardAction(hidePopupAction, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_FOCUSED); - popup.addPopupMenuListener(new PopupMenuListener() { - public void popupMenuWillBecomeVisible(PopupMenuEvent e) - { - } - public void popupMenuWillBecomeInvisible(PopupMenuEvent e) - { - textBox.unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)); - } - public void popupMenuCanceled(PopupMenuEvent e) - { - } - }); - listBox.setRequestFocusEnabled(false); - } - - public boolean isEmpty() - { - return m_empty; - } - - public void setEmpty(boolean empty) - { - m_empty = empty; - } - - private static final Action acceptAction = new AbstractAction() - { - private static final long serialVersionUID = -3950389799318995148L; - public void actionPerformed(ActionEvent e) - { - JComponent tf = (JComponent)e.getSource(); - AutoCompleter completer = (AutoCompleter)tf.getClientProperty(AUTOCOMPLETER); - completer.popup.setVisible(false); - if (completer.listBox.getSelectedValue() == null) - { - String txt = completer.textBox.getText(); - ListModel lm = completer.listBox.getModel(); - for (int index = 0; index < lm.getSize(); index++) - { - if (startsWithIgnoreCase(lm.getElementAt(index).toString(), txt)) - { - completer.acceptedListItem(lm.getElementAt(index)); - break; - } - } - } - else - { - completer.acceptedListItem(completer.listBox.getSelectedValue()); - } - } - }; - - private final DocumentListener documentListener = new DocumentListener() - { - public void insertUpdate(DocumentEvent e) - { - showPopupDelayed(); - } - public void removeUpdate(DocumentEvent e) - { - showPopupDelayed(); - } - public void changedUpdate(DocumentEvent e) - { - } - }; - - private void showPopupDelayed() - { - log.finest("showPopupDelayed.."); - timer.setRepeats(false); - timer.start(); - } - - private void showPopup() - { - log.finest("showPopup"); - popup.setVisible(false); - if (textBox.isEnabled() && updateListData() && listBox.getModel().getSize() != 0) - { - setEmpty(false); - if(!(textBox instanceof JTextField)) - { - textBox.getDocument().addDocumentListener(documentListener); - } - textBox.registerKeyboardAction(acceptAction, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), JComponent.WHEN_FOCUSED); - int size = listBox.getModel().getSize(); - listBox.setVisibleRowCount(size<10 ? size : 10); - - int x = 0; - try{ - int pos = Math.min(textBox.getCaret().getDot(), textBox.getCaret().getMark()); - x = textBox.getUI().modelToView(textBox, pos).x; - } catch(BadLocationException e){ - // this should never happen!!! - e.printStackTrace(); - } - popup.show(textBox, x, textBox.getHeight()); - } - else - { - popup.setVisible(false); - setEmpty(true); - } - textBox.requestFocus(); - } - - static Action showAction = new AbstractAction() - { - private static final long serialVersionUID = 8868536979000734628L; - public void actionPerformed(ActionEvent e) - { - JComponent tf = (JComponent)e.getSource(); - AutoCompleter completer = (AutoCompleter)tf.getClientProperty(AUTOCOMPLETER); - if(tf.isEnabled()) - { - if(completer.popup.isVisible()) - completer.selectNextPossibleValue(); - else - completer.showPopup(); - } - } - }; - - private static final Action upAction = new AbstractAction() - { - private static final long serialVersionUID = 2200136359410394434L; - - public void actionPerformed(ActionEvent e) - { - JComponent tf = (JComponent)e.getSource(); - AutoCompleter completer = (AutoCompleter)tf.getClientProperty(AUTOCOMPLETER); - if(tf.isEnabled()) - { - if(completer.popup.isVisible()) - completer.selectPreviousPossibleValue(); - } - } - }; - - private static final Action hidePopupAction = new AbstractAction() - { - private static final long serialVersionUID = -5683983067872135654L; - - public void actionPerformed(ActionEvent e) - { - JComponent tf = (JComponent)e.getSource(); - AutoCompleter completer = (AutoCompleter)tf.getClientProperty(AUTOCOMPLETER); - if(tf.isEnabled()) - completer.popup.setVisible(false); - } - }; - - /** - * Selects the next item in the list. It won't change the selection if the - * currently selected item is already the last item. - */ - protected void selectNextPossibleValue() - { - int si = listBox.getSelectedIndex(); - - if(si < listBox.getModel().getSize() - 1){ - listBox.setSelectedIndex(si + 1); - listBox.ensureIndexIsVisible(si + 1); - } - } - - /** - * Selects the previous item in the list. It won't change the selection if the - * currently selected item is already the first item. - */ - protected void selectPreviousPossibleValue() - { - int si = listBox.getSelectedIndex(); - - if(si > 0){ - listBox.setSelectedIndex(si - 1); - listBox.ensureIndexIsVisible(si - 1); - } - } - - /** - * Checks if str1 starts with str2 (ignores case, trim whitespaces, strip diacritics) - * @param str1 - * @param str2 - * @return true if str1 starts with str2 - */ - protected static boolean startsWithIgnoreCase(String str1, String str2) - { - String s1 = org.compiere.util.Util.stripDiacritics(str1.toUpperCase()).trim(); - String s2 = org.compiere.util.Util.stripDiacritics(str2.toUpperCase()).trim(); - return s1.startsWith(s2); - } - - - /** - * Update list model depending on the data in textfield - * @return - */ - protected abstract boolean updateListData(); - - /** - * User has selected some item in the list. Update textfield accordingly... - * @param selected - */ - protected abstract void acceptedListItem(Object selected); -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/AutoCompletion.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/AutoCompletion.java deleted file mode 100644 index 54e95c775f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/AutoCompletion.java +++ /dev/null @@ -1,284 +0,0 @@ -/* This work is hereby released into the Public Domain. - * To view a copy of the public domain dedication, visit - * http://creativecommons.org/licenses/publicdomain/ - */ -package org.compiere.grid.ed; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusAdapter; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; - -import javax.swing.ComboBoxEditor; -import javax.swing.ComboBoxModel; -import javax.swing.UIManager; -import javax.swing.text.AttributeSet; -import javax.swing.text.BadLocationException; -import javax.swing.text.JTextComponent; -import javax.swing.text.PlainDocument; - -import org.compiere.swing.CComboBox; - -/** - * Auto completion behaviour for a combo box - * - * @author phib: this is from http://www.orbital-computer.de/JComboBox - * with some minor revisions for Adempiere - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *
  • BF [ 1735043 ] AutoCompletion: drop down box is showed even if i press Caps - *
  • FR [ 1820783 ] AutoCompletion: posibility to toggle strict mode - *
  • BF [ 1820778 ] ESC(cancel editing) key not working if you are on VComboBox - *
  • BF [ 1898001 ] AutoComplete: Exception when selecting a text - *
  • FR [ 2552854 ] Combobox AutoCompletion should ignore diacritics - * @author tobi42, www.metas.de - *
  • BF [ 2861223 ] AutoComplete: Ignoring Whitespace in Search String - */ -public class AutoCompletion extends PlainDocument { - /** - * - */ - private static final long serialVersionUID = 1449135613844313889L; - CComboBox comboBox; - ComboBoxModel model; - JTextComponent editor; - /** - * Flag to indicate if setSelectedItem has been called - * subsequent calls to remove/insertString should be ignored - */ - boolean selecting=false; - boolean hidePopupOnFocusLoss; - boolean hitBackspace=false; - boolean hitBackspaceOnSelection; - /** Strict mode */ - private boolean m_strictMode = true; - - KeyListener editorKeyListener; - FocusListener editorFocusListener; - - public AutoCompletion(final CComboBox comboBox) { - this.comboBox = comboBox; - model = comboBox.getModel(); - comboBox.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (!selecting) highlightCompletedText(0); - } - }); - comboBox.addPropertyChangeListener(new PropertyChangeListener() { - public void propertyChange(PropertyChangeEvent e) { - if (e.getPropertyName().equals("editor")) configureEditor((ComboBoxEditor) e.getNewValue()); - if (e.getPropertyName().equals("model")) model = (ComboBoxModel) e.getNewValue(); - } - }); - editorKeyListener = new KeyAdapter() { - public void keyPressed(KeyEvent e) { - // Ignore keys that do not alter the text - teo_sarca [ 1735043 ] - if (e.getKeyChar() == KeyEvent.CHAR_UNDEFINED) { - return; - } - // Ignore ESC key - teo_sarca BF [ 1820778 ] - if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { - return; - } - - if (comboBox.isDisplayable()) - comboBox.setPopupVisible(true); - if(!m_strictMode) - return; - hitBackspace=false; - switch (e.getKeyCode()) { - // determine if the pressed key is backspace (needed by the remove method) - case KeyEvent.VK_BACK_SPACE : - hitBackspace=true; - hitBackspaceOnSelection=editor.getSelectionStart()!=editor.getSelectionEnd(); - break; - // ignore delete key - case KeyEvent.VK_DELETE : - e.consume(); - UIManager.getLookAndFeel().provideErrorFeedback(comboBox); - break; - } - } - }; - // Bug 5100422 on Java 1.5: Editable JComboBox won't hide popup when tabbing out - hidePopupOnFocusLoss=System.getProperty("java.version").startsWith("1.5"); - // Highlight whole text when gaining focus - editorFocusListener = new FocusAdapter() { - public void focusGained(FocusEvent e) { - highlightCompletedText(0); - } - public void focusLost(FocusEvent e) { - // Workaround for Bug 5100422 - Hide Popup on focus loss - if (hidePopupOnFocusLoss) comboBox.setPopupVisible(false); - } - }; - configureEditor(comboBox.getEditor()); - // Handle initially selected object - Object selected = comboBox.getSelectedItem(); - if (selected!=null) setText(selected.toString()); - highlightCompletedText(0); - } - - /** - * Enable auto completion for a combo box (strict mode) - * @param comboBox - */ - public static void enable(CComboBox comboBox) { - enable(comboBox, true); - } - - /** - * Enable auto completion for a combo box - * @param comboBox - * @param strictMode true if you want to set strict mode - */ - public static void enable(CComboBox comboBox, boolean strictMode) { - // has to be editable - comboBox.setEditable(true); - // change the editor's document - AutoCompletion ac = new AutoCompletion(comboBox); - // set strict mode - ac.setStrictMode(strictMode); - } - - void configureEditor(ComboBoxEditor newEditor) { - if (editor != null) { - editor.removeKeyListener(editorKeyListener); - editor.removeFocusListener(editorFocusListener); - } - - if (newEditor != null) { - editor = (JTextComponent) newEditor.getEditorComponent(); - editor.addKeyListener(editorKeyListener); - editor.addFocusListener(editorFocusListener); - editor.setDocument(this); - } - } - - @Override - public void remove(int offs, int len) throws BadLocationException { - // return immediately when selecting an item - if (selecting) return; - if (hitBackspace) { - // user hit backspace => move the selection backwards - // old item keeps being selected - if (offs>0) { - if (hitBackspaceOnSelection) offs--; - } else { - // User hit backspace with the cursor positioned on the start => beep - UIManager.getLookAndFeel().provideErrorFeedback(comboBox); - } - highlightCompletedText(offs); - } else { - super.remove(offs, len); - } - } - - @Override - public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { - - if (selecting) return; - - super.insertString(offs, str, a); - - // lookup and select a matching item - Object item = lookupItem(getText(0, getLength())); - - if (item != null) { - setSelectedItem(item); - } else { - if (m_strictMode) { - if ( offs == 0 ) - setSelectedItem(null); //null is valid for non-mandatory fields - //so if cursor is at start of line allow it - // otherwise keep old item selected if there is no better match - else - item = comboBox.getSelectedItem(); - // undo the insertion as there isn't a valid match - offs = offs-str.length(); - UIManager.getLookAndFeel().provideErrorFeedback(comboBox); - } - else { - return; - } - } - - if (item != null) - setText(item.toString()); - else setText(""); - // select the completed part so it can be overwritten easily - highlightCompletedText(offs+str.length()); - } - - /** - * Set text - * @param text - */ - public void setText(String text) { - try { - // remove all text and insert the completed string - super.remove(0, getLength()); - super.insertString(0, text, null); - } catch (BadLocationException e) { - throw new RuntimeException(e.toString()); - } - } - - private void highlightCompletedText(int start) { - editor.setCaretPosition(getLength()); - if (getLength() < start) - start = getLength(); - editor.moveCaretPosition(start); - } - - private void setSelectedItem(Object item) { - selecting = true; - model.setSelectedItem(item); - selecting = false; - } - - private Object lookupItem(String pattern) { - Object selectedItem = model.getSelectedItem(); - // only search for a different item if the currently selected does not match - if (selectedItem != null && startsWithIgnoreCase(selectedItem.toString(), pattern)) { - return selectedItem; - } else { - // iterate over all items - for (int i=0, n=model.getSize(); i < n; i++) { - Object currentItem = model.getElementAt(i); - // current item starts with the pattern? - if (currentItem != null && startsWithIgnoreCase(currentItem.toString(), pattern)) { - return currentItem; - } - } - } - - return null; - } - - /** - * Set strict mode. If the strict mode is enabled, you can't enter any other values than the - * ones from combo box list. - * @param mode true if strict mode - */ - public void setStrictMode (boolean mode) { - m_strictMode = mode; - } - - /** - * Checks if str1 starts with str2 (ignores case, trim leading whitespaces, strip diacritics) - * @param str1 - * @param str2 - * @return true if str1 starts with str2 - */ - protected boolean startsWithIgnoreCase(String str1, String str2) { - String s1 = org.compiere.util.Util.stripDiacritics(str1.toUpperCase()).replaceAll("^\\s+", "");; - String s2 = org.compiere.util.Util.stripDiacritics(str2.toUpperCase()).replaceAll("^\\s+", "");; - return s1.startsWith(s2); - } - -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/Calculator.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/Calculator.java deleted file mode 100644 index 24f70113ea..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/Calculator.java +++ /dev/null @@ -1,689 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.FlowLayout; -import java.awt.Frame; -import java.awt.GridLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.text.DecimalFormat; -import java.text.ParseException; -import java.util.StringTokenizer; -import java.util.logging.Level; - -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JDialog; -import javax.swing.JLabel; -import javax.swing.SwingConstants; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.model.MConversionRate; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -/** - * Calculator with currency conversion - * - * @author Jorg Janke - * @version $Id: Calculator.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public final class Calculator extends CDialog - implements ActionListener, KeyListener -{ - /** - * - */ - private static final long serialVersionUID = 467225451773238663L; - - /** - * Create Calculator - * @param frame parent - * @param title title - * @param displayType date or datetime or time - * @param format display format - * @param number initial amount - */ - public Calculator(Frame frame, String title, int displayType, - DecimalFormat format, BigDecimal number) - { - super(frame, title, true); - setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - // Get WindowNo for Currency - m_WindowNo = AEnv.getWindowNo(frame); - // - m_DisplayType = displayType; - if (!DisplayType.isNumeric(m_DisplayType)) - m_DisplayType = DisplayType.Number; - // - m_format = format; - if (m_format == null) - m_format = DisplayType.getNumberFormat(m_DisplayType); - // - m_number = number; - if (m_number == null) - m_number = Env.ZERO; - // - try - { - jbInit(); - finishSetup(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "Calculator" + ex); - } - } // Calculator - - /** - * Abbreviated Constructor - * @param frame parent - */ - public Calculator(Frame frame) - { - this (frame, Msg.getMsg(Env.getCtx(), "Calculator"), DisplayType.Number, null, null); - } // Calculator - - /** - * Abbreviated Constructor - * @param frame parent - * @param number initial amount - */ - public Calculator(Frame frame, BigDecimal number) - { - this (frame, Msg.getMsg(Env.getCtx(), "Calculator"), DisplayType.Number, null, number); - } // Calculator - - private BigDecimal m_number; // the current number - private String m_display = ""; // what is displayed - private int m_DisplayType; - private DecimalFormat m_format; - private int m_WindowNo; - private boolean m_abort = true; - private boolean m_currencyOK = false; - private boolean p_disposeOnEqual = true; //teo_sarca, bug[ 1628773 ] - - private final static String OPERANDS = "/*-+%"; - private char m_decimal = '.'; - /** Logger */ - private static CLogger log = CLogger.getCLogger(Calculator.class); - // - private CPanel mainPanel = new CPanel(); - private CPanel displayPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel keyPanel = new CPanel(); - private JLabel display = new JLabel(); - private BorderLayout displayLayout = new BorderLayout(); - private JButton b7 = new JButton(); - private JButton b8 = new JButton(); - private JButton b9 = new JButton(); - private JButton b4 = new JButton(); - private JButton b5 = new JButton(); - private JButton b6 = new JButton(); - private JButton b1 = new JButton(); - private JButton b2 = new JButton(); - private JButton b3 = new JButton(); - private GridLayout keyLayout = new GridLayout(); - private JButton bCur = new JButton(); - private JButton bC = new JButton(); - private JButton bDiv = new JButton(); - private JButton bM = new JButton(); - private JButton bMin = new JButton(); - private JButton bProc = new JButton(); - private JButton bAC = new JButton(); - private JButton bResult = new JButton(); - private JButton bDec = new JButton(); - private JButton b0 = new JButton(); - private JButton bPlus = new JButton(); - private CPanel bordPanel = new CPanel(); - private CPanel currencyPanel = new CPanel(); - private BorderLayout bordLayout = new BorderLayout(); - private JComboBox curFrom = new JComboBox(); - private JComboBox curTo = new JComboBox(); - private JLabel curLabel = new JLabel(); - private FlowLayout currencyLayout = new FlowLayout(); - - /** - * Static init - * @throws Exception - */ - void jbInit() throws Exception - { - mainPanel.setLayout(mainLayout); - displayPanel.setLayout(displayLayout); - keyPanel.setLayout(keyLayout); - mainLayout.setHgap(2); - mainLayout.setVgap(2); - mainPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); - - mainPanel.addKeyListener(this); - display.setBackground(Color.white); - display.setFont(new java.awt.Font("SansSerif", 0, 14)); - display.setBorder(BorderFactory.createCompoundBorder( - BorderFactory.createEmptyBorder(2, 0, 2, 1), - BorderFactory.createLineBorder(AdempierePLAF.getPrimary1()))); - display.setText("0"); - display.setHorizontalAlignment(SwingConstants.RIGHT); - - b7.setText("7"); - b8.setText("8"); - b9.setText("9"); - b4.setText("4"); - b5.setText("5"); - b6.setText("6"); - b1.setText("1"); - b2.setText("2"); - b3.setText("3"); - keyLayout.setColumns(5); - keyLayout.setHgap(3); - keyLayout.setRows(4); - keyLayout.setVgap(3); - bCur.setForeground(Color.yellow); - bCur.setToolTipText(Msg.getMsg(Env.getCtx(), "CurrencyConversion")); - bCur.setText("$"); - bC.setForeground(Color.red); - bC.setText("C"); - bDiv.setForeground(Color.blue); - bDiv.setText("/"); - bM.setForeground(Color.blue); - bM.setText("*"); - bMin.setForeground(Color.blue); - bMin.setText("-"); - bProc.setForeground(Color.blue); - bProc.setText("%"); - bAC.setForeground(Color.red); - bAC.setText("AC"); - bResult.setForeground(Color.green); - bResult.setText("="); - bDec.setText("."); - b0.setText("0"); - bPlus.setForeground(Color.blue); - bPlus.setText("+"); - bordPanel.setLayout(bordLayout); - curLabel.setHorizontalAlignment(SwingConstants.CENTER); - curLabel.setHorizontalTextPosition(SwingConstants.CENTER); - curLabel.setText(" >> "); - currencyPanel.setLayout(currencyLayout); - bordLayout.setHgap(2); - bordLayout.setVgap(2); - displayLayout.setHgap(2); - displayLayout.setVgap(2); - currencyLayout.setHgap(3); - currencyLayout.setVgap(2); - displayPanel.setBackground(Color.white); - getContentPane().add(mainPanel); - mainPanel.add(displayPanel, BorderLayout.NORTH); - displayPanel.add(display, BorderLayout.CENTER); - mainPanel.add(bordPanel, BorderLayout.CENTER); - bordPanel.add(currencyPanel, BorderLayout.NORTH); - currencyPanel.add(curFrom, null); - currencyPanel.add(curLabel, null); - currencyPanel.add(curTo, null); - bordPanel.add(keyPanel, BorderLayout.CENTER); - keyPanel.add(bAC, null); - keyPanel.add(b7, null); - keyPanel.add(b8, null); - keyPanel.add(b9, null); - keyPanel.add(bM, null); - keyPanel.add(bC, null); - keyPanel.add(b4, null); - keyPanel.add(b5, null); - keyPanel.add(b6, null); - keyPanel.add(bDiv, null); - keyPanel.add(bProc, null); - keyPanel.add(b1, null); - keyPanel.add(b2, null); - keyPanel.add(b3, null); - keyPanel.add(bMin, null); - keyPanel.add(bCur, null); - keyPanel.add(b0, null); - keyPanel.add(bDec, null); - keyPanel.add(bResult, null); - keyPanel.add(bPlus, null); - } // jbInit - - /** - * Finish Setup - */ - private void finishSetup() - { - Insets in = new Insets(2, 2, 2, 2); - - // For all buttons - Component[] comp = keyPanel.getComponents(); - for (int i = 0; i < comp.length; i++) - { - if (comp[i] instanceof JButton) - { - JButton b = (JButton)comp[i]; - b.setMargin(in); - b.addActionListener(this); - b.addKeyListener(this); - } - } - // Currency - toggleCurrency(); - - // Format setting - m_decimal = m_format.getDecimalFormatSymbols().getDecimalSeparator(); - - // display start number - if (m_number.doubleValue() != 0.00 ) - { - m_display = m_format.format(m_number); - display.setText(m_display); - } - } // finishSetup - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - // Handle Button input - if (e.getSource() instanceof JButton) - { - String cmd = e.getActionCommand(); - if (cmd != null && cmd.length() > 0) - handleInput(cmd.charAt(0)); - } - // Convert Amount - else if (e.getSource() == curTo) - { - KeyNamePair p = (KeyNamePair)curFrom.getSelectedItem(); - int curFromID = p.getKey(); - p = (KeyNamePair)curTo.getSelectedItem(); - int curToID = p.getKey(); - // convert - int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); - int AD_Org_ID = Env.getAD_Org_ID(Env.getCtx()); - m_number = MConversionRate.convert(Env.getCtx(), - evaluate(), curFromID, curToID, AD_Client_ID, AD_Org_ID); - m_display = m_format.format(m_number); - display.setText(m_display); - curFrom.setSelectedItem(p); - } - } // actionPerformed - - /** - * handle input - * @param c input character - */ - public void handleInput(char c) - { - // System.out.println("Input: " + c); - switch (c) - { - // Number =============================== - case '0': case '1': case '2': - case '3': case '4': case '5': - case '6': case '7': case '8': - case '9': - m_display += c; - break; - - // Decimal =============================== - case '.': - case ',': - m_display += m_decimal; - break; - - // Commands =============================== - case '/': case '*': - case '-': case '+': - case '%': - if (m_display.length() > 0) - { - char last = m_display.charAt(m_display.length()-1); - if (OPERANDS.indexOf(last) == -1) - m_display += c; - else - m_display = m_display.substring(0, m_display.length()-1) + c; - } - m_display = m_format.format(evaluate()); - if (c != '%') - m_display += c; - break; - - // Clear last char - case 'C': - if (m_display.length() > 0) - m_display = m_display.substring(0, m_display.length()-1); - break; - - // Clear all - case 'A': - m_display = ""; - break; - - // Currency convert toggle - case '$': - m_display = m_format.format(evaluate()); - toggleCurrency(); - break; - - // fini - case '=': - m_display = m_format.format(evaluate()); - m_abort = false; - if (isDisposeOnEqual()) //teo_sarca, bug [ 1628773 ] - dispose(); - break; - - // Error =============================== - default: - ADialog.beep(); - break; - } // switch - - if (m_display.equals("")) - m_display = "0"; - - // Eliminate leading zeroes - if (m_display.length() > 1 && m_display.startsWith("0")) - if (m_display.charAt(1) != ',' && m_display.charAt(1) != '.') - m_display = m_display.substring(1); - - // Display it - display.setText(m_display); - } // handleInput - - /** - * Evaluate. - * - evaluate info in display and set number - * @return result - */ - private BigDecimal evaluate() - { - // nothing or zero - if (m_display == null || m_display.equals("") || m_display.equals("0")) - { - m_number = Env.ZERO; - return m_number; - } - - StringTokenizer st = new StringTokenizer(m_display, OPERANDS, true); - - // first token - String token = st.nextToken(); - // do we have a negative number ? - if (token.equals("-")) - { - if (st.hasMoreTokens()) - token += st.nextToken(); - else - { - m_number = Env.ZERO; - return m_number; - } - } - - // First Number - Number firstNumber; - try - { - firstNumber = m_format.parse(token); - } - catch (ParseException pe1) - { - log.log(Level.SEVERE, "Calculator.evaluate - token: " + token, pe1); - m_number = Env.ZERO; - return m_number; - } - BigDecimal firstNo = new BigDecimal(firstNumber.toString()); - - // intermediate result - m_number = firstNo; - - // only one number - if (!st.hasMoreTokens()) - return m_number; - - // now we should get an operand - token = st.nextToken(); - if (OPERANDS.indexOf(token) == -1) - { - log.log(Level.SEVERE, "Calculator.evaluate - Unknown token: " + token); - return m_number; - } - // get operand - char op = token.charAt(0); - - if (op == '%') { - firstNo = firstNo.divide(Env.ONEHUNDRED, m_format.getMaximumFractionDigits(), RoundingMode.HALF_UP); - m_number = firstNo; - } - - // no second number - if (!st.hasMoreTokens()) - return m_number; - - token = st.nextToken(); - Number secondNumber; - try - { - secondNumber = m_format.parse(token); - } - catch (ParseException pe2) - { - log.log(Level.SEVERE, "Calculator.evaluate - token: " + token, pe2); - m_number = Env.ZERO; - return m_number; - } - BigDecimal secondNo = new BigDecimal(secondNumber.toString()); - - // Check the next operand - char op2 = 0; - if (st.hasMoreTokens()) - { - token = st.nextToken(); - if (OPERANDS.indexOf(token) == -1) - { - log.log(Level.SEVERE, "Calculator.evaluate - Unknown token: " + token); - return m_number; - } - // get operand - op2 = token.charAt(0); - } - - // Percent operation - if (op2 == '%') - secondNo = secondNo.divide(Env.ONEHUNDRED, m_format.getMaximumFractionDigits(), RoundingMode.HALF_UP); - - switch (op) - { - case '/': - m_number = firstNo - .divide(secondNo, m_format.getMaximumFractionDigits(), RoundingMode.HALF_UP); - break; - case '*': - m_number = firstNo.multiply(secondNo); - break; - case '-': - m_number = firstNo.subtract(secondNo); - break; - case '+': - m_number = firstNo.add(secondNo); - break; - default: - break; - } - return m_number.setScale(m_format.getMaximumFractionDigits(), RoundingMode.HALF_UP); - } // evaluate - - - /** - * Display or don't display Currency - */ - private void toggleCurrency() - { - if (currencyPanel.isVisible()) - currencyPanel.setVisible(false); - else - { - if (!m_currencyOK) - loadCurrency(); - currencyPanel.setVisible(true); - } - pack(); - } // toggleCurrency - - /** - * Load Currency - */ - private void loadCurrency() - { - // Get Default - int C_Currency_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "C_Currency_ID"); - if (C_Currency_ID == 0) - C_Currency_ID = Env.getContextAsInt(Env.getCtx(), "$C_Currency_ID"); - - String sql = "SELECT C_Currency_ID, ISO_Code FROM C_Currency " - + "WHERE IsActive='Y' ORDER BY 2"; - KeyNamePair defaultValue = null; - Statement stmt = null; - ResultSet rs = null; - try - { - stmt = DB.createStatement(); - rs = stmt.executeQuery(sql); - while (rs.next()) - { - int id = rs.getInt("C_Currency_ID"); - String s = rs.getString("ISO_Code"); - KeyNamePair p = new KeyNamePair(id, s); - curFrom.addItem(p); - curTo.addItem(p); - // Default - if (id == C_Currency_ID) - defaultValue = p; - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, "Calculator.loadCurrency", e); - } - finally - { - DB.close(rs, stmt); - rs = null; - stmt = null; - } - - // Set Defaults - if (defaultValue != null) - { - curFrom.setSelectedItem(defaultValue); - curTo.setSelectedItem(defaultValue); - } - // Set Listener - curTo.addActionListener(this); - m_currencyOK = true; - } // loadCurrency - - - /** - * Return Number - * @return result - */ - public BigDecimal getNumber() - { - if (m_abort) - return null; - - return m_number; - } // getNumber - - public boolean isDisposeOnEqual() - { - return p_disposeOnEqual; - } - - public void setDisposeOnEqual(boolean b) - { - p_disposeOnEqual = b; - } - - /*************************************************************************/ - - /** - * KeyPressed Listener - * @param e event - */ - public void keyPressed(KeyEvent e) - { - // sequence: pressed - typed(no KeyCode) - released - - char input = e.getKeyChar(); - int code = e.getKeyCode(); - - e.consume(); // does not work on JTextField - - if (code == KeyEvent.VK_DELETE) - input = 'A'; - else if (code == KeyEvent.VK_BACK_SPACE) - input = 'C'; - else if (code == KeyEvent.VK_ENTER) - input = '='; - else if (code == KeyEvent.VK_SHIFT) - // ignore - return; - // abort - else if (code == KeyEvent.VK_CANCEL || code == KeyEvent.VK_ESCAPE) - { - m_abort = true; - dispose(); - return; - } - handleInput(input); - } - - /** - * KeyTyped Listener (nop) - * @param e event - */ - public void keyTyped(KeyEvent e) {} - /** - * KeyReleased Listener (nop) - * @param e event - */ - public void keyReleased(KeyEvent e) {} - -} // Calculator - diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/Calendar.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/Calendar.java deleted file mode 100644 index 6b07cfcf67..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/Calendar.java +++ /dev/null @@ -1,906 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.GridLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.awt.event.WindowEvent; -import java.sql.Time; -import java.sql.Timestamp; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Locale; -import java.util.TimeZone; -import java.util.logging.Level; - -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JDialog; -import javax.swing.JLabel; -import javax.swing.JSpinner; -import javax.swing.SpinnerNumberModel; -import javax.swing.SwingConstants; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.swing.CButton; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Language; -import org.compiere.util.Msg; - -/** - * Pop up Calendar & Time - * - * @author Jorg Janke - * @version $Id: Calendar.java,v 1.3 2006/07/30 00:51:27 jjanke Exp $ - */ -public class Calendar extends CDialog - implements ActionListener, MouseListener, ChangeListener, KeyListener -{ - /** - * - */ - private static final long serialVersionUID = 6482995795697809468L; - - /** - * Mimimum Constructor for Date editor - * @param frame frame - */ - public Calendar (Frame frame) - { - this (frame, Msg.getMsg(Env.getCtx(), "Calendar"), null, DisplayType.Date); - } // Calendar - - /** - * Constructor - * @param frame frame - * @param title title - * @param startTS start date/time - * @param displayType DisplayType (Date, DateTime, Time) - */ - public Calendar (Frame frame, String title, Timestamp startTS, int displayType) - { - super (frame, title, true); - if (log.isLoggable(Level.INFO)) log.info(startTS==null ? "null" : startTS.toString() + " - DT=" + displayType); - m_displayType = displayType; - // - try - { - jbInit(); - setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "Calendar", ex); - } - // - loadData(startTS); - } // Calendar - - /** Display Type */ - private int m_displayType; - /** The Date */ - // BUG:3075946KTU - fix Thai Date - //private GregorianCalendar m_calendar; - private java.util.Calendar m_calendar; - // KTU - /** Is there a PM format */ - private boolean m_hasAM_PM = false; - // - private CButton[] m_days; - private CButton m_today; - /** First Dat of week */ - private int m_firstDay; - // - private int m_currentDay; - private int m_currentMonth; - private int m_currentYear; - private int m_current24Hour = 0; - private int m_currentMinute = 0; - // - private boolean m_setting = true; - /** Abort = ignore */ - private boolean m_abort = true; - /** Cancel = set null */ - private boolean m_cancel = false; - /** Clear = set new Timestamp(-1) */ - private boolean m_clear = false; - // - private long m_lastClick = System.currentTimeMillis(); - private int m_lastDay = -1; - // - private static final Insets ZERO_INSETS = new Insets(0,0,0,0); - /** Logger */ - private static CLogger log = CLogger.getCLogger(Calendar.class); - // - private CPanel mainPanel = new CPanel(); - private CPanel monthPanel = new CPanel(); - private CComboBox cMonth = new CComboBox(); - // BUG:3075946 KTU - Fix Thai Date - //private JSpinner cYear = new JSpinner(new SpinnerNumberModel(2000, 1900,2100,1)); - private JSpinner cYear = new JSpinner(new SpinnerNumberModel(2000, 1900, 3000, 1)); - // KTU - private BorderLayout mainLayout = new BorderLayout(); - private CPanel dayPanel = new CPanel(); - private GridLayout dayLayout = new GridLayout(); - private GridBagLayout monthLayout = new GridBagLayout(); - private CButton bNext = new CButton(); - private CButton bBack = new CButton(); - private CPanel timePanel = new CPanel(); - private CComboBox fHour = new CComboBox(getHours()); - private CLabel lTimeSep = new CLabel(); - private JSpinner fMinute = new JSpinner(new MinuteModel(5)); // 5 minute snap size - private JCheckBox cbPM = new JCheckBox(); - private JLabel lTZ = new JLabel(); - private CButton bOK = new CButton(); - private GridBagLayout timeLayout = new GridBagLayout(); - private boolean userTime = true; - - /** - * Static init - * @throws Exception - */ - private void jbInit() throws Exception - { - this.addKeyListener(this); - // - mainPanel.setLayout(mainLayout); - mainLayout.setHgap(2); - mainLayout.setVgap(2); - //mainPanel.setBorder(BorderFactory.createLoweredBevelBorder()); - mainPanel.setBorder(BorderFactory.createEmptyBorder(4,4,4,2)); - getContentPane().add(mainPanel); - - // Month Panel - monthPanel.setLayout(monthLayout); - monthPanel.add(bBack, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); - monthPanel.add(cYear, new GridBagConstraints(3, 0, 1, 1, 1.0, 0.0 - ,GridBagConstraints.SOUTHEAST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 0), 0, 0)); - monthPanel.add(bNext, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); - monthPanel.add(cMonth, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); - monthPanel.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 0)); - - mainPanel.add(monthPanel, BorderLayout.NORTH); - cMonth.addActionListener(this); - cYear.addChangeListener(this); - bBack.setIcon(Env.getImageIcon("Parent16.gif")); // < - bBack.setMargin(new Insets(0,0,0,0)); - bBack.addActionListener(this); - bNext.setIcon(Env.getImageIcon("Detail16.gif")); // > - bNext.setMargin(new Insets(0,0,0,0)); - bNext.addActionListener(this); - - // Day Panel - dayPanel.setLayout(dayLayout); - dayLayout.setColumns(7); - dayLayout.setHgap(2); - dayLayout.setRows(7); - dayLayout.setVgap(2); - dayPanel.setBackground(Color.white); - dayPanel.setOpaque(true); - mainPanel.add(dayPanel, BorderLayout.CENTER); - - // Time Panel - timePanel.setLayout(timeLayout); - lTimeSep.setText(" : "); - timePanel.add(fHour, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(0, 6, 0, 0), 0, 0)); - timePanel.add(lTimeSep, new GridBagConstraints(1, 0, 1, 1, 0.0, 1.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); - timePanel.add(fMinute, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); - timePanel.add(cbPM, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 0), 0, 0)); - timePanel.add(lTZ, new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 4, 0, 0), 0, 0)); - timePanel.add(bOK, new GridBagConstraints(5, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 6, 0, 2), 0, 0)); - mainPanel.add(timePanel, BorderLayout.SOUTH); - fHour.addKeyListener(this); // Enter returns - // JSpinner ignores KeyListener - ((JSpinner.DefaultEditor)fMinute.getEditor()).getTextField().addKeyListener(this); - fMinute.addChangeListener(this); - cbPM.addActionListener(this); - cbPM.addKeyListener(this); - bOK.setIcon(Env.getImageIcon("Ok16.gif")); - bOK.setMargin(new Insets(0,1,0,1)); - bOK.addActionListener(this); - - AutoCompletion.enable(fHour); - - } // jbInit - - /** - * Window Events - requestFocus - * @param e event - */ - protected void processWindowEvent(WindowEvent e) - { - // log.config( "Calendar.processWindowEvent", e); - super.processWindowEvent(e); - if (e.getID() == WindowEvent.WINDOW_OPENED) - { - if (m_displayType == DisplayType.Time) - fHour.requestFocus(); - else if (m_today != null) - m_today.requestFocus(); - } - } // processWindowEvent - - - /************************************************************************** - * Load Data. - * - Years - * - Month names - * - Day Names - * @param startTS time stamp - */ - private void loadData (Timestamp startTS) - { - // BUG:3075946 KTU - Fix Thai Date - //m_calendar = new GregorianCalendar(Language.getLoginLanguage().getLocale()); - m_calendar = java.util.Calendar.getInstance(Language.getLoginLanguage().getLocale()); - // KTU - if (startTS == null) - m_calendar.setTimeInMillis(System.currentTimeMillis()); - else - m_calendar.setTime(startTS); - // [ 1948445 ] Time field problem on daylight - if (m_displayType == DisplayType.Time) - m_calendar.set(1970, 1, 1); - m_firstDay = m_calendar.getFirstDayOfWeek(); - // - Locale loc = Language.getLoginLanguage().getLocale(); - SimpleDateFormat formatDate = (SimpleDateFormat)DateFormat.getDateInstance(DateFormat.LONG, loc); - // Short: h:mm a - HH:mm Long: h:mm:ss a z - HH:mm:ss z - SimpleDateFormat formatTime = (SimpleDateFormat)DateFormat.getTimeInstance(DateFormat.SHORT, loc); - m_hasAM_PM = formatTime.toPattern().indexOf('a') != -1; - if (m_hasAM_PM) - cbPM.setText(formatTime.getDateFormatSymbols().getAmPmStrings()[1]); - else - cbPM.setVisible(false); - - // Years - m_currentYear = m_calendar.get(java.util.Calendar.YEAR); - cYear.setEditor(new JSpinner.NumberEditor(cYear, "0000")); - cYear.setValue(Integer.valueOf(m_currentYear)); - - // Months -> 0=Jan 12=_ - String[] months = formatDate.getDateFormatSymbols().getMonths(); - for (int i = 0; i < months.length; i++) - { - KeyNamePair p = new KeyNamePair(i+1, months[i]); - if (!months[i].equals("")) - cMonth.addItem(p); - } - m_currentMonth = m_calendar.get(java.util.Calendar.MONTH) + 1; // Jan=0 - cMonth.setSelectedIndex(m_currentMonth-1); - - // Week Days -> 0=_ 1=Su .. 7=Sa - String[] days = formatDate.getDateFormatSymbols().getShortWeekdays(); // 0 is blank, 1 is Sunday - for (int i = m_firstDay; i < 7 + m_firstDay; i++) - { - int index = i > 7 ? i -7 : i; - dayPanel.add(createWeekday(days[index]), null); - } - - // Days - m_days = new CButton[6*7]; - m_currentDay = m_calendar.get(java.util.Calendar.DATE); - for (int i = 0; i < 6; i++) // six weeks a month maximum - for (int j = 0; j < 7; j++) // seven days - { - int index = i*7 + j; - m_days[index] = createDay(); - dayPanel.add(m_days[index], null); - } - - // Today button - m_days[m_days.length-1].setBackground(Color.green); - m_days[m_days.length-1].setText("*"); - m_days[m_days.length-1].setToolTipText(Msg.getMsg(Env.getCtx(), "Today")); - // Cancel - m_days[m_days.length-2].setBackground(Color.red); - m_days[m_days.length-2].setText("x"); - m_days[m_days.length-2].setToolTipText(Msg.getMsg(Env.getCtx(), "Cancel")); - // Clear - m_days[m_days.length-3].setBackground(Color.yellow); - String keyClear = Msg.getMsg(Env.getCtx(), "Key_Clear"); - if ("Key_Clear".equals(keyClear)) - keyClear = "c"; - m_days[m_days.length-3].setText(keyClear); - m_days[m_days.length-3].setToolTipText(Msg.getMsg(Env.getCtx(), "Clear")); - - // Date/Time - m_current24Hour = m_calendar.get(java.util.Calendar.HOUR_OF_DAY); - m_currentMinute = m_calendar.get(java.util.Calendar.MINUTE); - - // What to show - timePanel.setVisible(m_displayType == DisplayType.DateTime || m_displayType == DisplayType.Time); - monthPanel.setVisible(m_displayType != DisplayType.Time); - dayPanel.setVisible(m_displayType != DisplayType.Time); - - // update UI from m_current... - m_setting = false; - setCalendar(); - userTime = false; - } // loadData - - /** - * Create Week Day Label - * @param title Weekday Title - * @return week day - */ - private JLabel createWeekday (String title) - { - JLabel label = new JLabel(title); - //label.setBorder(BorderFactory.createRaisedBevelBorder()); - label.setHorizontalAlignment(SwingConstants.CENTER); - label.setHorizontalTextPosition(SwingConstants.CENTER); - label.setRequestFocusEnabled(false); - label.setBackground(AdempierePLAF.getPrimary1()); - label.setForeground(Color.white); - label.setOpaque(true); - return label; - } // createWeekday - - /** - * Create Day Label - * @return button - */ - private CButton createDay() - { - CButton button = new CButton(); - //button.setBorder(BorderFactory.createLoweredBevelBorder()); - button.setBorder(BorderFactory.createEmptyBorder()); - button.setHorizontalTextPosition(SwingConstants.CENTER); - button.setMargin(ZERO_INSETS); - button.addActionListener(this); - button.addMouseListener(this); - button.addKeyListener(this); - button.setFocusPainted(false); - button.putClientProperty("Plastic.is3D", Boolean.FALSE); - return button; - } // createWeekday - - /** - * Create 12/25 hours - * @return Array with hours as String - */ - private Object[] getHours() - { - Locale loc = Language.getLoginLanguage().getLocale(); - // Short: h:mm a - HH:mm Long: h:mm:ss a z - HH:mm:ss z - SimpleDateFormat formatTime = (SimpleDateFormat)DateFormat.getTimeInstance(DateFormat.SHORT, loc); - m_hasAM_PM = formatTime.toPattern().indexOf('a') != -1; - // - Object[] retValue = new Object[m_hasAM_PM ? 12 : 24]; - if (m_hasAM_PM) - { - retValue[0] = "12"; - for (int i = 1; i < 10; i++) - retValue[i] = " " + String.valueOf(i); - for (int i = 10; i < 12; i++) - retValue[i] = String.valueOf(i); - } - else - { - for (int i = 0; i < 10; i++) - retValue[i] = "0" + String.valueOf(i); - for (int i = 10; i < 24; i++) - retValue[i] = String.valueOf(i); - } - return retValue; - } // getHours - - - /************************************************************************** - * Set Calendar from m_current variables and update UI - */ - private void setCalendar() - { - if (m_setting) - return; - // log.config( "Calendar.setCalendar"); - - // --- Set Month & Year - m_setting = true; - cMonth.setSelectedIndex(m_currentMonth-1); - cYear.setValue(Integer.valueOf(m_currentYear)); - m_setting = false; - - // --- Set Day - // what is the first day in the selected month? - m_calendar.set(m_currentYear, m_currentMonth-1, 1); // Month is zero based - int dayOne = m_calendar.get(java.util.Calendar.DAY_OF_WEEK); - int lastDate = m_calendar.getActualMaximum(java.util.Calendar.DATE); - - // convert to index - dayOne -= m_firstDay; - if (dayOne < 0) - dayOne += 7; - lastDate += dayOne - 1; - - // for all buttons but the last - int curDay = 1; - for (int i = 0; i < m_days.length-3; i++) - { - if (i >= dayOne && i <= lastDate) - { - if (m_currentDay == curDay) - { - m_days[i].setBackground(Color.blue); - m_days[i].setForeground(Color.yellow); - m_today = m_days[i]; - m_today.requestFocus(); - } - else - { - m_days[i].setBackground(Color.white); - m_days[i].setForeground(Color.black); - } - m_days[i].setText(String.valueOf(curDay++)); - m_days[i].setReadWrite(true); - } - else - { - m_days[i].setText(""); - m_days[i].setReadWrite(false); - m_days[i].setBackground(AdempierePLAF.getFieldBackground_Inactive()); - } - } - - if ( !userTime ) - { - m_current24Hour = 0; - m_currentMinute = 0; - } - - // Set Hour - boolean pm = m_current24Hour > 11; - int index = m_current24Hour; - if (pm && m_hasAM_PM) - index -= 12; - if (index < 0 || index >= fHour.getItemCount()) - index = 0; - fHour.setSelectedIndex(index); - // Set Minute - int m = m_currentMinute; - fMinute.setValue(Integer.valueOf(m)); - // Set PM - cbPM.setSelected(pm); - // Set TZ - TimeZone tz = m_calendar.getTimeZone(); - lTZ.setText(tz.getDisplayName(tz.inDaylightTime(m_calendar.getTime()), TimeZone.SHORT)); - - // Update Calendar - m_calendar.set(m_currentYear, m_currentMonth-1, m_currentDay, m_current24Hour, m_currentMinute, 0); - m_calendar.set(java.util.Calendar.MILLISECOND, 0); - } // setCalendar - - /** - * Set Current Time from UI. - * - set m_current.. variables - */ - private void setTime() - { - // Hour - int h = fHour.getSelectedIndex(); - if ( h != m_current24Hour ) - userTime = true; - - m_current24Hour = h; - if (m_hasAM_PM && cbPM.isSelected()) - m_current24Hour += 12; - if (m_current24Hour < 0 || m_current24Hour > 23) - m_current24Hour = 0; - - // Minute - Integer ii = (Integer)fMinute.getValue(); - if ( m_currentMinute != ii.intValue() ) - userTime = true; - - m_currentMinute = ii.intValue(); - if (m_currentMinute < 0 || m_currentMinute > 59) - m_currentMinute = 0; - } // setTime - - /** - * Return Time stamp - * @return date and time - */ - public Timestamp getTimestamp() - { - // log.config( "Calendar.getTimeStamp"); - // Set Calendar - m_calendar.set(m_currentYear, m_currentMonth-1, m_currentDay, m_current24Hour, m_currentMinute, 0); - m_calendar.set(java.util.Calendar.MILLISECOND, 0); - - // Return value - if (m_abort || m_cancel) - { - if (m_clear) - // 1970-01-01 04:59:59.999 - return new Timestamp(-1); - else - return null; - } - long time = m_calendar.getTimeInMillis(); - if (m_displayType == DisplayType.Date) - time = new java.sql.Date(time).getTime(); - else if (m_displayType == DisplayType.Time) - time = new Time(time).getTime(); // based on 1970-01-01 - return new Timestamp(time); - } // getTimestamp - - /** - * Cancel button pressed - * @return true if canceled - */ - public boolean isCancel() - { - return m_cancel; - } // isCancel - - /** - * Clear button pressed - * @return true if canceled - */ - public boolean isClear() - { - return m_clear; - } // isCancel - - /************************************************************************** - * Action Listener for Month/Year combo & date buttons. - * - Double clicking on a date closes it - * - set m_current... - * @param e Event - */ - public void actionPerformed (ActionEvent e) - { - if (m_setting) - return; - // log.config( "Calendar.actionPerformed"); - setTime(); - - if (e.getSource() == bOK) - { - m_abort = false; - dispose(); - return; - } - else if (e.getSource() == bBack) - { - if (--m_currentMonth < 1) - { - m_currentMonth = 12; - m_currentYear--; - } - m_lastDay = -1; - } - else if (e.getSource() == bNext) - { - if (++m_currentMonth > 12) - { - m_currentMonth = 1; - m_currentYear++; - } - m_lastDay = -1; - } - else if (e.getSource() instanceof JButton) - { - JButton b = (JButton)e.getSource(); - String text = b.getText(); - // Today - Set to today's date - if (text.equals("*")) - { - m_calendar.setTime(new Timestamp(System.currentTimeMillis())); - m_currentDay = m_calendar.get(java.util.Calendar.DATE); - m_currentMonth = m_calendar.get(java.util.Calendar.MONTH) + 1; - m_currentYear = m_calendar.get(java.util.Calendar.YEAR); - m_current24Hour = m_calendar.get(java.util.Calendar.HOUR_OF_DAY); - m_currentMinute = m_calendar.get(java.util.Calendar.MINUTE); - } - // Cancel - else if (text.equals("x")) - { - m_cancel = true; - dispose(); - return; - } - // Clear - else if (text.equals("c")) - { - m_clear = true; - dispose(); - return; - } - // we have a day - else if (text.length() > 0) - { - m_currentDay = Integer.parseInt(text); - long currentClick = System.currentTimeMillis(); - if (m_currentDay == m_lastDay - && currentClick-m_lastClick < 1000) // double click 1 second - { - m_abort = false; - dispose(); - return; - } - m_lastClick = currentClick; - m_lastDay = m_currentDay; - } - } - else if (e.getSource() == cbPM) - { - setTime(); - m_lastDay = -1; - } - else - { - // Set Month - m_currentMonth = cMonth.getSelectedIndex()+1; - m_lastDay = -1; - } - setCalendar(); - } // actionPerformed - - /** - * ChangeListener (Year/Minute Spinner) - * @param e Event - */ - public void stateChanged(ChangeEvent e) - { - if (m_setting) - return; - - // Set Minute - if (e.getSource() == fMinute) - { - setTime(); - return; - } - // Set Year - m_currentYear = ((Integer)cYear.getValue()).intValue(); - m_lastDay = -1; - setCalendar(); - } // stateChanged - - - /************************************************************************** - * Mouse Clicked - * @param e Evant - */ - public void mouseClicked(MouseEvent e) - { - if (e.getClickCount() == 2) - { - m_abort = false; - dispose(); - } - } // mouseClicked - - /** - * mousePressed - * @param e - */ - public void mousePressed(MouseEvent e) {} - /** - * mouseEntered - * @param e - */ - public void mouseEntered(MouseEvent e) {} - /** - * mouseExited - * @param e - */ - public void mouseExited(MouseEvent e) {} - /** - * mouseReleased - * @param e - */ - public void mouseReleased(MouseEvent e) {} - - - /************************************************************************** - * Key Released - Return on enter - * @param e event - */ - public void keyReleased(KeyEvent e) - { - // System.out.println("Released " + e); - // Day Buttons - if (e.getSource() instanceof JButton) - { - if (e.getKeyCode() == KeyEvent.VK_PAGE_DOWN) - { - if (++m_currentMonth > 12) - { - m_currentMonth = 1; - m_currentYear++; - } - setCalendar(); - return; - } - if (e.getKeyCode() == KeyEvent.VK_PAGE_UP) - { - if (--m_currentMonth < 1) - { - m_currentMonth = 12; - m_currentYear--; - } - setCalendar(); - return; - } - - // Arrows - int offset = 0; - if (e.getKeyCode() == KeyEvent.VK_RIGHT) - offset = 1; - else if (e.getKeyCode() == KeyEvent.VK_LEFT) - offset = -1; - else if (e.getKeyCode() == KeyEvent.VK_UP) - offset = -7; - else if (e.getKeyCode() == KeyEvent.VK_DOWN) - offset = 7; - if (offset != 0) - { - System.out.println(m_calendar.getTime() + " offset=" + offset); - m_calendar.add(java.util.Calendar.DAY_OF_YEAR, offset); - System.out.println(m_calendar.getTime()); - - m_currentDay = m_calendar.get(java.util.Calendar.DAY_OF_MONTH); - m_currentMonth = m_calendar.get(java.util.Calendar.MONTH) + 1; - m_currentYear = m_calendar.get(java.util.Calendar.YEAR); - setCalendar(); - return; - } - // something else - actionPerformed(new ActionEvent(e.getSource(), ActionEvent.ACTION_PERFORMED, "")); - } - - // Pressed Enter anywhere - if (e.getKeyCode() == KeyEvent.VK_ENTER) - { - m_abort = false; - setTime(); - dispose(); - return; - } - - // ESC = Cancel - teo_sarca, [ 1660164 ] - if (e.getKeyCode() == KeyEvent.VK_ESCAPE) - { - m_cancel = true; - dispose(); - return; - } - - // Modified Hour/Minute - setTime(); - m_lastDay = -1; - } // keyReleased - - /** - * keyTyped - * @param e - */ - public void keyTyped(KeyEvent e) - { - // System.out.println("Typed " + e); - } - /** - * keyPressed - * @param e - */ - public void keyPressed(KeyEvent e) - { - // System.out.println("Pressed " + e); - } - -} // Calendar - -/** - * Minute Spinner Model. - * Based on Number Model - uses snap size to determine next value. - * Allows to manually set any minute, but return even snap value - * when spinner buttons are used. - * - * @author Jorg Janke - * @version $Id: Calendar.java,v 1.3 2006/07/30 00:51:27 jjanke Exp $ - */ -class MinuteModel extends SpinnerNumberModel -{ - /** - * - */ - private static final long serialVersionUID = -7328155195096551848L; - - /** - * Constructor. - * Creates Integer Spinner with minimum=0, maximum=59, stepsize=1 - * @param snapSize snap size - */ - public MinuteModel(int snapSize) - { - super(0,0,59, 1); // Integer Model - m_snapSize = snapSize; - } // MinuteModel - - /** Snap size */ - private int m_snapSize; - - /** - * Return next full snap value - * @return next snap value - */ - public Object getNextValue() - { - int minutes = ((Integer)getValue()).intValue(); - minutes += m_snapSize; - if (minutes >= 60) - minutes -= 60; - // - int steps = minutes / m_snapSize; - return Integer.valueOf(steps * m_snapSize); - } // getNextValue - - - /** - * Return previous full step value - * @return previous snap value - */ - public Object getPreviousValue() - { - int minutes = ((Integer)getValue()).intValue(); - minutes -= m_snapSize; - if (minutes < 0) - minutes += 60; - // - int steps = minutes / m_snapSize; - if (minutes % m_snapSize != 0) - steps++; - if (steps * m_snapSize > 59) - steps = 0; - return Integer.valueOf(steps * m_snapSize); - } // getNextValue - -} // MinuteModel diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/CityAutoCompleter.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/CityAutoCompleter.java deleted file mode 100644 index d26ef437f5..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/CityAutoCompleter.java +++ /dev/null @@ -1,243 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2009 SC ARHIPAC SERVICE SRL. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Color; -import java.awt.event.MouseEvent; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.text.JTextComponent; - -import org.adempiere.exceptions.DBException; -import org.compiere.model.MSysConfig; -import org.compiere.util.DB; -import org.compiere.util.Env; - -/** - * - * @author Cristina Ghita , www.arhipac.ro - * - */ -public class CityAutoCompleter extends AutoCompleter -{ - public static final CityVO ITEM_More = new CityVO(-1, "...", -1, ""); - private final int m_maxRows = MSysConfig.getIntValue(MSysConfig.LOCATION_MAX_CITY_ROWS, 7); - private CityVO m_city = null; - private final int m_windowNo; - private ArrayList list = new ArrayList(); - private ArrayList listShow = new ArrayList(); - - public CityAutoCompleter(JTextComponent comp, int windowNo) - { - super(comp); - this.m_windowNo = windowNo; - listBox.setVisibleRowCount(m_maxRows); - setCity(null); - } - - - @Override - protected void acceptedListItem(Object selected) - { - if (selected == null || selected == ITEM_More) - { - setCity(null); - return; - } - CityVO item = (CityVO) selected; - setCity(item); - Env.setContext(Env.getCtx(), m_windowNo, Env.TAB_INFO, "C_Region_ID", String.valueOf(item.C_Region_ID)); - textBox.setText(item.CityName); - } - - @Override - protected boolean updateListData() - { - String search = textBox.getText(); - if (m_city != null && m_city.CityName.compareTo(search) != 0) - { - setCity(null); - } - listShow.clear(); - boolean truncated = false; - search = search.toUpperCase(); - int i = 0; - for (CityVO vo : list) { - if (vo.CityName.toUpperCase().startsWith(search)) { - if (i > 0 && i == m_maxRows+1) - { - listShow.add(ITEM_More); - truncated = true; - break; - } - listShow.add(vo); - i++; - } - } - this.listBox.setListData(listShow.toArray()); - //if there is no city on the list return false, to not show the popup - if (listShow.isEmpty()) - { - return false; - } - else - { - CityVO city = (CityVO) listShow.get(0); - if (city.CityName.equalsIgnoreCase(search)) - { - m_city = city; - return true; - } - } - //if the list has only one item, but that item is not equals with m_city - //return false to not show any popup - if (!truncated && listShow.size() == 1 - && m_city != null && listShow.get(0).equals(this.m_city)) - { - log.finest("nothing to do 1"); - return false; - } - return true; - } - - public void fillList() - { - // Carlos Ruiz - globalqss - improve to avoid going to the database on every keystroke - list.clear(); - listShow.clear(); - ArrayList params = new ArrayList(); - final StringBuilder sql = new StringBuilder( - "SELECT cy.C_City_ID, cy.Name, cy.C_Region_ID, r.Name" - +" FROM C_City cy" - +" LEFT OUTER JOIN C_Region r ON (r.C_Region_ID=cy.C_Region_ID)" - +" WHERE cy.AD_Client_ID IN (0,?)"); - params.add(getAD_Client_ID()); - if (getC_Region_ID() > 0) - { - sql.append(" AND cy.C_Region_ID=?"); - params.add(getC_Region_ID()); - } - if (getC_Country_ID() > 0) - { - sql.append(" AND cy.C_Country_ID=?"); - params.add(getC_Country_ID()); - } - sql.append(" ORDER BY cy.Name, r.Name"); - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql.toString(), null); - DB.setParameters(pstmt, params); - rs = pstmt.executeQuery(); - int i = 0; - while(rs.next()) - { - CityVO vo = new CityVO(rs.getInt(1), rs.getString(2), rs.getInt(3), rs.getString(4)); - list.add(vo); - if (i <= m_maxRows) { - listShow.add(vo); - } else if (i == m_maxRows + 1 && i > 0) { - listShow.add(ITEM_More); - } - i++; - } - } - catch (SQLException e) - { - throw new DBException(e, sql.toString()); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - // - this.listBox.setListData(listShow.toArray()); - } - - private void setCity(CityVO vo) - { - m_city = vo; - if (log.isLoggable(Level.FINEST)) log.finest("C_City_ID="+m_city); - if (m_city == null) { - textBox.setBackground(new Color(230, 230, 255)); - } else { - textBox.setBackground(Color.WHITE); - } - } - public int getC_City_ID() - { - return m_city != null ? m_city.C_City_ID : -1; - } - public int getAD_Client_ID() - { - return Env.getAD_Client_ID(Env.getCtx()); - } - public int getC_Country_ID() - { - return Env.getContextAsInt(Env.getCtx(), m_windowNo, Env.TAB_INFO, "C_Country_ID"); - } - public int getC_Region_ID() - { - return Env.getContextAsInt(Env.getCtx(), m_windowNo, Env.TAB_INFO, "C_Region_ID"); - } - - public CityVO getCity() - { - return m_city; - } - - public void mouseEntered(MouseEvent e) - { - // nothing to do - - } - - public void mouseExited(MouseEvent e) - { - // nothing to do - - } - - public void mousePressed(MouseEvent e) - { - // nothing to do - - } - - public void mouseReleased(MouseEvent e) - { - // nothing to do - - } - - public void mouseClicked(MouseEvent e) - { - if (e == null || listBox == null || listBox.getSelectedValue() == null || listBox.getSelectedValue().equals(ITEM_More)) - { - setCity(null); - return; - } - - CityVO item = (CityVO)listBox.getSelectedValue(); - setCity(item); - Env.setContext(Env.getCtx(), m_windowNo, Env.TAB_INFO, "C_Region_ID", String.valueOf(item.C_Region_ID)); - textBox.setText(item.CityName); - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/ComboSelectionManager.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/ComboSelectionManager.java deleted file mode 100644 index ef32a350c2..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/ComboSelectionManager.java +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.util.logging.Level; - -import javax.swing.ComboBoxModel; -import javax.swing.JComboBox; - -import org.compiere.util.CLogger; - -/** - * ComboBox Selection Manager for AuroReduction - * - * @author Jorg Janke - * @version $Id: ComboSelectionManager.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class ComboSelectionManager implements JComboBox.KeySelectionManager -{ - /** - * - */ - public ComboSelectionManager() - { - } // ComboSelectionManager - - /** Logger */ - private static CLogger log = CLogger.getCLogger(ComboSelectionManager.class); - - /** - * Given aKey and the model, returns the row - * that should become selected. Return -1 if no match was - * found. - * - * @param key a char value, usually indicating a keyboard key that was pressed - * @param model a ComboBoxModel -- the component's data model, containing the list of selectable items - * @return an int equal to the selected row, where 0 is the first item and -1 is none - */ - public int selectionForKey (char key, @SuppressWarnings("rawtypes") ComboBoxModel model) - { - if (log.isLoggable(Level.FINE)) log.fine("Key=" + key); - // - //Object selectedItem = model.getSelectedItem(); - - return 0; - } // selectionForKey - - -} // ComboSelectionManager diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/Editor.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/Editor.java deleted file mode 100644 index c15e8dbe22..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/Editor.java +++ /dev/null @@ -1,342 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.io.BufferedWriter; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.io.UnsupportedEncodingException; -import java.util.logging.Level; - -import javax.swing.JDialog; -import javax.swing.JFileChooser; -import javax.swing.JFrame; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JTabbedPane; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.StatusBar; -import org.compiere.swing.CDialog; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextArea; -import org.compiere.swing.CTextPane; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Editor for Text (textArea) with HTML (textPane) View - * - * @author Jorg Janke - * @version $Id: Editor.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class Editor extends CDialog - implements ChangeListener, ActionListener, KeyListener -{ - /** - * - */ - private static final long serialVersionUID = -8314686583942866712L; - - /** - * Factory: Start Editor - * @param jc container to get parent frame - * @param header heading - * @param text initial text - * @param editable if false = r/o - * @param maxSize max size - * @return edited string - */ - public static String startEditor(Container jc, String header, String text, boolean editable, int maxSize) - { - // Find frame - JFrame frame = AEnv.getFrame(jc); - String hdr = header; - if (hdr == null || hdr.length() == 0) - hdr = Msg.getMsg(Env.getCtx(), "Editor"); - // Start it - Editor ed = new Editor(frame, hdr, text, editable, maxSize); - AEnv.showCenterWindow(frame, ed); - String s = ed.getText(); - ed = null; - return s; - } // startEditor - - /** - * Minimum constructor - * @param frame parent - */ - public Editor(Frame frame) - { - this (frame, Msg.getMsg(Env.getCtx(), "Editor"), "", true, 0); - } // Editor - - /** - * Standard constructor - * @param frame parent - * @param header heading - * @param text initial text - * @param editable if false = r/o - * @param maxSize max size; 0 = ignore - */ - public Editor(Frame frame, String header, String text, boolean editable, int maxSize) - { - super (frame, header, frame != null); - try - { - m_maxSize = maxSize; - jbInit(); - setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - // Set Text - m_text = text; - textArea.setText(m_text); - textArea.setEditable(editable); - if (editable) - textArea.setBackground(AdempierePLAF.getFieldBackground_Normal()); - else - textArea.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - textPane.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - updateStatusBar(); - } // Editor - - /** The Text */ - private String m_text; - /** Maximum Size */ - private int m_maxSize = 0; - /** Logger */ - private static CLogger log = CLogger.getCLogger(Editor.class); - - private CPanel panel = new CPanel(); - private BorderLayout panelLayout = new BorderLayout(); - private JTabbedPane tabbedPane = new JTabbedPane(); - private CTextArea textArea = new CTextArea(); - private CTextPane textPane = new CTextPane(); - private JMenuBar menuBar = new JMenuBar(); - private JMenu mFile = new JMenu(); - private CMenuItem mImport = new CMenuItem(); - private CMenuItem mExport = new CMenuItem(); - private ConfirmPanel confirmPanel = new ConfirmPanel(); - private StatusBar statusBar = new StatusBar(false); - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - panel.setLayout(panelLayout); - this.setJMenuBar(menuBar); - // Text Tab - textArea.setPreferredSize(new Dimension(300, 300)); - textArea.setWrapStyleWord(true); - textArea.setLineWrap(true); - tabbedPane.add(textArea, "Text"); - textArea.addKeyListener(this); - // HTML Tab - textPane.setContentType("text/html"); - textPane.setEditable(false); - tabbedPane.add(textPane, "HTML"); - // - mFile.setText("File"); - mImport.setText("Import"); - mImport.addActionListener(this); - mExport.setText("Export"); - mExport.addActionListener(this); - tabbedPane.addChangeListener(this); - panel.add(tabbedPane, BorderLayout.CENTER); - confirmPanel.addActionListener(this); - panel.add(confirmPanel, BorderLayout.SOUTH); - this.getContentPane().add(panel, BorderLayout.CENTER); - this.getContentPane().add(statusBar, BorderLayout.SOUTH); - // - menuBar.add(mFile); - mFile.add(mImport); - mFile.add(mExport); - updateStatusBar(); - } // jbInit - - /** - * ActionListener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - m_text = textArea.getText(); - if (log.isLoggable(Level.FINE)) log.fine("OK - length=" + m_text.length()); - dispose(); - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - dispose(); - } - - else if (e.getSource() == mImport) - { - importText(); - } - else if (e.getSource() == mExport) - { - exportText(); - } - } // actionPerformed - - /** - * Update Status Bar - */ - private void updateStatusBar() - { - String str = textArea.getText(); - int length = str.length(); - statusBar.setStatusDB(length); - int size = length; - try - { - size = str.getBytes("UTF-8").length; - } - catch (UnsupportedEncodingException e) - { - log.log(Level.SEVERE, str, e); - } - - if (m_maxSize == 0) - statusBar.setStatusLine(String.valueOf(size)); - else if (size < m_maxSize) - statusBar.setStatusLine(size + " < " + m_maxSize, false); - else if (size == m_maxSize) - statusBar.setStatusLine(size + " = " + m_maxSize, false); - else - { - statusBar.setStatusLine(size + " > " + m_maxSize, true); - Toolkit.getDefaultToolkit().beep(); - } - } // updateStatusBar - - /** - * Get Text - * @return edited text - */ - public String getText() - { - return m_text; - } // getText - - /** - * Import Text from File - */ - private void importText() - { - JFileChooser jc = new JFileChooser(); - jc.setDialogTitle(Msg.getMsg(Env.getCtx(), "ImportText")); - jc.setDialogType(JFileChooser.OPEN_DIALOG); - jc.setFileSelectionMode(JFileChooser.FILES_ONLY); - // - if (jc.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) - return; - - StringBuilder sb = new StringBuilder(); - try - { - InputStreamReader in = new InputStreamReader (new FileInputStream (jc.getSelectedFile())); - char[] cbuf = new char[1024]; - int count; - while ((count = in.read(cbuf)) > 0) - sb.append(cbuf, 0, count); - in.close(); - } - catch (Exception e) - { - log.log(Level.WARNING, e.getMessage()); - return; - } - textArea.setText(sb.toString()); - updateStatusBar(); - } // importText - - /** - * Export Text to File - */ - private void exportText() - { - JFileChooser jc = new JFileChooser(); - jc.setDialogTitle(Msg.getMsg(Env.getCtx(), "ExportText")); - jc.setDialogType(JFileChooser.SAVE_DIALOG); - jc.setFileSelectionMode(JFileChooser.FILES_ONLY); - // - if (jc.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) - return; - - try - { - BufferedWriter bout = new BufferedWriter (new OutputStreamWriter (new FileOutputStream (jc.getSelectedFile()))); - bout.write(textArea.getText()); - bout.flush(); - bout.close(); - } - catch (Exception e) - { - log.log(Level.WARNING, e.getMessage()); - } - } // exportText - - /** - * ChangeListener for TabbedPane - * @param e event - */ - public void stateChanged(ChangeEvent e) - { - if (tabbedPane.getSelectedIndex() == 1) // switch to HTML - textPane.setText(textArea.getText()); - } // stateChanged - - public void keyTyped (KeyEvent e) - { - } - - public void keyPressed (KeyEvent e) - { - } - - public void keyReleased (KeyEvent e) - { - updateStatusBar(); - } - -} // Editor diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/HTMLEditor.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/HTMLEditor.java deleted file mode 100644 index c522129a78..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/HTMLEditor.java +++ /dev/null @@ -1,531 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Dialog; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.Window; -import java.awt.event.ActionEvent; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.util.Hashtable; -import java.util.logging.Level; - -import javax.swing.Action; -import javax.swing.JButton; -import javax.swing.JFileChooser; -import javax.swing.JFrame; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JScrollPane; -import javax.swing.JTextPane; -import javax.swing.JToolBar; -import javax.swing.text.EditorKit; -import javax.swing.text.html.HTML; -import javax.swing.text.html.HTMLEditorKit; - -import org.compiere.Adempiere; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * HTML Editor. - * (Thanks to Kim Topley "Core Swing Programming" for action menu organization) - * @author Jorg Janke - * @version $Id: HTMLEditor.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class HTMLEditor extends CDialog -{ - /** - * - */ - private static final long serialVersionUID = -7502050590234610482L; - - - /** - * HTML Editor - * @param owner owner - * @param htmlText text - */ - public HTMLEditor (Frame owner, String title, String htmlText, boolean editable) - { - super (owner, title == null ? Msg.getMsg(Env.getCtx(), "Editor") : title, true); - init(owner, htmlText, editable); - } // HTMLEditor - - - /** - * HTML Editor - * @param owner owner - * @param htmlText text - */ - public HTMLEditor (Dialog owner, String title, String htmlText, boolean editable) - { - super (owner, title == null ? Msg.getMsg(Env.getCtx(), "Editor") : title, true); - init(owner, htmlText, editable); - } // HTMLEditor - - /** - * Init - * @param owner owner - * @param htmlText text - */ - private void init (Window owner, String htmlText, boolean editable) - { - try - { - jbInit(); - } - catch (Exception e) - { - log.log(Level.SEVERE, "HTMLEditor", e); - } - setHtmlText(htmlText); - editorPane.setEditable(editable); - AEnv.showCenterWindow(owner, this); - } // init - - /** Logger */ - private CLogger log = CLogger.getCLogger(getClass()); - /** The HTML Text */ - private String m_text; - - // - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - // - private JScrollPane editorScrollPane = new JScrollPane(); - private JTextPane editorPane = new JTextPane(); - // - private ConfirmPanel confirmPanel = new ConfirmPanel (true); - - // Tool Bar - private JToolBar toolBar = new JToolBar(); - private JButton bImport = AEnv.getButton("Import"); - private JButton bExport = AEnv.getButton("Export"); - private JButton bBold = AEnv.getButton("Bold"); - private JButton bItalic = AEnv.getButton("Italic"); - private JButton bUnderline = AEnv.getButton("Underline"); - - // Menu Bar - private JMenuBar menuBar = new JMenuBar(); - - private static String NAME_SIZE = Msg.getMsg(Env.getCtx(),"Size"); - private static String NAME_HEADING = Msg.getMsg(Env.getCtx(), "Heading"); - // Font Size Sub-Menu - private static HTMLEditor_MenuAction[] sizeMenu = new HTMLEditor_MenuAction[] { - new HTMLEditor_MenuAction(NAME_SIZE + " 8", "font-size-8"), - new HTMLEditor_MenuAction(NAME_SIZE + " 10", "font-size-10"), - new HTMLEditor_MenuAction(NAME_SIZE + " 12", "font-size-12"), - new HTMLEditor_MenuAction(NAME_SIZE + " 14", "font-size-14"), - new HTMLEditor_MenuAction(NAME_SIZE + " 16", "font-size-16"), - new HTMLEditor_MenuAction(NAME_SIZE + " 18", "font-size-18"), - new HTMLEditor_MenuAction(NAME_SIZE + " 24", "font-size-24"), - new HTMLEditor_MenuAction(NAME_SIZE + " 36", "font-size-36"), - new HTMLEditor_MenuAction(NAME_SIZE + " 48", "font-size-48") - }; - // Font Family Sub-Menu - private static HTMLEditor_MenuAction[] familyMenu = new HTMLEditor_MenuAction[] { - new HTMLEditor_MenuAction("Sans Serif", "font-family-SansSerif"), - new HTMLEditor_MenuAction("Monospaced", "font-family-Monospaced"), - new HTMLEditor_MenuAction("Serif", "font-family-Serif") - }; - // Font Size Sub-Menu - private static HTMLEditor_MenuAction[] styleMenu = new HTMLEditor_MenuAction[] { - new HTMLEditor_MenuAction(Msg.getMsg(Env.getCtx(), "Bold"), "font-bold"), - new HTMLEditor_MenuAction(Msg.getMsg(Env.getCtx(), "Italic"), "font-italic"), - new HTMLEditor_MenuAction(Msg.getMsg(Env.getCtx(), "Underline"), "font-underline") - // default-typed? - }; - // Heading Sub-Menu - private static HTMLEditor_MenuAction[] headingMenu = new HTMLEditor_MenuAction[] { - new HTMLEditor_MenuAction(NAME_HEADING + " 1", "Heading 1"), - new HTMLEditor_MenuAction(NAME_HEADING + " 2", "Heading 2"), - new HTMLEditor_MenuAction(NAME_HEADING + " 3", "Heading 3"), - new HTMLEditor_MenuAction(NAME_HEADING + " 4", "Heading 4"), - new HTMLEditor_MenuAction(NAME_HEADING + " 5", "Heading 5") - }; - // Font Menu - private static HTMLEditor_MenuAction[] fontMenu = new HTMLEditor_MenuAction[] { - new HTMLEditor_MenuAction(NAME_SIZE, sizeMenu), - new HTMLEditor_MenuAction(Msg.getMsg(Env.getCtx(), "FontFamily"), familyMenu), - new HTMLEditor_MenuAction(Msg.getMsg(Env.getCtx(), "FontStyle"), styleMenu), - new HTMLEditor_MenuAction(NAME_HEADING, headingMenu) - }; - // Alignment Menu - private static HTMLEditor_MenuAction[] alignMenu = new HTMLEditor_MenuAction[] { - new HTMLEditor_MenuAction(Msg.getMsg(Env.getCtx(), "Left"), "left-justify"), - new HTMLEditor_MenuAction(Msg.getMsg(Env.getCtx(), "Center"), "center-justify"), - new HTMLEditor_MenuAction(Msg.getMsg(Env.getCtx(), "Right"), "right-justify") - }; - // Other HTML Menu - private static HTMLEditor_MenuAction[] htmlMenu = new HTMLEditor_MenuAction[] { - new HTMLEditor_MenuAction("Paragraph", "Paragraph"), - new HTMLEditor_MenuAction("Table", "InsertTable"), - new HTMLEditor_MenuAction("Table Row", "InsertTableRow"), - new HTMLEditor_MenuAction("Table Cell", "InsertTableDataCell"), - new HTMLEditor_MenuAction("Unordered List", "InsertUnorderedList"), - new HTMLEditor_MenuAction("Unordered List Item", "InsertUnorderedListItem"), - new HTMLEditor_MenuAction("Ordered List", "InsertOrderedList"), - new HTMLEditor_MenuAction("Ordered List Item", "InsertOrderedListItem"), - new HTMLEditor_MenuAction("Preformatted Paragraph", "InsertPre"), - new HTMLEditor_MenuAction("Horizontal Rule", "InsertHR") - }; - - // Insert HTML Actions - private static HTMLEditorKit.InsertHTMLTextAction[] extraActions = - new HTMLEditorKit.InsertHTMLTextAction[] - { - new HTMLEditorKit.InsertHTMLTextAction("Heading 1", "

    h1

    ", - HTML.Tag.BODY, HTML.Tag.H1), - new HTMLEditorKit.InsertHTMLTextAction("Heading 2", "

    h2

    ", - HTML.Tag.BODY, HTML.Tag.H2), - new HTMLEditorKit.InsertHTMLTextAction("Heading 3", "

    h3

    ", - HTML.Tag.BODY, HTML.Tag.H3), - new HTMLEditorKit.InsertHTMLTextAction("Heading 4", "

    h4

    ", - HTML.Tag.BODY, HTML.Tag.H4), - new HTMLEditorKit.InsertHTMLTextAction("Heading 5", "

    h5

    ", - HTML.Tag.BODY, HTML.Tag.H5), - // - new HTMLEditorKit.InsertHTMLTextAction("Paragraph", "

    p

    ", - HTML.Tag.BODY, HTML.Tag.P) - }; - - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - // ToolBar - bImport.setToolTipText(Msg.getMsg(Env.getCtx(), "Import")); - bImport.addActionListener(this); - bExport.setToolTipText(Msg.getMsg(Env.getCtx(), "Export")); - bExport.addActionListener(this); - // - bBold.setToolTipText(Msg.getMsg(Env.getCtx(), "Bold")); - bItalic.setToolTipText(Msg.getMsg(Env.getCtx(), "Italic")); - bUnderline.setToolTipText(Msg.getMsg(Env.getCtx(), "Underline")); - - toolBar.add(bImport, null); - toolBar.add(bExport, null); - toolBar.addSeparator(); - toolBar.add(bBold, null); - toolBar.add(bItalic, null); - toolBar.add(bUnderline, null); - toolBar.addSeparator(); - - // Editor - editorPane.setContentType("text/html"); - // Set Menu (content type must be set) - setJMenuBar(menuBar); - createMenuBar(); - - // General Layout - mainPanel.setLayout(mainLayout); - getContentPane().add(mainPanel, BorderLayout.CENTER); - mainPanel.add(toolBar, BorderLayout.NORTH); - mainPanel.add(editorScrollPane, BorderLayout.CENTER); - // Size 600x600 - editorScrollPane.setPreferredSize(new Dimension(600,600)); - editorScrollPane.getViewport().add(editorPane, null); - mainPanel.add(confirmPanel, BorderLayout.SOUTH); - confirmPanel.addActionListener(this); - } // setHTMLText - - /** - * Create Menu Bar - */ - private void createMenuBar() - { - // Build Lookup - Action[] actionArray = editorPane.getActions(); - Hashtable actions = new Hashtable(); - for (int i = 0; i < actionArray.length; i++) - { - Object name = actionArray[i].getValue(Action.NAME); - // System.out.println (name); - actions.put(name, actionArray[i]); - } - for (int i = 0; i < extraActions.length; i++) - { - Object name = extraActions[i].getValue(Action.NAME); - actions.put(name, extraActions[i]); - } - - // Add the font menu - JMenu menu = buildMenu(Msg.getMsg(Env.getCtx(), "Font"), fontMenu, actions); - if (menu != null) - menuBar.add(menu); - - // Add the alignment menu - menu = buildMenu(Msg.getMsg(Env.getCtx(), "Align"), alignMenu, actions); - if (menu != null) - menuBar.add(menu); - - // Add the HTML menu - menu = buildMenu("HTML", htmlMenu, actions); - if (menu != null) - menuBar.add(menu); - - // Add to Button Actions - Action targetAction = (Action)actions.get("font-bold"); - bBold.addActionListener(targetAction); - targetAction = (Action)actions.get("font-italic"); - bItalic.addActionListener(targetAction); - targetAction = (Action)actions.get("font-underline"); - bUnderline.addActionListener(targetAction); - - } // createMenuBar - - /** - * Build Menu - * @param name name - * @param menuActions menu structure - * @param actions lookup - * @return menu - */ - private JMenu buildMenu(String name, HTMLEditor_MenuAction[] menuActions, Hashtable actions) - { - JMenu menu = new JMenu(name); - for (int i = 0; i < menuActions.length; i++) - { - HTMLEditor_MenuAction item = menuActions[i]; - if (item.isSubMenu()) // Recurse to handle a sub menu - { - JMenu subMenu = buildMenu(item.getName(), item.getSubMenus(), actions); - if (subMenu != null) - menu.add(subMenu); - } - else if (item.isAction()) // direct action - { - menu.add(item.getAction()); - } - else // find it - { - String actionName = item.getActionName(); - Action targetAction = (Action)actions.get(actionName); - // Create the menu item - JMenuItem menuItem = menu.add(item.getName()); - if (targetAction != null) - menuItem.addActionListener(targetAction); - else // Action not known - disable the menu item - menuItem.setEnabled(false); - } - } // for all actions - - // Return null if nothing was added to the menu. - if (menu.getMenuComponentCount() == 0) - menu = null; - - return menu; - } // buildMenu - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - // log.fine("actionPerformed - Text:" + getHtmlText()); - // - - if (e.getSource() == bImport) - cmd_import(); - else if (e.getSource() == bExport) - cmd_export(); - // - else if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - m_text = editorPane.getText(); - dispose(); - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - dispose(); - } // actionPerformed - - /** - * Import Text from File - */ - private void cmd_import() - { - JFileChooser jc = new JFileChooser(); - jc.setDialogTitle(Msg.getMsg(Env.getCtx(), "Import")); - jc.setDialogType(JFileChooser.OPEN_DIALOG); - jc.setFileSelectionMode(JFileChooser.FILES_ONLY); - // - if (jc.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) - return; - - StringBuilder sb = new StringBuilder(); - try - { - InputStreamReader in = new InputStreamReader (new FileInputStream (jc.getSelectedFile())); - char[] cbuf = new char[1024]; - int count; - while ((count = in.read(cbuf)) > 0) - sb.append(cbuf, 0, count); - in.close(); - } - catch (Exception e) - { - log.log(Level.SEVERE, "HTMLEditor.import" + e.getMessage()); - return; - } - setHtmlText(sb.toString()); - } // cmd_import - - /** - * Export Text to File - */ - private void cmd_export() - { - JFileChooser jc = new JFileChooser(); - jc.setDialogTitle(Msg.getMsg(Env.getCtx(), "Export")); - jc.setDialogType(JFileChooser.SAVE_DIALOG); - jc.setFileSelectionMode(JFileChooser.FILES_ONLY); - // - if (jc.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) - return; - - try - { - @SuppressWarnings("unused") - EditorKit kit = editorPane.getEditorKit(); - OutputStreamWriter writer = new OutputStreamWriter - (new FileOutputStream (jc.getSelectedFile())); - editorPane.write(writer); - writer.flush(); - writer.close(); - } - catch (Exception e) - { - log.log(Level.SEVERE, "HTMLEditor.export" + e.getMessage()); - } - } // cmd_export - - - /************************************************************************* - * Get Html Text - * @return text - */ - public String getHtmlText() - { - return m_text; - } // getHTMLText - - /** - * Set Html Text - * @param htmlText - */ - public void setHtmlText (String htmlText) - { - m_text = htmlText; - editorPane.setText(htmlText); - } // setHTMLText - - /************************************************************************** - * Test - * @param args ignored - */ - public static void main (String[] args) - { - Adempiere.startupEnvironment(true); - JFrame frame = new JFrame("test"); - frame.setVisible(true); - String text = "

    this is a line
    with bold info"; - int i = 0; - while (true) - { - HTMLEditor ed = new HTMLEditor (frame, "heading " + ++i, text, true); - text = ed.getHtmlText(); - } - } // main - -} // HTMLEditor - -/****************************************************************************** - * HTML Editor Menu Action - */ -class HTMLEditor_MenuAction -{ - public HTMLEditor_MenuAction(String name, HTMLEditor_MenuAction[] subMenus) - { - m_name = name; - m_subMenus = subMenus; - } - - public HTMLEditor_MenuAction(String name, String actionName) - { - m_name = name; - m_actionName = actionName; - } - - public HTMLEditor_MenuAction(String name, Action action) - { - m_name = name; - m_action = action; - } - - private String m_name; - private String m_actionName; - private Action m_action; - private HTMLEditor_MenuAction[] m_subMenus; - - - public boolean isSubMenu() - { - return m_subMenus != null; - } - - public boolean isAction() - { - return m_action != null; - } - - public String getName() - { - return m_name; - } - - public HTMLEditor_MenuAction[] getSubMenus() - { - return m_subMenus; - } - - public String getActionName() - { - return m_actionName; - } - - public Action getAction() - { - return m_action; - } - -} // MenuAction diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocDate.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocDate.java deleted file mode 100644 index 279ef458a6..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocDate.java +++ /dev/null @@ -1,304 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.sql.Timestamp; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.logging.Level; - -import javax.swing.event.CaretEvent; -import javax.swing.event.CaretListener; -import javax.swing.text.AttributeSet; -import javax.swing.text.BadLocationException; -import javax.swing.text.JTextComponent; -import javax.swing.text.PlainDocument; - -import org.compiere.apps.ADialog; -import org.compiere.util.CLogger; - -/** - * Date Model. - * Validates input based on date pattern - * @see VDate - * - * @author Jorg Janke - * @version $Id: MDocDate.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public final class MDocDate extends PlainDocument implements CaretListener -{ - /** - * - */ - private static final long serialVersionUID = 8453168098223574265L; - - /** - * Constructor - * @param displayType display type - * @param format format - * @param tc text component - * @param title title - */ - public MDocDate (int displayType, SimpleDateFormat format, - JTextComponent tc, String title) - { - super(); - m_displayType = displayType; - m_tc = tc; - m_tc.addCaretListener(this); - // - m_format = format; - if (m_format == null) - m_format = new SimpleDateFormat(); - m_format.setLenient(false); - - // Mark delimiters as '^' in Pattern - char[] pattern = m_format.toPattern().toCharArray(); - for (int i = 0; i < pattern.length; i++) - { - // do we have a delimiter? - if ("Mdy".indexOf(pattern[i]) == -1) - pattern[i] = DELIMITER; - } - m_mask = new String(pattern); - // - m_title = title; - if (m_title == null) - m_title = ""; - } // MDocDate - - private JTextComponent m_tc; - private SimpleDateFormat m_format; - private String m_mask; - private static final char DELIMITER = '^'; - // for Calendar - private String m_title; - private int m_displayType; - private int m_lastDot = 0; // last dot position - /** Logger */ - private static CLogger log = CLogger.getCLogger(MDocDate.class); - - /** - * Insert String - * @param offset offset - * @param string string - * @param attr attributes - * @throws BadLocationException - */ - @Override - public void insertString (int offset, String string, AttributeSet attr) - throws BadLocationException - { - if (log.isLoggable(Level.FINEST)) log.finest("Offset=" + offset + ",String=" + string + ",Attr=" + attr - + ",OldText=" + getText() + ",OldLength=" + getText().length()); - - // manual entry - // DBTextDataBinder.updateText sends stuff at once - length=8 - if (string != null && string.length() == 1) - { - // ignore if too long - if (offset >= m_mask.length()) - return; - - // is it an empty field? - int length = getText().length(); - if (offset == 0 && length == 0) - { - Date today = new Date(System.currentTimeMillis()); - String dateStr = m_format.format(today); - super.insertString(0, string + dateStr.substring(1), attr); - m_tc.setCaretPosition(1); - return; - } - - // is it a digit ? - try - { - Integer.parseInt(string); - } - catch (Exception pe) - { - //hengsin, [ 1660175 ] Date field - anoying popup - //startDateDialog(); - ADialog.beep(); - return; - } - - // try to get date in field, if invalid, get today's - /*try - { - char[] cc = getText().toCharArray(); - cc[offset] = string.charAt(0); - m_format.parse(new String(cc)); - } - catch (ParseException pe) - { - startDateDialog(); - return; - }*/ - - // positioned before the delimiter - jump over delimiter - if (offset != m_mask.length()-1 && m_mask.charAt(offset+1) == DELIMITER) - m_tc.setCaretPosition(offset+2); - - // positioned at the delimiter - if (m_mask.charAt(offset) == DELIMITER) - { - offset++; - m_tc.setCaretPosition(offset+1); - } - super.remove(offset, 1); // replace current position - } - - // Set new character - super.insertString(offset, string, attr); - // New value set Cursor - if (offset == 0 && string != null && string.length() > 1) - m_tc.setCaretPosition(0); - } // insertString - - /** - * Delete String - * @param offset offset - * @param length length - * @throws BadLocationException - */ - @Override - public void remove (int offset, int length) - throws BadLocationException - { - if (log.isLoggable(Level.FINEST)) log.finest("Offset=" + offset + ",Length=" + length); - - // begin of string - if (offset == 0 || length == 0) - { - // empty the field - // if the length is 0 or greater or equal with the mask length - teo_sarca, [ 1660595 ] Date field: incorrect functionality on paste - if (length >= m_mask.length() || length == 0) - super.remove(offset, length); - return; - } - - // one position behind delimiter - if (offset-1 >= 0 && offset-1 < m_mask.length() - && m_mask.charAt(offset-1) == DELIMITER) - { - if (offset-2 >= 0) - m_tc.setCaretPosition(offset-2); - else - return; - } - else - m_tc.setCaretPosition(offset-1); - } // deleteString - - /** - * Caret Listener - * @param e event - */ - public void caretUpdate(CaretEvent e) - { - if (log.isLoggable(Level.FINEST)) log.finest("Dot=" + e.getDot() + ",Last=" + m_lastDot - + ", Mark=" + e.getMark()); - // Selection - if (e.getDot() != e.getMark()) - { - m_lastDot = e.getDot(); - return; - } - // - - // Is the current position a fixed character? - if (e.getDot()+1 > m_mask.length() - || m_mask.charAt(e.getDot()) != DELIMITER) - { - m_lastDot = e.getDot(); - return; - } - - // Direction? - int newDot = -1; - if (m_lastDot > e.getDot()) // <- - newDot = e.getDot() - 1; - else // -> (or same) - newDot = e.getDot() + 1; - if (e.getDot() == 0) // first - newDot = 1; - else if (e.getDot() == m_mask.length()-1) // last - newDot = e.getDot() - 1; - // - if (log.isLoggable(Level.FINE)) log.fine("OnFixedChar=" + m_mask.charAt(e.getDot()) - + ", newDot=" + newDot + ", last=" + m_lastDot); - // - m_lastDot = e.getDot(); - if (newDot >= 0 && newDot < getText().length()) - m_tc.setCaretPosition(newDot); - } // caretUpdate - - /** - * Get Full Text - * @return text - */ - private String getText() - { - String str = ""; - try - { - str = getContent().getString(0, getContent().length()-1); // cr at end - } - catch (Exception e) - { - str = ""; - } - return str; - } // getString - - /** - * Call Calendar Dialog - */ - @SuppressWarnings("unused") - private void startDateDialog() - { - log.config(""); - - // Date Dialog - String result = getText(); - Timestamp ts = null; - try - { - ts = new Timestamp(m_format.parse(result).getTime()); - } - catch (Exception pe) - { - ts = new Timestamp(System.currentTimeMillis()); - } - ts = VDate.startCalendar(m_tc, ts, m_format, m_displayType, m_title); - result = m_format.format(ts); - - // move to field - try - { - super.remove(0, getText().length()); - super.insertString(0, result, null); - } - catch (BadLocationException ble) - { - log.log(Level.SEVERE, "", ble); - } - } // startDateDialog - -} // MDocDate diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocNumber.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocNumber.java deleted file mode 100644 index 4416b9afac..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocNumber.java +++ /dev/null @@ -1,322 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.DecimalFormat; -import java.text.DecimalFormatSymbols; -import java.text.ParseException; -import java.util.logging.Level; - -import javax.swing.text.AttributeSet; -import javax.swing.text.BadLocationException; -import javax.swing.text.JTextComponent; -import javax.swing.text.PlainDocument; - -import org.compiere.apps.ADialog; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; - -/** - * Number Document Model. - * Locale independent editing of numbers by removing thousands - * and treating ., as decimal separator. Final formatting in VNumber.setValue - * - * @see VNumber - * @author Jorg Janke - * @version $Id: MDocNumber.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - BF [ 1759655 ] - */ -public final class MDocNumber extends PlainDocument -{ - /** - * - */ - private static final long serialVersionUID = 2586631851842406102L; - - /** - * Constructor - * @param displayType - * @param format - * @param tc - * @param title - */ - public MDocNumber(int displayType, DecimalFormat format, - JTextComponent tc, String title) - { - super(); - if (format == null || tc == null || title == null) - throw new IllegalArgumentException("Invalid argument"); - // - m_displayType = displayType; - m_format = format; - m_tc = tc; - m_title = title; - // - DecimalFormatSymbols sym = m_format.getDecimalFormatSymbols(); - m_decimalSeparator = sym.getDecimalSeparator(); - m_groupingSeparator = sym.getGroupingSeparator(); - m_minusSign = sym.getMinusSign(); - // log.finest("Decimal=" + m_decimalSeparator + "(" + (int)m_decimalSeparator - // + ") - Group=" + m_groupingSeparator + "(" + (int)m_groupingSeparator +")"); - } // MDocNumber - - /** DisplayType used */ - private int m_displayType = 0; - /** Number Format */ - private DecimalFormat m_format = null; - /** The 'owning' component */ - private JTextComponent m_tc = null; - /** Title for calculator */ - private String m_title = null; - /** Decimal Separator */ - private char m_decimalSeparator = '.'; - /** Grouping Separator */ - private char m_groupingSeparator = ','; - /** Minus Sign */ - private char m_minusSign = '-'; - /** Percent Sign */ - private char m_percentSign = '%'; - /** Logger */ - private static CLogger log = CLogger.getCLogger (MDocNumber.class); - - /************************************************************************** - * Insert String - * @param origOffset - * @param string - * @param attr - * @throws BadLocationException - */ - @Override - public void insertString(int origOffset, String string, AttributeSet attr) - throws BadLocationException - { - if (log.isLoggable(Level.FINEST)) log.finest("Offset=" + origOffset + " String=" + string + " Length=" + string.length()); - if (origOffset < 0 || string == null) - throw new IllegalArgumentException("Invalid argument"); - - int offset = origOffset; - int length = string.length(); - // From DataBinder (assuming correct format) - if (length != 1) - { - super.insertString(offset, string, attr); - return; - } - - /** - * Manual Entry - */ - String content = getText(); - // remove all Thousands - if (content.indexOf(m_groupingSeparator) != -1) - { - StringBuilder result = new StringBuilder(); - for (int i = 0; i < content.length(); i++) - { - if (content.charAt(i) == m_groupingSeparator) - { - if (i < offset) - offset--; - } - else - result.append(content.charAt(i)); - } - super.remove(0, content.length()); - super.insertString(0, result.toString(), attr); - // - m_tc.setCaretPosition(offset); - // ADebug.trace(ADebug.l6_Database, "Clear Thousands (" + m_format.toPattern() + ")" + content + " -> " + result.toString()); - content = result.toString(); - } // remove Thousands - - /********************************************************************** - * Check Character entered - */ - char c = string.charAt(0); - if (Character.isDigit(c)) // c >= '0' && c <= '9') - { - // ADebug.trace(ADebug.l6_Database, "Digit=" + c); - super.insertString(offset, string, attr); - return; - } - - // Decimal - remove other decimals - // Thousand - treat as Decimal - else if (c == m_decimalSeparator || c == m_groupingSeparator || c == '.' || c == ',') - { - // log.info("Decimal=" + c + " (ds=" + m_decimalSeparator + "; gs=" + m_groupingSeparator + ")"); - // no decimals on integers - if (m_displayType == DisplayType.Integer) - return; - int pos = content.indexOf(m_decimalSeparator); - - // put decimal in - String decimal = String.valueOf(m_decimalSeparator); - super.insertString(offset, decimal, attr); - - // remove other decimals - if (pos != 0) - { - content = getText(); - StringBuilder result = new StringBuilder(); - int correction = 0; - for (int i = 0; i < content.length(); i++) - { - if (content.charAt(i) == m_decimalSeparator) - { - if (i == offset) - result.append(content.charAt(i)); - else if (i < offset) - correction++; - } - else - result.append(content.charAt(i)); - } - super.remove(0, content.length()); - super.insertString(0, result.toString(), attr); - m_tc.setCaretPosition(offset-correction+1); - } // remove other decimals - } // decimal or thousand - - // something else - else if (VNumber.AUTO_POPUP || "=+-/*%".indexOf(c) > -1) - { - - // Minus - put minus on start of string - if ( c == m_minusSign && offset == 0 ) - { - // no minus possible - if (m_displayType == DisplayType.Integer) - return; - // add at start of string - else - super.insertString(0, "-", attr); - } - else - { - if (log.isLoggable(Level.FINE)) log.fine("Input=" + c + " (" + (int)c + ")"); - - if (c == m_percentSign && offset > 0 ) { - // don't convert integers to percent. 1% = 0? - if (m_displayType == DisplayType.Integer) - return; - // divide by 100 - else - { - String value = getText(); - BigDecimal percentValue = Env.ZERO; - try - { - if (value != null && value.length() > 0) - { - Number number = m_format.parse(value); - percentValue = new BigDecimal (number.toString()); - percentValue = percentValue.divide(Env.ONEHUNDRED, m_format.getMaximumFractionDigits(), RoundingMode.HALF_UP); - m_tc.setText(m_format.format(percentValue)); - } - } - catch (ParseException pe) - { - if (log.isLoggable(Level.INFO)) log.info("InvalidEntry - " + pe.getMessage()); - } - - } - } - else - { - - String result = VNumber.startCalculator(m_tc, getText(), - m_format, m_displayType, m_title, c); - super.remove(0, content.length()); - - // insertString(0, result, attr); - m_tc.setText(result); - } - } - } - else - ADialog.beep(); - } // insertString - - - /************************************************************************** - * Delete String - * @param origOffset Offeset - * @param length length - * @throws BadLocationException - */ - @Override - public void remove (int origOffset, int length) - throws BadLocationException - { - if (log.isLoggable(Level.FINEST)) log.finest("Offset=" + origOffset + " Length=" + length); - if (origOffset < 0 || length < 0) - throw new IllegalArgumentException("MDocNumber.remove - invalid argument"); - - int offset = origOffset; - if (length != 1) - { - super.remove(offset, length); - return; - } - /** - * Manual Entry - */ - String content = getText(); - // remove all Thousands - if (content.indexOf(m_groupingSeparator) != -1) - { - StringBuilder result = new StringBuilder(); - for (int i = 0; i < content.length(); i++) - { - if (content.charAt(i) == m_groupingSeparator && i != origOffset) - { - if (i < offset) - offset--; - } - else - result.append(content.charAt(i)); - } - super.remove(0, content.length()); - super.insertString(0, result.toString(), null); - m_tc.setCaretPosition(offset); - } // remove Thousands - super.remove(offset, length); - } // remove - - /** - * Get Full Text - * @return text - */ - private String getText() - { - Content c = getContent(); - String str = ""; - try - { - str = c.getString(0, c.length()-1); // cr at end - } - catch (Exception e) - {} - return str; - } // getString - -} // MDocNumber diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocString.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocString.java deleted file mode 100644 index dcb30e01ac..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocString.java +++ /dev/null @@ -1,401 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.util.logging.Level; - -import javax.swing.event.CaretEvent; -import javax.swing.event.CaretListener; -import javax.swing.text.AttributeSet; -import javax.swing.text.BadLocationException; -import javax.swing.text.JTextComponent; -import javax.swing.text.PlainDocument; - -import org.compiere.util.CLogger; - -/** - * String Input Verification. - *

    - *	-	Length is set to length of VFormat or FieldLength if no format defined
    - *	Control Characters
    - *			(Space) any character
    - *		_	Space (fixed character)
    - *
    - *		l	any Letter a..Z NO space
    - *		L	any Letter a..Z NO space converted to upper case
    - *		o	any Letter a..Z or space
    - *		O	any Letter a..Z or space converted to upper case
    - *
    - *		0	Digits 0..9 NO space
    - *      9   Digits 0..9 or space
    - *
    - *		a	any Letters & Digits NO space
    - *		A	any Letters & Digits NO space converted to upper case
    - *		c	any Letters & Digits or space
    - *		C	any Letters & Digits or space converted to upper case
    - *		Z	any character converted to upper case
    - *  
    - * @see VString - * @author Jorg Janke - * @version $Id: MDocString.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public final class MDocString extends PlainDocument implements CaretListener -{ - /** - * - */ - private static final long serialVersionUID = -1714284669663890694L; - - /** - * Constructor - * @param VFormat - * @param fieldLength - * @param tc VPassword or VString - */ - public MDocString(String VFormat, int fieldLength, JTextComponent tc) - { - super(); - m_fieldLength = fieldLength; - setFormat (VFormat); - m_tc = tc; - if (tc != null) - m_tc.addCaretListener(this); - } // MDocNumber - - private String m_VFormat; // Value Format String - private String m_mask; // Fixed Elements - private int m_fieldLength; - private int m_maxLength; - private JTextComponent m_tc; - private int m_lastDot = 0; // last dot position - // - private static final char SPACE = ' '; - private static final char SPACE_IND = '_'; - /** Logger */ - private static CLogger log = CLogger.getCLogger(MDocString.class); - - /** - * Set Format - * @param VFormat - */ - public final void setFormat (String VFormat) - { - m_VFormat = VFormat; - if (m_VFormat == null) - m_VFormat = ""; - m_mask = m_VFormat; - // Set Length - m_maxLength = m_fieldLength; - if (m_VFormat.length() == 0) - return; - // - log.fine(VFormat); - if (m_maxLength > m_VFormat.length()) - m_maxLength = m_VFormat.length(); - - // Create Mask - m_mask = m_mask.replace('c', SPACE); // c any Letter or Digit or space - m_mask = m_mask.replace('C', SPACE); // C any Letter or Digit or space converted to upper case - m_mask = m_mask.replace('a', SPACE); // a any Letters or Digits NO space - m_mask = m_mask.replace('A', SPACE); // A any Letters or Digits NO space converted to upper case - m_mask = m_mask.replace('l', SPACE); // l any Letter a..Z NO space - m_mask = m_mask.replace('L', SPACE); // L any Letter a..Z NO space converted to upper case - m_mask = m_mask.replace('o', SPACE); // o any Letter a..Z or space - m_mask = m_mask.replace('O', SPACE); // O any Letter a..Z or space converted to upper case - m_mask = m_mask.replace('0', SPACE); // 0 Digits 0..9 NO space - m_mask = m_mask.replace('9', SPACE); // 9 Digits 0..9 or space - /** - * Feature Request [1707462] - * Convert any to Uppercase - */ - m_mask = m_mask.replace('Z', SPACE); // Z any character converted to upper case - - // Check Caret - if (m_tc == null || m_tc.getCaret() instanceof VOvrCaret) - return; - else - m_tc.setCaret(new VOvrCaret()); - } // setFormat - - /** - * Insert String - * @param offset - * @param string - * @param attr - * @throws BadLocationException - */ - @Override - public void insertString(int offset, String string, AttributeSet attr) - throws BadLocationException - { - // Max Length - if (m_VFormat.length() == 0) { - // non formatted strings - // // @Trifon - [ 1718897 ] User can enter more characters than max size field - if (getLength() + string.length() > m_maxLength) - return; - } else { - // Formatted strings - // globalqss - Carlos Ruiz [ 1766180 ] Formatted Field input Bug - if (offset >= m_maxLength) - return; - } - - // We have no Format or inserted not manually (assuming correct Format) - if (m_VFormat.length() == 0 || string.length() != 1) - { - if (log.isLoggable(Level.FINEST)) log.finest("Offset=" + offset + " String=" + string); - super.insertString(offset, string, attr); - return; - } - - /** Formating required **/ - if (log.isLoggable(Level.FINEST)) log.finest("Offset=" + offset - + ", String=" + string + ", MaxLength=" + m_maxLength - + ", Format=" + m_VFormat + ", Mask=" + m_mask - + ", Text=" + getText() + ", Length=" + getText().length()); - /** **/ - String text = getText(); - - // Apply Mask, if not target length - if (m_VFormat.length() != text.length()) - { - char[] result = m_mask.toCharArray(); - for (int i = 0; i < result.length; i++) - { - if (result[i] == SPACE && text.length() > i) - result[i] = text.charAt(i); - else if (result[i] == SPACE_IND) - result[i] = SPACE; - } - // - super.remove(0, text.length()); - super.insertString(0, new String(result), attr); - m_tc.setCaretPosition(offset); - text = getText(); - } - - // positioned before a mask character - jump over it - if (offset+1 < text.length() && m_mask.charAt(offset+1) != SPACE) - if (offset+2 < getText().length()) - m_tc.setCaretPosition(offset+2); - - // positioned at the mask character - if (m_mask.charAt(offset) != SPACE) - { - if (offset+1 == m_mask.length()) - return; - offset++; - m_tc.setCaretPosition(offset+1); - } - - // Conversion - char c = string.charAt(0); - char cmd = m_VFormat.charAt(offset); - if (log.isLoggable(Level.FINE)) log.fine( "char=" + c + ", cmd=" + cmd); - switch (cmd) - { - case 'c': // c any Letter or Digits or space - if (Character.isLetter(c) || Character.isDigit(c) || Character.isSpaceChar(c)) - ; - else - return; - break; - // - case 'C': // C any Letter or Digits or space converted to upper case - if (Character.isLetter(c) || Character.isDigit(c) || Character.isSpaceChar(c)) - string = string.toUpperCase(); - else - return; - break; - // - case 'a': // a any Letter or Digits NO space - if (Character.isLetter(c) || Character.isDigit(c)) - ; - else - return; - break; - // - case 'A': // A any Letter or Digits NO space converted to upper case - if (Character.isLetter(c) || Character.isDigit(c)) - string = string.toUpperCase(); - else - return; - break; - // ---- - case 'l': // l any Letter a..Z NO space - if (!Character.isLetter(c)) - return; - break; - // - case 'L': // L any Letter a..Z NO space converted to upper case - if (!Character.isLetter(c)) - return; - string = string.toUpperCase(); - break; - // - case 'o': // o any Letter a..Z or space - if (Character.isLetter(c) || Character.isSpaceChar(c)) - ; - else - return; - break; - // - case 'O': // O any Letter a..Z or space converted to upper case - if (Character.isLetter(c) || Character.isSpaceChar(c)) - string = string.toUpperCase(); - else - return; - break; - // ---- - case '9': // 9 Digits 0..9 or space - if (Character.isDigit(c) || Character.isSpaceChar(c)) - ; - else - return; - break; - // - case '0': // 0 Digits 0..9 NO space - if (!Character.isDigit(c)) - return; - break; - // - case SPACE: // any character - break; - // - /** - * Feature Request [1707462] - * Convert any to Uppercase - */ - case 'Z': // Z any character converted to upper case - string = string.toUpperCase(); - break; - // ---- - default: // other - return; - } // switch - - super.remove(offset, 1); // replace current position - super.insertString(offset, string, attr); - } // insertString - - /** - * Delete String - * @param offset - * @param length - * @throws BadLocationException - */ - @Override - public void remove (int offset, int length) - throws BadLocationException - { - // No format or non manual entry - if (m_VFormat.length() == 0 || length != 1) - { - if (log.isLoggable(Level.FINEST)) log.finest("Offset=" + offset + " Length=" + length); - super.remove(offset, length); - return; - } - - - // begin of string - if (offset == 0) - { - // empty the field - if (length == m_mask.length()) - super.remove(offset, length); - return; - } - - // one position behind delimiter - if (offset-1 >= 0 && m_mask.charAt(offset-1) != SPACE) - { - if (offset-2 >= 0) - m_tc.setCaretPosition(offset-2); - else - return; - } - else - m_tc.setCaretPosition(offset-1); - } // deleteString - - /** - * Get Full Text - * @return text - */ - private String getText() - { - String str = ""; - try - { - str = getContent().getString(0, getContent().length()-1); // cr at end - } - catch (Exception e) - { - str = ""; - } - return str; - } // getString - - - /************************************************************************** - * Caret Listener - * @param e - */ - public void caretUpdate(CaretEvent e) - { - // No Format - if (m_VFormat.length() == 0 - // Format error - all fixed characters - || m_VFormat.equals(m_mask)) - return; - // Selection - if (e.getDot() != e.getMark()) - { - m_lastDot = e.getDot(); - return; - } - // - // log.fine( "MDocString.caretUpdate -" + m_VFormat + "-" + m_mask + "- dot=" + e.getDot() + ", mark=" + e.getMark()); - - // Is the current position a fixed character? - if (e.getDot()+1 > m_mask.length() || m_mask.charAt(e.getDot()) == SPACE) - { - m_lastDot = e.getDot(); - return; - } - - // Direction? - int newDot = -1; - if (m_lastDot > e.getDot()) // <- - newDot = e.getDot() - 1; - else // -> (or same) - newDot = e.getDot() + 1; - // - if (e.getDot() == 0) // first - newDot = 1; - else if (e.getDot() == m_mask.length()-1) // last - newDot = e.getDot() - 1; - // - // log.fine( "OnFixedChar=" + m_mask.charAt(e.getDot()) + ", newDot=" + newDot + ", last=" + m_lastDot); - - m_lastDot = e.getDot(); - if (newDot >= 0 && newDot < getText().length()) - m_tc.setCaretPosition(newDot); - } // caretUpdate - -} // MDocString diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocTime.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocTime.java deleted file mode 100644 index bd9f7cc236..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocTime.java +++ /dev/null @@ -1,163 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.util.logging.Level; - -import javax.swing.text.AttributeSet; -import javax.swing.text.BadLocationException; -import javax.swing.text.PlainDocument; - -import org.compiere.util.CLogger; - -/** - * Time Model. - * Validates input for hour or minute field - * @see VDate - * - * @author Jorg Janke - * @version $Id: MDocTime.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public final class MDocTime extends PlainDocument -{ - /** - * - */ - private static final long serialVersionUID = 5359545674957190259L; - - /** - * Constructor - * @param isHour Hour field - * @param is12Hour 12 hour format - */ - public MDocTime(boolean isHour, boolean is12Hour) - { - super(); - m_isHour = isHour; - m_is12Hour = is12Hour; - } // MDocTime - - private boolean m_isHour; - private boolean m_is12Hour; - /** Logger */ - private static CLogger log = CLogger.getCLogger(MDocTime.class); - - /** - * Insert String - * @param offset offset - * @param string string - * @param attr attributes - * @throws BadLocationException - */ - public void insertString (int offset, String string, AttributeSet attr) - throws BadLocationException - { - // log.fine( "MDocTime.insertString - Offset=" + offset - // + ", String=" + string + ", Attr=" + attr + ", Text=" + getText() + ", Length=" + getText().length()); - - // manual entry - // DBTextDataBinder.updateText sends stuff at once - if (string != null && string.length() == 1) - { - // ignore if too long - if (offset > 2) - return; - - // is it a digit ? - if (!Character.isDigit(string.charAt(0))) - { - if (log.isLoggable(Level.CONFIG)) log.config("No Digit=" + string); - return; - } - - // resulting string - char[] cc = getText().toCharArray(); - cc[offset] = string.charAt(0); - String result = new String(cc); - - int i = 0; - try - { - i = Integer.parseInt(result.trim()); - } - catch (Exception e) - { - log.log(Level.SEVERE, e.toString()); - } - if (i < 0) - { - if (log.isLoggable(Level.CONFIG)) log.config("Invalid value: " + i); - return; - } - // Minutes - if (!m_isHour && i > 59) - { - if (log.isLoggable(Level.CONFIG)) log.config("Invalid minute value: " + i); - return; - } - // Hour - if (m_isHour && m_is12Hour && i > 12) - { - if (log.isLoggable(Level.CONFIG)) log.config("Invalid 12 hour value: " + i); - return; - } - if (m_isHour && !m_is12Hour && i > 24) - { - if (log.isLoggable(Level.CONFIG)) log.config("Invalid 24 hour value: " + i); - return; - } - // - // super.remove(offset, 1); // replace current position - } - // Set new character - super.insertString(offset, string, attr); - } // insertString - - /** - * Delete String - * @param offset offset - * @param length length - * @throws BadLocationException - */ - public void remove (int offset, int length) - throws BadLocationException - { - // log.fine( "MDocTime.remove - Offset=" + offset + ", Length=" + length); - - super.remove(offset, length); - } // deleteString - - /** - * Get Full Text (always two character) - * @return text - */ - private String getText() - { - StringBuilder sb = new StringBuilder(); - try - { - sb.append(getContent().getString(0, getContent().length()-1)); // cr at end - } - catch (Exception e) - { - } - while (sb.length() < 2) - sb.insert(0, ' '); - return sb.toString(); - } // getString - -} // MDocTime diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAccount.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAccount.java deleted file mode 100644 index 23c1725e2f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAccount.java +++ /dev/null @@ -1,507 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.logging.Level; - -import javax.swing.JComponent; -import javax.swing.JPopupMenu; -import javax.swing.LookAndFeel; -import javax.swing.SwingUtilities; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.AEnv; -import org.compiere.apps.FieldRecordInfo; -import org.compiere.model.GridField; -import org.compiere.model.MAccountLookup; -import org.compiere.model.MRole; -import org.compiere.swing.CButton; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; - -/** - * Account Control - Displays ValidCombination and launches Dialog - * - * @author Jorg Janke - * @version $Id: VAccount.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *
  • BF [ 1830531 ] Process parameter with type Account not working - */ -public final class VAccount extends JComponent - implements VEditor, ActionListener, FocusListener -{ - /** - * - */ - private static final long serialVersionUID = 8918710495283801426L; - - /****************************************************************************** - * Mouse Listener - */ - final class VAccount_mouseAdapter extends MouseAdapter - { - /** - * Constructor - * @param adaptee adaptee - */ - VAccount_mouseAdapter(VAccount adaptee) - { - m_adaptee = adaptee; - } // VNumber_mouseAdapter - - private VAccount m_adaptee; - - /** - * Mouse Listener - * @param e event - */ - public void mouseClicked(MouseEvent e) - { - // popup menu - if (SwingUtilities.isRightMouseButton(e)) - m_adaptee.popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - } // mouseClicked - - } - - /** - * Constructor - * @param columnName - * @param mandatory - * @param isReadOnly - * @param isUpdateable - * @param mAccount - * @param title - */ - public VAccount(String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable, - MAccountLookup mAccount, String title) - { - super(); - super.setName(columnName); - m_columnName = columnName; - m_mAccount = mAccount; - m_title = title; - // - LookAndFeel.installBorder(this, "TextField.border"); - this.setLayout(new BorderLayout()); - // Size - this.setPreferredSize(m_text.getPreferredSize()); // causes r/o to be the same length - int height = m_text.getPreferredSize().height; - - // *** Button & Text *** - m_text.setBorder(null); - m_text.addActionListener(this); - m_text.addFocusListener(this); - m_text.setFont(AdempierePLAF.getFont_Field()); - m_text.setForeground(AdempierePLAF.getTextColor_Normal()); - m_text.addMouseListener(new VAccount_mouseAdapter(this)); - this.add(m_text, BorderLayout.CENTER); - - m_button.setIcon(Env.getImageIcon("Account10.gif")); - m_button.setMargin(new Insets(0, 0, 0, 0)); - m_button.setPreferredSize(new Dimension(height, height)); - m_button.addActionListener(this); - m_button.setFocusable(false); - this.add(m_button, BorderLayout.EAST); - - // Editable - if (isReadOnly || !isUpdateable) - setReadWrite (false); - else - setReadWrite (true); - setMandatory (mandatory); - } // VAccount - - /** - * Dispose - */ - public void dispose() - { - m_text = null; - m_button = null; - m_mAccount = null; - } // dispose - - private CTextField m_text = new CTextField (VLookup.DISPLAY_LENGTH); - private CButton m_button = new CButton(); - private MAccountLookup m_mAccount; - private Object m_value; - private String m_title; - private int m_WindowNo; - - private String m_columnName; - // Popup - JPopupMenu popupMenu = new JPopupMenu(); - /** Logger */ - private static CLogger log = CLogger.getCLogger(VAccount.class); - - /** - * Enable/disable - * @param value - */ - public void setReadWrite(boolean value) - { - m_button.setReadWrite(value); - m_text.setReadWrite(value); - if (m_button.isVisible() != value) - m_button.setVisible(value); - setBackground(false); - } // setReadWrite - - /** - * IsReadWrite - * @return true if read write - */ - public boolean isReadWrite() - { - return m_button.isReadWrite(); - } // isReadWrite - - /** - * Set Mandatory (and back bolor) - * @param mandatory - */ - public void setMandatory (boolean mandatory) - { - m_button.setMandatory(mandatory); - setBackground(false); - } // setMandatory - - /** - * Is it mandatory - * @return mandatory - */ - public boolean isMandatory() - { - return m_button.isMandatory(); - } // isMandatory - - /** - * Set Background - * @param color - */ - public void setBackground (Color color) - { - // if (!color.equals(m_text.getBackground())) - m_text.setBackground(color); - } // setBackground - - /** - * Set Background based on editable / mandatory / error - * @param error if true, set background to error color, otherwise mandatory/editable - */ - public void setBackground (boolean error) - { - if (error) - setBackground(AdempierePLAF.getFieldBackground_Error()); - else if (!isReadWrite()) - setBackground(AdempierePLAF.getFieldBackground_Inactive()); - else if (isMandatory()) - setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - else - setBackground(AdempierePLAF.getFieldBackground_Normal()); - } // setBackground - - /** - * Set Foreground - * @param fg - */ - public void setForeground(Color fg) - { - m_text.setForeground(fg); - } // setForeground - - /** - * Set Editor to value - * @param value - */ - public void setValue (Object value) - { - m_value = value; - m_text.setText(m_mAccount.getDisplay(value)); // loads value - m_text.setToolTipText(m_mAccount.getDescription()); - } // setValue - - /** - * Request Focus - */ - public void requestFocus () - { - m_text.requestFocus (); - } // requestFocus - - /** - * Request Focus In Window - * @return focus request - */ - @Override - public boolean requestFocusInWindow() - { - return m_text.requestFocusInWindow(); - } // requestFocusInWindow - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return m_text; - } // getFocusComponent - - /** - * Property Change Listener - * @param evt - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * Return Editor value - * @return value - */ - public Object getValue() - { - return Integer.valueOf(m_mAccount.C_ValidCombination_ID); - } // getValue - - /** - * Return Display Value - * @return String representation - */ - public String getDisplay() - { - return m_text.getText(); - } // getDisplay - - /** - * ActionListener - Button - Start Dialog - * @param e - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(FieldRecordInfo.CHANGE_LOG_COMMAND)) - { - FieldRecordInfo.start(m_mField); - return; - } - - if (e.getSource() == m_text) - cmd_text(); - else - cmd_button(); - } // actionPerformed - - /** - * Button - Start Dialog - */ - public void cmd_button() - { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - int C_AcctSchema_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "C_AcctSchema_ID", false); - // Try to get C_AcctSchema_ID from global context - teo_sarca BF [ 1830531 ] - if (C_AcctSchema_ID <= 0) - { - C_AcctSchema_ID = Env.getContextAsInt(Env.getCtx(), "$C_AcctSchema_ID"); - } - VAccountDialog ad = new VAccountDialog (AEnv.getFrame(this), m_title, - m_mAccount, C_AcctSchema_ID); - setCursor(Cursor.getDefaultCursor()); - // - Integer newValue = ad.getValue(); -// if (newValue == null) -// return; - - // set & redisplay - setValue(newValue); - - // Data Binding - try - { - fireVetoableChange(m_columnName, null, newValue); - } - catch (PropertyVetoException pve) - { - } - } // cmd_button - - private boolean m_cmdTextRunning = false; - private GridField m_mField; - /** - * Text - try to find Alias or start Dialog - */ - public void cmd_text() - { - if (m_cmdTextRunning) - return; - m_cmdTextRunning = true; - - String text = m_text.getText(); - if (log.isLoggable(Level.INFO)) log.info("Text=" + text); - if (text == null || text.length() == 0 || text.equals("%")) - { - cmd_button(); - m_cmdTextRunning = false; - return; - } - if (!text.endsWith("%")) - text += "%"; - // - String sql = "SELECT C_ValidCombination_ID FROM C_ValidCombination " - + "WHERE C_AcctSchema_ID=?" - + " AND (UPPER(Alias) LIKE ? OR UPPER(Combination) LIKE ?)"; - sql = MRole.getDefault().addAccessSQL(sql, - "C_ValidCombination", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - int C_AcctSchema_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "C_AcctSchema_ID"); - // - int C_ValidCombination_ID = 0; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, C_AcctSchema_ID); - pstmt.setString(2, text.toUpperCase()); - pstmt.setString(3, text.toUpperCase()); - rs = pstmt.executeQuery(); - if (rs.next()) - { - C_ValidCombination_ID = rs.getInt(1); - if (rs.next()) // only one - C_ValidCombination_ID = 0; - } - } - catch (Exception e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - // We have a Value - if (C_ValidCombination_ID > 0) - { - Integer newValue = Integer.valueOf(C_ValidCombination_ID); - - // set & redisplay - setValue(newValue); - - // Data Binding - try - { - fireVetoableChange(m_columnName, null, newValue); - } - catch (PropertyVetoException pve) - { - } - } - else - cmd_button(); - - m_cmdTextRunning = false; - } // actionPerformed - - - /** - * Action Listener Interface - * @param listener - */ - public void addActionListener(ActionListener listener) - { - m_text.addActionListener(listener); - } // addActionListener - - /** - * Set Field/WindowNo for ValuePreference (NOP) - * @param mField - */ - public void setField (org.compiere.model.GridField mField) - { - if (mField != null) - m_WindowNo = mField.getWindowNo(); - m_mField = mField; - if (m_mField != null) - FieldRecordInfo.addMenu(this, popupMenu); - - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - /** - * String Representation - * @return info - */ - public String toString() - { - StringBuilder sb = new StringBuilder ("VAccount["); - sb.append (m_value).append ("]"); - return sb.toString (); - } // toString - - public void focusGained(FocusEvent e) - { - } - - public void focusLost(FocusEvent e) - { - if (m_text == null) return; // arhipac: teo_sarca: already disposed - // Test Case: Open a window, click on account field that is mandatory but not filled, close the window and you will get an NPE - // TODO: integrate to trunk - // New text - String newText = m_text.getText(); - if (newText == null) - newText = ""; - // Actual text - String actualText = m_mAccount.getDisplay(m_value); - if (actualText == null) - actualText = ""; - // If text was modified, try to resolve the valid combination - if (!newText.equals(actualText)) - { - cmd_text(); - } - } - -} // VAccount \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAccountDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAccountDialog.java deleted file mode 100644 index 15607409f2..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAccountDialog.java +++ /dev/null @@ -1,1145 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.beans.VetoableChangeListener; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.logging.Level; - -import javax.swing.BorderFactory; -import javax.swing.ImageIcon; -import javax.swing.JDialog; -import javax.swing.JLabel; -import javax.swing.JTable; -import javax.swing.JToolBar; -import javax.swing.border.TitledBorder; - -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.StatusBar; -import org.compiere.grid.GridController; -import org.compiere.model.DataStatusEvent; -import org.compiere.model.DataStatusListener; -import org.compiere.model.GridField; -import org.compiere.model.GridTab; -import org.compiere.model.GridWindow; -import org.compiere.model.GridWindowVO; -import org.compiere.model.MAccount; -import org.compiere.model.MAccountLookup; -import org.compiere.model.MAcctSchema; -import org.compiere.model.MAcctSchemaElement; -import org.compiere.model.MQuery; -import static org.compiere.model.SystemIDs.*; -import org.compiere.swing.CButton; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Dialog to enter Account Info - * - * @author Jorg Janke - * @version $Id: VAccountDialog.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $ - */ -public final class VAccountDialog extends CDialog - implements ActionListener, DataStatusListener, VetoableChangeListener -{ - /** - * - */ - private static final long serialVersionUID = -1980622319541357651L; - - /** - * Mouse Listener - */ - class VAccountDialog_mouseAdapter extends java.awt.event.MouseAdapter - { - VAccountDialog_mouseAdapter(VAccountDialog adaptee) - { - this.adaptee = adaptee; - } - - VAccountDialog adaptee; - - public void mouseClicked(MouseEvent e) - { - // Table => select - if (e.getSource() instanceof JTable && e.getClickCount() > 1) - { - adaptee.m_changed = true; - adaptee.dispose(); - } - } - } // VAccountDialog_mouseListener - - /** - * Constructor - * @param frame frame - * @param title title - * @param mAccount account info - * @param C_AcctSchema_ID as - */ - public VAccountDialog (Frame frame, String title, - MAccountLookup mAccount, int C_AcctSchema_ID) - { - super (frame, title, true); - if (log.isLoggable(Level.CONFIG)) log.config("C_AcctSchema_ID=" + C_AcctSchema_ID - + ", C_ValidCombination_ID=" + mAccount.C_ValidCombination_ID); - m_mAccount = mAccount; - m_C_AcctSchema_ID = C_AcctSchema_ID; - m_WindowNo = AEnv.createWindowNo (this); - setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - try - { - jbInit(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, ex.toString()); - } - if (initAccount()) - AEnv.showCenterWindow(frame, this); - else - dispose(); - } // VLocationDialog - - /** Window No */ - private int m_WindowNo; - /** Journal Entry * - private boolean m_onlyNonDocControlled = false; - /** Selection changed */ - protected boolean m_changed = false; - - /** Accounting Schema */ - private volatile static MAcctSchema s_AcctSchema = null; - /** MWindow for AccountCombination */ - private GridWindow m_mWindow = null; - /** MTab for AccountCombination */ - private GridTab m_mTab = null; - /** GridController */ - private GridController m_gridController = null; - - /** Account used */ - private MAccountLookup m_mAccount = null; - /** Result */ - private int m_C_ValidCombination_ID; - /** Acct Schema */ - private int m_C_AcctSchema_ID = 0; - /** Client */ - private int m_AD_Client_ID; - /** Where clause for combination search */ - private MQuery m_query; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VAccountDialog.class); - - // Editors for Query - private VEditor f_Alias, f_Combination, - f_AD_Org_ID, f_Account_ID, f_SubAcct_ID, - f_M_Product_ID, f_C_BPartner_ID, f_C_Campaign_ID, f_C_LocFrom_ID, f_C_LocTo_ID, - f_C_Project_ID, f_C_SalesRegion_ID, f_AD_OrgTrx_ID, f_C_Activity_ID, - f_User1_ID, f_User2_ID; - // - private JLabel f_Description = new JLabel ("", JLabel.CENTER); - - private GridBagConstraints m_gbc = new GridBagConstraints(); - private Insets m_labelInsets = new Insets(2,15,2,0); // top,left,bottom,right - private Insets m_fieldInsets = new Insets(2,5,2,10); - private int m_line = 0; - private boolean m_newRow = true; - // - private CPanel panel = new CPanel(); - private BorderLayout panelLayout = new BorderLayout(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - private TitledBorder titledBorder; - private StatusBar statusBar = new StatusBar(); - private CPanel northPanel = new CPanel(); - private CPanel parameterPanel = new CPanel(); - private GridBagLayout parameterLayout = new GridBagLayout(); - private BorderLayout northLayout = new BorderLayout(); - private JToolBar toolBar = new JToolBar(); - private CButton bRefresh = new CButton(); - private CButton bSave = new CButton(); - private CButton bIgnore = new CButton(); - - /** - * Static component init. - *
    -	 *  - panel
    -	 *      - northPanel
    -	 *          - parameterPanel
    -	 *          - toolBar
    -	 *      - gridController
    -	 *      - confirmPanel
    -	 *  - statusBar
    -	 *  
    - * @throws Exception - */ - void jbInit() throws Exception - { - // [ 1707303 ] Account Combination Form(VAccountDialog) translation issue - titledBorder = new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(134, 134, 134)), Msg.getMsg(Env.getCtx(),"Parameter")); - // - panelLayout.setHgap(5); - panelLayout.setVgap(5); - northLayout.setHgap(5); - northLayout.setVgap(5); - // - parameterPanel.setLayout(parameterLayout); - parameterPanel.setBorder(titledBorder); - northPanel.setLayout(northLayout); - toolBar.setOrientation(JToolBar.VERTICAL); - toolBar.setBorder(null); - toolBar.setRequestFocusEnabled(false); - toolBar.setBorderPainted(false); - toolBar.setMargin(new Insets(5, 5, 5, 5)); - bSave.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/Save24.gif"))); - bSave.setMargin(new Insets(2, 2, 2, 2)); - bSave.setToolTipText(Msg.getMsg(Env.getCtx(),"AccountNewUpdate")); - bSave.addActionListener(this); - bRefresh.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/Refresh24.gif"))); - bRefresh.setMargin(new Insets(2, 2, 2, 2)); - bRefresh.setToolTipText(Msg.getMsg(Env.getCtx(),"Refresh")); - bRefresh.addActionListener(this); - bIgnore.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/Ignore24.gif"))); - bIgnore.setMargin(new Insets(2, 2, 2, 2)); - bIgnore.setToolTipText(Msg.getMsg(Env.getCtx(),"Ignore")); - bIgnore.addActionListener(this); - // - toolBar.addSeparator(); - toolBar.add(bRefresh, null); - toolBar.add(bIgnore, null); - toolBar.add(bSave, null); - // - getContentPane().add(panel); - panel.setLayout(panelLayout); - panel.add(confirmPanel, BorderLayout.SOUTH); - panel.add(northPanel, BorderLayout.NORTH); - northPanel.add(parameterPanel, BorderLayout.CENTER); - northPanel.add(toolBar, BorderLayout.EAST); - // - this.getContentPane().add(statusBar, BorderLayout.SOUTH); - confirmPanel.addActionListener(this); - } // jbInit - - /** - * Dyanmic Init. - * When a row is selected, the editor values are set - * (editors do not change grid) - * @return true if initialized - */ - private boolean initAccount() - { - m_AD_Client_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "AD_Client_ID"); - // Get AcctSchema Info - if (s_AcctSchema == null || s_AcctSchema.getC_AcctSchema_ID() != m_C_AcctSchema_ID) - s_AcctSchema = new MAcctSchema (Env.getCtx(), m_C_AcctSchema_ID, null); - if (log.isLoggable(Level.CONFIG)) log.config(s_AcctSchema.toString() - + ", #" + s_AcctSchema.getAcctSchemaElements().length); - Env.setContext(Env.getCtx(), m_WindowNo, "C_AcctSchema_ID", m_C_AcctSchema_ID); - - // Model - int AD_Window_ID = WINDOW_ACCOUNTCOMBINATION; // Maintain Account Combinations - GridWindowVO wVO = Env.getMWindowVO (m_WindowNo, AD_Window_ID, 0); - if (wVO == null) - return false; - m_mWindow = new GridWindow (wVO); - m_mTab = m_mWindow.getTab(0); - // Make sure is the tab is loaded - teo_sarca [ 1659124 ] - if (!m_mTab.isLoadComplete()) - m_mWindow.initTab(0); - - // ParameterPanel restrictions - m_mTab.getField("Alias").setDisplayLength(15); - m_mTab.getField("Combination").setDisplayLength(15); - // Grid restrictions - m_mTab.getField("AD_Client_ID").setDisplayed(false); - m_mTab.getField("C_AcctSchema_ID").setDisplayed(false); - m_mTab.getField("IsActive").setDisplayed(false); - m_mTab.getField("IsFullyQualified").setDisplayed(false); - // don't show fields not being displayed in this environment - for (int i = 0; i < m_mTab.getFieldCount(); i++) - { - GridField field = m_mTab.getField(i); - if (!field.isDisplayed (true)) // check context - field.setDisplayed (false); - } - - // GridController - m_gridController = new GridController(); - m_gridController.initGrid(m_mTab, true, m_WindowNo, null, null); - m_gridController.setPreferredSize(new Dimension(300,100)); - panel.add(m_gridController, BorderLayout.CENTER); - - // Prepare Parameter - m_gbc.anchor = GridBagConstraints.NORTHWEST; - m_gbc.gridy = 0; // line - m_gbc.gridx = 0; - m_gbc.gridwidth = 1; - m_gbc.insets = m_fieldInsets; - m_gbc.fill = GridBagConstraints.HORIZONTAL; - m_gbc.weightx = 0; - m_gbc.weighty = 0; - - // Alias - if (s_AcctSchema.isHasAlias()) - { - GridField alias = m_mTab.getField("Alias"); - f_Alias = VEditorFactory.getEditor(m_mTab, alias, false); - addLine(alias, f_Alias, false); - } // Alias - - // Combination - GridField combination = m_mTab.getField("Combination"); - f_Combination = VEditorFactory.getEditor(m_mTab, combination, false); - addLine(combination, f_Combination, false); - m_newRow = true; - - /** - * Create Fields in Element Order - */ - MAcctSchemaElement[] elements = s_AcctSchema.getAcctSchemaElements(); - for (int i = 0; i < elements.length; i++) - { - MAcctSchemaElement ase = elements[i]; - String type = ase.getElementType(); - boolean isMandatory = ase.isMandatory(); - // - if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Organization)) - { - GridField field = m_mTab.getField("AD_Org_ID"); - f_AD_Org_ID = VEditorFactory.getEditor(m_mTab, field, false); - addLine(field, f_AD_Org_ID, isMandatory); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Account)) - { - GridField field = m_mTab.getField("Account_ID"); - f_Account_ID = VEditorFactory.getEditor(m_mTab, field, false); - // ((VLookup)f_Account_ID).setWidth(400); - addLine(field, f_Account_ID, isMandatory); - f_Account_ID.addVetoableChangeListener(this); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_SubAccount)) - { - GridField field = m_mTab.getField("C_SubAcct_ID"); - f_SubAcct_ID = VEditorFactory.getEditor(m_mTab, field, false); - // ((VLookup)f_SubAcct_ID).setWidth(400); - addLine(field, f_SubAcct_ID, isMandatory); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Product)) - { - GridField field = m_mTab.getField("M_Product_ID"); - f_M_Product_ID = VEditorFactory.getEditor(m_mTab, field, false); - addLine(field, f_M_Product_ID, isMandatory); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_BPartner)) - { - GridField field = m_mTab.getField("C_BPartner_ID"); - f_C_BPartner_ID = VEditorFactory.getEditor(m_mTab, field, false); - addLine(field, f_C_BPartner_ID, isMandatory); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Campaign)) - { - GridField field = m_mTab.getField("C_Campaign_ID"); - f_C_Campaign_ID = VEditorFactory.getEditor(m_mTab, field, false); - addLine(field, f_C_Campaign_ID, isMandatory); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_LocationFrom)) - { - GridField field = m_mTab.getField("C_LocFrom_ID"); - f_C_LocFrom_ID = VEditorFactory.getEditor(m_mTab, field, false); - addLine(field, f_C_LocFrom_ID, isMandatory); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_LocationTo)) - { - GridField field = m_mTab.getField("C_LocTo_ID"); - f_C_LocTo_ID = VEditorFactory.getEditor(m_mTab, field, false); - addLine(field, f_C_LocTo_ID, isMandatory); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Project)) - { - GridField field = m_mTab.getField("C_Project_ID"); - f_C_Project_ID = VEditorFactory.getEditor(m_mTab, field, false); - addLine(field, f_C_Project_ID, isMandatory); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_SalesRegion)) - { - GridField field = m_mTab.getField("C_SalesRegion_ID"); - f_C_SalesRegion_ID = VEditorFactory.getEditor(m_mTab, field, false); - addLine(field, f_C_SalesRegion_ID, isMandatory); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_OrgTrx)) - { - GridField field = m_mTab.getField("AD_OrgTrx_ID"); - f_AD_OrgTrx_ID = VEditorFactory.getEditor(m_mTab, field, false); - addLine(field, f_AD_OrgTrx_ID, isMandatory); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Activity)) - { - GridField field = m_mTab.getField("C_Activity_ID"); - f_C_Activity_ID = VEditorFactory.getEditor(m_mTab, field, false); - addLine(field, f_C_Activity_ID, isMandatory); - } - // User1 - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_UserElementList1)) - { - GridField field = m_mTab.getField("User1_ID"); - f_User1_ID = VEditorFactory.getEditor(m_mTab, field, false); - addLine(field, f_User1_ID, isMandatory); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_UserElementList2)) - { - GridField field = m_mTab.getField("User2_ID"); - f_User2_ID = VEditorFactory.getEditor(m_mTab, field, false); - addLine(field, f_User2_ID, isMandatory); - } - } // Create Fields in Element Order - - // Add description - m_newRow = true; - m_gbc.gridy = m_line++; - m_gbc.gridx = 0; - m_gbc.gridwidth = 4; - m_gbc.insets = new Insets(5,15,2,0); // top,left,bottom,right - m_gbc.fill = GridBagConstraints.HORIZONTAL; - f_Description.setFont(f_Description.getFont().deriveFont(Font.ITALIC)); - parameterPanel.add(f_Description, m_gbc); - - // Finish - m_query = new MQuery(); - m_query.addRestriction("C_AcctSchema_ID", MQuery.EQUAL, m_C_AcctSchema_ID); - m_query.addRestriction("IsFullyQualified", MQuery.EQUAL, "Y"); - if (m_mAccount.C_ValidCombination_ID == 0) - m_mTab.setQuery(MQuery.getEqualQuery("1", "2")); - else - { - MQuery query = new MQuery(); - query.addRestriction("C_AcctSchema_ID", MQuery.EQUAL, m_C_AcctSchema_ID); - query.addRestriction("C_ValidCombination_ID", MQuery.EQUAL, m_mAccount.C_ValidCombination_ID); - m_mTab.setQuery(query); - } - m_mTab.query(false); - m_gridController.getTable().addMouseListener(new VAccountDialog_mouseAdapter(this)); - m_gridController.addDataStatusListener(this); - - statusBar.setStatusLine(s_AcctSchema.toString()); - statusBar.setStatusDB("?"); - - // Initial value - if (m_mAccount.C_ValidCombination_ID != 0) - m_mTab.navigate(0); - - log.config("fini"); - return true; - } // initAccount - - /** - * Add Editor to parameterPanel alernative right/left depending on m_newRow. - * Field Value changes update Editors - * @param field field - * @param editor editor - * @param mandatory mandatory - */ - private void addLine (GridField field, VEditor editor, boolean mandatory) - { - if (log.isLoggable(Level.FINE)) log.fine("Field=" + field); - JLabel label = VEditorFactory.getLabel(field); - label.setLabelFor((Component)editor); - editor.setReadWrite(true); - editor.setMandatory(mandatory); - // MField => VEditor - field.addPropertyChangeListener(editor); - - // label - if (m_newRow) - { - m_gbc.gridy = m_line++; - m_gbc.gridx = 0; - } - else - m_gbc.gridx = 2; - m_gbc.insets = m_labelInsets; - m_gbc.fill = GridBagConstraints.HORIZONTAL; - m_gbc.weightx = 0; - parameterPanel.add(label, m_gbc); - - // Field - if (m_newRow) - m_gbc.gridx = 1; - else - m_gbc.gridx = 3; - m_gbc.insets = m_fieldInsets; - m_gbc.fill = GridBagConstraints.HORIZONTAL; - m_gbc.weightx = 1; - parameterPanel.add((Component)editor, m_gbc); - // - m_newRow = !m_newRow; - } // addLine - - /** - * Load Information - * @param C_ValidCombination_ID valid combination - * @param C_AcctSchema_ID acct schema - */ - private void loadInfo (int C_ValidCombination_ID, int C_AcctSchema_ID) - { - if (log.isLoggable(Level.FINE)) log.fine("C_ValidCombination_ID=" + C_ValidCombination_ID); - String sql = "SELECT * FROM C_ValidCombination WHERE C_ValidCombination_ID=? AND C_AcctSchema_ID=?"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, C_ValidCombination_ID); - pstmt.setInt(2, C_AcctSchema_ID); - rs = pstmt.executeQuery(); - if (rs.next()) - { - if (f_Alias != null) - f_Alias.setValue(rs.getString("Alias")); - f_Combination.setValue(rs.getString("Combination")); - // - loadInfoOf (rs, f_AD_Org_ID, "AD_Org_ID"); - loadInfoOf (rs, f_Account_ID, "Account_ID"); - loadInfoOf (rs, f_SubAcct_ID, "C_SubAcct_ID"); - // - loadInfoOf (rs, f_M_Product_ID, "M_Product_ID"); - loadInfoOf (rs, f_C_BPartner_ID, "C_BPartner_ID"); - loadInfoOf (rs, f_C_Campaign_ID, "C_Campaign_ID"); - loadInfoOf (rs, f_C_LocFrom_ID, "C_LocFrom_ID"); - loadInfoOf (rs, f_C_LocTo_ID, "C_LocTo_ID"); - loadInfoOf (rs, f_C_Project_ID, "C_Project_ID"); - loadInfoOf (rs, f_C_SalesRegion_ID, "C_SalesRegion_ID"); - loadInfoOf (rs, f_AD_OrgTrx_ID, "AD_OrgTrx_ID"); - loadInfoOf (rs, f_C_Activity_ID, "C_Activity_ID"); - loadInfoOf (rs, f_User1_ID, "User1_ID"); - loadInfoOf (rs, f_User2_ID, "User2_ID"); - // - f_Description.setText (rs.getString("Description")); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - } // loadInfo - - /** - * Set Value of Editor - * @param rs result set - * @param editor editor - * @param name name - * @throws SQLException - */ - private void loadInfoOf (ResultSet rs, VEditor editor, String name) throws SQLException - { - if (editor == null) - return; - int intValue = rs.getInt(name); - if (rs.wasNull()) - editor.setValue(null); - else - editor.setValue(Integer.valueOf(intValue)); - } // loadInfoOf - - - /** - * dispose - */ - public void dispose() - { - saveSelection(); - // GridController - if (m_gridController != null) - m_gridController.dispose(); - m_gridController = null; - // Model - m_mTab = null; - if (m_mWindow != null) - m_mWindow.dispose(); - m_mWindow = null; - - removeAll(); - Env.clearWinContext(m_WindowNo); - super.dispose(); - } // dispose - - /** - * Save Selection - */ - private void saveSelection() - { - if (m_changed && m_gridController != null) - { - int row = m_gridController.getTable().getSelectedRow(); - if (row >= 0) - m_C_ValidCombination_ID = ((Integer)m_mTab.getValue(row, "C_ValidCombination_ID")).intValue(); - if (log.isLoggable(Level.CONFIG)) log.config("(" + row + ") - " + m_C_ValidCombination_ID); - } - } // saveSelection - - /** - * ActionListener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - m_changed = true; - dispose(); - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - m_changed = false; - dispose(); - } - // - else if (e.getSource() == bSave) - action_Save(); - else if (e.getSource() == bIgnore) - action_Ignore(); - // all other - else - action_Find (true); - - } // actionPerformed - - - /** - * Status Change Listener - * @param e event - */ - public void dataStatusChanged (DataStatusEvent e) - { - if (log.isLoggable(Level.CONFIG)) log.config(e.toString()); - String info = (String)m_mTab.getValue("Description"); - f_Description.setText (info); - // - // log.info( ">> Field=" + m_mTab.getValue("AD_Org_ID"), - // "Editor=" + f_AD_Org_ID.getValue()); - // if (f_AD_Org_ID.getValue() == null) - // f_AD_Org_ID.setValue(m_mTab.getValue("AD_Org_ID")); - } // statusChanged - - - /** - * Action Find. - * - create where clause - * - query database - * @param includeAliasCombination include alias combination - */ - private void action_Find (boolean includeAliasCombination) - { - log.info(""); - setCursor (Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - - // Create where Clause - MQuery query = null; - if (m_query != null) - query = m_query.deepCopy(); - else - query = new MQuery(); - // Alias - if (includeAliasCombination && f_Alias != null && f_Alias.getValue().toString().length() > 0) - { - String value = f_Alias.getValue().toString().toUpperCase(); - if (!value.endsWith("%")) - value += "%"; - query.addRestriction("UPPER(Alias)", MQuery.LIKE, value); - } - // Combination (mandatory) - if (includeAliasCombination && f_Combination.getValue().toString().length() > 0) - { - String value = f_Combination.getValue().toString().toUpperCase(); - if (!value.endsWith("%")) - value += "%"; - query.addRestriction("UPPER(Combination)", MQuery.LIKE, value); - } - // Org (mandatory) - if (f_AD_Org_ID != null && f_AD_Org_ID.getValue() != null) - query.addRestriction("AD_Org_ID", MQuery.EQUAL, f_AD_Org_ID.getValue()); - // Account (mandatory) - if (f_Account_ID != null && f_Account_ID.getValue() != null) - query.addRestriction("Account_ID", MQuery.EQUAL, f_Account_ID.getValue()); - if (f_SubAcct_ID != null && f_SubAcct_ID.getValue() != null) - query.addRestriction("C_SubAcct_ID", MQuery.EQUAL, f_SubAcct_ID.getValue()); - - // Product - if (f_M_Product_ID != null && f_M_Product_ID.getValue() != null) - query.addRestriction("M_Product_ID", MQuery.EQUAL, f_M_Product_ID.getValue()); - // BPartner - if (f_C_BPartner_ID != null && f_C_BPartner_ID.getValue() != null) - query.addRestriction("C_BPartner_ID", MQuery.EQUAL, f_C_BPartner_ID.getValue()); - // Campaign - if (f_C_Campaign_ID != null && f_C_Campaign_ID.getValue() != null) - query.addRestriction("C_Campaign_ID", MQuery.EQUAL, f_C_Campaign_ID.getValue()); - // Loc From - if (f_C_LocFrom_ID != null && f_C_LocFrom_ID.getValue() != null) - query.addRestriction("C_LocFrom_ID", MQuery.EQUAL, f_C_LocFrom_ID.getValue()); - // Loc To - if (f_C_LocTo_ID != null && f_C_LocTo_ID.getValue() != null) - query.addRestriction("C_LocTo_ID", MQuery.EQUAL, f_C_LocTo_ID.getValue()); - // Project - if (f_C_Project_ID != null && f_C_Project_ID.getValue() != null) - query.addRestriction("C_Project_ID", MQuery.EQUAL, f_C_Project_ID.getValue()); - // SRegion - if (f_C_SalesRegion_ID != null && f_C_SalesRegion_ID.getValue() != null) - query.addRestriction("C_SalesRegion_ID", MQuery.EQUAL, f_C_SalesRegion_ID.getValue()); - // Org Trx - if (f_AD_OrgTrx_ID != null && f_AD_OrgTrx_ID.getValue() != null) - query.addRestriction("AD_OrgTrx_ID", MQuery.EQUAL, f_AD_OrgTrx_ID.getValue()); - // Activity - if (f_C_Activity_ID != null && f_C_Activity_ID.getValue() != null) - query.addRestriction("C_Activity_ID", MQuery.EQUAL, f_C_Activity_ID.getValue()); - // User 1 - if (f_User1_ID != null && f_User1_ID.getValue() != null) - query.addRestriction("User1_ID", MQuery.EQUAL, f_User1_ID.getValue()); - // User 2 - if (f_User2_ID != null && f_User2_ID.getValue() != null) - query.addRestriction("User2_ID", MQuery.EQUAL, f_User2_ID.getValue()); - - // Query - m_mTab.setQuery(query); - m_mTab.query(false); - statusBar.setStatusDB(String.valueOf(m_mTab.getRowCount())); - setCursor (Cursor.getDefaultCursor()); - } // action_Find - - - /** - * Create/Save Account - */ - private void action_Save() - { - log.info(""); - /** - * Check completeness (mandatory fields) ... and for duplicates - */ - StringBuilder sb = new StringBuilder(); - StringBuilder sql = new StringBuilder ("SELECT C_ValidCombination_ID, Alias FROM C_ValidCombination WHERE "); - Object value = null; - if (s_AcctSchema.isHasAlias()) - { - value = f_Alias.getValue().toString(); - if (value == null) - sb.append(Msg.translate(Env.getCtx(), "Alias")).append(", "); - } - MAcctSchemaElement[] elements = s_AcctSchema.getAcctSchemaElements(); - for (int i = 0; i < elements.length; i++) - { - MAcctSchemaElement ase = elements[i]; - String type = ase.getElementType(); - // - if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Organization)) - { - value = f_AD_Org_ID.getValue(); - sql.append("AD_Org_ID"); - if (value == null) - sql.append(" IS NULL AND "); - else - sql.append("=").append(value).append(" AND "); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Account)) - { - value = f_Account_ID.getValue(); - sql.append("Account_ID"); - if (value == null) - sql.append(" IS NULL AND "); - else - sql.append("=").append(value).append(" AND "); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_SubAccount)) - { - value = f_SubAcct_ID.getValue(); - sql.append("C_SubAcct_ID"); - if (value == null) - sql.append(" IS NULL AND "); - else - sql.append("=").append(value).append(" AND "); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Product)) - { - value = f_M_Product_ID.getValue(); - sql.append("M_Product_ID"); - if (value == null) - sql.append(" IS NULL AND "); - else - sql.append("=").append(value).append(" AND "); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_BPartner)) - { - value = f_C_BPartner_ID.getValue(); - sql.append("C_BPartner_ID"); - if (value == null) - sql.append(" IS NULL AND "); - else - sql.append("=").append(value).append(" AND "); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Campaign)) - { - value = f_C_Campaign_ID.getValue(); - sql.append("C_Campaign_ID"); - if (value == null) - sql.append(" IS NULL AND "); - else - sql.append("=").append(value).append(" AND "); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_LocationFrom)) - { - value = f_C_LocFrom_ID.getValue(); - sql.append("C_LocFrom_ID"); - if (value == null) - sql.append(" IS NULL AND "); - else - sql.append("=").append(value).append(" AND "); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_LocationTo)) - { - value = f_C_LocTo_ID.getValue(); - sql.append("C_LocTo_ID"); - if (value == null) - sql.append(" IS NULL AND "); - else - sql.append("=").append(value).append(" AND "); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Project)) - { - value = f_C_Project_ID.getValue(); - sql.append("C_Project_ID"); - if (value == null) - sql.append(" IS NULL AND "); - else - sql.append("=").append(value).append(" AND "); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_SalesRegion)) - { - value = f_C_SalesRegion_ID.getValue(); - sql.append("C_SalesRegion_ID"); - if (value == null) - sql.append(" IS NULL AND "); - else - sql.append("=").append(value).append(" AND "); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_OrgTrx)) - { - value = f_AD_OrgTrx_ID.getValue(); - sql.append("AD_OrgTrx_ID"); - if (value == null) - sql.append(" IS NULL AND "); - else - sql.append("=").append(value).append(" AND "); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Activity)) - { - value = f_C_Activity_ID.getValue(); - sql.append("C_Activity_ID"); - if (value == null) - sql.append(" IS NULL AND "); - else - sql.append("=").append(value).append(" AND "); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_UserElementList1)) - { - value = f_User1_ID.getValue(); - sql.append("User1_ID"); - if (value == null) - sql.append(" IS NULL AND "); - else - sql.append("=").append(value).append(" AND "); - } - else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_UserElementList2)) - { - value = f_User2_ID.getValue(); - sql.append("User2_ID"); - if (value == null) - sql.append(" IS NULL AND "); - else - sql.append("=").append(value).append(" AND "); - } - // - if (ase.isMandatory() && value == null) - sb.append(ase.getName()).append(", "); - } // Fields in Element Order - - if (sb.length() != 0) - { - ADialog.error(m_WindowNo, this, "FillMandatory", sb.substring(0, sb.length()-2)); - return; - } - if (f_AD_Org_ID == null || f_AD_Org_ID.getValue() == null) - { - ADialog.error(m_WindowNo, this, "FillMandatory", Msg.getElement(Env.getCtx(), "AD_Org_ID")); - return; - } - if (f_Account_ID == null || f_Account_ID.getValue() == null) - { - ADialog.error(m_WindowNo, this, "FillMandatory", Msg.getElement(Env.getCtx(), "Account_ID")); - return; - } - - - /** - * Check if already exists - */ - sql.append("AD_Client_ID=? AND C_AcctSchema_ID=?"); - if (log.isLoggable(Level.FINE)) log.fine("Check = " + sql.toString()); - int IDvalue = 0; - String Alias = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql.toString(), null); - pstmt.setInt(1, m_AD_Client_ID); - pstmt.setInt(2, s_AcctSchema.getC_AcctSchema_ID()); - rs = pstmt.executeQuery(); - if (rs.next()) - { - IDvalue = rs.getInt(1); - Alias = rs.getString(2); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql.toString(), e); - IDvalue = 0; - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - if (log.isLoggable(Level.FINE)) log.fine("ID=" + IDvalue + ", Alias=" + Alias); - - if (Alias == null) - Alias = ""; - - // We have an account like this already - check alias - if (IDvalue != 0 && s_AcctSchema.isHasAlias() - && !f_Alias.getValue().toString().equals(Alias)) - { - sql = new StringBuilder("UPDATE C_ValidCombination SET Alias="); - if (f_Alias.getValue().toString().length() == 0) - sql.append("NULL"); - else - sql.append("'").append(f_Alias.getValue()).append("'"); - sql.append(" WHERE C_ValidCombination_ID=").append(IDvalue); - int i = 0; - PreparedStatement stmt = null; - try - { - stmt = DB.prepareStatement(sql.toString(), - ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE, null); - i = stmt.executeUpdate(); - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql.toString(), e); - } - finally - { - DB.close(stmt); - stmt = null; - } - if (i == 0) - ADialog.error(m_WindowNo, this, "AccountNotUpdated"); - } - - // load and display - if (IDvalue != 0) - { - loadInfo (IDvalue, s_AcctSchema.getC_AcctSchema_ID()); - action_Find (false); - return; - } - - log.config("New"); - Alias = null; - if (f_Alias != null) - Alias = f_Alias.getValue().toString(); - int C_SubAcct_ID = 0; - if (f_SubAcct_ID != null && f_SubAcct_ID.getValue() != null) - C_SubAcct_ID = ((Integer)f_SubAcct_ID.getValue()).intValue(); - int M_Product_ID = 0; - if (f_M_Product_ID != null && f_M_Product_ID.getValue() != null) - M_Product_ID = ((Integer)f_M_Product_ID.getValue()).intValue(); - int C_BPartner_ID = 0; - if (f_C_BPartner_ID != null && f_C_BPartner_ID.getValue() != null) - C_BPartner_ID = ((Integer)f_C_BPartner_ID.getValue()).intValue(); - int AD_OrgTrx_ID = 0; - if (f_AD_OrgTrx_ID != null && f_AD_OrgTrx_ID.getValue() != null) - AD_OrgTrx_ID = ((Integer)f_AD_OrgTrx_ID.getValue()).intValue(); - int C_LocFrom_ID = 0; - if (f_C_LocFrom_ID != null && f_C_LocFrom_ID.getValue() != null) - C_LocFrom_ID = ((Integer)f_C_LocFrom_ID.getValue()).intValue(); - int C_LocTo_ID = 0; - if (f_C_LocTo_ID != null && f_C_LocTo_ID.getValue() != null) - C_LocTo_ID = ((Integer)f_C_LocTo_ID.getValue()).intValue(); - int C_SRegion_ID = 0; - if (f_C_SalesRegion_ID != null && f_C_SalesRegion_ID.getValue() != null) - C_SRegion_ID = ((Integer)f_C_SalesRegion_ID.getValue()).intValue(); - int C_Project_ID = 0; - if (f_C_Project_ID != null && f_C_Project_ID.getValue() != null) - C_Project_ID= ((Integer)f_C_Project_ID.getValue()).intValue(); - int C_Campaign_ID = 0; - if (f_C_Campaign_ID != null && f_C_Campaign_ID.getValue() != null) - C_Campaign_ID = ((Integer)f_C_Campaign_ID.getValue()).intValue(); - int C_Activity_ID = 0; - if (f_C_Activity_ID != null && f_C_Activity_ID.getValue() != null) - C_Activity_ID = ((Integer)f_C_Activity_ID.getValue()).intValue(); - int User1_ID = 0; - if (f_User1_ID != null && f_User1_ID.getValue() != null) - User1_ID = ((Integer)f_User1_ID.getValue()).intValue(); - int User2_ID = 0; - if (f_User2_ID != null && f_User2_ID.getValue() != null) - User2_ID = ((Integer)f_User2_ID.getValue()).intValue(); - - MAccount acct = MAccount.get (Env.getCtx(), m_AD_Client_ID, - ((Integer)f_AD_Org_ID.getValue()).intValue(), - s_AcctSchema.getC_AcctSchema_ID(), - ((Integer)f_Account_ID.getValue()).intValue(), C_SubAcct_ID, - M_Product_ID, C_BPartner_ID, AD_OrgTrx_ID, - C_LocFrom_ID, C_LocTo_ID, C_SRegion_ID, - C_Project_ID, C_Campaign_ID, C_Activity_ID, - User1_ID, User2_ID, 0, 0, null); - if (acct != null && acct.get_ID() == 0) - acct.saveEx(); - - // Show Info - if (acct == null || acct.get_ID() == 0) - loadInfo (0, 0); - else - { - // Update Account with optional Alias - if (Alias != null && Alias.length() > 0) - { - acct.setAlias(Alias); - acct.saveEx(); - } - loadInfo (acct.get_ID(), s_AcctSchema.getC_AcctSchema_ID()); - } - action_Find (false); - } // action_Save - - - /** - * Ignore - */ - private void action_Ignore() - { - if (f_Alias != null) - f_Alias.setValue(""); - f_Combination.setValue(""); - f_Description.setText(""); - // - // Org (mandatory) - f_AD_Org_ID.setValue(null); - // Account (mandatory) - f_Account_ID.setValue(null); - if (f_SubAcct_ID != null) - f_SubAcct_ID.setValue(null); - - // Product - if (f_M_Product_ID != null) - f_M_Product_ID.setValue(null); - // BPartner - if (f_C_BPartner_ID != null) - f_C_BPartner_ID.setValue(null); - // Campaign - if (f_C_Campaign_ID != null) - f_C_Campaign_ID.setValue(null); - // Loc From - if (f_C_LocFrom_ID != null) - f_C_LocFrom_ID.setValue(null); - // Loc To - if (f_C_LocTo_ID != null) - f_C_LocTo_ID.setValue(null); - // Project - if (f_C_Project_ID != null) - f_C_Project_ID.setValue(null); - // SRegion - if (f_C_SalesRegion_ID != null) - f_C_SalesRegion_ID.setValue(null); - // Org Trx - if (f_AD_OrgTrx_ID != null) - f_AD_OrgTrx_ID.setValue(null); - // Activity - if (f_C_Activity_ID != null) - f_C_Activity_ID.setValue(null); - // User 1 - if (f_User1_ID != null) - f_User1_ID.setValue(null); - // User 2 - if (f_User2_ID != null) - f_User2_ID.setValue(null); - } // action_Ignore - - /** - * Get selected account - * @return account - */ - public Integer getValue() - { - if (log.isLoggable(Level.CONFIG)) log.config("C_ValidCombination_ID=" + m_C_ValidCombination_ID + ", Changed=" + m_changed); - if (!m_changed || m_C_ValidCombination_ID == 0) - return null; - return Integer.valueOf(m_C_ValidCombination_ID); - } - - /** - * VetoableChange - Account Changed - * @param evt event - * @throws PropertyVetoException - */ - public void vetoableChange (PropertyChangeEvent evt) - throws PropertyVetoException - { - Object newValue = evt.getNewValue(); - if (newValue instanceof Integer) - Env.setContext(Env.getCtx(), m_WindowNo, "Account_ID", ((Integer)newValue).intValue()); - } // vetoableChange - -} // VAccountDialog diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAssignment.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAssignment.java deleted file mode 100644 index f5479221c1..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAssignment.java +++ /dev/null @@ -1,462 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.text.DateFormat; -import java.text.NumberFormat; -import java.util.logging.Level; - -import javax.swing.JComponent; -import javax.swing.JPopupMenu; -import javax.swing.JTextField; -import javax.swing.LookAndFeel; -import javax.swing.SwingUtilities; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.AEnv; -import org.compiere.apps.FieldRecordInfo; -import org.compiere.apps.search.InfoSchedule; -import org.compiere.model.GridField; -import org.compiere.model.MResourceAssignment; -import org.compiere.swing.CButton; -import org.compiere.swing.CMenuItem; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Resource Assignment Entry - * - * @author Jorg Janke - * @version $Id: VAssignment.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VAssignment extends JComponent - implements VEditor, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 4270887524258628077L; - - /** - * Mouse Listener - */ - final class VAssignment_mouseAdapter extends MouseAdapter - { - /** - * Constructor - * @param adaptee adaptee - */ - VAssignment_mouseAdapter(VAssignment adaptee) - { - this.adaptee = adaptee; - } // VAssignment_mouseAdapter - - private VAssignment adaptee; - - /** - * Mouse Listener - * @param e event - */ - public void mouseClicked(MouseEvent e) - { - // Double Click - if (e.getClickCount() > 1) - adaptee.actionPerformed(new ActionEvent(e.getSource(), e.getID(), "Mouse")); - // popup menu - if (SwingUtilities.isRightMouseButton(e)) - adaptee.popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - } // mouse Clicked - - } // VAssignment_mouseAdapter - - /** - * IDE Constructor - */ - public VAssignment() - { - this (false, false, true); - } // VAssigment - - /** - * Create Resource Assigment. - *
    -	 * 		Resource DateTimeFrom Qty UOM Button
    -	 *  
    - * @param mandatory mandatory - * @param isReadOnly read only - * @param isUpdateable updateable - */ - public VAssignment (boolean mandatory, boolean isReadOnly, boolean isUpdateable) - { - super(); - // super.setName(columnName); - LookAndFeel.installBorder(this, "TextField.border"); - this.setLayout(new BorderLayout()); - // Size - this.setPreferredSize(m_text.getPreferredSize()); - int height = m_text.getPreferredSize().height; - - // *** Text *** - m_text.setEditable(false); - m_text.setFocusable(false); - m_text.setBorder(null); - m_text.setHorizontalAlignment(JTextField.LEADING); - // Background - setMandatory(mandatory); - this.add(m_text, BorderLayout.CENTER); - - // *** Button *** - m_button.setIcon(Env.getImageIcon("Assignment10.gif")); - m_button.setMargin(new Insets(0, 0, 0, 0)); - m_button.setPreferredSize(new Dimension(height, height)); - m_button.addActionListener(this); - m_button.setFocusable(true); - this.add(m_button, BorderLayout.EAST); - - // Prefereed Size - this.setPreferredSize(this.getPreferredSize()); // causes r/o to be the same length - // ReadWrite - if (isReadOnly || !isUpdateable) - setReadWrite(false); - else - setReadWrite(true); - - // Popup - m_text.addMouseListener(new VAssignment_mouseAdapter(this)); - menuEditor = new CMenuItem(Msg.getMsg(Env.getCtx(), "InfoResource"), Env.getImageIcon("Zoom16.gif")); - menuEditor.addActionListener(this); - popupMenu.add(menuEditor); - } // VAssignment - - /** Data Value */ - private Object m_value = null; - /** Get Info */ - private PreparedStatement m_pstmt = null; - - /** The Text Field */ - private JTextField m_text = new JTextField (VLookup.DISPLAY_LENGTH); - /** The Button */ - private CButton m_button = new CButton(); - - JPopupMenu popupMenu = new JPopupMenu(); - private CMenuItem menuEditor; - - private boolean m_readWrite; - private boolean m_mandatory; - - /** The Format */ - private DateFormat m_dateFormat = DisplayType.getDateFormat(DisplayType.DateTime); - private NumberFormat m_qtyFormat = DisplayType.getNumberFormat(DisplayType.Quantity); - private GridField m_mField; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VAssignment.class); - - /** - * Dispose resources - */ - public void dispose() - { - try - { - DB.close(m_pstmt); - m_pstmt = null; - } - catch (Exception e) - { - log.log(Level.SEVERE, "VAssignment.dispose"); - } - m_text = null; - m_button = null; - } // dispose - - /** - * Set Mandatory - * @param mandatory mandatory - */ - public void setMandatory (boolean mandatory) - { - m_mandatory = mandatory; - m_button.setMandatory(mandatory); - setBackground (false); - } // setMandatory - - /** - * Get Mandatory - * @return mandatory - */ - public boolean isMandatory() - { - return m_mandatory; - } // isMandatory - - /** - * Set ReadWrite - * @param rw read rwite - */ - public void setReadWrite (boolean rw) - { - m_readWrite = rw; - m_button.setReadWrite(rw); - setBackground (false); - } // setReadWrite - - /** - * Is Read Write - * @return read write - */ - public boolean isReadWrite() - { - return m_readWrite; - } // isReadWrite - - /** - * Set Foreground - * @param color color - */ - public void setForeground (Color color) - { - m_text.setForeground(color); - } // SetForeground - - /** - * Set Background - * @param error Error - */ - public void setBackground (boolean error) - { - if (error) - setBackground(AdempierePLAF.getFieldBackground_Error()); - else if (!m_readWrite) - setBackground(AdempierePLAF.getFieldBackground_Inactive()); - else if (m_mandatory) - setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - else - setBackground(AdempierePLAF.getInfoBackground()); - } // setBackground - - /** - * Set Background - * @param color Color - */ - public void setBackground (Color color) - { - m_text.setBackground(color); - } // setBackground - - /** - * Request Focus - */ - public void requestFocus () - { - m_text.requestFocus (); - } // requestFocus - - /** - * Request Focus In Window - * @return focus request - */ - @Override - public boolean requestFocusInWindow() - { - return m_text.requestFocusInWindow(); - } // requestFocusInWindow - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return m_text; - } // getFocusComponent - - /************************************************************************** - * Set/lookup Value - * @param value value - */ - public void setValue(Object value) - { - if (value == m_value) - return; - m_value = value; - int S_ResourceAssignment_ID = 0; - if (m_value != null && m_value instanceof Integer) - S_ResourceAssignment_ID = ((Integer)m_value).intValue(); - // Set Empty - if (S_ResourceAssignment_ID == 0) - { - m_text.setText(""); - return; - } - - // Statement - if (m_pstmt == null) - m_pstmt = DB.prepareStatement("SELECT r.Name,ra.AssignDateFrom,ra.Qty,uom.UOMSymbol " - + "FROM S_ResourceAssignment ra, S_Resource r, S_ResourceType rt, C_UOM uom " - + "WHERE ra.S_ResourceAssignment_ID=?" - + " AND ra.S_Resource_ID=r.S_Resource_ID" - + " AND r.S_ResourceType_ID=rt.S_ResourceType_ID" - + " and rt.C_UOM_ID=uom.C_UOM_ID", null); - // - ResultSet rs = null; - try - { - m_pstmt.setInt(1, S_ResourceAssignment_ID); - rs = m_pstmt.executeQuery(); - if (rs.next()) - { - StringBuilder sb = new StringBuilder(rs.getString(1)); - sb.append(" ").append(m_dateFormat.format(rs.getTimestamp(2))) - .append(" ").append(m_qtyFormat.format(rs.getBigDecimal(3))) - .append(" ").append(rs.getString(4).trim()); - m_text.setText(sb.toString()); - } - else - m_text.setText("<" + S_ResourceAssignment_ID + ">"); - } - catch (Exception e) - { - log.log(Level.SEVERE, "", e); - } - finally - { - DB.close(rs); - rs = null; - } - } // setValue - - /** - * Get Value - * @return value - */ - public Object getValue() - { - return m_value; - } // getValue - - /** - * Get Display Value - * @return info - */ - public String getDisplay() - { - return m_text.getText(); - } // getDisplay - - /*************************************************************************/ - - /** - * Set Field - NOP - * @param mField MField - */ - public void setField(GridField mField) - { - m_mField = mField; - if (m_mField != null) - FieldRecordInfo.addMenu(this, popupMenu); - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - /** - * Action Listener Interface - * @param listener listener - */ - public void addActionListener(ActionListener listener) - { - // m_text.addActionListener(listener); - } // addActionListener - - /** - * Action Listener - start dialog - * @param e Event - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(FieldRecordInfo.CHANGE_LOG_COMMAND)) - { - FieldRecordInfo.start(m_mField); - return; - } - if (!m_button.isEnabled()) - return; - m_button.setEnabled(false); - // - Integer oldValue = (Integer)getValue(); - int S_ResourceAssignment_ID = oldValue == null ? 0 : oldValue.intValue(); - MResourceAssignment ma = new MResourceAssignment(Env.getCtx(), S_ResourceAssignment_ID, null); - - // Start VAssignment Dialog - if (S_ResourceAssignment_ID != 0) - { - VAssignmentDialog vad = new VAssignmentDialog (AEnv.getFrame(this), ma, true, true); - ma = vad.getMResourceAssignment(); - } - // Start InfoSchedule directly - else - { - InfoSchedule is = new InfoSchedule(AEnv.getFrame(this), ma, true); - ma = is.getMResourceAssignment(); - } - - // Set Value - if (ma != null && ma.getS_ResourceAssignment_ID() != 0) - { - setValue(Integer.valueOf(ma.getS_ResourceAssignment_ID())); - try - { - fireVetoableChange(this.getName(), new Object(), getValue()); - } - catch (PropertyVetoException pve) - { - log.log(Level.SEVERE, "", pve); - } - } - m_button.setEnabled(true); - requestFocus(); - } // actionPerformed - - /** - * Property Change Listener - * @param evt event - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - -} // VAssignment diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAssignmentDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAssignmentDialog.java deleted file mode 100644 index 10d1791073..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAssignmentDialog.java +++ /dev/null @@ -1,387 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.HashMap; -import java.util.logging.Level; - -import javax.swing.JButton; -import javax.swing.WindowConstants; - -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.search.InfoSchedule; -import org.compiere.model.MResourceAssignment; -import org.compiere.model.MRole; -import org.compiere.model.MUOMConversion; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; -import org.compiere.util.TimeUtil; - -/** - * Resource Assignment Dialog - * - * @author Jorg Janke - * @version $Id: VAssignmentDialog.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VAssignmentDialog extends CDialog - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 4130085811212412204L; - - - /** - * Assignment Dialog. - *
    -	 * 		Creates a new assignment oor displays an assignment
    -	 * 		Create new:	(ID == 0)
    -	 * 			check availability & create assignment
    -	 * 			(confirmed when order/incoice/timeExpense is processed)
    -	 * 			alternatively let InfoResource do the assignment
    -	 * 			return ID
    -	 * 		Existing assignment: (ID != 0)
    -	 * 			if confirmed - no change.
    -	 * 			ability to delete or change assignment
    -	 * 			return ID
    -	 * 	
    - * @param frame parent - * @param mAssignment Assignment - * @param allowZoom allow to zoom to schedule - * @param allowDelete allow to delete recorde - */ - public VAssignmentDialog (Frame frame, MResourceAssignment mAssignment, - boolean allowZoom, boolean allowDelete) - { - super (frame, Msg.getMsg(Env.getCtx(), "VAssignmentDialog"), true); - if (log.isLoggable(Level.CONFIG)) log.config(mAssignment.toString()); - m_mAssignment = mAssignment; - m_frame = frame; - try - { - jbInit(); - if (!allowZoom) - confirmPanel.getZoomButton().setVisible(false); - delete.setVisible(allowDelete); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - } - setDisplay(); // from mAssignment - // - AEnv.showCenterScreen(this); - } // VAssignmentDialog - - /** Assignment */ - private MResourceAssignment m_mAssignment; - /** Parent frame */ - private Frame m_frame; - /** True if setting Value */ - private boolean m_setting = false; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VAssignmentDialog.class); - /** Lookup with Resource & UOM */ - private HashMap m_lookup = new HashMap(); - - // - private CPanel mainPanel = new CPanel(); - private GridBagLayout mainLayout = new GridBagLayout(); - private CLabel lResource = new CLabel(Msg.translate(Env.getCtx(), "S_Resource_ID")); - private VComboBox fResource = new VComboBox(getResources()); - private CLabel lDate = new CLabel(Msg.translate(Env.getCtx(), "DateFrom")); - private VDate fDateFrom = new VDate(DisplayType.DateTime); - private CLabel lQty = new CLabel(Msg.translate(Env.getCtx(), "Qty")); - private VNumber fQty = new VNumber(); - private CLabel lUOM = new CLabel(); - private CLabel lName = new CLabel(Msg.translate(Env.getCtx(), "Name")); - private CLabel lDescription = new CLabel(Msg.translate(Env.getCtx(), "Description")); - private CTextField fName = new CTextField (30); - private CTextField fDescription = new CTextField(30); - private ConfirmPanel confirmPanel = new ConfirmPanel(true, false, false, false, false, true, true); - private JButton delete = ConfirmPanel.createDeleteButton(true); - - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); - fResource.addActionListener(this); - delete.addActionListener(this); - confirmPanel.addButton(delete); - confirmPanel.addActionListener(this); - // - mainPanel.setLayout(mainLayout); - mainPanel.add(lResource, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(8, 8, 4, 4), 0, 0)); - mainPanel.add(fResource, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(8, 0, 4, 4), 0, 0)); - mainPanel.add(lDate, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 8, 4, 4), 0, 0)); - mainPanel.add(fDateFrom, new GridBagConstraints(1, 1, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 4, 8), 100, 0)); - mainPanel.add(lQty, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 8, 4, 4), 0, 0)); - mainPanel.add(fQty, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 4, 4), 0, 0)); - mainPanel.add(lUOM, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 4, 4, 8), 0, 0)); - mainPanel.add(lName, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 8, 4, 4), 0, 0)); - mainPanel.add(lDescription, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 8, 8, 4), 0, 0)); - mainPanel.add(fName, new GridBagConstraints(1, 3, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 4, 8), 0, 0)); - mainPanel.add(fDescription, new GridBagConstraints(1, 4, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 8, 8), 0, 0)); - // - this.getContentPane().add(mainPanel, BorderLayout.CENTER); - this.getContentPane().add(confirmPanel, BorderLayout.SOUTH); - } // jbInit - - /** - * Initialize component & values from m_mAssignment - */ - private void setDisplay() - { - m_setting = true; - - // Set Resource - int S_Resource_ID = m_mAssignment.getS_Resource_ID(); - KeyNamePair[] resources = new KeyNamePair[m_lookup.size()]; - m_lookup.keySet().toArray(resources); - for (int i = 0; i < resources.length; i++) - { - if (resources[i].getKey() == S_Resource_ID) - { - fResource.setSelectedItem(resources[i]); - break; - } - } - KeyNamePair check = (KeyNamePair)fResource.getSelectedItem(); - if (check == null || check.getKey() != S_Resource_ID) - { - if (m_mAssignment.getS_ResourceAssignment_ID() == 0) // new record select first - fResource.setSelectedItem(fResource.getSelectedItem()); // initiates UOM display - else - log.log(Level.SEVERE, "Resource not found ID=" + S_Resource_ID); - } - - // Set Date, Qty - fDateFrom.setValue(m_mAssignment.getAssignDateFrom()); - fQty.setValue(m_mAssignment.getQty()); - - // Name, Description - fName.setValue(m_mAssignment.getName()); - fDescription.setValue(m_mAssignment.getDescription()); - - // Set Editor to R/O if confirmed - boolean readWrite = true; - if (m_mAssignment.isConfirmed()) - readWrite = false; - confirmPanel.getCancelButton().setVisible(readWrite); - fResource.setReadWrite(readWrite); - fDateFrom.setReadWrite(readWrite); - fQty.setReadWrite(readWrite); - - m_setting = false; - } // dynInit - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (m_setting) - return; - // Update Assignment - KeyNamePair resource = (KeyNamePair)fResource.getSelectedItem(); - if (resource != null) - { - int S_Resource_ID = resource.getKey(); - m_mAssignment.setS_Resource_ID (S_Resource_ID); - } - Timestamp assignDateFrom = fDateFrom.getTimestamp(); - if (assignDateFrom != null) - m_mAssignment.setAssignDateFrom (assignDateFrom); - BigDecimal qty = (BigDecimal)fQty.getValue(); - if (qty != null) - m_mAssignment.setQty(qty); - m_mAssignment.setName((String)fName.getValue()); - m_mAssignment.setDescription((String)fDescription.getValue()); - - // Resource - Look up UOM - if (e.getSource() == fResource) - { - Object o = m_lookup.get(fResource.getSelectedItem()); - if (o == null) - lUOM.setText(" ? "); - else - lUOM.setText(o.toString()); - } - - // Zoom - InfoResource - else if (e.getActionCommand().equals(ConfirmPanel.A_ZOOM)) - { - InfoSchedule is = new InfoSchedule (m_frame, - m_mAssignment, true); - if (is.getMResourceAssignment() != null) - { - m_mAssignment = is.getMResourceAssignment(); - // setDisplay(); - dispose(); - } - is = null; - } - - // cancel - return - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - dispose(); - } - - // delete - delete and return - else if (e.getActionCommand().equals(ConfirmPanel.A_DELETE)) - { - if (m_mAssignment.delete(true)) - { - m_mAssignment = null; - dispose(); - } - else - ADialog.error(0, this, "ResourceAssignmentNotDeleted"); - } - - // OK - Save - else if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - if (cmd_save()) - dispose(); - } - } // actionPerformed - - - /************************************************************************** - * Get Assignment - * @return Assignment - */ - public MResourceAssignment getMResourceAssignment() - { - return m_mAssignment; - } // getMResourceAssignment - - - /** - * Check availability and insert record - * @return true if saved/updated - */ - private boolean cmd_save() - { - log.config(""); - // Set AssignDateTo - Timestamp assignDateFrom = fDateFrom.getTimestamp(); - BigDecimal qty = (BigDecimal)fQty.getValue(); - KeyNamePair uom = (KeyNamePair)m_lookup.get(fResource.getSelectedItem()); - int minutes = MUOMConversion.convertToMinutes(Env.getCtx(), uom.getKey(), qty); - Timestamp assignDateTo = TimeUtil.addMinutess(assignDateFrom, minutes); - m_mAssignment.setAssignDateTo (assignDateTo); - // - // m_mAssignment.dump(); - return m_mAssignment.save(); - } // cmdSave - - - /************************************************************************** - * Load Resources. - * called from variable constructor - * @return Array with resources - */ - private KeyNamePair[] getResources() - { - if (m_lookup.size() == 0) - { - String sql = MRole.getDefault().addAccessSQL( - "SELECT r.S_Resource_ID, r.Name, r.IsActive," // 1..3 - + "uom.C_UOM_ID,uom.UOMSymbol " // 4..5 - + "FROM S_Resource r, S_ResourceType rt, C_UOM uom " - + "WHERE r.S_ResourceType_ID=rt.S_ResourceType_ID AND rt.C_UOM_ID=uom.C_UOM_ID", - "r", MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - rs = pstmt.executeQuery(); - while (rs.next()) - { - StringBuilder sb = new StringBuilder (rs.getString(2)); - if (!"Y".equals(rs.getString(3))) - sb.insert(0,'~').append('~'); // inactive marker - // Key S_Resource_ID/Name - KeyNamePair key = new KeyNamePair (rs.getInt(1), sb.toString()); - // Value C_UOM_ID/Name - KeyNamePair value = new KeyNamePair (rs.getInt(4), rs.getString(5).trim()); - m_lookup.put(key, value); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - } - // Convert to Array - KeyNamePair[] retValue = new KeyNamePair[m_lookup.size()]; - m_lookup.keySet().toArray(retValue); - Arrays.sort(retValue); - return retValue; - } // getResources - -} // VAssignmentDialog diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VBPartner.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VBPartner.java deleted file mode 100644 index 669d72b9c7..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VBPartner.java +++ /dev/null @@ -1,486 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.logging.Level; - -import javax.swing.Box; -import javax.swing.JComboBox; -import javax.swing.JComponent; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.model.MBPartner; -import org.compiere.model.MBPartnerLocation; -import org.compiere.model.MLocation; -import org.compiere.model.MLocationLookup; -import org.compiere.model.MRole; -import org.compiere.model.MUser; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -/** - * Business Partner Editor. - * Set BPartner: loadBPartner - * Get result: getC_BPartner_ID - * - * @author Jorg Janke - * @version $Id: VBPartner.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public final class VBPartner extends CDialog implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -4130643780412193122L; - - - /** - * Constructor. - * Requires call loadBPartner - * @param frame parent - * @param WindowNo Window No - */ - public VBPartner(Frame frame, int WindowNo) - { - super(frame, Msg.translate(Env.getCtx(), "C_BPartner_ID"), true); - m_WindowNo = WindowNo; - m_readOnly = !MRole.getDefault().canUpdate( - Env.getAD_Client_ID(Env.getCtx()), Env.getAD_Org_ID(Env.getCtx()), - MBPartner.Table_ID, 0, false); - if (log.isLoggable(Level.INFO)) log.info("R/O=" + m_readOnly); - try - { - jbInit(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, ex.getMessage()); - } - initBPartner(); - // - AEnv.positionCenterWindow(frame, this); - } // VBPartner - - private int m_WindowNo; - /** The Partner */ - private MBPartner m_partner = null; - /** The Location */ - private MBPartnerLocation m_pLocation = null; - /** The User */ - private MUser m_user = null; - /** Read Only */ - private boolean m_readOnly = false; - - - private Insets m_labelInsets = new Insets(2,15,2,0); // top,left,bottom,right - private Insets m_fieldInsets = new Insets(2,5,2,10); // top,left,bottom,right - private GridBagConstraints m_gbc = new GridBagConstraints(); - private int m_line; - private Object[] m_greeting; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VBPartner.class); - // - private VString fValue, fName, fName2, fContact, fTitle, fPhone, fFax, fPhone2, fEMail; - private VLocation fAddress; - private JComboBox fGreetingBP, fGreetingC; - // - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel centerPanel = new CPanel(); - private CPanel southPanel = new CPanel(); - private GridBagLayout centerLayout = new GridBagLayout(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - private BorderLayout southLayout = new BorderLayout(); - - - /** - * Static Init - * @throws Exception - */ - void jbInit() throws Exception - { - mainPanel.setLayout(mainLayout); - southPanel.setLayout(southLayout); - centerPanel.setLayout(centerLayout); - mainLayout.setVgap(5); - getContentPane().add(mainPanel); - mainPanel.add(centerPanel, BorderLayout.CENTER); - mainPanel.add(southPanel, BorderLayout.SOUTH); - southPanel.add(confirmPanel, BorderLayout.CENTER); - // - confirmPanel.addActionListener(this); - } // jbInit - - /** - * Dynamic Init - */ - private void initBPartner() - { - // Get Data - m_greeting = fillGreeting(); - - // Display - m_gbc.anchor = GridBagConstraints.NORTHWEST; - m_gbc.gridx = 0; - m_gbc.gridy = 0; - m_gbc.gridwidth = 1; - m_gbc.weightx = 0; - m_gbc.weighty = 0; - m_gbc.fill = GridBagConstraints.HORIZONTAL; - m_gbc.ipadx = 0; - m_gbc.ipady = 0; - m_line = 0; - - // Value - fValue = new VString("Value", true, false, true, 30, 60, "", null); - fValue.addActionListener(this); - createLine (fValue, "Value", true); - // Greeting Business Partner - fGreetingBP = new JComboBox (m_greeting); - createLine (fGreetingBP, "Greeting", false); - // Name - fName = new VString("Name", true, false, true, 30, 60, "", null); - fName.addActionListener(this); - createLine (fName, "Name", false).setFontBold(true); - // Name2 - fName2 = new VString("Name2", false, false, true, 30, 60, "", null); - createLine (fName2, "Name2", false); - - // Contact - fContact = new VString("Contact", false, false, true, 30, 60, "", null); - createLine (fContact, "Contact", true).setFontBold(true); - // Greeting Contact - fGreetingC = new JComboBox (m_greeting); - createLine (fGreetingC, "Greeting", false); - // Title - fTitle = new VString("Title", false, false, true, 30, 60, "", null); - createLine(fTitle, "Title", false); - // Email - fEMail = new VString("EMail", false, false, true, 30, 40, "", null); - createLine (fEMail, "EMail", false); - - // Location - boolean ro = m_readOnly; - if (!ro) - ro = !MRole.getDefault().canUpdate( - Env.getAD_Client_ID(Env.getCtx()), Env.getAD_Org_ID(Env.getCtx()), - MBPartnerLocation.Table_ID, 0, false); - if (!ro) - ro = !MRole.getDefault().canUpdate( - Env.getAD_Client_ID(Env.getCtx()), Env.getAD_Org_ID(Env.getCtx()), - MLocation.Table_ID, 0, false); - fAddress = new VLocation ("C_Location_ID", false, ro, true, new MLocationLookup (Env.getCtx(), m_WindowNo)); - fAddress.setValue (null); - createLine (fAddress, "C_Location_ID", true).setFontBold(true); - // Phone - fPhone = new VString("Phone", false, false, true, 30, 40, "", null); - createLine (fPhone, "Phone", true); - // Phone2 - fPhone2 = new VString("Phone2", false, false, true, 30, 40, "", null); - createLine (fPhone2, "Phone2", false); - // Fax - fFax = new VString("Fax", false, false, true, 30, 40, "", null); - createLine (fFax, "Fax", false); - // - fName.setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - fAddress.setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - } // initBPartner - - /** - * Create Line - * @param field field - * @param title label value - * @param addSpace add more space - * @return label - */ - private CLabel createLine (JComponent field, String title, boolean addSpace) - { - if (addSpace) - { - m_gbc.gridy = m_line++; - m_gbc.gridx = 1; - m_gbc.insets = m_fieldInsets; - centerPanel.add (Box.createHorizontalStrut(6), m_gbc); - } - - // Line - m_gbc.gridy = m_line++; - - // Label - m_gbc.gridx = 0; - m_gbc.insets = m_labelInsets; - m_gbc.fill = GridBagConstraints.HORIZONTAL; - CLabel label = new CLabel(Msg.translate(Env.getCtx(), title)); - centerPanel.add(label, m_gbc); - - // Field - m_gbc.gridx = 1; - m_gbc.insets = m_fieldInsets; - m_gbc.fill = GridBagConstraints.HORIZONTAL; - centerPanel.add(field, m_gbc); - if (m_readOnly) - field.setEnabled(false); - return label; - } // createLine - - /** - * Fill Greeting - * @return KeyNamePair Array of Greetings - */ - private Object[] fillGreeting() - { - String sql = "SELECT C_Greeting_ID, Name FROM C_Greeting WHERE IsActive='Y' ORDER BY 2"; - sql = MRole.getDefault().addAccessSQL(sql, "C_Greeting", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - return DB.getKeyNamePairs(sql, true); - } // fillGreeting - - /** - * Search m_greeting for key - * @param key C_Greeting_ID - * @return Greeting - */ - private KeyNamePair getGreeting (int key) - { - for (int i = 0; i < m_greeting.length; i++) - { - KeyNamePair p = (KeyNamePair)m_greeting[i]; - if (p.getKey() == key) - return p; - } - return new KeyNamePair(-1, " "); - } // getGreeting - - /** - * Load BPartner - * @param C_BPartner_ID - existing BPartner or 0 for new - * @return true if loaded - */ - public boolean loadBPartner (int C_BPartner_ID) - { - if (log.isLoggable(Level.CONFIG)) log.config("C_BPartner_ID=" + C_BPartner_ID); - // New bpartner - if (C_BPartner_ID == 0) - { - m_partner = null; - m_pLocation = null; - m_user = null; - return true; - } - - m_partner = new MBPartner (Env.getCtx(), C_BPartner_ID, null); - if (m_partner.get_ID() == 0) - { - ADialog.error(m_WindowNo, this, "BPartnerNotFound"); - return false; - } - - // BPartner - Load values - fValue.setText(m_partner.getValue()); - fGreetingBP.setSelectedItem(getGreeting(m_partner.getC_Greeting_ID())); - fName.setText(m_partner.getName()); - fName2.setText(m_partner.getName2()); - - // Contact - Load values - m_pLocation = m_partner.getLocation( - Env.getContextAsInt(Env.getCtx(), m_WindowNo, "C_BPartner_Location_ID")); - if (m_pLocation != null) - { - int location = m_pLocation.getC_Location_ID(); - fAddress.setValue (Integer.valueOf(location)); - // - fPhone.setText(m_pLocation.getPhone()); - fPhone2.setText(m_pLocation.getPhone2()); - fFax.setText(m_pLocation.getFax()); - } - // User - Load values - m_user = m_partner.getContact( - Env.getContextAsInt(Env.getCtx(), m_WindowNo, "AD_User_ID")); - if (m_user != null) - { - fGreetingC.setSelectedItem(getGreeting(m_user.getC_Greeting_ID())); - fContact.setText(m_user.getName()); - fTitle.setText(m_user.getTitle()); - fEMail.setText(m_user.getEMail()); - // - fPhone.setText(m_user.getPhone()); - fPhone2.setText(m_user.getPhone2()); - fFax.setText(m_user.getFax()); - } - return true; - } // loadBPartner - - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (m_readOnly) - dispose(); - // copy value - else if (e.getSource() == fValue) - { - if (fName.getText() == null || fName.getText().length() == 0) - fName.setText(fValue.getText()); - } - else if (e.getSource() == fName) - { - if (fContact.getText() == null || fContact.getText().length() == 0) - fContact.setText(fName.getText()); - } - // OK pressed - else if (e.getActionCommand().equals(ConfirmPanel.A_OK) - && actionSave()) - dispose(); - // Cancel pressed - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - dispose(); - } // actionPerformed - - /** - * Save. - * Checks mandatory fields and saves Partner, Contact and Location - * @return true if saved - */ - private boolean actionSave() - { - log.config(""); - - // Check Mandatory fields - if (fName.getText().equals("")) - { - fName.setBackground(AdempierePLAF.getFieldBackground_Error()); - return false; - } - else - fName.setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - if (fAddress.getC_Location_ID() == 0) - { - fAddress.setBackground(AdempierePLAF.getFieldBackground_Error()); - return false; - } - else - fAddress.setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - - // ***** Business Partner ***** - if (m_partner == null) - { - int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); - m_partner = MBPartner.getTemplate(Env.getCtx(), AD_Client_ID); - m_partner.setAD_Org_ID(Env.getAD_Org_ID(Env.getCtx())); // Elaine 2009/07/03 - boolean isSOTrx = !"N".equals(Env.getContext(Env.getCtx(), m_WindowNo, "IsSOTrx")); - m_partner.setIsCustomer (isSOTrx); - m_partner.setIsVendor (!isSOTrx); - } - // Check Value - String value = fValue.getText(); - if (value == null || value.length() == 0) - { - // get Table Documet No - value = DB.getDocumentNo (Env.getAD_Client_ID(Env.getCtx()), "C_BPartner", null, m_partner); - fValue.setText(value); - } - m_partner.setValue(fValue.getText()); - // - m_partner.setName(fName.getText()); - m_partner.setName2(fName2.getText()); - KeyNamePair p = (KeyNamePair)fGreetingBP.getSelectedItem(); - if (p != null && p.getKey() > 0) - m_partner.setC_Greeting_ID(p.getKey()); - else - m_partner.setC_Greeting_ID(0); - if (m_partner.save()) { - if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_ID=" + m_partner.getC_BPartner_ID()); - } else { - ADialog.error(m_WindowNo, this, "BPartnerNotSaved"); - } - - // ***** Business Partner - Location ***** - if (m_pLocation == null) - m_pLocation = new MBPartnerLocation(m_partner); - m_pLocation.setC_Location_ID(fAddress.getC_Location_ID()); - // - m_pLocation.setPhone(fPhone.getText()); - m_pLocation.setPhone2(fPhone2.getText()); - m_pLocation.setFax(fFax.getText()); - if (m_pLocation.save()) { - if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_Location_ID=" + m_pLocation.getC_BPartner_Location_ID()); - } else { - ADialog.error(m_WindowNo, this, "BPartnerNotSaved", Msg.translate(Env.getCtx(), "C_BPartner_Location_ID")); - } - - // ***** Business Partner - User ***** - String contact = fContact.getText(); - String email = fEMail.getText(); - if (m_user == null && (contact.length() > 0 || email.length() > 0)) - m_user = new MUser (m_partner); - if (m_user != null) - { - if (contact.length() == 0) - contact = fName.getText(); - m_user.setName(contact); - m_user.setEMail(email); - m_user.setTitle(fTitle.getText()); - p = (KeyNamePair)fGreetingC.getSelectedItem(); - if (p != null && p.getKey() > 0) - m_user.setC_Greeting_ID(p.getKey()); - else - m_user.setC_Greeting_ID(0); - // - m_user.setPhone(fPhone.getText()); - m_user.setPhone2(fPhone2.getText()); - m_user.setFax(fFax.getText()); - if (m_user.save()) { - if (log.isLoggable(Level.FINE)) log.fine("AD_User_ID=" + m_user.getAD_User_ID()); - } else { - ADialog.error(m_WindowNo, this, "BPartnerNotSaved", Msg.translate(Env.getCtx(), "AD_User_ID")); - } - } - return true; - } // actionSave - - - /** - * Returns BPartner ID - * @return C_BPartner_ID (0 = not saved) - */ - public int getC_BPartner_ID() - { - if (m_partner == null) - return 0; - return m_partner.getC_BPartner_ID(); - } // getBPartner_ID - -} // VBPartner - diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VBinary.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VBinary.java deleted file mode 100644 index 128a4e6212..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VBinary.java +++ /dev/null @@ -1,287 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Color; -import java.awt.Component; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.util.logging.Level; - -import javax.swing.JButton; -import javax.swing.JFileChooser; - -import org.compiere.model.GridField; -import org.compiere.util.CLogger; - -/** - * Binary Editor. - * Shows length of data. - * - * @author Jorg Janke - * @version $Id: VBinary.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VBinary extends JButton - implements VEditor, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -1940719045449193395L; - - /** - * Binary Editor - * @param columnName column name - * @param WindowNo - */ - public VBinary (String columnName, int WindowNo) - { - super(""); - m_columnName = columnName; - m_WindowNo = WindowNo; - super.addActionListener(this); - } // VBinary - - /** - * Dispose - */ - public void dispose() - { - m_data = null; - } // dispose - - - /** Column Name */ - private String m_columnName; - /** WindowNo */ - @SuppressWarnings("unused") - private int m_WindowNo; - /** Data */ - private Object m_data = null; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(VBinary.class); - - /** - * Set Value - * @param value - */ - public void setValue(Object value) - { - if (log.isLoggable(Level.CONFIG)) log.config("=" + value); - m_data = value; - if (m_data == null) - setText("-"); - else - { - String text = "?"; - if (m_data instanceof byte[]) - { - byte[] bb = (byte[])m_data; - text = "#" + bb.length; - } - else - { - text = m_data.getClass().getName(); - int index = text.lastIndexOf('.'); - if (index != -1) - text = text.substring(index+1); - } - setText(text); - } - } // setValue - - /** - * Get Value - * @return value - */ - public Object getValue() - { - return m_data; - } // getValue - - /** - * Get Display Value - * @return image name - */ - public String getDisplay() - { - return getText(); - } // getDisplay - - /** - * Set ReadWrite - * @param rw - */ - public void setReadWrite (boolean rw) - { - if (isEnabled() != rw) - setEnabled (rw); - } // setReadWrite - - /** - * Get ReadWrite - * @return true if rw - */ - public boolean isReadWrite() - { - return super.isEnabled(); - } // getReadWrite - - /** - * Set Mandatory - * @param mandatory NOP - */ - public void setMandatory (boolean mandatory) - { - } // setMandatory - - /** - * Get Mandatory - * @return false - */ - public boolean isMandatory() - { - return false; - } // isMandatory - - /** - * Set Background - nop - * @param color - */ - public void setBackground(Color color) - { - } // setBackground - - /** - * Set Background - nop - */ - public void setBackground() - { - } // setBackground - - /** - * Set Background - nop - * @param error - */ - public void setBackground(boolean error) - { - } // setBackground - - /** - * Property Change - * @param evt - */ - public void propertyChange(PropertyChangeEvent evt) - { - if (log.isLoggable(Level.INFO)) log.info(evt.toString()); - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * ActionListener - start dialog and set value - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - JFileChooser fc = new JFileChooser(""); - fc.setMultiSelectionEnabled(false); - fc.setFileSelectionMode(JFileChooser.FILES_ONLY); - int option = 0; - boolean save = m_data != null; - if (save) - option = fc.showSaveDialog(this); - else - option = fc.showOpenDialog(this); - if (option != JFileChooser.APPROVE_OPTION) - return; - File file = fc.getSelectedFile(); - if (file == null) - return; - // - if (log.isLoggable(Level.INFO)) log.info(file.toString()); - try - { - if (save) - { - FileOutputStream os = new FileOutputStream(file); - byte[] buffer = (byte[])m_data; - os.write(buffer); - os.flush(); - os.close(); - if (log.isLoggable(Level.CONFIG)) log.config("Save to " + file + " #" + buffer.length); - } - else // load - { - FileInputStream is = new FileInputStream(file); - ByteArrayOutputStream os = new ByteArrayOutputStream(); - byte[] buffer = new byte[1024*8]; // 8kB - int length = -1; - while ((length = is.read(buffer)) != -1) - os.write(buffer, 0, length); - is.close(); - byte[] data = os.toByteArray(); - m_data = data; - if (log.isLoggable(Level.CONFIG)) log.config("Load from " + file + " #" + data.length); - os.close(); - } - } - catch (Exception ex) - { - log.log(Level.WARNING, "Save=" + save, ex); - } - - try - { - fireVetoableChange(m_columnName, null, m_data); - } - catch (PropertyVetoException pve) {} - } // actionPerformed - - // Field for Value Preference - private GridField m_mField = null; - /** - * Set Field/WindowNo for ValuePreference (NOP) - * @param mField - */ - public void setField (GridField mField) - { - m_mField = mField; - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return this; - } // getFocusComponent - -} // VBinary diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VButton.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VButton.java deleted file mode 100644 index 7793762408..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VButton.java +++ /dev/null @@ -1,403 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import static org.compiere.model.SystemIDs.REFERENCE_DOCUMENTACTION; -import static org.compiere.model.SystemIDs.REFERENCE_PAYMENTRULE; -import static org.compiere.model.SystemIDs.REFERENCE_POSTED; - -import java.awt.Color; -import java.awt.Component; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.logging.Level; - -import org.compiere.model.GridField; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.swing.CButton; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.NamePair; - -/** - * General Button. - *
    - *  Special Buttons:
    - *      Payment,
    - *      Processing,
    - *      CreateFrom,
    - *      Record_ID       - Zoom
    - *  
    - * Maintains all values for display in m_values. - * see org.compiere.apps.APanel#actionButton(VButton) - * - * @author Jorg Janke - * @version $Id: VButton.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public final class VButton extends CButton - implements VEditor -{ - /** - * - */ - private static final long serialVersionUID = 148906133238037062L; - - /** - * Constructor - * @param columnName column - * @param mandatory mandatory - * @param isReadOnly read only - * @param isUpdateable updateable - * @param text text - * @param description description - * @param help help - * @param AD_Process_ID process to start - */ - public VButton (String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable, - String text, String description, String help, int AD_Process_ID) - { - super (text); - super.setName(columnName); - super.setActionCommand(columnName); - m_text = text; - m_columnName = columnName; - // - setMandatory (mandatory); - if (isReadOnly || !isUpdateable) - setReadWrite(false); - else - setReadWrite(true); - - // Special Buttons - if (columnName.equals("PaymentRule")) - { - readReference(REFERENCE_PAYMENTRULE); - this.setForeground(Color.blue); - setIcon(Env.getImageIcon("Payment16.gif")); // 29*14 - } - else if (columnName.equals("DocAction")) - { - readReference(REFERENCE_DOCUMENTACTION); - this.setForeground(Color.blue); - setIcon(Env.getImageIcon("Process16.gif")); // 16*16 - } - else if (columnName.equals("CreateFrom")) - { - setIcon(Env.getImageIcon("Copy16.gif")); // 16*16 - } - else if (columnName.equals("Record_ID")) - { - setIcon(Env.getImageIcon("Zoom16.gif")); // 16*16 - this.setText(Msg.getMsg(Env.getCtx(), "ZoomDocument")); - } - else if (columnName.equals("Posted")) - { - readReference(REFERENCE_POSTED); - this.setForeground(Color.magenta); - setIcon(Env.getImageIcon("InfoAccount16.gif")); // 16*16 - } - - // Deescription & Help - m_description = description; - if (description == null || description.length() == 0) - m_description = " "; - else - setToolTipText(m_description); - // - m_help = help; - if (help == null) - m_help = ""; - m_AD_Process_ID = AD_Process_ID; - } // VButton - - /** Mnemonic saved */ - private char m_savedMnemonic = 0; - - /** - * Dispose - */ - public void dispose() - { - m_actionListener = null; - if (m_values != null) - m_values.clear(); - m_values = null; - } // dispose - - private String m_columnName; - private String m_text; - private boolean m_mandatory; - private Object m_value; - @SuppressWarnings("unused") - private ActionListener m_actionListener; - /** List of Key/Name */ - private HashMap m_values = null; - /** Description as ToolTip */ - private String m_description = ""; - private String m_help; - private int m_AD_Process_ID; - private MLookup m_lookup; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VButton.class); - - /** - * Set Value - * @param value value - */ - public void setValue(Object value) - { - m_value = value; - String text = m_text; - - // Nothing to show or Record_ID - if (value == null || m_columnName.equals("Record_ID")) - ; - else if (m_values != null) - text = (String)m_values.get(value); - else if (m_lookup != null) - { - NamePair pp = m_lookup.get (value); - if (pp != null) - text = pp.getName(); - } - // Display it - setText (text != null ? text : ""); - } // setValue - - /** - * Property Change Listener - * @param evt event - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * Return Value - * @return value - */ - public Object getValue() - { - return m_value; - } // getValue - - /** - * Return Display Value - * @return String value - */ - public String getDisplay() - { - return m_value.toString(); - } // getDisplay - - /** - * Set Mandatory - NOP - * @param mandatory mandatory - */ - public void setMandatory (boolean mandatory) - { - m_mandatory = mandatory; - } // setMandatory - - /** - * Mandatory? - * @return true if mandatory - */ - public boolean isMandatory() - { - return m_mandatory; - } // isMandatory - - /** - * Set Background - NOP - * @param error error - */ - public void setBackground(boolean error) - { - } // setBackground - - /** - * Get ColumnName - * @return column name - */ - public String getColumnName() - { - return m_columnName; - } // getColumnName - - /** - * Get Description - * @return description string - */ - public String getDescription() - { - return m_description; - } // getDescription - - /** - * Get Help - * @return help string - */ - public String getHelp() - { - return m_help; - } // getHelp - - /** - * Get AD_Process_ID - * @return AD_Process_ID or 0 - */ - public int getProcess_ID() - { - return m_AD_Process_ID; - } // getProcess_ID - - /** - * Add ActionListener - * @param aListener listener - */ - public void addActionListener(ActionListener aListener) - { - m_actionListener = aListener; - super.addActionListener(aListener); - } // addActionListener - - /** - * String representation - * @return String representation - */ - public String toString() - { - StringBuilder sb = new StringBuilder ("VButton["); - sb.append(m_columnName); - sb.append("=").append(m_value).append("]"); - return sb.toString(); - } // toString - - /** - * Fill m_Values with Ref_List values - * @param AD_Reference_ID reference - */ - private void readReference( int AD_Reference_ID) - { - m_values = new HashMap(); - String SQL; - if (Env.isBaseLanguage(Env.getCtx(), "AD_Ref_List")) - SQL = "SELECT Value, Name FROM AD_Ref_List WHERE AD_Reference_ID=?"; - else - SQL = "SELECT l.Value, t.Name FROM AD_Ref_List l, AD_Ref_List_Trl t " - + "WHERE l.AD_Ref_List_ID=t.AD_Ref_List_ID" - + " AND t.AD_Language='" + Env.getAD_Language(Env.getCtx()) + "'" - + " AND l.AD_Reference_ID=?"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(SQL, null); - pstmt.setInt(1, AD_Reference_ID); - rs = pstmt.executeQuery(); - while (rs.next()) - { - String value = rs.getString(1); - String name = rs.getString(2); - m_values.put(value, name); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, SQL, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - } // readReference - - /** - * Return value/name - * @return HashMap with Value/Names - */ - public HashMap getValues() - { - return m_values; - } // getValues - - // Field for Value Preference - private GridField m_mField = null; - /** - * Set Field/WindowNo for ValuePreference - * @param mField field model - */ - public void setField (GridField mField) - { - if (mField.getColumnName().endsWith("_ID") && !mField.getColumnName().equals("Record_ID")) - { - m_lookup = MLookupFactory.get(Env.getCtx(), mField.getWindowNo(), 0, - mField.getAD_Column_ID(), DisplayType.Search); - } - else if (mField.getAD_Reference_Value_ID() != 0) - { - // Assuming List - m_lookup = MLookupFactory.get(Env.getCtx(), mField.getWindowNo(), 0, - mField.getAD_Column_ID(), DisplayType.List); - } - m_mField = mField; - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - /** - * @return Returns the savedMnemonic. - */ - public char getSavedMnemonic () - { - return m_savedMnemonic; - } // getSavedMnemonic - - /** - * @param savedMnemonic The savedMnemonic to set. - */ - public void setSavedMnemonic (char savedMnemonic) - { - m_savedMnemonic = savedMnemonic; - } // getSavedMnemonic - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return this; - } // getFocusableComponent - -} // VButton diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCellEditor.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCellEditor.java deleted file mode 100644 index 1899ffcf59..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCellEditor.java +++ /dev/null @@ -1,266 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Component; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.VetoableChangeListener; -import java.util.EventObject; -import java.util.logging.Level; - -import javax.swing.AbstractCellEditor; -import javax.swing.BorderFactory; -import javax.swing.JComboBox; -import javax.swing.JTable; -import javax.swing.UIManager; -import javax.swing.table.TableCellEditor; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.model.GridField; -import org.compiere.model.GridTable; -import org.compiere.util.CLogger; - -/** - * Cell Editor. - *
    - *		Sequence of events:
    - *			isCellEditable
    - *			getTableCellEditor
    - *			shouldSelectCell
    - *			getCellEditorValue
    - *  
    - * A new Editor is created for editable columns. - * @author Jorg Janke - * @version $Id: VCellEditor.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public final class VCellEditor extends AbstractCellEditor - implements TableCellEditor, VetoableChangeListener, ActionListener -{ - - /** - * - */ - private static final long serialVersionUID = 1406944397509282968L; - - /** - * Constructor for Grid - * @param mField - */ - public VCellEditor (GridField mField) - { - super(); - m_mField = mField; - // Click - } // VCellEditor - - /** The Field */ - private GridField m_mField = null; - /** The Table Editor */ - private VEditor m_editor = null; - - /** Table */ - private JTable m_table = null; - //private ActionListener buttonListener; - private ActionListener actionListener; - - /** ClickCount */ - private static int CLICK_TO_START = 1; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VCellEditor.class); - - /** - * Create Editor - */ - private void createEditor() - { - m_editor = VEditorFactory.getEditor(m_mField, true); - m_editor.addVetoableChangeListener(this); - m_editor.addActionListener(this); - - } // createEditor - - /** - * Ask the editor if it can start editing using anEvent. - * If editing can be started this method returns true. - * Previously called: MTable.isCellEditable - * @param anEvent event - * @return true if editable - */ - public boolean isCellEditable (EventObject anEvent) - { - if (!m_mField.isEditable (true)) // row data is in context - return false; - if (log.isLoggable(Level.FINE)) log.fine(m_mField.getHeader()); // event may be null if CellEdit - // not enough mouse clicks - if (anEvent instanceof MouseEvent - && ((MouseEvent)anEvent).getClickCount() < CLICK_TO_START) - return false; - - if (m_editor == null) - createEditor(); - return true; - } // isCellEditable - - /** - * Sets an initial value for the editor. This will cause the editor to - * stopEditing and lose any partially edited value if the editor is editing - * when this method is called. - * Returns the component that should be added to the client's Component hierarchy. - * Once installed in the client's hierarchy this component - * will then be able to draw and receive user input. - * - * @param table - * @param value - * @param isSelected - * @param row - * @param col - * @return component - */ - public Component getTableCellEditorComponent (JTable table, Object value, boolean isSelected, int row, int col) - { - if (log.isLoggable(Level.FINEST)) log.finest(m_mField.getColumnName() + ": Value=" + value + ", row=" + row + ", col=" + col); - if (row >= 0) - table.setRowSelectionInterval(row,row); // force moving to new row - if (m_editor == null ) - createEditor(); - - if ( m_editor instanceof VLookup) - { - ((VLookup)m_editor).setStopEditing(false); - } - - m_editor.setReadWrite(m_mField.isEditable (true)); - - m_table = table; - - // Set Value - m_editor.setValue(value); - - // Set Background/Foreground to "normal" (unselected) colors - m_editor.setBackground(m_mField.isError()); - m_editor.setForeground(AdempierePLAF.getTextColor_Normal()); - - // Other UI - m_editor.setFont(table.getFont()); - if ( m_editor instanceof VLookup) { - VLookup lookup = (VLookup)m_editor; - if (lookup.getComponents()[0] instanceof JComboBox) { - lookup.setBorder(BorderFactory.createEmptyBorder()); - } else { - lookup.setBorder(UIManager.getBorder("Table.focusCellHighlightBorder")); - } - } else { - m_editor.setBorder(UIManager.getBorder("Table.focusCellHighlightBorder")); - } - // - return (Component)m_editor; - } // getTableCellEditorComponent - - /** - * The editing cell should be selected or not - * @param e event - * @return true (constant) - */ - public boolean shouldSelectCell(EventObject e) - { - if (log.isLoggable(Level.FINEST)) log.finest(m_mField.getColumnName()); - return true; - } // shouldSelectCell - - /** - * Returns the value contained in the editor - * @return value - */ - public Object getCellEditorValue() - { - if (log.isLoggable(Level.FINEST)) log.finest(m_mField.getColumnName() + ": " + m_editor.getValue()); - return m_editor.getValue(); - } // getCellEditorValue - - /** - * VEditor Change Listener (property name is columnName). - * - indicate change (for String/Text/..)
    - * When editing is complete the value is retrieved via getCellEditorValue - * @param e event - */ - public void vetoableChange(PropertyChangeEvent e) - { - if (m_table == null) - return; - if (log.isLoggable(Level.FINE)) log.fine(e.getPropertyName() + "=" + e.getNewValue()); - // - ((GridTable)m_table.getModel()).setChanged(true); - } // vetoableChange - - /** - * Get Actual Editor. - * Called from GridController to add ActionListener to Button - * @return VEditor - */ - public VEditor getEditor() - { - return m_editor; - } // getEditor - - /** - * Action Editor - Stop Editor - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (log.isLoggable(Level.FINER)) log.finer(m_mField.getColumnName() + ": Value=" + m_editor.getValue()); - if (e.getSource() == m_editor && actionListener != null) - actionListener.actionPerformed(e); - } // actionPerformed - - /** - * Dispose - */ - public void dispose() - { - m_editor = null; - m_mField = null; - m_table = null; - } // dispose - - @Override - public boolean stopCellEditing() { - if (super.stopCellEditing()) { - if (m_editor instanceof VLookup) { - ((VLookup)m_editor).setStopEditing(true); - } - return true; - } else { - return false; - } - } - - @Override - public void cancelCellEditing() { - super.cancelCellEditing(); - if (m_editor instanceof VLookup) { - ((VLookup)m_editor).setStopEditing(true); - } - } - - public void setActionListener(ActionListener listener) { - actionListener = listener; - } -} // VCellEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCellRenderer.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCellRenderer.java deleted file mode 100644 index 74865147d4..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCellRenderer.java +++ /dev/null @@ -1,293 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Insets; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.logging.Level; - -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JTable; -import javax.swing.table.DefaultTableCellRenderer; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.model.GridField; -import org.compiere.model.Lookup; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; - -/** - * Table Cell Renderer based on DisplayType - * - * @author Jorg Janke - * @version $Id: VCellRenderer.java,v 1.4 2006/07/30 00:51:27 jjanke Exp $ - * - * @author Teo Sarca - *
  • FR [ 2866571 ] VCellRenderer: implement getters - * https://sourceforge.net/tracker/?func=detail&aid=2866571&group_id=176962&atid=879335 - */ -public final class VCellRenderer extends DefaultTableCellRenderer -{ - /** - * - */ - private static final long serialVersionUID = 3135422746697244864L; - - /** - * Constructor for Grid - * @param mField field model - */ - public VCellRenderer(GridField mField) - { - this (mField.getDisplayType()); - m_columnName = mField.getColumnName(); - this.setName(m_columnName); - m_lookup = mField.getLookup(); - m_password = mField.isEncryptedField(); - } // VCellRenderer - - /** - * Constructor for MiniGrid - * @param displayType Display Type - */ - public VCellRenderer (int displayType) - { - super(); - m_displayType = displayType; - // Number - if (DisplayType.isNumeric(m_displayType)) - { - m_numberFormat = DisplayType.getNumberFormat(m_displayType); - setHorizontalAlignment(JLabel.RIGHT); - } - // Date - else if (DisplayType.isDate(m_displayType)) - m_dateFormat = DisplayType.getDateFormat(m_displayType); - // - else if (m_displayType == DisplayType.YesNo) - { - m_check = new JCheckBox(); - m_check.setMargin(new Insets(0,0,0,0)); - m_check.setHorizontalAlignment(JLabel.CENTER); - m_check.setOpaque(true); - } - } // VCellRenderer - - private int m_displayType; - private String m_columnName = null; - private Lookup m_lookup = null; - private boolean m_password = false; - // - private SimpleDateFormat m_dateFormat = null; - private DecimalFormat m_numberFormat = null; - private JCheckBox m_check = null; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VCellRenderer.class); - - /** - * Get TableCell RendererComponent. - * @param table table - * @param value value - * @param isSelected selected - * @param hasFocus focus - * @param row row - * @param col col - * @return component - */ - public Component getTableCellRendererComponent (JTable table, Object value, - boolean isSelected, boolean hasFocus, int row, int col) - { - // log.finest(m_columnName - // + ": Value=" + (value == null ? "null" : value.toString()) - // + ", Row=" + row + ", Col=" + col); - - Component c = null; - if (m_displayType == DisplayType.YesNo) - c = m_check; - else - { // returns JLabel - c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col); - //c.setFont(AdempierePLAF.getFont_Field()); - c.setFont(table.getFont()); - } - - // Background & Foreground - Color bg = AdempierePLAF.getFieldBackground_Normal(); - Color fg = AdempierePLAF.getTextColor_Normal(); - // Inactive Background - boolean ro = !table.isCellEditable(row, col); - if (ro) - { - bg = AdempierePLAF.getFieldBackground_Inactive(); - if (isSelected && !hasFocus) - bg = bg.darker(); - } - - // Foreground - int cCode = 0; - // Grid - if (table instanceof org.compiere.grid.VTable) - cCode = ((org.compiere.grid.VTable)table).getColorCode (row); - // MiniGrid - else if (table instanceof org.compiere.minigrid.MiniTable) - cCode = ((org.compiere.minigrid.MiniTable)table).getColorCode (row); - // - if (cCode == 0) - ; // Black - else if (cCode < 0) - fg = AdempierePLAF.getTextColor_Issue(); // Red - else - fg = AdempierePLAF.getTextColor_OK(); // Blue - - // Highlighted row - if (isSelected) - { - // Windows is white on blue - bg = table.getSelectionBackground(); - fg = table.getSelectionForeground(); - if (hasFocus) - bg = org.adempiere.apps.graph.GraphUtil.brighter(bg, .9); - } - - // Set Color - c.setBackground(bg); - c.setForeground(fg); - // - // log.fine( "r=" + row + " c=" + col, // + " - " + c.getClass().getName(), - // "sel=" + isSelected + ", focus=" + hasFocus + ", edit=" + table.isCellEditable(row, col)); - // Log.trace(7, "BG=" + (bg.equals(Color.white) ? "white" : bg.toString()), "FG=" + (fg.equals(Color.black) ? "black" : fg.toString())); - - // Format it - setValue(value); - return c; - } // getTableCellRendererComponent - - - /** - * Format Display Value. - * Default is JLabel - * @param value (key)value - */ - protected void setValue (Object value) - { - String retValue = null; - try - { - // Checkbox - if (m_displayType == DisplayType.YesNo) - { - if (value instanceof Boolean) - m_check.setSelected(((Boolean)value).booleanValue()); - else - m_check.setSelected("Y".equals(value)); - return; - } - else if (value == null) - ; - // Number - else if (DisplayType.isNumeric(m_displayType)) - if (value instanceof Number) - retValue = m_numberFormat.format(value); - else - retValue = value.toString(); - // Date - else if (DisplayType.isDate(m_displayType)) - if (value instanceof Date) - retValue = m_dateFormat.format(value); - else - retValue = value.toString(); - // Row ID - else if (m_displayType == DisplayType.RowID) - retValue = ""; - // Lookup - else if (m_lookup != null && (DisplayType.isLookup(m_displayType) - || m_displayType == DisplayType.Location - || m_displayType == DisplayType.Account - || m_displayType == DisplayType.Locator - || m_displayType == DisplayType.PAttribute )) - retValue = m_lookup.getDisplay(value); - // Button - else if (m_displayType == DisplayType.Button) - { - if ("Record_ID".equals(m_columnName)) - retValue = "#" + value + "#"; - else - retValue = null; - } - // Password (fixed string) - else if (m_password) - retValue = "**********"; - // other (String ...) - else - { - super.setValue(value); - return; - } - } - catch (Exception e) - { - log.log(Level.SEVERE, "(" + value + ") " + value.getClass().getName() , e); - retValue = value.toString(); - } - super.setValue(retValue); - } // setValue - - /** - * to String - * @return String representation - */ - public String toString() - { - return "VCellRenderer[" + m_columnName - + ",DisplayType=" + m_displayType + " - " + m_lookup + "]"; - } // toString - - /** - * Dispose - */ - public void dispose() - { - if (m_lookup != null) - m_lookup.dispose(); - m_lookup = null; - } // dispose - - public String getColumnName() - { - return m_columnName; - } - - public Lookup getLookup() - { - return m_lookup; - } - - public int getDisplayType() - { - return m_displayType; - } - - public boolean isPassword() - { - return m_password; - } -} // VCellRenderer diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VChart.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VChart.java deleted file mode 100644 index af54e918c5..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VChart.java +++ /dev/null @@ -1,192 +0,0 @@ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.VetoableChangeListener; - -import org.adempiere.apps.graph.ChartBuilder; -import org.compiere.apps.AEnv; -import org.compiere.model.GridField; -import org.compiere.model.MChart; -import org.compiere.model.MQuery; -import org.compiere.swing.CPanel; -import org.compiere.util.Env; -import org.jfree.chart.ChartMouseEvent; -import org.jfree.chart.ChartMouseListener; -import org.jfree.chart.ChartPanel; -import org.jfree.chart.JFreeChart; -import org.jfree.chart.entity.CategoryItemEntity; -import org.jfree.chart.entity.ChartEntity; -import org.jfree.chart.entity.PieSectionEntity; -import org.jfree.chart.entity.XYItemEntity; -import org.jfree.data.time.TimeSeries; -import org.jfree.data.time.TimeSeriesCollection; -import org.jfree.data.time.TimeSeriesDataItem; - -public class VChart extends CPanel implements ChartMouseListener, VEditor { - /** - * - */ - private static final long serialVersionUID = 4089566607789995074L; - - ChartPanel chartPanel; - MChart chartModel; - private ChartBuilder chartBuilder; - /** - * Constructor - */ - public VChart() - { - super(); - this.setLayout(new BorderLayout()); - } // Chart - - public VChart(int AD_Chart_ID, int windowNo) { - this(); - chartModel = new MChart(Env.getCtx(), AD_Chart_ID, null); - chartModel.setWindowNo(windowNo); - //createChart(); - } - - public void createChart() - { - chartBuilder = new ChartBuilder(chartModel); - JFreeChart chart = chartBuilder.createChart(); - if (chartPanel != null) - remove(chartPanel); - - chartPanel = new ChartPanel(chart); - Dimension size = getSize(); - size.height= chartModel.getWinHeight(); - chartPanel.setPreferredSize(size); - chartPanel.addChartMouseListener(this); - add(chartPanel,BorderLayout.CENTER); - - this.setMinimumSize(size); - } // BarGraph - - - @Override - public void addActionListener(ActionListener listener) {} - - @Override - public void addVetoableChangeListener(VetoableChangeListener listener) {} - - @Override - public void dispose() {} - - @Override - public String getName() {return chartModel.get_Translation(MChart.COLUMNNAME_Name);} - - @Override - public void removeVetoableChangeListener(VetoableChangeListener listener) {} - - @Override - public void propertyChange(PropertyChangeEvent arg0) {} - - @Override - public void chartMouseClicked(ChartMouseEvent event) { - - if ((event.getEntity()!=null) && (event.getTrigger().getClickCount() > 1)) - { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - try - { - ChartEntity entity = event.getEntity(); - String key = null; - String seriesName = null; - if (entity instanceof CategoryItemEntity) - { - CategoryItemEntity item = ((CategoryItemEntity)entity); - Comparable colKey = item.getColumnKey(); - Comparable rowKey = item.getRowKey(); - if (colKey != null && rowKey !=null) - { - key = colKey.toString(); - seriesName = rowKey.toString(); - } - } - else if (entity instanceof PieSectionEntity) - { - Comparable sectionKey = ((PieSectionEntity)entity).getSectionKey(); - if (sectionKey != null) - { - key = sectionKey.toString(); - } - } - if (entity instanceof XYItemEntity) - { - XYItemEntity item = ((XYItemEntity)entity); - if ( item.getDataset() instanceof TimeSeriesCollection ) - { - TimeSeriesCollection data = (TimeSeriesCollection) item.getDataset(); - TimeSeries series = data.getSeries(item.getSeriesIndex()); - TimeSeriesDataItem dataitem = series.getDataItem(item.getItem()); - seriesName = series.getKey().toString(); - key = dataitem.getPeriod().toString(); - } - } - - if ( key == null ) - return; - - MQuery query = chartBuilder.getQuery(seriesName == null ? key : seriesName+"__"+key); - - if (query != null) - AEnv.zoom(query); - - } - finally - { - setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - } - } - } - - @Override - public void chartMouseMoved(ChartMouseEvent arg0) {} - - @Override - public void setField(GridField mField) {} - - @Override - public String getDisplay() {return null;} - - @Override - public Object getValue() {return null;} - - @Override - public boolean isMandatory() {return false;} - - @Override - public boolean isReadWrite() {return false;} - - @Override - public void setBackground(boolean error) {} - - @Override - public void setMandatory(boolean mandatory) {} - - @Override - public void setReadWrite(boolean rw) {} - - @Override - public void setValue(Object value) {} - - @Override - public GridField getField() { return null; } - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return this; - } // getFocusComponent - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCheckBox.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCheckBox.java deleted file mode 100644 index 6ee336b465..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCheckBox.java +++ /dev/null @@ -1,275 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Component; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; - -import javax.swing.JLabel; -import javax.swing.JPopupMenu; -import javax.swing.SwingUtilities; - -import org.compiere.apps.FieldRecordInfo; -import org.compiere.model.GridField; -import org.compiere.swing.CCheckBox; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Checkbox Control - * - * @author Jorg Janke - * @version $Id: VCheckBox.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VCheckBox extends CCheckBox - implements VEditor, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -3840182999009176708L; - - /****************************************************************************** - * Mouse Listener - */ - final class VCheckBox_mouseAdapter extends MouseAdapter - { - /** - * Constructor - * @param adaptee adaptee - */ - VCheckBox_mouseAdapter(VCheckBox adaptee) - { - m_adaptee = adaptee; - } // VNumber_mouseAdapter - - private VCheckBox m_adaptee; - - /** - * Mouse Listener - * @param e event - */ - public void mouseClicked(MouseEvent e) - { - // popup menu - if (SwingUtilities.isRightMouseButton(e)) - m_adaptee.popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - } // mouseClicked - - } - - /** - * Default Constructor - */ - public VCheckBox() - { - this("", false, false, true, "", null, false); - } // VCheckBox - - /** - * Standard Constructor - * @param columnName - * @param mandatory - * @param isReadOnly - * @param isUpdateable - * @param title - * @param description - * @param tableEditor - */ - public VCheckBox(String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable, - String title, String description, boolean tableEditor) - { - super(); - super.setName(columnName); - m_columnName = columnName; - setMandatory(mandatory); - // - if (isReadOnly || !isUpdateable) - setEditable(false); - else - setEditable(true); - - // Normal - if (!tableEditor) - { - setText(title); - if (description != null && description.length() > 0) - setToolTipText(description); - } - else - { - setHorizontalAlignment(JLabel.CENTER); - } - // - this.addActionListener(this); - addMouseListener(new VCheckBox_mouseAdapter(this)); - } // VCheckBox - - /** Mnemonic saved */ - private char m_savedMnemonic = 0; - - /** - * Dispose - */ - public void dispose() - { - } // dispose - - private String m_columnName; - private GridField m_mField; - // Popup - JPopupMenu popupMenu = new JPopupMenu(); - - /** - * Set Editable - * @param value - */ - public void setEditable (boolean value) - { - super.setReadWrite(value); - } // setEditable - - /** - * IsEditable - * @return true if editable - */ - public boolean isEditable() - { - return super.isReadWrite(); - } // isEditable - - /** - * Set Editor to value - * @param value - */ - public void setValue (Object value) - { - boolean sel = false; - if (value != null) - { - if (value instanceof Boolean) - sel = ((Boolean)value).booleanValue(); - else - sel = "Y".equals(value); - } - setSelected(sel); - } // setValue - - /** - * Property Change Listener - * @param evt - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * Return Editor value - * @return value - */ - public Object getValue() - { - return Boolean.valueOf(isSelected()); - } // getValue - - /** - * Return Display Value - * @return value - */ - public String getDisplay() - { - String value = isSelected() ? "Y" : "N"; - return Msg.translate(Env.getCtx(), value); - } // getDisplay - - /** - * Set Background (nop) - */ - public void setBackground() - { - } // setBackground - - /** - * Action Listener - data binding - * @param e - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(FieldRecordInfo.CHANGE_LOG_COMMAND)) - { - FieldRecordInfo.start(m_mField); - return; - } - // ADebug.info("VCheckBox.actionPerformed"); - try - { - fireVetoableChange(m_columnName, null, getValue()); - } - catch (PropertyVetoException pve) - { - } - } // actionPerformed - - /** - * Set Field/WindowNo for ValuePreference (NOP) - * @param mField - */ - public void setField (org.compiere.model.GridField mField) - { - m_mField = mField; - if (m_mField != null) - FieldRecordInfo.addMenu(this, popupMenu); - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - /** - * @return Returns the savedMnemonic. - */ - public char getSavedMnemonic () - { - return m_savedMnemonic; - } // getSavedMnemonic - - /** - * @param savedMnemonic The savedMnemonic to set. - */ - public void setSavedMnemonic (char savedMnemonic) - { - m_savedMnemonic = savedMnemonic; - } // getSavedMnemonic - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return this; - } // getFocusableComponent - -} // VCheckBox diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VColor.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VColor.java deleted file mode 100644 index a7e3d061cc..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VColor.java +++ /dev/null @@ -1,371 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Color; -import java.awt.Component; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.logging.Level; - -import javax.swing.JFrame; - -import org.compiere.model.GridField; -import org.compiere.model.GridTab; -import org.compiere.plaf.CompiereColor; -import org.compiere.plaf.CompiereLookAndFeel; -import org.compiere.swing.CButton; -import org.compiere.swing.ColorEditor; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; - -/** - * Color Editor. - * The editor stores/gets the attributes from the tab. - * - * @author Jorg Janke - * @version $Id: VColor.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VColor extends CButton - implements VEditor, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -8272165162228993219L; - - /** - * Constructor - * @param mTab Tab - * @param mandatory mandatory - * @param isReadOnly read only - */ - public VColor (GridTab mTab, boolean mandatory, boolean isReadOnly) - { - m_mTab = mTab; - setMandatory(mandatory); - setReadWrite(!isReadOnly); - addActionListener(this); - } // VColor - - /** - * Dispose - */ - public void dispose() - { - m_mTab = null; - } // dispose - - private GridTab m_mTab; - private boolean m_mandatory; -// private int m_AD_Color_ID = 0; - private CompiereColor m_cc = null; - private Object m_value; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VColor.class); - - /** - * Set Mandatory - * @param mandatory mandatory - */ - public void setMandatory (boolean mandatory) - { - m_mandatory = mandatory; - } // setMandatory - - /** - * Is Mandatory - * @return true if Mandatory - */ - public boolean isMandatory() - { - return m_mandatory; - } // isMandatory - - /** - * Set Background (nop) - * @param error error - */ - public void setBackground (boolean error) - { - } // setBackground - - /** - * Set Value - * @param value value - */ - public void setValue (Object value) - { - if (log.isLoggable(Level.CONFIG)) log.config("Value=" + value); - m_value = value; - m_cc = getAdempiereColor(); - - // Display It - setText(getDisplay()); - if (m_cc != null) - setBackgroundColor(m_cc); - else - { - setOpaque(false); - putClientProperty(CompiereLookAndFeel.BACKGROUND, null); - } - repaint(); - } // setValue - - /** - * GetValue - * @return value - */ - public Object getValue() - { - return m_value; - } // getValue - - /** - * Get Displayed Value - * @return String representation - */ - public String getDisplay() - { - if (m_cc == null) - return "-/-"; - return " "; - } // getDisplay - - /** - * Property Change Listener - * @param evt event - */ - public void propertyChange (PropertyChangeEvent evt) - { - // log.config( "VColor.propertyChange", evt); - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - { - setValue(evt.getNewValue()); - setBackground(false); - } - } // propertyChange - - // Field for Value Preference - private GridField m_mField = null; - /** - * Set Field/WindowNo for ValuePreference - * @param mField field - */ - public void setField (GridField mField) - { - mField.setValueNoFire(false); // fire every time - m_mField = mField; - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - /*************************************************************************/ - - /** - * Load Color from Tab - * @return true if loaded - * @see org.compiere.model.MColor#getAdempiereColor - */ - private CompiereColor getAdempiereColor() - { - Integer AD_Color_ID = (Integer)m_mTab.getValue("AD_Color_ID"); - if (log.isLoggable(Level.FINE)) log.fine("AD_Color_ID=" + AD_Color_ID); - CompiereColor cc = null; - - // Color Type - String ColorType = (String)m_mTab.getValue("ColorType"); - if (ColorType == null) - { - log.fine("No ColorType"); - return null; - } - // - if (ColorType.equals(CompiereColor.TYPE_FLAT)) - { - cc = new CompiereColor(getColor(true), true); - } - else if (ColorType.equals(CompiereColor.TYPE_GRADIENT)) - { - Integer RepeatDistance = (Integer)m_mTab.getValue("RepeatDistance"); - String StartPoint = (String)m_mTab.getValue("StartPoint"); - int repeatDistance = RepeatDistance == null ? 0 : RepeatDistance.intValue(); - int startPoint = StartPoint == null ? 0 : Integer.parseInt(StartPoint); - cc = new CompiereColor(getColor(true), getColor(false), startPoint, repeatDistance); - } - else if (ColorType.equals(CompiereColor.TYPE_LINES)) - { - BigDecimal LineWidth = (BigDecimal)m_mTab.getValue("LineWidth"); - BigDecimal LineDistance = (BigDecimal)m_mTab.getValue("LineDistance"); - int lineWidth = LineWidth == null ? 0 : LineWidth.intValue(); - int lineDistance = LineDistance == null ? 0 : LineDistance.intValue(); - cc = new CompiereColor(getColor(false), getColor(true), lineWidth, lineDistance); - } - else if (ColorType.equals(CompiereColor.TYPE_TEXTURE)) - { - Integer AD_Image_ID = (Integer)m_mTab.getValue("AD_Image_ID"); - String url = getURL(AD_Image_ID); - if (url == null) - return null; - BigDecimal ImageAlpha = (BigDecimal)m_mTab.getValue("ImageAlpha"); - float compositeAlpha = ImageAlpha == null ? 0.7f : ImageAlpha.floatValue(); - cc = new CompiereColor(url, getColor(true), compositeAlpha); - } - else - return null; - - if (log.isLoggable(Level.FINE)) log.fine("AdempiereColor=" + cc); - return cc; - } // getAdempiereColor - - /** - * Get Color from Tab - * @param primary true if primary false if secondary - * @return Color - */ - private Color getColor (boolean primary) - { - String add = primary ? "" : "_1"; - // is either BD or Int - Integer Red = (Integer)m_mTab.getValue("Red" + add); - Integer Green = (Integer)m_mTab.getValue("Green" + add); - Integer Blue = (Integer)m_mTab.getValue("Blue" + add); - // - int red = Red == null ? 0 : Red.intValue(); - int green = Green == null ? 0 : Green.intValue(); - int blue = Blue == null ? 0 : Blue.intValue(); - // - return new Color (red, green, blue); - } // getColor - - /** - * Get URL from Image - * @param AD_Image_ID image - * @return URL as String or null - */ - private String getURL (Integer AD_Image_ID) - { - if (AD_Image_ID == null || AD_Image_ID.intValue() == 0) - return null; - // - String retValue = null; - String sql = "SELECT ImageURL FROM AD_Image WHERE AD_Image_ID=?"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt (1, AD_Image_ID.intValue()); - rs = pstmt.executeQuery(); - if (rs.next()) - { - retValue = rs.getString(1); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - return retValue; - } // getURL - - /*************************************************************************/ - - /** - * Action Listener - Open Dialog - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - // Show Dialog - CompiereColor cc = ColorEditor.showDialog((JFrame)Env.getParent(this), m_cc); - if (cc == null) - { - log.info( "VColor.actionPerformed - no color"); - return; - } - setBackgroundColor(cc); // set Button - repaint(); - - // Update Values - m_mTab.setValue("ColorType", cc.getType()); - if (cc.isFlat()) - { - setColor (cc.getFlatColor(), true); - } - else if (cc.isGradient()) - { - setColor (cc.getGradientUpperColor(), true); - setColor (cc.getGradientLowerColor(), false); - m_mTab.setValue("RepeatDistance", new BigDecimal(cc.getGradientRepeatDistance())); - m_mTab.setValue("StartPoint", String.valueOf(cc.getGradientStartPoint())); - } - else if (cc.isLine()) - { - setColor (cc.getLineBackColor(), true); - setColor (cc.getLineColor(), false); - m_mTab.getValue("LineWidth"); - m_mTab.getValue("LineDistance"); - } - else if (cc.isTexture()) - { - setColor (cc.getTextureTaintColor(), true); - // URL url = cc.getTextureURL(); - // m_mTab.setValue("AD_Image_ID"); - m_mTab.setValue("ImageAlpha", BigDecimal.valueOf(cc.getTextureCompositeAlpha())); - } - m_cc = cc; - } // actionPerformed - - /** - * Set Color in Tab - * @param c Color - * @param primary true if primary false if secondary - */ - private void setColor (Color c, boolean primary) - { - String add = primary ? "" : "_1"; - m_mTab.setValue("Red" + add, new BigDecimal(c.getRed())); - m_mTab.setValue("Green" + add, new BigDecimal(c.getGreen())); - m_mTab.setValue("Blue" + add, new BigDecimal(c.getBlue())); - } // setColor - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return this; - } // getFocusableComponent - -} // VColor diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VComboBox.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VComboBox.java deleted file mode 100644 index 94c1bc6fb5..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VComboBox.java +++ /dev/null @@ -1,176 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.util.logging.Level; - -import javax.swing.ComboBoxModel; - -import org.compiere.model.MLocator; -import org.compiere.swing.CComboBox; -import org.compiere.util.CLogger; -import org.compiere.util.KeyNamePair; -import org.compiere.util.NamePair; - -/** - * Combobox with KeyNamePair/ValueNamePair or Locator. - *

    - * It has the same hight as a TextField - * - * @author Jorg Janke - * @version $Id: VComboBox.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VComboBox extends CComboBox -{ - /** - * - */ - private static final long serialVersionUID = 7632613004262943867L; - - /** - * Constructor - */ - public VComboBox() - { - super(); -// common_init(); - } - public VComboBox(Object[] items) - { - super(items); -// common_init(); - } - public VComboBox(ComboBoxModel model) - { - super(model); -// common_init(); - } // VComboBox - - /** Logger */ - private static CLogger log = CLogger.getCLogger(VComboBox.class); - - /** - * Common Setup - * - private void common_init() - { - LookAndFeel.installColorsAndFont(this, "TextField.background", "TextField.foreground", "TextField.font"); - setForeground(AdempierePLAF.getTextColor_Normal()); - setBackground(AdempierePLAF.getFieldBackground_Normal()); - setPreferredSize(s_text.getPreferredSize()); - // this.setKeySelectionManager(new ComboSelectionManager()); - } // common_init - - /** Reference Field * - private static JTextField s_text = new JTextField(VTextField.DISPLAY_SIZE); - - /** - * Set Selected Item to key. - * Find key value in list - * @param key - */ - public void setValue(Object key) - { - if (key == null) - { - this.setSelectedIndex(-1); - return; - } - - ComboBoxModel model = getModel(); - int size = model.getSize(); - for (int i = 0; i < size; i++) - { - Object element = model.getElementAt(i); - String ID = null; - if (element instanceof NamePair) - ID = ((NamePair)element).getID(); - else if (element instanceof MLocator) - ID = String.valueOf(((MLocator)element).getM_Locator_ID()); - else - log.log(Level.SEVERE, "Element not NamePair - " + element.getClass().toString()); - - if (key == null || ID == null) - { - if (key == null && ID == null) - { - setSelectedIndex(i); - return; - } - } - else if (ID.equals(key.toString())) - { - setSelectedIndex(i); - return; - } - } - setSelectedIndex(-1); - setSelectedItem(null); - } // setValue - - /** - * Set Selected item to key if exists - * @param key - */ - public void setValue (int key) - { - setValue(String.valueOf(key)); - } // setValue - - /** - * Get Value - * @return key as Integer or String value - */ - public Object getValue() - { - NamePair p = (NamePair)getSelectedItem(); - if (p == null) - return null; - // - if (p instanceof KeyNamePair) - { - if (p.getID() == null) // -1 return null - return null; - return Integer.valueOf(((KeyNamePair)p).getID()); - } - return p.getID(); - } // getValue - - /** - * Get Display - * @return displayed string - */ - public String getDisplay() - { - if (getSelectedItem() == null) - return ""; - // - NamePair p = (NamePair)getSelectedItem(); - if (p == null) - return ""; - return p.getName(); - } // getDisplay - - @Override - protected boolean isMatchingFilter(Object element) - { - if (element instanceof NamePair) - element = ((NamePair)element).getName(); - return super.isMatchingFilter(element); - } - -} // VComboBox diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDate.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDate.java deleted file mode 100644 index c13fe4913e..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDate.java +++ /dev/null @@ -1,648 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.sql.Timestamp; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.logging.Level; - -import javax.swing.JComponent; -import javax.swing.JPopupMenu; -import javax.swing.JTextField; -import javax.swing.LookAndFeel; -import javax.swing.SwingUtilities; -import javax.swing.text.Document; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.AEnv; -import org.compiere.apps.FieldRecordInfo; -import org.compiere.model.GridField; -import org.compiere.model.MRole; -import org.compiere.swing.CButton; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; - -/** - * Date Edit. - * Maintains data as Timestamp - * - * @author Jorg Janke - * @version $Id: VDate.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VDate extends JComponent - implements VEditor, ActionListener, KeyListener, FocusListener -{ - /** - * - */ - private static final long serialVersionUID = 6876765074500243476L; - - /***************************************************************************** - * Mouse Listener for Popup Menu - */ - class VDate_mouseAdapter extends java.awt.event.MouseAdapter - { - /** - * Constructor - * @param adaptee adaptee - */ - VDate_mouseAdapter(VDate adaptee) - { - this.adaptee = adaptee; - } // VLookup_mouseAdapter - - private VDate adaptee; - - /** - * Mouse Listener - * @param e MouseEvent - */ - public void mouseClicked(MouseEvent e) - { - // System.out.println("mouseClicked " + e.getID() + " " + e.getSource().getClass().toString()); - // popup menu - if (SwingUtilities.isRightMouseButton(e)) - adaptee.popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - } // mouse Clicked - - } // VLookup_mouseAdapter - - /** - * IDE Bean Constructor - */ - public VDate() - { - this (DisplayType.Date); - } // VDate - - /** - * Simple Constructor - * @param displayType display Type - */ - public VDate (int displayType) - { - this("Date", false, false, true, displayType, "Date"); - } // VDate - - /** - * Create right aligned Date field - * @param columnName column name - * @param mandatory mandatory - * @param isReadOnly read only - * @param isUpdateable updateable - * @param displayType display type - * @param title title - */ - public VDate(String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable, - int displayType, String title) - { - super(); - super.setName(columnName); - m_columnName = columnName; - m_title = title; - // - LookAndFeel.installBorder(this, "TextField.border"); - this.setLayout(new BorderLayout()); - this.setFocusable(false); - // Size - this.setPreferredSize(m_text.getPreferredSize()); - int height = m_text.getPreferredSize().height; - setMinimumSize(new Dimension (30,height)); - - VDate_mouseAdapter mouse = new VDate_mouseAdapter(this); // popup - m_text.addMouseListener(mouse); - - // *** Text *** - m_text.setBorder(null); - m_text.setHorizontalAlignment(JTextField.TRAILING); - if (m_displayType == DisplayType.Date) - { - m_text.addFocusListener(this); - m_text.addKeyListener(this); - m_text.setCaret(new VOvrCaret()); - } - else if (m_displayType == DisplayType.DateTime) - m_text.setColumns(20); - // Background - setMandatory(mandatory); - this.add(m_text, BorderLayout.CENTER); - // - if (displayType == DisplayType.DateTime || displayType == DisplayType.Time) - m_displayType = displayType; // default = Date - setFormat(); - - // *** Button *** - m_button.setIcon(Env.getImageIcon("Calendar10.gif")); - m_button.setMargin(new Insets(0, 0, 0, 0)); - m_button.setPreferredSize(new Dimension(height, height)); - m_button.addActionListener(this); - m_button.setFocusable(false); - this.add(m_button, BorderLayout.EAST); - - // Prefereed Size - this.setPreferredSize(this.getPreferredSize()); // causes r/o to be the same length - - // ReadWrite - if (isReadOnly || !isUpdateable) - setReadWrite(false); - else - setReadWrite(true); - } // VDate - - /** - * Dispose - */ - public void dispose() - { - m_text = null; - m_button = null; - m_mField = null; - } // dispose - - /** - * Set Document - * @param doc doc - */ - protected void setDocument(Document doc) - { - m_text.setDocument(doc); - } // getDocument - - private String m_columnName; - protected int m_displayType = DisplayType.Date; - private String m_title; - private boolean m_setting; - private String m_oldText; - private String m_initialText; - // - private SimpleDateFormat m_format; - // - private boolean m_readWrite; - private boolean m_mandatory; - - /** The Text Field */ - private CTextField m_text = new CTextField (12); - /** The Button */ - private CButton m_button = new CButton(); - - // Popup - JPopupMenu popupMenu = new JPopupMenu(); - // Field for Value Preference - private GridField m_mField = null; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VDate.class); - - /** - * Set ReadWrite - field is always r/o for Time or DateTime - * @param value value - */ - public void setReadWrite (boolean value) - { - m_readWrite = value; - // this.setFocusable(value); - // editor - if (m_displayType == DisplayType.Date) - m_text.setReadWrite(value); // sets Background - else - { - m_text.setEditable(false); - m_text.setFocusable(false); - setBackground(false); - } - - // Don't show button if not ReadWrite - if (m_button.isVisible() != value) - m_button.setVisible(value); - if (m_button.isEnabled() != value) - m_button.setEnabled(value); - } // setReadWrite - - /** - * IsReadWrite - * @return true if rw - */ - public boolean isReadWrite() - { - return m_readWrite; - } // isReadWrite - - /** - * Set Mandatory (and back bolor) - * @param mandatory mandatory - */ - public void setMandatory (boolean mandatory) - { - m_mandatory = mandatory; - m_text.setMandatory(mandatory); - setBackground(false); - } // setMandatory - - /** - * Is it mandatory - * @return true if mandatory - */ - public boolean isMandatory() - { - return m_mandatory; - } // isMandatory - - /** - * Set Background based on ReadWrite / mandatory / error - * @param error if true, set background to error color, otherwise mandatory/ReadWrite - */ - public void setBackground (boolean error) - { - if (error) - m_text.setBackground(AdempierePLAF.getFieldBackground_Error()); - else if (!m_readWrite) - m_text.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - else if (m_mandatory) - m_text.setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - else - m_text.setBackground(AdempierePLAF.getFieldBackground_Normal()); - } // setBackground - - /** - * Set Foreground - * @param fg color - */ - public void setForeground(Color fg) - { - m_text.setForeground(fg); - } // setForeground - - /** - * Set Format - * Required when Format/Locale changed - */ - public void setFormat() - { - m_format = DisplayType.getDateFormat(m_displayType); - if (m_displayType == DisplayType.Date) - m_text.setDocument(new MDocDate(m_displayType, m_format, m_text, m_title)); - } // setFormat - - /** - * Request Focus - */ - public void requestFocus () - { - m_text.requestFocus (); - } // requestFocus - - /** - * Request Focus In Window - * @return focus request - */ - @Override - public boolean requestFocusInWindow() - { - return m_text.requestFocusInWindow(); - } // requestFocusInWindow - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return m_text; - } // getFocusComponent - - /** - * Set Editor to value - * @param value timestamp/date or String to be parsed - */ - public void setValue (Object value) - { - if (log.isLoggable(Level.FINEST)) log.finest("Value=" + value); - m_oldText = ""; - if (value == null) - ; - else if (value instanceof java.util.Date) - m_oldText = m_format.format(value); - else - { - String strValue = value.toString(); - // String values - most likely in YYYY-MM-DD (JDBC format) - try - { - java.util.Date date = DisplayType.getDateFormat_JDBC().parse (strValue); - m_oldText = m_format.format(date); // convert to display value - } - catch (ParseException pe0) - { - // Try local string format - try - { - java.util.Date date = m_format.parse(strValue); - m_oldText = m_format.format(date); - } - catch (ParseException pe1) - { - log.log(Level.SEVERE, "setValue - " + pe1.getMessage()); - m_oldText = ""; - } - } - } - if (m_setting) - return; - m_text.setText(m_oldText); - m_initialText = m_oldText; - } // setValue - - /** - * Property Change Listener - * @param evt event - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * Return Editor value - * @return value - */ - public Timestamp getTimestamp() - { - if (m_text == null) - return null; - String value = m_text.getText(); - if (value == null || value.length() == 0) - return null; - // - Timestamp ts = null; - try - { - java.util.Date date = m_format.parse(value); - ts = new Timestamp(date.getTime()); - } - catch (ParseException pe) - { - if (log.isLoggable(Level.FINE)) log.fine(pe.getMessage()); - } - return ts; - } // getValue - - /** - * Return Editor value (Timestamp) - * @return value - */ - public Object getValue() - { - return getTimestamp(); - } // getValue - - /** - * Return Display Value - * @return display value - */ - public String getDisplay() - { - return m_text.getText(); - } // getDisplay - - - /************************************************************************** - * Action Listener (Button) - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - // Preference - if (e.getActionCommand().equals(ValuePreference.NAME)) - { - if (MRole.getDefault().isShowPreference() && !m_mField.isEncrypted() && !m_mField.isEncryptedColumn()) - ValuePreference.start (m_mField, getValue(), getDisplay()); - return; - } - else if (e.getActionCommand().equals(FieldRecordInfo.CHANGE_LOG_COMMAND)) - { - FieldRecordInfo.start(m_mField); - return; - } - if (e.getSource() == m_button) - { - m_button.setEnabled(false); - setValue(startCalendar(this, getTimestamp(), m_format, m_displayType, m_title)); - try - { - fireVetoableChange (m_columnName, m_oldText, getValue()); - } - catch (PropertyVetoException pve) {} - m_button.setEnabled(true); - m_text.requestFocus(); - } - } // actionPerformed - - /** - * Action Listener Interface (Text) - * @param listener listener - */// addActionListener - - /************************************************************************** - * Key Listener Interface - * @param e Event - */ - public void keyTyped(KeyEvent e) {} - public void keyPressed(KeyEvent e) {} - - /** - * Key Listener. - * - Escape - Restore old Text - * - firstChange - signal change - * @param e event - */ - public void keyReleased(KeyEvent e) - { - if (log.isLoggable(Level.FINEST)) log.finest("Key=" + e.getKeyCode() + " - " + e.getKeyChar() - + " -> " + m_text.getText()); - // ESC - if (e.getKeyCode() == KeyEvent.VK_ESCAPE) - m_text.setText(m_initialText); - } // keyReleased - - /** - * Focus Gained - Save for Escape - * @param e event - */ - public void focusGained (FocusEvent e) - { - } // focusGained - - /** - * Data Binding to to GridController. - * @param e event - */ - public void focusLost (FocusEvent e) - { - m_setting = true; - try - { - Timestamp ts = getTimestamp(); // getValue - if (ts == null) // format error - just indicate change - fireVetoableChange (m_columnName, m_oldText, null); - else - fireVetoableChange (m_columnName, m_oldText, ts); - } - catch (PropertyVetoException pve) {} - m_setting = false; - - // did not get Focus first - if (e.isTemporary()) - return; - // log.config( "VDate.focusLost"); - if (m_text == null || m_text.getText() == null) - return; - Object value = getValue(); - setValue(value); - } // focusLost - - /** - * Invalid Entry - Start Calendar - * @param jc parent - * @param value value - * @param format format - * @param displayType display type - * @param title title - * @return formatted Date - */ - public static Timestamp startCalendar(Container jc, Timestamp value, - SimpleDateFormat format, int displayType, String title) - { - if (log.isLoggable(Level.CONFIG)) log.config("Date=" + value); - - // Find frame - Frame frame = AEnv.getFrame(jc); - // Actual Call - Calendar cal = new Calendar(frame, title, value, displayType); - AEnv.showCenterWindow(frame, cal); - Timestamp result = cal.getTimestamp(); - if (log.isLoggable(Level.CONFIG)) log.config( "Result=" + result); - if (result == null) - result = value; // original - else if (result.compareTo(new Timestamp(-1))==0) - result = null; - cal = null; - return result; - } // startCalendar - - /** - * Set Field/WindowNo for ValuePreference - * @param mField MField - */ - public void setField (GridField mField) - { - m_mField = mField; - if (m_mField != null - && MRole.getDefault().isShowPreference() - && !mField.isEncrypted() && !mField.isEncryptedColumn()) - ValuePreference.addMenu (this, popupMenu); - if (m_mField != null) - FieldRecordInfo.addMenu(this, popupMenu); - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - /** - * Set Enabled - * @param enabled enabled - */ - public void setEnabled (boolean enabled) - { - super.setEnabled(enabled); - m_text.setEnabled(enabled); - m_button.setEnabled(enabled); - if (enabled) - m_button.setReadWrite(m_readWrite); - } // setEnabled - - /************************************************************************** - * Remove Action Listner - * @param l Action Listener - */ - public void removeActionListener(ActionListener l) - { - listenerList.remove(ActionListener.class, l); - } // removeActionListener - - /** - * Add Action Listner - * @param l Action Listener - */ - public void addActionListener(ActionListener l) - { - listenerList.add(ActionListener.class, l); - } // addActionListener - - /** - * Fire Action Event to listeners - * - protected void fireActionPerformed() - { - int modifiers = 0; - AWTEvent currentEvent = EventQueue.getCurrentEvent(); - if (currentEvent instanceof InputEvent) - modifiers = ((InputEvent)currentEvent).getModifiers(); - else if (currentEvent instanceof ActionEvent) - modifiers = ((ActionEvent)currentEvent).getModifiers(); - ActionEvent ae = new ActionEvent (this, ActionEvent.ACTION_PERFORMED, - "VDate", EventQueue.getMostRecentEventTime(), modifiers); - - // Guaranteed to return a non-null array - Object[] listeners = listenerList.getListenerList(); - // Process the listeners last to first, notifying those that are interested in this event - for (int i = listeners.length-2; i>=0; i-=2) - { - if (listeners[i]==ActionListener.class) - { - ((ActionListener)listeners[i+1]).actionPerformed(ae); - } - } - } // fireActionPerformed - /**/ - - @Override - public void setBackground(Color bg) - { - m_text.setBackground(bg); - } -} // VDate \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDocAction.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDocAction.java deleted file mode 100644 index 5b0e30b97e..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDocAction.java +++ /dev/null @@ -1,440 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.model.GridTab; -import org.compiere.model.MAllocationHdr; -import org.compiere.model.MBankStatement; -import org.compiere.model.MDocType; -import org.compiere.model.MPeriod; -import org.compiere.model.MProduction; -import org.compiere.model.MTable; -import org.compiere.model.PO; -import org.compiere.process.DocAction; -import org.compiere.process.DocumentEngine; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.wf.MWFActivity; - -/** - * Displays valid Document Action Options based on context - * - * @author Jorg Janke - * @version $Id: VDocAction.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VDocAction extends CDialog - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -7800828832602048052L; - - /** - * Constructor. - * Started from APanel. - * getNumberOfOptions()is used to determine to show the dialog - * @param WindowNo window no - * @param mTab tab - * @param Record_ID record id - * @param button button - */ - public VDocAction (int WindowNo, GridTab mTab, VButton button, int Record_ID) - { - super(AEnv.getWindow(WindowNo), Msg.translate(Env.getCtx(), "DocAction"), true); - log.config(""); - m_WindowNo = WindowNo; - m_mTab = mTab; - // - try - { - jbInit(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - - // dynamic init preparation - m_AD_Table_ID = mTab.getAD_Table_ID(); - if (s_value == null) - readReference(); - // - dynInit(Record_ID); - // - AEnv.positionCenterWindow(AEnv.getWindow(WindowNo), this); - } // VDocAction - - // - private int m_WindowNo = 0; - private int m_AD_Table_ID; - private boolean m_OKpressed = false; - private boolean m_batch = false; - private GridTab m_mTab; - // - private static String[] s_value = null; - private static String[] s_name; - private static String[] s_description; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VDocAction.class); - // - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel northPanel = new CPanel(); - private CComboBoxactionCombo = new CComboBox(); - private JLabel actionLabel = new JLabel(); - private JScrollPane centerPane = new JScrollPane(); - private JTextArea message = new JTextArea(); - private FlowLayout northLayout = new FlowLayout(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - private JButton batchButton = ConfirmPanel.createProcessButton( - Msg.getMsg(Env.getCtx(), "StartBackground")); - - /** - * Static Init - * @throws Exception - */ - void jbInit() throws Exception - { - mainPanel.setLayout(mainLayout); - actionLabel.setText(Msg.translate(Env.getCtx(), "DocAction")); - actionCombo.addActionListener(this); - message.setLineWrap(true); - message.setPreferredSize(new Dimension(350, 35)); - message.setWrapStyleWord(true); - message.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - message.setEditable(false); - northPanel.setLayout(northLayout); - northLayout.setAlignment(FlowLayout.RIGHT); - getContentPane().add(mainPanel); - mainPanel.add(northPanel, BorderLayout.NORTH); - northPanel.add(actionLabel, null); - northPanel.add(actionCombo, null); - mainPanel.add(centerPane, BorderLayout.CENTER); - centerPane.getViewport().add(message, null); - // - mainPanel.add(confirmPanel, BorderLayout.SOUTH); - confirmPanel.addButton(batchButton); - confirmPanel.addActionListener(this); - batchButton.addActionListener(this); - } // jbInit - - /** - * Dynamic Init - determine valid DocActions based on DocStatus for the different documents. - *
    -	 *  DocStatus (131)
    -			??                         Unknown
    -			AP *                       Approved
    -			CH                         Changed
    -			CL *                       Closed
    -			CO *                       Completed
    -			DR                         Drafted
    -			IN                         Inactive
    -			NA                         Not Approved
    -			PE                         Posting Error
    -			PO *                       Posted
    -			PR *                       Printed
    -			RE                         Reversed
    -			TE                         Transfer Error
    -			TR *                       Transferred
    -			VO *                       Voided
    -			XX                         Being Processed
    -	 *
    -	 *   DocAction (135)
    -			--                         
    -			AP *                       Approve
    -			CL *                       Close
    -			CO *                       Complete
    -			PO *                       Post
    -			PR *                       Print
    -			RA                         Reverse - Accrual
    -			RC                         Reverse - Correction
    -			RE                         RE-activate
    -			RJ                         Reject
    -			TR *                       Transfer
    -			VO *                       Void
    -			XL                         Unlock
    -	 *  
    - * @param Record_ID id - */ - private void dynInit(int Record_ID) - { - String DocStatus = (String)m_mTab.getValue("DocStatus"); - String DocAction = (String)m_mTab.getValue("DocAction"); - // - Object Processing = m_mTab.getValue("Processing"); - String OrderType = Env.getContext(Env.getCtx(), m_WindowNo, "OrderType"); - String IsSOTrx = Env.getContext(Env.getCtx(), m_WindowNo, "IsSOTrx"); - - if (DocStatus == null) - { - message.setText("*** ERROR ***"); - return; - } - - if (log.isLoggable(Level.FINE)) log.fine("DocStatus=" + DocStatus - + ", DocAction=" + DocAction + ", OrderType=" + OrderType - + ", IsSOTrx=" + IsSOTrx + ", Processing=" + Processing - + ", AD_Table_ID=" + m_AD_Table_ID + ", Record_ID=" + Record_ID); - // - String[] options = new String[s_value.length]; - int index = 0; - - /** - * Check Existence of Workflow Activities - */ - String wfStatus = MWFActivity.getActiveInfo(Env.getCtx(), m_AD_Table_ID, Record_ID); - if (wfStatus != null) - { - ADialog.error(m_WindowNo, this, "WFActiveForRecord", wfStatus); - return; - } - - // Status Change - if (!checkStatus(m_mTab.getTableName(), Record_ID, DocStatus)) - { - ADialog.error(m_WindowNo, this, "DocumentStatusChanged"); - return; - } - - /******************* - * General Actions - */ - MTable table = MTable.get(Env.getCtx(), m_AD_Table_ID); - PO po = table.getPO(Record_ID, null); - boolean periodOpen = true; - if (po instanceof DocAction) - periodOpen = MPeriod.isOpen(Env.getCtx(), m_AD_Table_ID, Record_ID, null); - - String[] docActionHolder = new String[] {DocAction}; - index = DocumentEngine.getValidActions(DocStatus, Processing, OrderType, IsSOTrx, m_AD_Table_ID, - docActionHolder, options, periodOpen, po); - - Integer doctypeId = (Integer)m_mTab.getValue("C_DocType_ID"); - if(doctypeId==null || doctypeId.intValue()==0){ - doctypeId = (Integer)m_mTab.getValue("C_DocTypeTarget_ID"); - } - if (doctypeId == null && MAllocationHdr.Table_ID == m_AD_Table_ID) { - doctypeId = MDocType.getDocType(MDocType.DOCBASETYPE_PaymentAllocation); - } - if (doctypeId == null && MBankStatement.Table_ID == m_AD_Table_ID) { - doctypeId = MDocType.getDocType(MDocType.DOCBASETYPE_BankStatement); - } - if (doctypeId == null && MProduction.Table_ID == m_AD_Table_ID) { - doctypeId = MDocType.getDocType(MDocType.DOCBASETYPE_MaterialProduction); - } - if (log.isLoggable(Level.FINE)) log.fine("get doctype: " + doctypeId); - if (doctypeId != null) { - index = DocumentEngine.checkActionAccess(Env.getAD_Client_ID(Env.getCtx()), - Env.getAD_Role_ID(Env.getCtx()), - doctypeId, options, index); - } - - DocAction = docActionHolder[0]; - - /** - * Fill actionCombo - */ - for (int i = 0; i < index; i++) - { - // Search for option and add it - boolean added = false; - for (int j = 0; j < s_value.length && !added; j++) - if (options[i].equals(s_value[j])) - { - actionCombo.addItem(s_name[j]); - added = true; - } - } - - // setDefault - if (DocAction.equals("--")) // If None, suggest closing - DocAction = DocumentEngine.ACTION_Close; - String defaultV = ""; - for (int i = 0; i < s_value.length && defaultV.equals(""); i++) - if (DocAction.equals(s_value[i])) - defaultV = s_name[i]; - if (!defaultV.equals("")) - actionCombo.setSelectedItem(defaultV); - } // dynInit - - /** - * Check Status Change - * @param TableName table name - * @param Record_ID record - * @param DocStatus current doc status - * @return true if status not changed - */ - private boolean checkStatus (String TableName, int Record_ID, String DocStatus) - { - String sql = "SELECT 2 FROM " + TableName - + " WHERE " + TableName + "_ID=" + Record_ID - + " AND DocStatus='" + DocStatus + "'"; - int result = DB.getSQLValue(null, sql); - return result == 2; - } // checkStatusChange - - - /** - * Number of options available (to decide to display it) - * @return item count - */ - public int getNumberOfOptions() - { - return actionCombo.getItemCount(); - } // getNumberOfOptions - - /** - * Should the process be started? - * @return OK pressed - */ - public boolean isStartProcess() - { - return m_OKpressed; - } // isStartProcess - - /** - * Should the process be started in batch? - * @return batch - */ - public boolean isBatch() - { - return m_batch; - } // IsBatch - - /** - * Fill Vector with DocAction Ref_List(135) values - */ - private void readReference() - { - ArrayList v_value = new ArrayList(); - ArrayList v_name = new ArrayList(); - ArrayList v_description = new ArrayList(); - - DocumentEngine.readReferenceList(v_value, v_name, v_description); - - // convert to arrays - int size = v_value.size(); - s_value = new String[size]; - s_name = new String[size]; - s_description = new String[size]; - for (int i = 0; i < size; i++) - { - s_value[i] = (String)v_value.get(i); - s_name[i] = (String)v_name.get(i); - s_description[i] = (String)v_description.get(i); - } - } // readReference - - - /** - * ActionListener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - m_batch = e.getSource() == batchButton; - if (m_batch || e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - if (save()) - { - dispose(); - m_OKpressed = true; - return; - } - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - dispose(); - return; - } - else if (e.getSource() != actionCombo) - return; - - /** - * ActionCombo: display the description for the selection - */ - int index = getSelectedIndex(); - // Display description - if (index != -1) - { - message.setText(s_description[index]); - // log.finer("DocAction=" + s_name[index] + " - " + s_value[index]); - } - } // actionPerformed - - - /** - * Get index of selected choice - * @return index or -a - */ - private int getSelectedIndex() - { - int index = -1; - - // get Selection - String sel = (String)actionCombo.getSelectedItem(); - if (sel == null) - return index; - - // find it in vector - for (int i = 0; i < s_name.length && index == -1; i++) - if (sel.equals(s_name[i])) - index = i; - // - return index; - } // getSelectedIndex - - /** - * Save to Database - * @return true if saved to Tab - */ - private boolean save() - { - int index = getSelectedIndex(); - if (index == -1) - return false; - - // Save Selection - if (log.isLoggable(Level.CONFIG)) log.config("DocAction=" + s_value[index]); - m_mTab.setValue("DocAction", s_value[index]); - return true; - } // save - -} // VDocAction \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VEditor.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VEditor.java deleted file mode 100644 index 8f22367df8..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VEditor.java +++ /dev/null @@ -1,113 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Font; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeListener; -import java.beans.VetoableChangeListener; - -import javax.swing.border.Border; - -import org.compiere.model.GridField; -import org.compiere.swing.CEditor; - -/** - * Editor Interface for single Row Editors (also used as TableCellEditors). - *

    - * Editors fire VetoableChange to inform about new entered values - * and listen to propertyChange (MField.PROPERTY) to receive new values - * or to (MField.ATTRIBUTE) in changes of Background or Editability - * - * @author Jorg Janke - * @version $Id: VEditor.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public interface VEditor extends CEditor, PropertyChangeListener -{ - /** - * Get Column Name - * @return column name - */ - public String getName(); - - /** - * Set Column Name - * @patam columnName name - */ - public void setName(String columnName); - - /** - * Change Listener Interface - * @param listener - */ - public void addVetoableChangeListener(VetoableChangeListener listener); - /** - * Change Listener Interface - * @param listener - */ - public void removeVetoableChangeListener(VetoableChangeListener listener); - /** - * Action Listener - * @param listener - */ - public void addActionListener(ActionListener listener); -// public void removeActionListener(ActionListener listener); - - /** - * Used to set border for table editors - * @param border - */ - public void setBorder(Border border); - - /** - * Set Font - * @param font - */ - public void setFont(Font font); - - /** - * Set Foreground - * @param color - */ - public void setForeground(Color color); - - /** - * Set Field/WindowNo for ValuePreference - * @param mField - */ - public void setField (GridField mField); - - /** - * Get Field/WindowNo for ValuePreference - * @return mField - */ - public GridField getField (); - - /** - * Dispose - */ - public void dispose(); - - /** - * Get Focusable Component - * @return component - */ - public Component getFocusableComponent(); - -} // VEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VEditorFactory.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VEditorFactory.java deleted file mode 100644 index 001638010f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VEditorFactory.java +++ /dev/null @@ -1,103 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.util.List; - -import org.adempiere.base.Service; -import org.adempiere.ui.swing.factory.IEditorFactory; -import org.compiere.model.GridField; -import org.compiere.model.GridTab; -import org.compiere.swing.CLabel; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; - -/** - * Factory for VEditor and its Label for single Row display and multi row-editor - * - * @see VCellRenderer for multi-row display - * @author Jorg Janked - * @version $Id: VEditorFactory.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VEditorFactory -{ - /** - * Create Editor for MField. - * The Name is set to the column name for dynamic display management - * @param mField MField - * @param tableEditor true if table editor - * @return grid editor - */ - public static VEditor getEditor (GridField mField, boolean tableEditor) - { - return getEditor (null, mField, tableEditor); - } // getEditor - - /** - * Create Editor for MField. - * The Name is set to the column name for dynamic display management - * @param mTab MTab - * @param mField MField - * @param tableEditor true if table editor - * @return grid editor - */ - public static VEditor getEditor (GridTab mTab, GridField mField, boolean tableEditor) - { - VEditor editor = null; - List factoryList = Service.locator().list(IEditorFactory.class).getServices(); - for(IEditorFactory factory : factoryList) - { - editor = factory.getEditor(mTab, mField, tableEditor); - if (editor != null) - break; - } - return editor; - } // getEditor - - /** - * Create Label for MField. (null for YesNo/Button) - * The Name is set to the column name for dynamic display management - * - * @param mField MField - * @return Label - */ - public static CLabel getLabel (GridField mField) - { - if (mField == null) - return null; - - int displayType = mField.getDisplayType(); - - // No Label for FieldOnly, CheckBox, Button - if (mField.isFieldOnly() - || displayType == DisplayType.YesNo - || displayType == DisplayType.Button) - return null; - // - CLabel label = new CLabel(mField.getHeader(), mField.getDescription()); - label.setName(mField.getColumnName()); - // label.setFont(AdempierePLAF.getFont_Label()); - // label.setForeground(AdempierePLAF.getTextColor_Label()); - return label; - } // getLabel - - /** Logger */ - @SuppressWarnings("unused") - private static CLogger log = CLogger.getCLogger(VEditorFactory.class); - - -} // VEditorFactory diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VFile.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VFile.java deleted file mode 100644 index 6bd97eb14d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VFile.java +++ /dev/null @@ -1,459 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.io.File; -import java.util.logging.Level; - -import javax.swing.JComponent; -import javax.swing.JFileChooser; -import javax.swing.LookAndFeel; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.model.GridField; -import org.compiere.swing.CButton; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * File/Path Selection - * - * @author Initial: Jirimuto - * @version $Id: VFile.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - * - * @author Teo Sarca - */ -public class VFile extends JComponent - implements VEditor, ActionListener, KeyListener, FocusListener -{ - /** - * - */ - private static final long serialVersionUID = 1381828235230540932L; - - /****************************************************************************** - * Mouse Listener for Popup Menu - */ - final class VFile_mouseAdapter extends java.awt.event.MouseAdapter - { - /** - * Constructor - * @param adaptee adaptee - */ - VFile_mouseAdapter(VFile adaptee) - { - m_adaptee = adaptee; - } // VLookup_mouseAdapter - - @SuppressWarnings("unused") - private VFile m_adaptee; - - /** - * Mouse Listener - * @param e MouseEvent - */ - public void mouseClicked(MouseEvent e) - { - - } // mouse Clicked - - } // VFile_mouseAdapter - - /** - * Constructor - * - * @param columnName column name - * @param mandatory mandatory - * @param isReadOnly read only - * @param isUpdateable updateable - * @param files Files only if false Directory only - */ - public VFile(String columnName, boolean mandatory, - boolean isReadOnly, boolean isUpdateable, int fieldLength, boolean files) - { - super(); - super.setName(columnName); - m_columnName = columnName; - m_fieldLength = fieldLength; - if (files) // default Directories - m_selectionMode = JFileChooser.FILES_ONLY; - String col = columnName.toLowerCase(); - if (col.indexOf("open") != -1 || col.indexOf("load") != -1) - m_dialogType = JFileChooser.OPEN_DIALOG; - else if (col.indexOf("save") != -1) - m_dialogType = JFileChooser.SAVE_DIALOG; - // - LookAndFeel.installBorder(this, "TextField.border"); - this.setLayout(new BorderLayout()); - // Size - this.setPreferredSize(m_text.getPreferredSize()); // causes r/o to be the same length - int height = m_text.getPreferredSize().height; - - // Button - m_button.setIcon(Env.getImageIcon("Open16.gif")); - m_button.setMargin(new Insets(0,0,0,0)); - m_button.setPreferredSize(new Dimension(height, height)); - m_button.addActionListener(this); - this.add(m_button, BorderLayout.EAST); - // *** Button & Text *** - m_text.setBorder(null); - m_text.setEditable(true); - m_text.setFocusable(true); - m_text.setFont(AdempierePLAF.getFont_Field()); - m_text.setForeground(AdempierePLAF.getTextColor_Normal()); - m_text.addMouseListener(new VFile_mouseAdapter(this)); - m_text.addKeyListener(this); - m_text.addFocusListener(this); - this.add(m_text, BorderLayout.CENTER); - - // Editable - if (isReadOnly || !isUpdateable) - setReadWrite (false); - else - setReadWrite (true); - setMandatory (mandatory); - } // VFile - - /** - * Dispose - */ - public void dispose() - { - m_text = null; - m_button = null; - m_field = null; - } // dispose - - /** The Text Field */ - private CTextField m_text = new CTextField(VLookup.DISPLAY_LENGTH); - /** The Button */ - private CButton m_button = new CButton(); - /** Column Name */ - private String m_columnName; - private String m_oldText; - private String m_initialText; - /** Field Length */ - private int m_fieldLength; - /** Setting new value */ - private volatile boolean m_setting = false; - /** Selection Mode */ - private int m_selectionMode = JFileChooser.DIRECTORIES_ONLY; - /** Save/Open */ - private int m_dialogType = JFileChooser.CUSTOM_DIALOG; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VFile.class); - - /** - * Enable/disable - * @param value true if ReadWrite - */ - public void setReadWrite (boolean value) - { - m_button.setReadWrite (value); - if (m_button.isVisible() != value) - m_button.setVisible (value); - m_text.setReadWrite(value); - setBackground(false); - } // setReadWrite - - /** - * IsReadWrite - * @return value true if ReadWrite - */ - public boolean isReadWrite() - { - return m_button.isReadWrite(); - } // isReadWrite - - /** - * Set Mandatory (and back bolor) - * @param mandatory true if mandatory - */ - public void setMandatory (boolean mandatory) - { - m_button.setMandatory(mandatory); - setBackground(false); - } // setMandatory - - /** - * Is it mandatory - * @return true if mandatory - */ - public boolean isMandatory() - { - return m_button.isMandatory(); - } // isMandatory - - /** - * Set Background - * @param color color - */ - public void setBackground (Color color) - { - if (!color.equals(m_text.getBackground())) - m_text.setBackground(color); - } // setBackground - - /** - * Set Background based on editable / mandatory / error - * @param error if true, set background to error color, otherwise mandatory/editable - */ - public void setBackground (boolean error) - { - if (error) - setBackground(AdempierePLAF.getFieldBackground_Error()); - else if (!isReadWrite()) - setBackground(AdempierePLAF.getFieldBackground_Inactive()); - else if (isMandatory()) - setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - else - setBackground(AdempierePLAF.getFieldBackground_Normal()); - } // setBackground - - /** - * Set Foreground - * @param fg color - */ - public void setForeground(Color fg) - { - m_text.setForeground(fg); - } // setForeground - - /** - * Set Editor to value - * @param value value - */ - public void setValue(Object value) - { - if (value == null) - m_oldText = ""; - else - m_oldText = value.toString(); - // only set when not updated here - if (m_setting) - return; - m_text.setText (m_oldText); - m_initialText = m_oldText; - } // setValue - - /** - * Property Change Listener - * @param evt PropertyChangeEvent - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * Return Editor value - * @return value - */ - public Object getValue() - { - return m_text.getText(); - } // getValue - - /** - * Return Display Value - * @return display value - */ - public String getDisplay() - { - return m_text.getText(); - } // getDisplay - - /** - * ActionListener - Button - Start Dialog - * @param e ActionEvent - */ - public void actionPerformed(ActionEvent e) - { - String m_value = m_text.getText(); - // - log.config(m_value); - // - String fieldName = null; - if (m_field != null) - fieldName = m_field.getHeader(); - else - fieldName = Msg.getElement(Env.getCtx(), m_columnName); - // - JFileChooser chooser = new JFileChooser(m_value); - chooser.setMultiSelectionEnabled(false); - chooser.setFileSelectionMode(m_selectionMode); - chooser.setDialogTitle(fieldName); - chooser.setDialogType(m_dialogType); - // - int returnVal = -1; - if (m_dialogType == JFileChooser.SAVE_DIALOG) - returnVal = chooser.showSaveDialog(this); - else if (m_dialogType == JFileChooser.OPEN_DIALOG) - returnVal = chooser.showOpenDialog(this); - else // if (m_dialogType == JFileChooser.CUSTOM_DIALOG) - returnVal= chooser.showDialog(this, fieldName); - if (returnVal != JFileChooser.APPROVE_OPTION) - return; - - File selectedFile = chooser.getSelectedFile(); - m_text.setText(selectedFile.getAbsolutePath() ); - // Data Binding - try - { - fireVetoableChange(m_columnName, m_oldText, m_text.getText()); - } - catch (PropertyVetoException pve) - { - } - - } // actionPerformed - - /** - * Action Listener Interface - * @param listener listener - */ - public void addActionListener(ActionListener listener) - { - m_text.addActionListener(listener); - } // addActionListener - - /** - * Action Listener Interface - * @param listener - */ - public void removeActionListener(ActionListener listener) - { - m_text.removeActionListener(listener); - } // removeActionListener - - /** - * Set Field/WindowNo - * @param mField field - */ - public void setField (GridField mField) - { - m_field = mField; - } // setField - - /** Grid Field */ - private GridField m_field = null; - - /** - * Get Field - * @return gridField - */ - public GridField getField() - { - return m_field; - } // getField - - /** - * Request Focus - */ - @Override - public void requestFocus() - { - m_text.requestFocus(); - } // requestFocus - - /** - * Request Focus In Window - * @return focus request - */ - @Override - public boolean requestFocusInWindow() - { - return m_text.requestFocusInWindow(); - } // requestFocusInWindow - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return m_text; - } // getFocusComponent - - public void keyPressed(KeyEvent e) { - } - - public void keyTyped(KeyEvent e) { - } - - /** - * Key Released. - * if Escape Restore old Text - * @param e event - * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent) - */ - public void keyReleased(KeyEvent e) { - if (log.isLoggable(Level.FINEST)) log.finest("Key=" + e.getKeyCode() + " - " + e.getKeyChar() + " -> " + m_text.getText()); - // ESC - if (e.getKeyCode() == KeyEvent.VK_ESCAPE) - m_text.setText(m_initialText); - // Ignore keys that do not alter the text - else if (e.getKeyChar() == KeyEvent.CHAR_UNDEFINED) - return; - } - - /** - * Focus Gained - Save for Escape - * @param e event - */ - public void focusGained (FocusEvent e) - { - } // focusGained - - /** - * Data Binding to to GridController. - * @param e event - */ - public void focusLost (FocusEvent e) - { - m_setting = true; - try - { - String clear = m_text.getText(); - if (clear.length() > m_fieldLength) - clear = clear.substring(0, m_fieldLength); - fireVetoableChange (m_columnName, m_oldText, clear); - } - catch (PropertyVetoException pve) - { - } - m_setting = false; - } // focusLost - -} // VFile diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VHeaderRenderer.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VHeaderRenderer.java deleted file mode 100644 index a4d8bd4cc5..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VHeaderRenderer.java +++ /dev/null @@ -1,130 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Insets; - -import javax.swing.Icon; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JTable; -import javax.swing.SwingConstants; -import javax.swing.UIManager; -import javax.swing.table.TableCellRenderer; - -import org.compiere.swing.CButton; -import org.compiere.swing.CTable; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; - -/** - * Table Header Renderer based on Display Type for aligmnet - * - * @author Jorg Janke - * @version $Id: VHeaderRenderer.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public final class VHeaderRenderer implements TableCellRenderer -{ - public VHeaderRenderer() - { - m_button = new CButton(); - m_button.setMargin(new Insets(0,0,0,0)); - m_button.putClientProperty("Plastic.is3D", Boolean.FALSE); - } - - /** - * Constructor - * @param displayType - */ - public VHeaderRenderer(int displayType) - { - super(); - // Alignment - if (DisplayType.isNumeric(displayType)) - m_alignment = JLabel.RIGHT; - else if (displayType == DisplayType.YesNo) - m_alignment = JLabel.CENTER; - else - m_alignment = JLabel.LEFT; - } // VHeaderRenderer - - // for 3D effect in Windows - private CButton m_button; - - private int m_alignment; - - /** - * Get TableCell RendererComponent - * @param table - * @param value - * @param isSelected - * @param hasFocus - * @param row - * @param column - * @return Button - */ - public Component getTableCellRendererComponent(JTable table, Object value, - boolean isSelected, boolean hasFocus, int row, int column) - { - // Log.trace(this,10, "VHeaderRenderer.getTableCellRendererComponent", value==null ? "null" : value.toString()); - // indicator for invisible column - Icon icon = null; - if (table instanceof CTable) - { - CTable cTable = (CTable)table; - if (cTable.getSortColumn() == table.convertColumnIndexToModel(column)) - { - icon = cTable.isSortAscending() - ? Env.getImageIcon2("uparrow") - : Env.getImageIcon2("downarrow"); - } - } - - TableCellRenderer headerRenderer = table.getTableHeader().getDefaultRenderer(); - Component headerComponent = headerRenderer == null ? null : - headerRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - if (headerComponent != null && headerComponent instanceof JComponent) { - if (headerComponent instanceof JLabel ) { - JLabel label = (JLabel)headerComponent; - label.setHorizontalAlignment(m_alignment); - if (value == null) - label.setPreferredSize(new Dimension(0,0)); - else - label.setText(value.toString()); - label.setIcon(icon); - label.setHorizontalTextPosition(SwingConstants.LEADING); - return label; - } - m_button.setBorder(((JComponent)headerComponent).getBorder()); - } else { - m_button.setBorder(UIManager.getBorder("TableHeader.cellBorder")); - } - - if (value == null) - { - m_button.setPreferredSize(new Dimension(0,0)); - return m_button; - } - m_button.setText(value.toString()); - m_button.setIcon(icon); - m_button.setHorizontalTextPosition(SwingConstants.LEADING); - return m_button; - } // getTableCellRendererComponent - -} // VHeaderRenderer diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VImage.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VImage.java deleted file mode 100644 index 35c3ee6673..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VImage.java +++ /dev/null @@ -1,269 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Image; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.util.logging.Level; - -import javax.swing.ImageIcon; -import javax.swing.JButton; - -import org.compiere.apps.AEnv; -import org.compiere.model.GridField; -import org.compiere.model.MImage; -import org.compiere.util.CLogger; -import org.compiere.util.Env; - -/** - * Image Display of AD_Iamge_ID - * - * @author Jorg Janke - * @version $Id: VImage.java,v 1.6 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VImage extends JButton - implements VEditor, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 2061377580245794385L; - - /** - * Image Editor - * @param columnName column name - * @param WindowNo window no - */ - public VImage (String columnName, int WindowNo) - { - super("-"); - m_columnName = columnName; - m_WindowNo = WindowNo; - super.addActionListener(this); - } // VImage - - /** - * Dispose - */ - public void dispose() - { - m_mImage = null; - } // dispose - - /** WindowNo */ - private int m_WindowNo; - /** The Image Model */ - private MImage m_mImage = null; - /** Mandatory flag */ - private boolean m_mandatory = false; - /** Column Name */ - private String m_columnName = "AD_Image_ID"; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VImage.class); - - /** - * Set Value - * @param value - */ - public void setValue(Object value) - { - final int COLUMNSIZE = 220; - - int newValue = 0; - if (value instanceof Integer) - newValue = ((Integer)value).intValue(); - if (newValue == 0) - { - m_mImage = null; - super.setText("-"); - super.setIcon(null); - super.setDisabledIcon(null); - super.setToolTipText(null); - return; - } - // Get/Create Image - if (m_mImage == null || newValue != m_mImage.get_ID()) - m_mImage = MImage.get (Env.getCtx(), newValue); - // - if (log.isLoggable(Level.FINE)) log.fine(m_mImage.toString()); - super.setText(null); - - if (m_mImage.getImage()==null) - return; - - ImageIcon image = new ImageIcon(m_mImage.getImage()); - if (image.getIconHeight() > COLUMNSIZE || image.getIconWidth() > COLUMNSIZE) { - if (image.getIconHeight() > image.getIconWidth()) { - super.setIcon(new ImageIcon(m_mImage.getImage().getScaledInstance(-1, COLUMNSIZE, Image.SCALE_DEFAULT))); - super.setDisabledIcon(new ImageIcon(m_mImage.getImage().getScaledInstance(-1, COLUMNSIZE, Image.SCALE_DEFAULT))); - } else { - super.setIcon(new ImageIcon(m_mImage.getImage().getScaledInstance(COLUMNSIZE, -1, Image.SCALE_DEFAULT))); - super.setDisabledIcon(new ImageIcon(m_mImage.getImage().getScaledInstance(COLUMNSIZE, -1, Image.SCALE_DEFAULT))); - } - } else { - // the image is smaller than the COLUMNSIZE - super.setIcon(m_mImage.getIcon()); - super.setDisabledIcon(m_mImage.getIcon()); - } - super.setToolTipText(m_mImage.getName()); - invalidate(); - } // setValue - - /** - * Get Value - * @return value - */ - public Object getValue() - { - if (m_mImage == null || m_mImage.get_ID() == 0) - return null; - return Integer.valueOf(m_mImage.get_ID()); - } // getValue - - /** - * Get Display Value - * @return image name - */ - public String getDisplay() - { - return m_mImage.getName(); - } // getDisplay - - /** - * Set ReadWrite - * @param rw - */ - public void setReadWrite (boolean rw) - { - if (isEnabled() != rw) - setEnabled (rw); - } // setReadWrite - - /** - * Get ReadWrite - * @return true if rw - */ - public boolean isReadWrite() - { - return super.isEnabled(); - } // getReadWrite - - /** - * Set Mandatory - * @param mandatory - */ - public void setMandatory (boolean mandatory) - { - m_mandatory = mandatory; - } // setMandatory - - /** - * Get Mandatory - * @return true if mandatory - */ - public boolean isMandatory() - { - return m_mandatory; - } // isMandatory - - /** - * Set Background - nop - * @param color - */ - public void setBackground(Color color) - { - } // setBackground - - /** - * Set Background - nop - */ - public void setBackground() - { - } // setBackground - - /** - * Set Background - nop - * @param error - */ - public void setBackground(boolean error) - { - } // setBackground - - /** - * Property Change - * @param evt - */ - public void propertyChange(PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * ActionListener - start dialog and set value - * @param e - */ - public void actionPerformed (ActionEvent e) - { - VImageDialog vid = new VImageDialog(AEnv.getWindow(m_WindowNo), m_mImage); - vid.setVisible(true); - int AD_Image_ID = vid.getAD_Image_ID(); - Integer newValue = null; - if (AD_Image_ID != 0) - newValue = Integer.valueOf(AD_Image_ID); - // - m_mImage = null; // force reload - setValue(newValue); // set explicitly - // - try - { - fireVetoableChange(m_columnName, null, newValue); - } - catch (PropertyVetoException pve) {} - } // actionPerformed - - // Field for Value Preference - private GridField m_mField = null; - /** - * Set Field/WindowNo for ValuePreference (NOP) - * @param mField - */ - public void setField (GridField mField) - { - m_mField = mField; - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return this; - } // getFocusableComponent - -} // VImage diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VImageDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VImageDialog.java deleted file mode 100644 index e4f3828e20..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VImageDialog.java +++ /dev/null @@ -1,255 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.Frame; -import java.awt.Image; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.ComponentEvent; -import java.awt.event.ComponentListener; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.util.logging.Level; - -import javax.swing.BorderFactory; -import javax.swing.ImageIcon; -import javax.swing.JFileChooser; -import javax.swing.JLabel; -import javax.swing.SwingConstants; - -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.model.MImage; -import org.compiere.swing.CButton; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Image Dialog - * - * @author Jorg Janke - * @version $Id: VImageDialog.java,v 1.4 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VImageDialog extends CDialog - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -2630060904081520523L; - - /** - * Constructor - * @param owner - * @param mImage - */ - public VImageDialog (Frame owner, MImage mImage) - { - super (owner, Msg.translate(Env.getCtx(), "AD_Image_ID"), true); - if (log.isLoggable(Level.INFO)) log.info("MImage=" + mImage); - m_mImage = mImage; - try - { - jbInit(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - // load data - if (m_mImage == null) - m_mImage = MImage.get (Env.getCtx(), 0); - fileButton.setText(m_mImage.getName()); - imageLabel.setIcon(m_mImage.getIcon()); - imageLabel.addComponentListener(new ComponentListener() { - - @Override - public void componentHidden(ComponentEvent e) {} - - @Override - public void componentMoved(ComponentEvent e) {} - - @Override - public void componentResized(ComponentEvent e) { - Image image = m_mImage.getImage(); - JLabel label = (JLabel) e.getComponent(); - - System.err.println("iamge:" + image + " M_mImage: " + m_mImage); - - if (image == null) - return; - - int imageheight = image.getWidth(null); - int imagewidth = image.getWidth(null); - int labelheight = label.getHeight(); - int labelwidth = label.getWidth(); - - if (labelheight == 0 || imageheight == 0) - return; - - // check which dimension we have to scale - if ((double) labelwidth / labelheight < (double) imagewidth / imageheight) { - // do not upscale images - if (imagewidth > labelwidth) - label.setIcon(new ImageIcon(m_mImage.getImage().getScaledInstance(label.getWidth(), -1, Image.SCALE_DEFAULT))); - } else { - if (imageheight > labelheight) - label.setIcon(new ImageIcon(m_mImage.getImage().getScaledInstance(-1, label.getHeight(), Image.SCALE_DEFAULT))); - } - } - - @Override - public void componentShown(ComponentEvent e) {} - }); - AEnv.positionCenterWindow(owner, this); - } // VImageDialog - - /** Image Model */ - private MImage m_mImage = null; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VImageDialog.class); - - /** */ - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel parameterPanel = new CPanel(); - private CLabel fileLabel = new CLabel(); - private CButton fileButton = new CButton(); - private CLabel imageLabel = new CLabel(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - - /** - * Static Init - * @throws Exception - */ - void jbInit() throws Exception - { - mainPanel.setLayout(mainLayout); - fileLabel.setText(Msg.getMsg(Env.getCtx(), "SelectFile")); - fileButton.setText("-"); - imageLabel.setBackground(Color.white); - imageLabel.setBorder(BorderFactory.createRaisedBevelBorder()); - // imageLabel.setPreferredSize(new Dimension(50, 50)); - imageLabel.setHorizontalAlignment(SwingConstants.CENTER); - getContentPane().add(mainPanel); - mainPanel.add(parameterPanel, BorderLayout.NORTH); - parameterPanel.add(fileLabel, null); - parameterPanel.add(fileButton, null); - mainPanel.add(imageLabel, BorderLayout.CENTER); - mainPanel.add(confirmPanel, BorderLayout.SOUTH); - // - fileButton.addActionListener(this); - confirmPanel.addActionListener(this); - } // jbInit - - /** - * ActionListener - * @param e - */ - public void actionPerformed (ActionEvent e) - { - if (e.getSource() == fileButton) - cmd_file(); - - else if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - if (m_mImage.save()) - dispose(); - else - setCursor(Cursor.getDefaultCursor()); - } - - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - m_mImage = null; // reset - dispose(); - } - } // actionPerformed - - /** - * Load file & display - */ - private void cmd_file() - { - // Show File Open Dialog - JFileChooser jfc = new JFileChooser(); - jfc.setMultiSelectionEnabled(false); - jfc.setFileSelectionMode(JFileChooser.FILES_ONLY); - jfc.showOpenDialog(this); - - // Get File Name - File imageFile = jfc.getSelectedFile(); - if (imageFile == null || imageFile.isDirectory() || !imageFile.exists()) - return; - - String fileName = imageFile.getAbsolutePath(); - byte[] data = null; - - // See if we can load & display it - try - { - FileInputStream fis = new FileInputStream(imageFile); - ByteArrayOutputStream os = new ByteArrayOutputStream(); - byte[] buffer = new byte[1024*8]; // 8kB - int length = -1; - while ((length = fis.read(buffer)) != -1) - os.write(buffer, 0, length); - fis.close(); - data = os.toByteArray(); - os.close(); - // - ImageIcon image = new ImageIcon (data, fileName); - imageLabel.setIcon(image); - } - catch (Exception e) - { - log.log(Level.WARNING, "load image", e); - return; - } - - // OK - fileButton.setText(imageFile.getAbsolutePath()); - pack(); - - // Save info - m_mImage.setName(fileName); - m_mImage.setImageURL(fileName); - m_mImage.setBinaryData(data); - } // cmd_file - - /** - * Get Image ID - * @return ID or 0 - */ - public int getAD_Image_ID() - { - if (m_mImage != null) - return m_mImage.getAD_Image_ID(); - return 0; - } // getAD_Image_ID - -} // VImageDialog diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLine.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLine.java deleted file mode 100644 index e7baf28b0c..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLine.java +++ /dev/null @@ -1,143 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Font; -import java.awt.Graphics; - -import javax.swing.border.AbstractBorder; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.util.Language; - -/** - * Horizontal Line with Text - * - * @author Jorg Janke - * @version $Id: VLine.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VLine extends AbstractBorder -{ - /** - * - */ - private static final long serialVersionUID = -3510090015856709962L; - - /** - * IDE Bean Constructor - */ - public VLine() - { - this(""); - } // VLine - - /** - * Constructor - * @param header - */ - public VLine(String header) - { - super(); - setHeader(header); - } // VLine - - /** Header */ - private String m_header = ""; - - private Font m_font = AdempierePLAF.getFont_Label(); - private Color m_color = AdempierePLAF.getTextColor_Label(); - - /** Gap between element */ - public final static int GAP = 5; - /** space for characters below line (y) */ - public final static int SPACE = 4; // used in VPanel - - /** - * Paint Border - * @param c the component for which this border is being painted - * @param g the paint graphics - * @param x the x position of the painted border - * @param y the y position of the painted border - * @param w the width of the painted border - * @param h the height of the painted border - */ - public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) - { - Graphics copy = g.create(); - if (copy != null) - { - try - { - copy.translate(x, y); - paintLine(c, copy, w, h); - } - finally - { - copy.dispose(); - } - } - } // paintBorder - - /** - * Paint Line with Header - * @param c - * @param g - * @param w - * @param h - */ - private void paintLine (Component c, Graphics g, int w, int h) - { - int y = h-SPACE; - // Line - g.setColor(Color.darkGray); - g.drawLine(GAP, y, w-GAP, y); - g.setColor(Color.white); - g.drawLine(GAP, y+1, w-GAP, y+1); // last part of line - - if (m_header == null || m_header.length() == 0) - return; - - // Header Text - g.setColor(m_color); - g.setFont(m_font); - if (!Language.getLoginLanguage().isLeftToRight()) - { - } - g.drawString(m_header, GAP, h-SPACE-1); - } // paintLine - - /** - * Set Header - * @param newHeader String - '_' are replaced by spaces - */ - public void setHeader(String newHeader) - { - m_header = newHeader.replace('_', ' '); - } // setHeader - - /** - * Get Header - * @return header string - */ - public String getHeader() - { - return m_header; - } // getHeader - -} // VLine diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocation.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocation.java deleted file mode 100644 index 7d085750b9..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocation.java +++ /dev/null @@ -1,433 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.util.logging.Level; - -import javax.swing.JComponent; -import javax.swing.JPopupMenu; -import javax.swing.JTextField; -import javax.swing.LookAndFeel; -import javax.swing.SwingUtilities; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.AEnv; -import org.compiere.apps.FieldRecordInfo; -import org.compiere.model.GridField; -import org.compiere.model.GridTab; -import org.compiere.model.MLocation; -import org.compiere.model.MLocationLookup; -import org.compiere.swing.CButton; -import org.compiere.swing.CMenuItem; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Location Control (Address) - * - * @author Jorg Janke - * @version $Id: VLocation.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VLocation extends JComponent - implements VEditor, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -8952858645752621513L; - - /** - * Mouse Listener for Popup Menu - */ - final class VLocation_mouseAdapter extends java.awt.event.MouseAdapter - { - /** - * Constructor - * @param adaptee adaptee - */ - VLocation_mouseAdapter(VLocation adaptee) - { - this.adaptee = adaptee; - } // VLookup_mouseAdapter - - private VLocation adaptee; - - /** - * Mouse Listener - * @param e MouseEvent - */ - public void mouseClicked(MouseEvent e) - { - // popup menu - if (SwingUtilities.isRightMouseButton(e)) - adaptee.popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - } // mouse Clicked - - } // VLocation_mouseAdapter - - /** - * Constructor - * - * @param columnName column name - * @param mandatory mandatory - * @param isReadOnly read only - * @param isUpdateable updateable - * @param mLocation location model - */ - public VLocation(String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable, - MLocationLookup mLocation) - { - this(null, columnName, mandatory, isReadOnly, isUpdateable, mLocation); - } - - /** - * Constructor - * - * @param gridTab - * @param columnName column name - * @param mandatory mandatory - * @param isReadOnly read only - * @param isUpdateable updateable - * @param mLocation location model - */ - public VLocation(GridTab gridTab, String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable, - MLocationLookup mLocation) - { - super(); - super.setName(columnName); - m_GridTab = gridTab; - m_columnName = columnName; - m_mLocation = mLocation; - // - LookAndFeel.installBorder(this, "TextField.border"); - this.setLayout(new BorderLayout()); - // Size - this.setPreferredSize(m_text.getPreferredSize()); // causes r/o to be the same length - int height = m_text.getPreferredSize().height; - - // Button - m_button.setIcon(Env.getImageIcon("Location10.gif")); - m_button.setMargin(new Insets(0,0,0,0)); - m_button.setPreferredSize(new Dimension(height, height)); - m_button.addActionListener(this); - this.add(m_button, BorderLayout.EAST); - // *** Button & Text *** - m_text.setBorder(null); - m_text.setEditable(false); - m_text.setFocusable(false); - m_text.setFont(AdempierePLAF.getFont_Field()); - m_text.setForeground(AdempierePLAF.getTextColor_Normal()); - m_text.addMouseListener(new VLocation_mouseAdapter(this)); - this.add(m_text, BorderLayout.CENTER); - - // Editable - if (isReadOnly || !isUpdateable) - setReadWrite (false); - else - setReadWrite (true); - setMandatory (mandatory); - // - mDelete = new CMenuItem(Msg.getMsg(Env.getCtx(), "Delete"), Env.getImageIcon ("Delete16.gif")); - mDelete.addActionListener(this); - popupMenu.add(mDelete); - - } // VLocation - - /** - * Dispose - */ - public void dispose() - { - m_text = null; - m_button = null; - m_mLocation = null; - m_GridField = null; - m_GridTab = null; - } // dispose - - /** The Text Field */ - private JTextField m_text = new JTextField(VLookup.DISPLAY_LENGTH); - /** The Button */ - private CButton m_button = new CButton(); - - private MLocationLookup m_mLocation; - private MLocation m_value; - - private String m_columnName; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VLocation.class); - - // Popup - JPopupMenu popupMenu = new JPopupMenu(); - private CMenuItem mDelete; - - /** The Grid Tab * */ - @SuppressWarnings("unused") - private GridTab m_GridTab; // added for processCallout - /** The Grid Field * */ - private GridField m_GridField; // added for processCallout - - /** - * Enable/disable - * @param value true if ReadWrite - */ - public void setReadWrite (boolean value) - { - m_button.setReadWrite (value); - if (m_button.isVisible() != value) - m_button.setVisible (value); - setBackground(false); - } // setReadWrite - - /** - * IsReadWrite - * @return value true if ReadWrite - */ - public boolean isReadWrite() - { - return m_button.isReadWrite(); - } // isReadWrite - - /** - * Set Mandatory (and back color) - * @param mandatory true if mandatory - */ - public void setMandatory (boolean mandatory) - { - m_button.setMandatory(mandatory); - setBackground(false); - } // setMandatory - - /** - * Is it mandatory - * @return true if mandatory - */ - public boolean isMandatory() - { - return m_button.isMandatory(); - } // isMandatory - - /** - * Set Background - * @param color color - */ - public void setBackground (Color color) - { - if (!color.equals(m_text.getBackground())) - m_text.setBackground(color); - } // setBackground - - /** - * Set Background based on editable / mandatory / error - * @param error if true, set background to error color, otherwise mandatory/editable - */ - public void setBackground (boolean error) - { - if (error) - setBackground(AdempierePLAF.getFieldBackground_Error()); - else if (!isReadWrite()) - setBackground(AdempierePLAF.getFieldBackground_Inactive()); - else if (isMandatory()) - setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - else - setBackground(AdempierePLAF.getFieldBackground_Normal()); - } // setBackground - - /** - * Set Foreground - * @param fg color - */ - public void setForeground(Color fg) - { - m_text.setForeground(fg); - } // setForeground - - /** - * Set Editor to value - * @param value value - */ - public void setValue(Object value) - { - if (value == null) - { - m_value = null; - m_text.setText(null); - } - else - { - m_value = m_mLocation.getLocation(value, null); - if (m_value == null) - m_text.setText("<" + value + ">"); - else - m_text.setText(m_value.toString()); - } - } // setValue - - /** - * Request Focus - */ - public void requestFocus () - { - m_text.requestFocus (); - } // requestFocus - - /** - * Request Focus In Window - * @return focus request - */ - @Override - public boolean requestFocusInWindow() - { - return m_text.requestFocusInWindow(); - } // requestFocusInWindow - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return m_text; - } // getFocusComponent - - /** - * Property Change Listener - * @param evt PropertyChangeEvent - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * Return Editor value - * @return value - */ - public Object getValue() - { - if (m_value == null) - return null; - return Integer.valueOf(m_value.getC_Location_ID()); - } // getValue - - /** - * Return Editor value - * @return value - */ - public int getC_Location_ID() - { - if (m_value == null) - return 0; - return m_value.getC_Location_ID(); - } // getC_Location_ID - - /** - * Return Display Value - * @return display value - */ - public String getDisplay() - { - return m_text.getText(); - } // getDisplay - - /** - * ActionListener - Button - Start Dialog - * @param e ActionEvent - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(FieldRecordInfo.CHANGE_LOG_COMMAND)) - { - FieldRecordInfo.start(m_GridField); - return; - } - - if (e.getSource() == mDelete) - m_value = null; // create new - // - if (log.isLoggable(Level.CONFIG)) log.config( "actionPerformed - " + m_value); - VLocationDialog ld = new VLocationDialog(AEnv.getFrame(this), - Msg.getMsg(Env.getCtx(), "Location"), m_value, m_GridField); - ld.setVisible(true); - Object oldValue = getValue(); - m_value = ld.getValue(); - // - if (e.getSource() == mDelete) - ; - else if (!ld.isChanged()) - return; - - // Data Binding - try - { - int C_Location_ID = 0; - if (m_value != null) - C_Location_ID = m_value.getC_Location_ID(); - Integer ii = Integer.valueOf(C_Location_ID); - - if (C_Location_ID != 0) - fireVetoableChange(m_columnName, oldValue, ii); - setValue(ii); - } - catch (PropertyVetoException pve) - { - log.log(Level.SEVERE, "VLocation.actionPerformed", pve); - } - } // actionPerformed - - /** - * Action Listener Interface - * @param listener listener - */ - public void addActionListener(ActionListener listener) - { - m_text.addActionListener(listener); - } // addActionListener - - // Field for Value Preference - private GridField m_mField = null; - /** - * Set Field/WindowNo for ValuePreference (NOP) - * @param mField Model Field - */ - public void setField (org.compiere.model.GridField mField) - { - m_GridField = mField; - if (m_GridField != null) - FieldRecordInfo.addMenu(this, popupMenu); - } // setField - - @Override - public GridField getField() { - return m_mField; - } - -} // VLocation - -/*****************************************************************************/ \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java deleted file mode 100644 index e9ef4a0999..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java +++ /dev/null @@ -1,1010 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Set; -import java.util.StringTokenizer; -import java.util.logging.Level; - -import javax.swing.Box; -import javax.swing.JButton; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.SwingConstants; - -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.model.GridField; -import org.compiere.model.MAddressValidation; -import org.compiere.model.MBPartnerLocation; -import org.compiere.model.MCountry; -import org.compiere.model.MLocation; -import org.compiere.model.MOrgInfo; -import org.compiere.model.MRegion; -import org.compiere.model.MSysConfig; -import org.compiere.swing.CButton; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CComboBoxEditable; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextArea; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Trx; - -import com.akunagroup.uk.postcode.AddressLookupInterface; -import com.akunagroup.uk.postcode.Postcode; - -/** - * Dialog to enter Location Info (Address) - * - * @author Jorg Janke - * @version $Id: VLocationDialog.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *

  • BF [ 1831060 ] Location dialog should use Address1, Address2 ... elements - * @author Michael Judd, Akuna Ltd (UK) - *
  • FR [ 1741222 ] - Webservice connector for address lookups - * @author Cristina Ghita, www.arhipac.ro - *
  • FR [ 2794312 ] Location AutoComplete - * - * http://jira.idempiere.com/browse/IDEMPIERE-147 - Show GoogleMap on Location Dialog - * @author Fernando Lucktemberg (Faire, www.faire.com.br) - *
  • seeded the Map button - * @author Mario Grigioni (Kenos, www.kenos.com.br) - *
  • expanded to add Route button - * @author Alvaro Montenegro (Kenos, www.kenos.com.br) - *
  • BF: Check URL before open the Browser - */ -public class VLocationDialog extends CDialog - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -8325818864115049548L; - - /** Lookup result header */ - private Object[] header = null; - - private int m_WindowNo = 0; - - private GridField m_GridField = null; - - /** - * Constructor - * - * @param frame parent - * @param title title (field name) - * @param location Model Location - */ - public VLocationDialog (Frame frame, String title, MLocation location) - { - this(frame, title, location, null); - } // VLocationDialog - - public VLocationDialog(Frame frame, String title, MLocation location, GridField gridField) { - super(frame, title, true); - m_GridField = gridField; - //m_WindowNo = WindowNo; - try - { - jbInit(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, ex.getMessage()); - } - m_location = location; - if (m_location == null) - m_location = new MLocation (Env.getCtx(), 0, null); - // Overwrite title - if (m_location.getC_Location_ID() == 0) - setTitle(Msg.getMsg(Env.getCtx(), "LocationNew")); - else - setTitle(Msg.getMsg(Env.getCtx(), "LocationUpdate")); - - // Reset TAB_INFO context - Env.setContext(Env.getCtx(), m_WindowNo, Env.TAB_INFO, "C_Region_ID", null); - Env.setContext(Env.getCtx(), m_WindowNo, Env.TAB_INFO, "C_Country_ID", null); - - // Current Country - fCountry = new CComboBoxEditable(MCountry.getCountries(Env.getCtx())); - fCountry.setSelectedItem(m_location.getCountry()); - m_origCountry_ID = m_location.getC_Country_ID(); - // Current Region - fRegion = new CComboBoxEditable(MRegion.getRegions(Env.getCtx(), m_origCountry_ID)); - if (m_location.getCountry().isHasRegion()) { - if ( m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName) != null - && m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName).trim().length() > 0) - lRegion.setText(m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName)); - else - lRegion.setText(Msg.getMsg(Env.getCtx(), "Region")); - } - fRegion.setSelectedItem(m_location.getRegion()); - // - fOnline.setText(Msg.getMsg(Env.getCtx(), "Online")); - initLocation(); - fCountry.addActionListener(this); - fOnline.addActionListener(this); - fRegion.addActionListener(this); - AEnv.positionCenterWindow(frame, this); - } - - private boolean m_change = false; - private MLocation m_location; - private int m_origCountry_ID; - private int s_oldCountry_ID = 0; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VLocationDialog.class); - - private CPanel panel = new CPanel(); - private CPanel mainPanel = new CPanel(); - private CPanel southPanel = new CPanel(); - private BorderLayout panelLayout = new BorderLayout(); - private GridBagLayout gridBagLayout = new GridBagLayout(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - private BorderLayout southLayout = new BorderLayout(); - // - private CLabel lAddress1 = new CLabel(Msg.getElement(Env.getCtx(), "Address1")); - private CLabel lAddress2 = new CLabel(Msg.getElement(Env.getCtx(), "Address2")); - private CLabel lAddress3 = new CLabel(Msg.getElement(Env.getCtx(), "Address3")); - private CLabel lAddress4 = new CLabel(Msg.getElement(Env.getCtx(), "Address4")); - private CLabel lAddress5 = new CLabel(Msg.getElement(Env.getCtx(), "Address5")); - private CLabel lComments = new CLabel(Msg.getElement(Env.getCtx(), "Comments")); - private CLabel lCity = new CLabel(Msg.getMsg(Env.getCtx(), "City")); - private CLabel lCountry = new CLabel(Msg.getMsg(Env.getCtx(), "Country")); - private CLabel lRegion = new CLabel(Msg.getMsg(Env.getCtx(), "Region")); - private CLabel lPostal = new CLabel(Msg.getMsg(Env.getCtx(), "Postal")); - private CLabel lPostalAdd = new CLabel(Msg.getMsg(Env.getCtx(), "PostalAdd")); - private CLabel lOnline = new CLabel(""); - private CTextField fAddress1 = new CTextField(20); // length=60 - private CTextField fAddress2 = new CTextField(20); // length=60 - private CTextField fAddress3 = new CTextField(20); // length=60 - private CTextField fAddress4 = new CTextField(20); // length=60 - private CTextField fAddress5 = new CTextField(20); // length=60 - private CTextField fComments = new CTextField(20); // length=2000 - private CTextField fCity = new CTextField(20); // length=60 - private CityAutoCompleter fCityAutoCompleter; - private CComboBoxEditable fCountry; - private CComboBoxEditable fRegion; - private CTextField fPostal = new CTextField(5); // length=10 - private CTextField fPostalAdd = new CTextField(5); // length=10 - private CButton fOnline = new CButton(); - // - private GridBagConstraints gbc = new GridBagConstraints(); - private Insets labelInsets = new Insets(2,15,2,0); // top,left,bottom,right - private Insets fieldInsets = new Insets(2,5,2,10); - - private boolean isCityMandatory = false; - private boolean isRegionMandatory = false; - private boolean isAddress1Mandatory = false; - private boolean isAddress2Mandatory = false; - private boolean isAddress3Mandatory = false; - private boolean isAddress4Mandatory = false; - private boolean isAddress5Mandatory = false; - private boolean isCommentsMandatory = false; - private boolean isPostalMandatory = false; - private boolean isPostalAddMandatory = false; - - private boolean inCountryAction; - private boolean inOKAction; - - private JButton toLink = new JButton(); - private JButton toRoute = new JButton(); - - private CComboBoxEditable lstAddressValidation = new CComboBoxEditable(); - private CButton btnOnline = new CButton(); - private CTextArea txtResult = new CTextArea(3, 30); - private CCheckBox cbxValid = new CCheckBox(); - private ArrayList enabledCountryList = new ArrayList(); - //END - - /** - * Static component init - * @throws Exception - */ - void jbInit() throws Exception - { - panel.setLayout(panelLayout); - southPanel.setLayout(southLayout); - mainPanel.setLayout(gridBagLayout); - panelLayout.setHgap(5); - panelLayout.setVgap(10); - getContentPane().add(panel); - panel.add(mainPanel, BorderLayout.CENTER); - panel.add(southPanel, BorderLayout.SOUTH); - southPanel.add(confirmPanel, BorderLayout.NORTH); - - //BEGIN fernandinho/ricardo - toLink.setText(Msg.getMsg(Env.getCtx(), "Map")); - toLink.addActionListener(this); - toLink.setMargin(ConfirmPanel.s_insets); - confirmPanel.addComponent(toLink); - if (MLocation.LOCATION_MAPS_URL_PREFIX == null) - toLink.setVisible(false); - - toRoute.setText(Msg.getMsg(Env.getCtx(), "Route")); - toRoute.addActionListener(this); - toRoute.setMargin(ConfirmPanel.s_insets); - confirmPanel.addComponent(toRoute); - if (MLocation.LOCATION_MAPS_ROUTE_PREFIX == null) - toRoute.setVisible(false); - //END - - btnOnline.setText(Msg.getElement(Env.getCtx(), "ValidateAddress")); - btnOnline.addActionListener(this); - - txtResult.setReadWrite(false); - cbxValid.setReadWrite(false); - - // - confirmPanel.addActionListener(this); - // - fCityAutoCompleter = new CityAutoCompleter(fCity, m_WindowNo); - } // jbInit - - /** - * Dynamic Init & fill fields - Called when Country changes! - */ - private void initLocation() - { - MCountry country = m_location.getCountry(); - if (log.isLoggable(Level.FINE)) log.fine(country.getName() + ", Region=" + country.isHasRegion() + " " + country.getCaptureSequence() - + ", C_Location_ID=" + m_location.getC_Location_ID()); - // new Country - if (country.getC_Country_ID() != s_oldCountry_ID) - { - fRegion.removeAllItems(); - if (country.isHasRegion()) { - for (MRegion region : MRegion.getRegions(Env.getCtx(), country.getC_Country_ID())) { - fRegion.addItem(region); - } - if ( m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName) != null - && m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName).trim().length() > 0) - lRegion.setText(m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName)); - else - lRegion.setText(Msg.getMsg(Env.getCtx(), "Region")); - } - s_oldCountry_ID = m_location.getC_Country_ID(); - } - - if (m_location.getC_Region_ID() > 0 && m_location.getC_Region().getC_Country_ID() == country.getC_Country_ID()) { - fRegion.setSelectedItem(m_location.getC_Region()); - } else { - fRegion.setSelectedItem(null); - m_location.setC_Region_ID(0); - } - - if (country.isHasRegion() && m_location.getC_Region_ID() > 0) - { - Env.setContext(Env.getCtx(), m_WindowNo, Env.TAB_INFO, "C_Region_ID", String.valueOf(m_location.getC_Region_ID())); - } else { - Env.setContext(Env.getCtx(), m_WindowNo, Env.TAB_INFO, "C_Region_ID", "0"); - } - Env.setContext(Env.getCtx(), m_WindowNo, Env.TAB_INFO, "C_Country_ID", String.valueOf(country.get_ID())); - - fCityAutoCompleter.fillList(); - - gbc.anchor = GridBagConstraints.NORTHWEST; - gbc.gridy = 0; // line - gbc.gridx = 0; - gbc.gridwidth = 1; - gbc.insets = fieldInsets; - gbc.fill = GridBagConstraints.HORIZONTAL; - gbc.weightx = 0; - gbc.weighty = 0; - - mainPanel.removeAll(); - - mainPanel.add(Box.createVerticalStrut(5), gbc); // top gap - - int line = 1; - // sequence of City Postal Region - @P@ @C@ - @C@, @R@ @P@ - String ds = country.getCaptureSequence(); - if (ds == null || ds.length() == 0) - { - log.log(Level.SEVERE, "CaptureSequence empty - " + country); - ds = ""; // @C@, @P@ - } - isCityMandatory = false; - isRegionMandatory = false; - isAddress1Mandatory = false; - isAddress2Mandatory = false; - isAddress3Mandatory = false; - isAddress4Mandatory = false; - isAddress5Mandatory = false; - isCommentsMandatory = false; - isPostalMandatory = false; - isPostalAddMandatory = false; - StringTokenizer st = new StringTokenizer(ds, "@", false); - while (st.hasMoreTokens()) - { - String s = st.nextToken(); - if (s.startsWith("CO")) { - // Country Last - addLine(line++, lCountry, fCountry); - // disable online if this country doesn't have post code lookup - if (m_location.getCountry().isPostcodeLookup()) { - addLine(line++, lOnline, fOnline); - } - } else if (s.startsWith("Com")) { - addLine(line++, lComments, fComments); - isCommentsMandatory = s.endsWith("!"); - } else if (s.startsWith("A1")) { - addLine(line++, lAddress1, fAddress1); - isAddress1Mandatory = s.endsWith("!"); - } else if (s.startsWith("A2")) { - addLine(line++, lAddress2, fAddress2); - isAddress2Mandatory = s.endsWith("!"); - } else if (s.startsWith("A3")) { - addLine(line++, lAddress3, fAddress3); - isAddress3Mandatory = s.endsWith("!"); - } else if (s.startsWith("A4")) { - addLine(line++, lAddress4, fAddress4); - isAddress4Mandatory = s.endsWith("!"); - } else if (s.startsWith("A5")) { - addLine(line++, lAddress5, fAddress5); - isAddress5Mandatory = s.endsWith("!"); - } else if (s.startsWith("C")) { - addLine(line++, lCity, fCity); - isCityMandatory = s.endsWith("!"); - } else if (s.startsWith("P")) { - addLine(line++, lPostal, fPostal); - isPostalMandatory = s.endsWith("!"); - } else if (s.startsWith("A")) { - addLine(line++, lPostalAdd, fPostalAdd); - isPostalAddMandatory = s.endsWith("!"); - } else if (s.startsWith("R") && m_location.getCountry().isHasRegion()) { - addLine(line++, lRegion, fRegion); - isRegionMandatory = s.endsWith("!"); - } - } - - // Fill it - if (m_location.getC_Location_ID() != 0) - { - fAddress1.setText(m_location.getAddress1()); - fAddress2.setText(m_location.getAddress2()); - fAddress3.setText(m_location.getAddress3()); - fAddress4.setText(m_location.getAddress4()); - fAddress5.setText(m_location.getAddress5()); - fComments.setText(m_location.getComments()); - fCity.setText(m_location.getCity()); - fPostal.setText(m_location.getPostal()); - fPostalAdd.setText(m_location.getPostal_Add()); - if (m_location.getCountry().isHasRegion()) - { - if ( m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName) != null - && m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName).trim().length() > 0) - lRegion.setText(m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName)); - else - lRegion.setText(Msg.getMsg(Env.getCtx(), "Region")); - fRegion.setSelectedItem(m_location.getRegion()); - } - - if (!fCountry.getSelectedItem().equals(country)) - fCountry.setSelectedItem(country); - } - - String addressValidation = MSysConfig.getValue(MSysConfig.ADDRESS_VALIDATION, null, Env.getAD_Client_ID(Env.getCtx())); - enabledCountryList.clear(); - if (addressValidation != null && addressValidation.trim().length() > 0) - { - st = new StringTokenizer(addressValidation, ";"); - while (st.hasMoreTokens()) - { - String token = st.nextToken().trim(); - enabledCountryList.add(token); - } - } - - if (enabledCountryList.size() > 0) - { - addLine(line++, new CLabel(Msg.getElement(Env.getCtx(), "C_AddressValidation_ID")), lstAddressValidation); - - MAddressValidation[] validations = MAddressValidation.getAddressValidation(Env.getCtx(), Env.getAD_Client_ID(Env.getCtx()), null); - for (MAddressValidation validation : validations) - { - lstAddressValidation.addItem(validation); - if (m_location.getC_AddressValidation_ID() == validation.getC_AddressValidation_ID()) - lstAddressValidation.setSelectedItem(validation); - } - - if (lstAddressValidation.getSelectedIndex() == -1 && lstAddressValidation.getItemCount() > 0) - lstAddressValidation.setSelectedIndex(0); - - addLine(line++, new CLabel(Msg.getElement(Env.getCtx(), "Result")), txtResult); - txtResult.setText(m_location.getResult()); - - addLine(line++, new CLabel(Msg.getElement(Env.getCtx(), "IsValid")), cbxValid); - cbxValid.setSelected(m_location.isValid()); - - addLine(line++, new JLabel(), btnOnline); - - if (!enabledCountryList.isEmpty()) - { - boolean isEnabled = false; - if (m_location.getCountry() != null) - { - for (String enabledCountry : enabledCountryList) - { - if (enabledCountry.equals(m_location.getCountry().getCountryCode().trim())) - { - isEnabled = true; - break; - } - } - } - btnOnline.setEnabled(isEnabled); - } - } - - // Update UI - pack(); - } // initLocation - - /** - * Add Line to screen - * - * @param line line number (zero based) - * @param label label - * @param field field - */ - private void addLine(int line, JLabel label, JComponent field) - { - gbc.gridy = line; - // label - gbc.insets = labelInsets; - gbc.gridx = 0; - gbc.weightx = 0.0; - gbc.fill = GridBagConstraints.HORIZONTAL; - label.setHorizontalAlignment(SwingConstants.RIGHT); - mainPanel.add(label, gbc); - // Field - gbc.insets = fieldInsets; - gbc.gridx = 1; - gbc.weightx = 1.0; - gbc.fill = GridBagConstraints.NONE; - gbc.insets = fieldInsets; - mainPanel.add(field, gbc); - - } // addLine - - @Override - public void dispose() - { - if (!m_change && m_location != null && !m_location.is_new()) - { - m_location = new MLocation(m_location.getCtx(), m_location.get_ID(), null); - } - super.dispose(); - } - - /** - * ActionListener - * @param e ActionEvent - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - inOKAction = true; - - if (m_location.getCountry().isHasRegion() && fRegion.getSelectedItem() == null) { - if (fCityAutoCompleter.getC_Region_ID() > 0 && fCityAutoCompleter.getC_Region_ID() != m_location.getC_Region_ID()) { - fRegion.setSelectedItem(MRegion.get(Env.getCtx(), fCityAutoCompleter.getC_Region_ID())); - m_location.setRegion(MRegion.get(Env.getCtx(), fCityAutoCompleter.getC_Region_ID())); - } - } - - String msg = validate_OK(); - if (msg != null) { - ADialog.error(0, this, "FillMandatory", Msg.parseTranslation(Env.getCtx(), msg)); - inOKAction = false; - return; - } - - if (action_OK()) - { - m_change = true; - dispose(); - } - else - { - ADialog.error(m_WindowNo, this, "CityNotFound"); - } - inOKAction = false; - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - m_change = false; - dispose(); - } - - // Country Changed - display in new Format - else if (e.getSource() == fCountry) - { - inCountryAction = true; - // Modifier for Mouse selection is 16 - for any key selection 0 - MCountry c = (MCountry)fCountry.getSelectedItem(); - m_location.setCountry(c); - - initLocation(); - - if (!enabledCountryList.isEmpty()) - { - boolean isEnabled = false; - if (c != null) - { - for (String enabledCountry : enabledCountryList) - { - if (enabledCountry.equals(c.getCountryCode().trim())) - { - isEnabled = true; - break; - } - } - } - btnOnline.setEnabled(isEnabled); - } - - fCountry.requestFocus(); // allows to use Keyboard selection - inCountryAction = false; - } - // Region Changed - else if (e.getSource() == fRegion) - { - if (inCountryAction || inOKAction) - return; - MRegion r = (MRegion)fRegion.getSelectedItem(); - m_location.setRegion(r); - m_location.setC_City_ID(0); - m_location.setCity(null); - - initLocation(); - fRegion.requestFocus(); // allows to use Keyboard selection - } - //BEGIN fernandinho/ricardo - else if (e.getSource() == toLink) - { - String urlString = MLocation.LOCATION_MAPS_URL_PREFIX + getFullAdress(); - String message = null; - - try - { - Env.startBrowser(urlString); - } - catch (Exception ex) - { - message = ex.getMessage(); - ADialog.warn(0, this, "URLnotValid", message); - } - } - else if (e.getSource() == toRoute) - { - int AD_Org_ID = Env.getAD_Org_ID(Env.getCtx()); - if (AD_Org_ID != 0){ - MOrgInfo orgInfo = MOrgInfo.get(Env.getCtx(), AD_Org_ID,null); - MLocation orgLocation = new MLocation(Env.getCtx(),orgInfo.getC_Location_ID(),null); - - String urlString = MLocation.LOCATION_MAPS_ROUTE_PREFIX + - MLocation.LOCATION_MAPS_SOURCE_ADDRESS + orgLocation.getMapsLocation() + //org - MLocation.LOCATION_MAPS_DESTINATION_ADDRESS + getFullAdress(); //partner - String message = null; - try - { - Env.startBrowser(urlString); - } - catch (Exception ex) - { - message = ex.getMessage(); - ADialog.warn(0, this, "URLnotValid", message); - } - } - } - //END - else if (e.getSource() == btnOnline) - { - btnOnline.setEnabled(false); - - inOKAction = true; - - if (m_location.getCountry().isHasRegion() && fRegion.getSelectedItem() == null) { - if (fCityAutoCompleter.getC_Region_ID() > 0 && fCityAutoCompleter.getC_Region_ID() != m_location.getC_Region_ID()) { - fRegion.setSelectedItem(MRegion.get(Env.getCtx(), fCityAutoCompleter.getC_Region_ID())); - m_location.setRegion(MRegion.get(Env.getCtx(), fCityAutoCompleter.getC_Region_ID())); - } - } - - String msg = validate_OK(); - if (msg != null) { - ADialog.error(0, this, "FillMandatory", Msg.parseTranslation(Env.getCtx(), msg)); - inOKAction = false; - return; - } - - MLocation m_location = new MLocation(Env.getCtx(), 0, null); - m_location.setAddress1(fAddress1.getText()); - m_location.setAddress2(fAddress2.getText()); - m_location.setAddress3(fAddress3.getText()); - m_location.setAddress4(fAddress4.getText()); - m_location.setAddress5(fAddress5.getText()); - m_location.setComments(fComments.getText()); - m_location.setCity(fCity.getText()); - m_location.setC_City_ID(fCityAutoCompleter.getC_City_ID()); - m_location.setPostal(fPostal.getText()); - m_location.setPostal_Add(fPostalAdd.getText()); - // Country/Region - MCountry c = (MCountry)fCountry.getSelectedItem(); - m_location.setCountry(c); - if (m_location.getCountry().isHasRegion()) - { - MRegion r = (MRegion)fRegion.getSelectedItem(); - m_location.setRegion(r); - } - else - m_location.setC_Region_ID(0); - - MAddressValidation validation = (MAddressValidation) lstAddressValidation.getSelectedItem(); - if (validation == null && lstAddressValidation.getItemCount() > 0) - validation = (MAddressValidation) lstAddressValidation.getItemAt(0); - if (validation != null) - { - boolean ok = m_location.processOnline(validation.getC_AddressValidation_ID()); - - txtResult.setText(m_location.getResult()); - cbxValid.setSelected(m_location.isValid()); - lstAddressValidation.setSelectedItem(m_location.getC_AddressValidation()); - - if (!ok) - ADialog.error(0, this, "Error", m_location.getErrorMessage()); - } - - inOKAction = false; - - btnOnline.setEnabled(true); - } - else if (e.getSource() == fOnline) - { - - // check to see if we have a postcode lookup plugin for this country - MCountry c = (MCountry)fCountry.getSelectedItem(); - if (c.isPostcodeLookup()) - { - lookupPostcode(c, fPostal.getText()); - } - } - } // actionPerformed - - // LCO - address 1, region and city required - private String validate_OK() { - String fields = ""; - if (isAddress1Mandatory && fAddress1.getText().trim().length() == 0) { - fields = fields + " " + "@Address1@, "; - } - if (isAddress2Mandatory && fAddress2.getText().trim().length() == 0) { - fields = fields + " " + "@Address2@, "; - } - if (isAddress3Mandatory && fAddress3.getText().trim().length() == 0) { - fields = fields + " " + "@Address3@, "; - } - if (isAddress4Mandatory && fAddress4.getText().trim().length() == 0) { - fields = fields + " " + "@Address4@, "; - } - if (isAddress5Mandatory && fAddress5.getText().trim().length() == 0) { - fields = fields + " " + "@Address5@, "; - } - if (isCommentsMandatory && fComments.getText().trim().length() == 0) { - fields = fields + " " + "@Comments@, "; - } - if (isCityMandatory && fCity.getText().trim().length() == 0) { - fields = fields + " " + "@C_City_ID@, "; - } - if (isRegionMandatory && fRegion.getSelectedItem() == null) { - fields = fields + " " + "@C_Region_ID@, "; - } - if (isPostalMandatory && fPostal.getText().trim().length() == 0) { - fields = fields + " " + "@Postal@, "; - } - if (isPostalAddMandatory && fPostalAdd.getText().trim().length() == 0) { - fields = fields + " " + "@PostalAdd@, "; - } - - if (fields.trim().length() > 0) - return fields.substring(0, fields.length() -2); - - return null; - } - - /** - * OK - check for changes (save them) & Exit - */ - private boolean action_OK() - { - Trx trx = Trx.get(Trx.createTrxName("VLocationDialog"), true); - m_location.set_TrxName(trx.getTrxName()); - m_location.setAddress1(fAddress1.getText()); - m_location.setAddress2(fAddress2.getText()); - m_location.setAddress3(fAddress3.getText()); - m_location.setAddress4(fAddress4.getText()); - m_location.setAddress5(fAddress5.getText()); - m_location.setComments(fComments.getText()); - m_location.setCity(fCity.getText()); - m_location.setC_City_ID(fCityAutoCompleter.getC_City_ID()); - m_location.setPostal(fPostal.getText()); - m_location.setPostal_Add(fPostalAdd.getText()); - // Country/Region - MCountry c = (MCountry)fCountry.getSelectedItem(); - m_location.setCountry(c); - if (m_location.getCountry().isHasRegion()) - { - MRegion r = (MRegion)fRegion.getSelectedItem(); - m_location.setRegion(r); - } - else - m_location.setC_Region_ID(0); - - if (lstAddressValidation.getSelectedIndex() != -1) - { - MAddressValidation validation = (MAddressValidation) lstAddressValidation.getSelectedItem(); - m_location.setC_AddressValidation_ID(validation.getC_AddressValidation_ID()); - } - - // Save changes - boolean success = false; - if (m_location.save()) - { - // IDEMPIERE-417 Force Update BPLocation.Name - if (m_GridField != null && m_GridField.getGridTab() != null - && "C_BPartner_Location".equals(m_GridField.getGridTab().getTableName()) - && !m_GridField.getGridTab().getValueAsBoolean("IsPreserveCustomName")) - { - m_GridField.getGridTab().setValue("Name", "."); - success = true; - } else { - //Update BP_Location name IDEMPIERE 417 - int bplID = DB.getSQLValueEx(trx.getTrxName(), MLocation.updateBPLocName, m_location.getC_Location_ID()); - if (bplID>0) - { - MBPartnerLocation bpl = new MBPartnerLocation(Env.getCtx(), bplID, trx.getTrxName()); - bpl.setName(bpl.getBPLocName(m_location)); - if (bpl.save()) - success = true; - } else { - success = true; - } - } - } - if (success) { - trx.commit(); - } else { - trx.rollback(); - } - trx.close(); - - return success; - } // actionOK - - /** - * Get result - * @return true, if changed - */ - public boolean isChanged() - { - return m_change; - } // getChange - - /** - * Get edited Value (MLocation) - * @return location - */ - public MLocation getValue() - { - return m_location; - } // getValue - /** - * lookupPostcode - * - * - * @param country - * @param postcode - * @return - */ - private String lookupPostcode(MCountry country, String postcode) - { - // Initialize the lookup class. - AddressLookupInterface pcLookup = null; - try { - AddressLookupInterface pcLookupTmp = (AddressLookupInterface) Class - .forName(country.getLookupClassName()).newInstance(); - pcLookup = pcLookupTmp.newInstance(); - } catch (Exception e) { - e.printStackTrace(); - return "lookupAddress(): " + e.getMessage(); - } - - // remove any spaces from the postcode and convert to upper case - postcode = postcode.replaceAll(" ", "").toUpperCase(); - if (log.isLoggable(Level.FINE)) log.fine("Looking up postcode: " + postcode); - - // Lookup postcode on server. - pcLookup.setServerUrl(country.getLookupUrl()); - pcLookup.setClientID(country.getLookupClientID()); - pcLookup.setPassword(country.getLookupPassword()); - if (pcLookup.lookupPostcode(postcode)==1){ - // Success - fillLocation(pcLookup.getAddressData(), country); - fAddress1.requestFocusInWindow(); - } else - return "Postcode Lookup Error"; - - return ""; - } - - /** - * Fills the location field using the information retrieved from postcode - * servers. - * - * @param ctx - * Context - * @param pkeyData - * Lookup results - * @param windowNo - * Window No. - * @param tab - * Tab - * @param field - * Field - */ - private void fillLocation(HashMap postcodeData, MCountry country) { - - // If it's not empty warn the user. - if (fAddress1 != null - || fAddress2 != null - || fAddress3 != null - || fAddress4 != null - || fAddress5 != null - || fComments != null - || fCity != null) { - String warningMsg = "Existing address information will be overwritten. Proceed?"; - String warningTitle = "Warning"; - int response = JOptionPane.showConfirmDialog(null, warningMsg, - warningTitle, JOptionPane.YES_NO_OPTION); - if (response == JOptionPane.NO_OPTION) - return; - } - - - Set pcodeKeys = postcodeData.keySet(); - Iterator iterator = pcodeKeys.iterator(); - header = null; - - // Allocate the header array - header = new Object[pcodeKeys.size()]; - - String headerStr = null; - - // need to check how many records returned - // TODO - check number of records returns - size() method is incorrect - if (pcodeKeys.size() > 2) - { - // TODO: Implement ResultData Grid and get return (for premises level data) - System.out.println("Too many postcodes returned from Postcode Lookup - need to Implement ResultData"); - } else - { - for (int i = 0; (headerStr = (iterator.hasNext() ? iterator.next() : null)) != null - || iterator.hasNext(); i++) { - header[i] = headerStr; - Postcode values = (Postcode) postcodeData.get(headerStr); - - // Overwrite the values in location field. - fAddress1.setText(values.getStreet1()); - fAddress2.setText(values.getStreet2()); - fAddress3.setText(values.getStreet3()); - fAddress4.setText(values.getStreet4()); - fAddress5.setText(values.getStreet5()); - fComments.setText(values.getComments()); - fCity.setText(values.getCity()); - fPostal.setText(values.getPostcode()); - - // Do region lookup - if (country.isHasRegion()) - { - // get all regions for this country - MRegion[] regions = MRegion.getRegions(country.getCtx(), country.getC_Country_ID()); - - // If regions were loaded - if ( regions.length > 0) - { - // loop through regions array to attempt a region match - don't finish loop if region found - boolean found = false; - for (i = 0; i < regions.length && !found; i++) - { - - if (regions[i].getName().equals(values.getRegion()) ) - { - // found Region - fRegion.setSelectedItem(regions[i]); - if (log.isLoggable(Level.FINE)) log.fine("Found region: " + regions[i].getName()); - found = true; - } - } - if (!found) - { - // add new region - MRegion region = new MRegion(country, values.getRegion()); - if (region.save()) - { - if (log.isLoggable(Level.FINE)) log.fine("Added new region from web service: " + values.getRegion()); - //reload regions to combo box - fRegion = new CComboBoxEditable(MRegion.getRegions(Env.getCtx(), country.getC_Country_ID())); - // select region - fRegion.setSelectedItem(values); - } else - log.severe("Error saving new region: " + region.getName()); - - } - } else - log.severe("Region lookup failed for Country: " + country.getName()); - - } - } - } - - } - - /** returns a string that contains all fields of current form */ - String getFullAdress() - { - MRegion region = null; - - if (fRegion.getSelectedItem()!=null) - region = new MRegion(Env.getCtx(), ((MRegion)fRegion.getSelectedItem()).getC_Region_ID(), null); - - MCountry c = (MCountry)fCountry.getSelectedItem(); - - String address = ""; - address = address + (fAddress1.getText() != null ? fAddress1.getText() + ", " : ""); - address = address + (fAddress2.getText() != null ? fAddress2.getText() + ", " : ""); - address = address + (fAddress3.getText() != null ? fAddress3.getText() + ", " : ""); - address = address + (fAddress4.getText() != null ? fAddress4.getText() + ", " : ""); - address = address + (fCity.getText() != null ? fCity.getText() + ", " : ""); - if (region != null) - address = address + (region.getName() != null ? region.getName() + ", " : ""); - - address = address + (c.getName() != null ? c.getName() : ""); - return address.replace(" ", "+"); - } - -} // VLocationDialog diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocator.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocator.java deleted file mode 100644 index 06e3870a31..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocator.java +++ /dev/null @@ -1,644 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.logging.Level; - -import javax.swing.ImageIcon; -import javax.swing.JComponent; -import javax.swing.JPopupMenu; -import javax.swing.JTextField; -import javax.swing.LookAndFeel; -import javax.swing.SwingUtilities; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.AEnv; -import org.compiere.apps.AWindow; -import org.compiere.apps.FieldRecordInfo; -import org.compiere.model.GridField; -import org.compiere.model.MLocator; -import org.compiere.model.MLocatorLookup; -import org.compiere.model.MQuery; -import org.compiere.model.MRole; -import org.compiere.model.MTable; -import org.compiere.model.MWarehouse; -import static org.compiere.model.SystemIDs.*; -import org.compiere.swing.CButton; -import org.compiere.swing.CMenuItem; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Warehouse Locator Control - * - * @author Jorg Janke - * @version $Id: VLocator.java,v 1.5 2006/07/30 00:51:27 jjanke Exp $ - */ -public class VLocator extends JComponent - implements VEditor, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -8164788185893073951L; - - /** - * Mouse Listener for Popup Menu - */ - final class VLocator_mouseAdapter extends java.awt.event.MouseAdapter - { - /** - * Constructor - * @param adaptee VLocator - */ - VLocator_mouseAdapter(VLocator adaptee) - { - m_adaptee = adaptee; - } // VLookup_mouseAdapter - - /** Adaptee */ - private VLocator m_adaptee; - - /** - * Mouse Listener - * @param e MouseEvent - */ - public void mouseClicked(MouseEvent e) - { - // popup menu - if (SwingUtilities.isRightMouseButton(e)) - m_adaptee.popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - } // mouse Clicked - - } // VLocator_mouseAdapter - - /** - * IDE Constructor - */ - public VLocator () - { - this("M_Locator_ID", false, false, true, null, 0); - } // VLocator - - /** - * Constructor - * - * @param columnName ColumnName - * @param mandatory mandatory - * @param isReadOnly read only - * @param isUpdateable updateable - * @param mLocator locator (lookup) model - * @param WindowNo window no - */ - public VLocator(String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable, - MLocatorLookup mLocator, int WindowNo) - { - super(); - super.setName(columnName); - m_columnName = columnName; - m_mLocator = mLocator; - m_WindowNo = WindowNo; - // - LookAndFeel.installBorder(this, "TextField.border"); - this.setLayout(new BorderLayout()); - // Size - this.setPreferredSize(m_text.getPreferredSize()); // causes r/o to be the same length - int height = m_text.getPreferredSize().height; - - // *** Button & Text *** - m_text.setBorder(null); - m_text.setEditable(true); - m_text.setFocusable(true); - m_text.addMouseListener(new VLocator_mouseAdapter(this)); // popup - m_text.setFont(AdempierePLAF.getFont_Field()); - m_text.setForeground(AdempierePLAF.getTextColor_Normal()); - m_text.addActionListener(this); - this.add(m_text, BorderLayout.CENTER); - - m_button.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/Locator10.gif"))); - m_button.setMargin(new Insets(0, 0, 0, 0)); - m_button.setPreferredSize(new Dimension(height, height)); - m_button.addActionListener(this); - this.add(m_button, BorderLayout.EAST); - - // Prefereed Size - this.setPreferredSize(this.getPreferredSize()); // causes r/o to be the same length - - // ReadWrite - if (isReadOnly || !isUpdateable) - setReadWrite (false); - else - setReadWrite (true); - setMandatory (mandatory); - // - mZoom = new CMenuItem(Msg.getMsg(Env.getCtx(), "Zoom"), Env.getImageIcon("Zoom16.gif")); - mZoom.addActionListener(this); - popupMenu.add(mZoom); - mRefresh = new CMenuItem(Msg.getMsg(Env.getCtx(), "Refresh"), Env.getImageIcon("Refresh16.gif")); - mRefresh.addActionListener(this); - popupMenu.add(mRefresh); - setDefault_Locator_ID(); // set default locator, teo_sarca [ 1661546 ] - } // VLocator - - /** - * Dispose - */ - public void dispose() - { - m_text = null; - m_button = null; - m_mLocator = null; - } // dispose - - private JTextField m_text = new JTextField (VLookup.DISPLAY_LENGTH); - private CButton m_button = new CButton(); - private MLocatorLookup m_mLocator; - private Object m_value; - // - private String m_columnName; - private int m_WindowNo; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VLocator.class); - // Popup - JPopupMenu popupMenu = new JPopupMenu(); - private CMenuItem mZoom; - private CMenuItem mRefresh; - private GridField m_mField; - - /** - * Enable/disable - * @param value r/w - */ - public void setReadWrite (boolean value) - { - m_button.setReadWrite(value); - if (m_button.isVisible() != value) - m_button.setVisible(value); - setBackground(false); - } // setReadWrite - - /** - * IsReadWrite - * @return true if ReadWrite - */ - public boolean isReadWrite() - { - return m_button.isReadWrite(); - } // isReadWrite - - /** - * Set Mandatory (and back bolor) - * @param mandatory true if mandatory - */ - public void setMandatory (boolean mandatory) - { - m_button.setMandatory(mandatory); - setBackground(false); - } // setMandatory - - /** - * Is it mandatory - * @return true if mandatory - */ - public boolean isMandatory() - { - return m_button.isMandatory(); - } // isMandatory - - /** - * Set Background - * @param color color - */ - public void setBackground (Color color) - { - if (!color.equals(m_text.getBackground())) - m_text.setBackground(color); - } // setBackground - - /** - * Set Background based on editable / mandatory / error - * @param error if true, set background to error color, otherwise mandatory/editable - */ - public void setBackground (boolean error) - { - if (error) - setBackground(AdempierePLAF.getFieldBackground_Error()); - else if (!isReadWrite()) - setBackground(AdempierePLAF.getFieldBackground_Inactive()); - else if (isMandatory()) - setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - else - setBackground(AdempierePLAF.getFieldBackground_Normal()); - } // setBackground - - /** - * Set Foreground - * @param fg color - */ - public void setForeground(Color fg) - { - m_text.setForeground(fg); - } // setForeground - - /** - * Request Focus - */ - public void requestFocus () - { - m_text.requestFocus (); - } // requestFocus - - /** - * Request Focus In Window - * @return focus request - */ - @Override - public boolean requestFocusInWindow() - { - return m_text.requestFocusInWindow(); - } // requestFocusInWindow - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return m_text; - } // getFocusComponent - - /** - * Set Editor to value - * @param value Integer - */ - public void setValue(Object value) - { - setValue (value, false); - } // setValue - - /** - * Set Value - * @param value value - * @param fire data binding - */ - private void setValue (Object value, boolean fire) - { - if (m_mLocator == null) - { - return ; - } - - if (value != null) - { - m_mLocator.setOnly_Warehouse_ID (getOnly_Warehouse_ID ()); - m_mLocator.setOnly_Product_ID(getOnly_Product_ID()); - if (!m_mLocator.isValid(value)) - value = null; - } - // - m_value = value; - m_text.setText(m_mLocator.getDisplay(value)); // loads value - - // Data Binding - try - { - fireVetoableChange(m_columnName, null, value); - } - catch (PropertyVetoException pve) - { - } - } // setValue - - - /** - * Property Change Listener - * @param evt PropertyChangeEvent - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * Return Editor value - * @return value - */ - public Object getValue() - { - if (getM_Locator_ID() == 0) - return null; - return m_value; - } // getValue - - /** - * Get M_Locator_ID - * @return id - */ - public int getM_Locator_ID() - { - if (m_value != null - && m_value instanceof Integer) - return ((Integer)m_value).intValue(); - return 0; - } // getM_Locator_ID - - /** - * Return Display Value - * @return display value - */ - public String getDisplay() - { - return m_text.getText(); - } // getDisplay - - /** - * ActionListener - * @param e ActionEvent - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(FieldRecordInfo.CHANGE_LOG_COMMAND)) - { - FieldRecordInfo.start(m_mField); - return; - } - - // Refresh - if (e.getSource() == mRefresh) - { - m_mLocator.refresh(); - return; - } - - // Zoom to M_Warehouse - if (e.getSource() == mZoom) - { - actionZoom(); - return; - } - - // Warehouse/Product - int only_Warehouse_ID = getOnly_Warehouse_ID(); - int only_Product_ID = getOnly_Product_ID(); - if (log.isLoggable(Level.CONFIG)) log.config("Only Warehouse_ID=" + only_Warehouse_ID - + ", Product_ID=" + only_Product_ID); - - // Text Entry ok - if (e.getSource() == m_text - && actionText(only_Warehouse_ID, only_Product_ID)) - return; - - // Button - Start Dialog - int M_Locator_ID = 0; - if (m_value instanceof Integer) - M_Locator_ID = ((Integer)m_value).intValue(); - // - m_mLocator.setOnly_Warehouse_ID(only_Warehouse_ID); - m_mLocator.setOnly_Product_ID(getOnly_Product_ID()); - VLocatorDialog ld = new VLocatorDialog(AEnv.getFrame(this), - Msg.translate(Env.getCtx(), m_columnName), - m_mLocator, M_Locator_ID, isMandatory(), only_Warehouse_ID); - // display - ld.setVisible(true); - m_mLocator.setOnly_Warehouse_ID(0); - - // redisplay - if (!ld.isChanged()) - return; - setValue (ld.getValue(), true); - } // actionPerformed - - /** - * Hit Enter in Text Field - * @param only_Warehouse_ID if not 0 restrict warehouse - * @param only_Product_ID of not 0 restricted product - * @return true if found - */ - private boolean actionText (int only_Warehouse_ID, int only_Product_ID) - { - String text = m_text.getText(); - log.fine(text); - // Null - if (text == null || text.length() == 0) - { - if (isMandatory()) - return false; - else - { - setValue (null, true); - return true; - } - } - if (text.endsWith("%")) - text = text.toUpperCase(); - else - text = text.toUpperCase() + "%"; - - // Look up - see MLocatorLookup.run - StringBuffer sql = new StringBuffer("SELECT M_Locator_ID FROM M_Locator ") - .append(" WHERE IsActive='Y' AND UPPER(Value) LIKE ") - .append(DB.TO_STRING(text)); - if (getOnly_Warehouse_ID() != 0) - sql.append(" AND M_Warehouse_ID=?"); - if (getOnly_Product_ID() != 0) - sql.append(" AND (IsDefault='Y' ") // Default Locator - .append("OR EXISTS (SELECT * FROM M_Product p ") // Product Locator - .append("WHERE p.M_Locator_ID=M_Locator.M_Locator_ID AND p.M_Product_ID=?)") - .append("OR EXISTS (SELECT * FROM M_Storage s ") // Storage Locator - .append("WHERE s.M_Locator_ID=M_Locator.M_Locator_ID AND s.M_Product_ID=?))"); - String finalSql = MRole.getDefault(Env.getCtx(), false).addAccessSQL( - sql.toString(), "M_Locator", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - // - int M_Locator_ID = 0; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(finalSql, null); - int index = 1; - if (only_Warehouse_ID != 0) - pstmt.setInt(index++, only_Warehouse_ID); - if (only_Product_ID != 0) - { - pstmt.setInt(index++, only_Product_ID); - pstmt.setInt(index++, only_Product_ID); - } - rs = pstmt.executeQuery(); - if (rs.next()) - { - M_Locator_ID = rs.getInt(1); - if (rs.next()) - M_Locator_ID = 0; // more than one - } - } - catch (SQLException ex) - { - log.log(Level.SEVERE, finalSql, ex); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - if (M_Locator_ID == 0) - return false; - - setValue (Integer.valueOf(M_Locator_ID), true); - return true; - } // actionText - - /** - * Action Listener Interface - * @param listener listener - */ - public void addActionListener(ActionListener listener) - { - m_text.addActionListener(listener); - } // addActionListener - - - /** - * Action - Zoom - */ - private void actionZoom() - { - int AD_Window_ID = MTable.get(Env.getCtx(), MLocator.Table_ID).getAD_Window_ID(); - if (AD_Window_ID <= 0) - AD_Window_ID = WINDOW_WAREHOUSE_LOCATOR; // hardcoded window Warehouse & Locators - log.info(""); - // - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - AWindow frame = new AWindow(null); - - MQuery zoomQuery = new MQuery(); - zoomQuery.addRestriction(MLocator.COLUMNNAME_M_Locator_ID, MQuery.EQUAL, getValue()); - zoomQuery.setRecordCount(1); // guess - - if (!frame.initWindow(AD_Window_ID, zoomQuery)) - return; - AEnv.addToWindowManager(frame); - AEnv.showCenterScreen(frame); - frame = null; - setCursor(Cursor.getDefaultCursor()); - } // actionZoom - - /** - * Set Field/WindowNo for ValuePreference (NOP) - * @param mField Model Field - */ - public void setField (org.compiere.model.GridField mField) - { - m_mField = mField; - if (m_mField != null) - FieldRecordInfo.addMenu(this, popupMenu); - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - /** - * Get Warehouse restriction if any. - * @return M_Warehouse_ID or 0 - */ - private int getOnly_Warehouse_ID() - { - String only_Warehouse = Env.getContext(Env.getCtx(), m_WindowNo, "M_Warehouse_ID", true); - int only_Warehouse_ID = 0; - try - { - if (only_Warehouse != null && only_Warehouse.length () > 0) - only_Warehouse_ID = Integer.parseInt (only_Warehouse); - } - catch (Exception ex) - { - } - return only_Warehouse_ID; - } // getOnly_Warehouse_ID - - /** - * Get Product restriction if any. - * @return M_Product_ID or 0 - */ - private int getOnly_Product_ID() - { - if (!Env.isSOTrx(Env.getCtx(), m_WindowNo)) - return 0; // No product restrictions for PO - // - String only_Product = Env.getContext(Env.getCtx(), m_WindowNo, "M_Product_ID", true); - int only_Product_ID = 0; - try - { - if (only_Product != null && only_Product.length () > 0) - only_Product_ID = Integer.parseInt (only_Product); - } - catch (Exception ex) - { - } - return only_Product_ID; - } // getOnly_Product_ID - - /** - * Set the default locator if this field is mandatory - * and we have a warehouse restriction. - * - * @since 3.1.4 - */ - private void setDefault_Locator_ID() - { - // teo_sarca, FR [ 1661546 ] Mandatory locator fields should use defaults - if (!isMandatory() || m_mLocator == null) { - return; - } - int M_Warehouse_ID = getOnly_Warehouse_ID(); - if (M_Warehouse_ID <= 0) { - return; - } - MWarehouse wh = MWarehouse.get(Env.getCtx(), M_Warehouse_ID); - if (wh == null || wh.get_ID() <= 0) { - return; - } - MLocator loc = wh.getDefaultLocator(); - if (loc == null || loc.get_ID() <= 0) { - return; - } - setValue(Integer.valueOf(loc.get_ID())); - } - -} // VLocator - -/*****************************************************************************/ \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocatorDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocatorDialog.java deleted file mode 100644 index e3431e730e..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocatorDialog.java +++ /dev/null @@ -1,508 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.logging.Level; - -import javax.swing.JCheckBox; -import javax.swing.JDialog; -import javax.swing.JLabel; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.model.MLocator; -import org.compiere.model.MLocatorLookup; -import org.compiere.model.MRole; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -/** - * Dialog to enter Warehouse Locator Info - * - * @author Jorg Janke - * @version $Id: VLocatorDialog.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VLocatorDialog extends CDialog - implements ActionListener, KeyListener -{ - /** - * - */ - private static final long serialVersionUID = 4727764506935600690L; - - /** - * Constructor - * @param frame frame - * @param title title - * @param mLocator locator - * @param M_Locator_ID locator id - * @param mandatory mandatory - * @param only_Warehouse_ID of not 0 restrict warehouse - */ - public VLocatorDialog (Frame frame, String title, MLocatorLookup mLocator, - int M_Locator_ID, boolean mandatory, int only_Warehouse_ID) - { - super (frame, title, true); - m_WindowNo = AEnv.getWindowNo(frame); - try - { - jbInit(); - setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "VLocatorDialog", ex); - } - // - m_mLocator = mLocator; - m_M_Locator_ID = M_Locator_ID; - m_mandatory = mandatory; - m_only_Warehouse_ID = only_Warehouse_ID; - // - initLocator(); - AEnv.positionCenterWindow(frame, this); - } // VLocatorDialog - - private int m_WindowNo; - private boolean m_change = false; - private MLocatorLookup m_mLocator; - private int m_M_Locator_ID; - private boolean m_mandatory = false; - private int m_only_Warehouse_ID = 0; - // - private int m_M_Warehouse_ID; - @SuppressWarnings("unused") - private String m_M_WarehouseName; - private String m_M_WarehouseValue; - private String m_Separator; - @SuppressWarnings("unused") - private int m_AD_Client_ID; - @SuppressWarnings("unused") - private int m_AD_Org_ID; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VLocatorDialog.class); - // - private CPanel panel = new CPanel(); - private CPanel mainPanel = new CPanel(); - private CPanel southPanel = new CPanel(); - private BorderLayout panelLayout = new BorderLayout(); - private GridBagLayout gridBagLayout = new GridBagLayout(); - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - private BorderLayout southLayout = new BorderLayout(); - // - private VComboBox fLocator = new VComboBox(); - private CComboBoxfWarehouse = new CComboBox(); - private JCheckBox fCreateNew = new JCheckBox(); - private CTextField fX = new CTextField(); - private CTextField fY = new CTextField(); - private CTextField fZ = new CTextField(); - private JLabel lLocator = new JLabel(); - private CTextField fWarehouseInfo = new CTextField(); - private CTextField fValue = new CTextField(); - private JLabel lWarehouseInfo = new JLabel(); - private JLabel lWarehouse = new JLabel(); - private JLabel lX = new JLabel(); - private JLabel lY = new JLabel(); - private JLabel lZ = new JLabel(); - private JLabel lValue = new JLabel(); - - /** - * Static component init - * @throws Exception - */ - private void jbInit() throws Exception - { - panel.setLayout(panelLayout); - southPanel.setLayout(southLayout); - mainPanel.setLayout(gridBagLayout); - panelLayout.setHgap(5); - panelLayout.setVgap(10); - fCreateNew.setText(Msg.getMsg(Env.getCtx(), "CreateNew")); - fX.setColumns(15); - fY.setColumns(15); - fZ.setColumns(15); - lLocator.setLabelFor(fLocator); - lLocator.setText(Msg.translate(Env.getCtx(), "M_Locator_ID")); - fWarehouseInfo.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - fWarehouseInfo.setReadWrite(false); - fWarehouseInfo.setColumns(15); - fValue.setColumns(15); - lWarehouseInfo.setLabelFor(fWarehouseInfo); - lWarehouseInfo.setText(Msg.translate(Env.getCtx(), "M_Warehouse_ID")); - lWarehouse.setLabelFor(fWarehouse); - lWarehouse.setText(Msg.translate(Env.getCtx(), "M_Warehouse_ID")); - lX.setLabelFor(fX); - lX.setText(Msg.getElement(Env.getCtx(), "X")); - lY.setLabelFor(fY); - lY.setText(Msg.getElement(Env.getCtx(), "Y")); - lZ.setLabelFor(fZ); - lZ.setText(Msg.getElement(Env.getCtx(), "Z")); - lValue.setLabelFor(fValue); - lValue.setText(Msg.translate(Env.getCtx(), "Value")); - getContentPane().add(panel); - panel.add(mainPanel, BorderLayout.CENTER); - // - mainPanel.add(lLocator, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - mainPanel.add(fLocator, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 0, 5), 0, 0)); - mainPanel.add(fCreateNew, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(10, 0, 0, 5), 0, 0)); - mainPanel.add(lWarehouseInfo, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - mainPanel.add(fWarehouseInfo, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 0, 5), 0, 0)); - mainPanel.add(lWarehouse, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - mainPanel.add(fWarehouse, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 0, 5), 0, 0)); - mainPanel.add(lX, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - mainPanel.add(fX, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 0, 5), 0, 0)); - mainPanel.add(lY, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - mainPanel.add(fY, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 0, 5), 0, 0)); - mainPanel.add(lZ, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - mainPanel.add(fZ, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 0, 5), 0, 0)); - mainPanel.add(lValue, new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - mainPanel.add(fValue, new GridBagConstraints(1, 7, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 0, 5), 0, 0)); - // - panel.add(southPanel, BorderLayout.SOUTH); - southPanel.add(confirmPanel, BorderLayout.NORTH); - confirmPanel.addActionListener(this); - } // jbInit - - /** - * Dynanmic Init & fill fields - */ - private void initLocator() - { - log.fine(""); - - // Load Warehouse - String sql = "SELECT M_Warehouse_ID, Name FROM M_Warehouse"; - if (m_only_Warehouse_ID != 0) - sql += " WHERE M_Warehouse_ID=" + m_only_Warehouse_ID; - String SQL = MRole.getDefault().addAccessSQL( - sql, "M_Warehouse", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO) - + " ORDER BY 2"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(SQL, null); - rs = pstmt.executeQuery(); - while (rs.next()) - fWarehouse.addItem(new KeyNamePair(rs.getInt(1), rs.getString(2))); - } - catch (SQLException e) - { - log.log(Level.SEVERE, SQL, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - if (log.isLoggable(Level.FINE)) log.fine("Warehouses=" + fWarehouse.getItemCount()); - - // Load existing Locators - m_mLocator.fillComboBox(m_mandatory, true, true, false, false); // IDEMPIERE 90 - if (log.isLoggable(Level.FINE)) log.fine(m_mLocator.toString()); - fLocator.setModel(m_mLocator); - fLocator.setValue(m_M_Locator_ID); - fLocator.addActionListener(this); - displayLocator(); - // - fCreateNew.setSelected(false); - fCreateNew.addActionListener(this); - enableNew(); - // - fWarehouse.addActionListener(this); - fX.addKeyListener(this); - fY.addKeyListener(this); - fZ.addKeyListener(this); - - // Update UI - pack(); - } // initLocator - - - /*************************************************************************/ - - /** - * ActionListener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - Object source = e.getSource(); - // - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - actionOK(); - m_change = true; - dispose(); - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - m_change = false; - dispose(); - } - // Locator Change - else if (e.getSource() == fLocator) - displayLocator(); - - // New Value Change - else if (source == fCreateNew) - enableNew(); - - // Entered/Changed data for Value - else if (fCreateNew.isSelected() && source == fWarehouse) - createValue(); - - } // actionPerformed - - /** - * KeyListener - nop - * @param e event - */ - public void keyPressed(KeyEvent e) - {} - /** - * KeyListener - * @param e event - */ - public void keyReleased(KeyEvent e) - { - if (fCreateNew.isSelected()) - createValue(); - } - /** - * KeyListener - nop - * @param e event - */ - public void keyTyped(KeyEvent e) - {} - - /** - * Display value of current locator - */ - private void displayLocator() - { - MLocator l = (MLocator) fLocator.getSelectedItem(); - if (l == null) - return; - // - m_M_Locator_ID = l.getM_Locator_ID(); - fWarehouseInfo.setText(l.getWarehouseName()); - fX.setText(l.getX()); - fY.setText(l.getY()); - fZ.setText(l.getZ()); - fValue.setText(l.getValue()); - getWarehouseInfo(l.getM_Warehouse_ID()); - // Set Warehouse - int size = fWarehouse.getItemCount(); - for (int i = 0; i < size; i++) - { - KeyNamePair pp = (KeyNamePair)fWarehouse.getItemAt(i); - if (pp.getKey() == l.getM_Warehouse_ID()) - { - fWarehouse.setSelectedIndex(i); - continue; - } - } - } // displayLocator - - /** - * Enable/disable New data entry - */ - private void enableNew() - { - boolean sel = fCreateNew.isSelected(); - lWarehouse.setVisible(sel); - fWarehouse.setVisible(sel); - lWarehouseInfo.setVisible(!sel); - fWarehouseInfo.setVisible(!sel); - fX.setReadWrite(sel); - fY.setReadWrite(sel); - fZ.setReadWrite(sel); - fValue.setReadWrite(sel); - pack(); - } // enableNew - - /** - * Get Warehouse Info - * @param M_Warehouse_ID warehouse - */ - private void getWarehouseInfo (int M_Warehouse_ID) - { - if (M_Warehouse_ID == m_M_Warehouse_ID) - return; - // Defaults - m_M_Warehouse_ID = 0; - m_M_WarehouseName = ""; - m_M_WarehouseValue = ""; - m_Separator = "."; - m_AD_Client_ID = 0; - m_AD_Org_ID = 0; - // - String SQL = "SELECT M_Warehouse_ID, Value, Name, Separator, AD_Client_ID, AD_Org_ID " - + "FROM M_Warehouse WHERE M_Warehouse_ID=?"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(SQL, null); - pstmt.setInt(1, M_Warehouse_ID); - rs = pstmt.executeQuery(); - if (rs.next()) - { - m_M_Warehouse_ID = rs.getInt(1); - m_M_WarehouseValue = rs.getString(2); - m_M_WarehouseName = rs.getString(3); - m_Separator = rs.getString(4); - m_AD_Client_ID = rs.getInt(5); - m_AD_Org_ID = rs.getInt(6); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, SQL, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - } // getWarehouseInfo - - /** - * Create Locator-Value - */ - private void createValue() - { - // Get Warehouse Info - KeyNamePair pp = (KeyNamePair)fWarehouse.getSelectedItem(); - if (pp == null) - return; - getWarehouseInfo(pp.getKey()); - // - StringBuilder buf = new StringBuilder(m_M_WarehouseValue); - buf.append(m_Separator).append(fX.getText()); - buf.append(m_Separator).append(fY.getText()); - buf.append(m_Separator).append(fZ.getText()); - fValue.setText(buf.toString()); - } // createValue - - /** - * OK - check for changes (save them) & Exit - */ - private void actionOK() - { - if (fCreateNew.isSelected()) - { - // Get Warehouse Info - KeyNamePair pp = (KeyNamePair)fWarehouse.getSelectedItem(); - if (pp != null) - getWarehouseInfo(pp.getKey()); - - // Check mandatory values - String mandatoryFields = ""; - if (m_M_Warehouse_ID == 0) - mandatoryFields += lWarehouse.getText() + " - "; - if (fValue.getText().length()==0) - mandatoryFields += lValue.getText() + " - "; - if (fX.getText().length()==0) - mandatoryFields += lX.getText() + " - "; - if (fY.getText().length()==0) - mandatoryFields += lY.getText() + " - "; - if (fZ.getText().length()==0) - mandatoryFields += lZ.getText() + " - "; - if (mandatoryFields.length() != 0) - { - ADialog.error(m_WindowNo, this, "FillMandatory", mandatoryFields.substring(0, mandatoryFields.length()-3)); - return; - } - - MLocator loc = MLocator.get(Env.getCtx(), m_M_Warehouse_ID, fValue.getText(), - fX.getText(), fY.getText(), fZ.getText()); - m_M_Locator_ID = loc.getM_Locator_ID(); - fLocator.addItem(loc); - fLocator.setSelectedItem(loc); - } // createNew - // - if (log.isLoggable(Level.CONFIG)) log.config("M_Locator_ID=" + m_M_Locator_ID); - } // actionOK - - /** - * Get Selected value - * @return value as Integer - */ - public Integer getValue() - { - MLocator l = (MLocator) fLocator.getSelectedItem(); - if (l != null && l.getM_Locator_ID() != 0) - return Integer.valueOf(l.getM_Locator_ID()); - return null; - } // getValue - - /** - * Get result - * @return true if changed - */ - public boolean isChanged() - { - if (m_change) - { - MLocator l = (MLocator) fLocator.getSelectedItem(); - if (l != null) - return l.getM_Locator_ID() == m_M_Locator_ID; - } - return m_change; - } // getChange - -} // VLocatorDialog diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java deleted file mode 100644 index 79abb36910..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java +++ /dev/null @@ -1,1761 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import static org.compiere.model.SystemIDs.COLUMN_AD_WF_ACTIVITY_AD_USER_ID; -import static org.compiere.model.SystemIDs.COLUMN_C_INVOICELINE_M_PRODUCT_ID; -import static org.compiere.model.SystemIDs.COLUMN_C_INVOICE_C_BPARTNER_ID; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.KeyEvent; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.logging.Level; - -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.ActionMap; -import javax.swing.DefaultComboBoxModel; -import javax.swing.InputMap; -import javax.swing.JComponent; -import javax.swing.JPopupMenu; -import javax.swing.KeyStroke; -import javax.swing.LookAndFeel; -import javax.swing.SwingUtilities; - -import org.adempiere.client.InfoManager; -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.AWindow; -import org.compiere.apps.FieldRecordInfo; -import org.compiere.apps.search.Info; -import org.compiere.model.GridField; -import org.compiere.model.Lookup; -import org.compiere.model.MBPartnerLocation; -import org.compiere.model.MLocation; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MQuery; -import org.compiere.model.MRole; -import org.compiere.model.MTable; -import org.compiere.model.MZoomCondition; -import org.compiere.swing.CButton; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Ini; -import org.compiere.util.Msg; -import org.compiere.util.NamePair; -import org.compiere.util.ValueNamePair; - -/** - * Lookup Visual Field. - *

    - * When r/o - display a Label - * When STABLE - display a ComboBox - * Otherwise show Selection Dialog - *

    - * Special handling of BPartner and Product - * - * @author Jorg Janke - * @version $Id: VLookup.java,v 1.5 2006/10/06 00:42:38 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *

  • BF [ 1740835 ] NPE when closing a window - *
  • BF [ 1817768 ] Isolate hardcoded table direct columns - *
  • BF [ 1834399 ] VLookup: pressing enter twice has a annoying behaviour - *
  • BF [ 1979213 ] VLookup.getDirectAccessSQL issue - *
  • BF [ 2552901 ] VLookup: TAB is not working OK - * @author Michael Judd (MultiSelect) - * - * @author hengsin, hengsin.low@idalica.com - * @see FR [2887701] https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2887701&group_id=176962 - * @sponsor www.metas.de - */ -public class VLookup extends JComponent - implements VEditor, ActionListener, FocusListener -{ - /** - * - */ - private static final long serialVersionUID = 3156026335667188091L; - - /***************************************************************************** - * Mouse Listener for Popup Menu - */ - final class VLookup_mouseAdapter extends java.awt.event.MouseAdapter - { - /** - * Constructor - * @param adaptee adaptee - */ - VLookup_mouseAdapter(VLookup adaptee) - { - m_adaptee = adaptee; - } // VLookup_mouseAdapter - - private VLookup m_adaptee; - - /** - * Mouse Listener - * @param e MouseEvent - */ - public void mouseClicked(MouseEvent e) - { - // System.out.println("mouseClicked " + e.getID() + " " + e.getSource().getClass().toString()); - // popup menu - if (SwingUtilities.isRightMouseButton(e)) - m_adaptee.popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - // Hide the popup if not right click - teo_sarca [ 1734802 ] - else - m_adaptee.popupMenu.setVisible(false); - } // mouse Clicked - - } // VLookup_mouseAdapter - - - @Override - protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, - int condition, boolean pressed) { - if (e.getSource() == m_combo || e.getSource() == m_text || e.getSource() == this) { - return super.processKeyBinding(ks, e, condition, pressed); - } - - JComponent editorComp = null; - if (m_lookup != null && m_lookup.getDisplayType() != DisplayType.Search) - editorComp = m_combo; - else - editorComp = m_text; - InputMap map = editorComp.getInputMap(condition); - ActionMap am = editorComp.getActionMap(); - - if(map!=null && am!=null && isEnabled()){ - Object binding = map.get(ks); - Action action = (binding==null) ? null : am.get(binding); - if(action!=null){ - return SwingUtilities.notifyAction(action, ks, e, editorComp, - e.getModifiersEx()); - } - } - return false; - } - - /** - * Create Optional BPartner Search Lookup - * @param WindowNo window - * @return VLookup - */ - public static VLookup createBPartner (int WindowNo) - { - int AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID - try - { - Lookup lookup = MLookupFactory.get (Env.getCtx(), WindowNo, - 0, AD_Column_ID, DisplayType.Search); - return new VLookup ("C_BPartner_ID", false, false, true, lookup); - } - catch (Exception e) - { - log.log(Level.SEVERE, "", e); - } - return null; - } // createBPartner - - /** - * Create Optional Product Search Lookup - * @param WindowNo window - * @return VLookup - */ - public static VLookup createProduct (int WindowNo) - { - int AD_Column_ID = COLUMN_C_INVOICELINE_M_PRODUCT_ID; // C_InvoiceLine.M_Product_ID - try - { - Lookup lookup = MLookupFactory.get (Env.getCtx(), WindowNo, 0, - AD_Column_ID, DisplayType.Search); - return new VLookup ("M_Product_ID", false, false, true, lookup); - } - catch (Exception e) - { - log.log(Level.SEVERE, "", e); - } - return null; - } // createProduct - - /** - * Create Optional User Search Lookup - * @param WindowNo window - * @return VLookup - */ - public static VLookup createUser (int WindowNo) - { - int AD_Column_ID = COLUMN_AD_WF_ACTIVITY_AD_USER_ID; // AD_WF_Activity.AD_User_UD - try - { - Lookup lookup = MLookupFactory.get (Env.getCtx(), WindowNo, 0, - AD_Column_ID, DisplayType.Search); - return new VLookup ("AD_User_ID", false, false, true, lookup); - } - catch (Exception e) - { - log.log(Level.SEVERE, "", e); - } - return null; - } // createProduct - - - /************************************************************************* - * Detail Constructor - * - * @param columnName column - * @param mandatory mandatory - * @param isReadOnly read only - * @param isUpdateable updateable - * @param lookup lookup - */ - public VLookup (String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable, - Lookup lookup) - { - super(); - super.setName(columnName); - m_combo.setName(columnName); - m_columnName = columnName; - setMandatory(mandatory); - m_lookup = lookup; - if (m_lookup != null) - m_lookup.setMandatory(mandatory); - // - setLayout(new BorderLayout()); - mouseAdapter = new VLookup_mouseAdapter(this); // popup - - // *** Text & Button *** - m_text.addActionListener(this); - m_text.addFocusListener(this); - m_text.addMouseListener(mouseAdapter); - // Button - m_button.addActionListener(this); - m_button.addMouseListener(mouseAdapter); - m_button.setFocusable(false); // don't focus when tabbing - m_button.setMargin(new Insets(0, 0, 0, 0)); - if (columnName.equals("C_BPartner_ID")) - m_button.setIcon(Env.getImageIcon("BPartner10.gif")); - else if (columnName.equals("M_Product_ID")) - m_button.setIcon(Env.getImageIcon("Product10.gif")); - else - m_button.setIcon(Env.getImageIcon("PickOpen10.gif")); - - // IDEMPIERE 90 - boolean isShortListAvailable = false; // Short List available for this lookup - if (m_lookup != null && (m_lookup.getDisplayType() == DisplayType.TableDir || m_lookup.getDisplayType() == DisplayType.Table)) // only for Table & TableDir - { - String tableName_temp = m_lookup.getColumnName(); // Returns AD_Org.AD_Org_ID - int posPoint = tableName_temp.indexOf("."); - String tableName = tableName_temp.substring(0, posPoint); - MTable table = MTable.get(Env.getCtx(), tableName); - isShortListAvailable = (table.getColumnIndex("IsShortList") >= 0); - if (isShortListAvailable) - { - setComboShortList(true); - m_lookup.setShortList(true); - - m_buttonSL.addActionListener(this); - m_buttonSL.addMouseListener(mouseAdapter); - m_buttonSL.setFocusable(false); // don't focus when tabbing - m_buttonSL.setMargin(new Insets(0, 0, 0, 0)); - m_buttonSL.setIcon(Env.getImageIcon("LockX16.gif")); - m_buttonSL.setToolTipText(Msg.getMsg(Env.getCtx(), "ShortListShortListItems")); - ActionMap am = m_combo.getActionMap(); - am.put("shortlist", new AbstractAction() { - /** - * - */ - private static final long serialVersionUID = 371998095806934367L; - - @Override - public void actionPerformed(ActionEvent e) { - actionShortList(); - } - }); - m_combo.getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) - .put(KeyStroke.getKeyStroke(KeyEvent.VK_L, KeyEvent.CTRL_DOWN_MASK), "shortlist"); - } - } - // IDEMPIERE 90 - - // *** VComboBox *** - if (m_lookup != null && m_lookup.getDisplayType() != DisplayType.Search) // No Search - { - // Don't have to fill up combobox if it is readonly - if (!isReadOnly && isUpdateable) - m_lookup.fillComboBox (isMandatory(), true, true, false, isShortListAvailable); // IDEMPIERE 90 - m_combo.setModel(m_lookup); - // - // AutoCompletion.enable(m_combo); - m_combo.addActionListener(this); // Selection - m_combo.getEditor().getEditorComponent().addMouseListener(mouseAdapter); // popup - // FocusListener to refresh selection before opening - m_combo.addFocusListener(this); - m_combo.getEditor().getEditorComponent().addFocusListener(this); - } - - setUI (true); - // ReadWrite - decides what components to show - if (isReadOnly || !isUpdateable || m_lookup == null) - setReadWrite(false); - else - setReadWrite(true); - - // Popup - if (m_lookup != null) - { - if ((m_lookup.getDisplayType() == DisplayType.List && Env.getContextAsInt(Env.getCtx(), "#AD_Role_ID") == 0) - || m_lookup.getDisplayType() != DisplayType.List) // only system admins can change lists, so no need to zoom for others - { - mZoom = new CMenuItem(Msg.getMsg(Env.getCtx(), "Zoom"), Env.getImageIcon("Zoom16.gif")); - mZoom.addActionListener(this); - popupMenu.add(mZoom); - } - mRefresh = new CMenuItem(Msg.getMsg(Env.getCtx(), "Refresh"), Env.getImageIcon("Refresh16.gif")); - mRefresh.addActionListener(this); - popupMenu.add(mRefresh); - } - // VBPartner quick entry link - if (columnName.equals("C_BPartner_ID")) - { - mBPartnerNew = new CMenuItem (Msg.getMsg(Env.getCtx(), "New"), Env.getImageIcon("InfoBPartner16.gif")); - mBPartnerNew.addActionListener(this); - mBPartnerNew.setVisible(isReadWrite()); // visible only if the field is editable - teo_sarca [ 1721710 ] - popupMenu.add(mBPartnerNew); - mBPartnerUpd = new CMenuItem (Msg.getMsg(Env.getCtx(), "Update"), Env.getImageIcon("InfoBPartner16.gif")); - mBPartnerUpd.addActionListener(this); - popupMenu.add(mBPartnerUpd); - } - if ((columnName.toUpperCase().equals("C_BPARTNER_LOCATION_ID")) - || (columnName.toUpperCase().equals("BILL_LOCATION_ID")) - || (columnName.toUpperCase().equals("DROPSHIP_LOCATION_ID"))) - { - m_location = new CMenuItem (Msg.getMsg(Env.getCtx(), "ShowLocation"), Env.getImageIcon("InfoBPartner16.gif")); - m_location.addActionListener(this); - popupMenu.add(m_location); - } - // - if (m_lookup != null && m_lookup.getZoom() == 0) - mZoom.setEnabled(false); - } // VLookup - - /** - * Dispose - */ - public void dispose() - { - m_text = null; - m_button = null; - m_lookup = null; - m_mField = null; - m_buttonSL = null; // IDEMPIERE 90 - // - m_combo.getEditor().getEditorComponent().removeFocusListener(this); - m_combo.getEditor().getEditorComponent().removeMouseListener(mouseAdapter); - m_combo.removeFocusListener(this); - m_combo.removeActionListener(this); - m_combo.setModel(new DefaultComboBoxModel()); // remove reference - // m_combo.removeAllItems(); - m_combo = null; - } // dispose - - /** Display Length for Lookups (15) */ - public final static int DISPLAY_LENGTH = 15; - /** Field Height */ - public static int FIELD_HIGHT = 0; - - /** Search: The Editable Text Field */ - private CTextField m_text = new CTextField (DISPLAY_LENGTH); - /** Search: The Button to open Editor */ - private CButton m_button = new CButton(); - /** The Combo Box if not a Search Lookup */ - private VComboBox m_combo = new VComboBox(); - /** Indicator that value is being set */ - private volatile boolean m_settingValue = false; - /** Indicator that docus is being set */ - private volatile boolean m_settingFocus = false; - /** Indicator that Lookup has focus */ - private volatile boolean m_haveFocus = false; - /** Indicator - inserting new value */ - private volatile boolean m_inserting = false; - /** Last Display */ - private String m_lastDisplay = ""; - /** Column Name */ - private String m_columnName; - /** Lookup */ - private Lookup m_lookup; - /** Conbo Box Active */ - private boolean m_comboActive = true; - /** The Value */ - private Object m_value; - - private boolean m_stopediting = false; - - // Popup - JPopupMenu popupMenu = new JPopupMenu(); - private CMenuItem mZoom; - private CMenuItem mRefresh; - private CMenuItem mBPartnerNew; - private CMenuItem mBPartnerUpd; - private CMenuItem m_location; - // Mouse Listener - private VLookup_mouseAdapter mouseAdapter; - - /** ShortList button IDEMPIERE 90 */ - private CButton m_buttonSL = new CButton(); - - /** All items or only those of the short list ?*/ - boolean onlyShortListItems = false; - - // Field for Value Preference - private GridField m_mField = null; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VLookup.class); - - /** - * Set Content and Size of Components - * @param initial if true, size and margins will be set - */ - private void setUI (boolean initial) - { - if (initial) - { - Dimension size = m_text.getPreferredSize(); - setPreferredSize(new Dimension(size)); // causes r/o to be the same length - m_combo.setPreferredSize(new Dimension(size)); - setMinimumSize(new Dimension (30, size.height)); - FIELD_HIGHT = size.height; - // - m_text.setBorder(null); - Dimension bSize = new Dimension(size.height, size.height); - m_button.setPreferredSize (bSize); - m_buttonSL.setPreferredSize (bSize); // IDEMPIERE 90 - } - - // What to show - this.remove(m_combo); - this.remove(m_button); - this.remove(m_buttonSL); // IDEMPIERE 90 - this.remove(m_text); - // - if (!isReadWrite()) // r/o - show text only - { - LookAndFeel.installBorder(this, "TextField.border"); - this.add(m_text, BorderLayout.CENTER); - m_text.setReadWrite(false); - m_combo.setReadWrite(false); - m_comboActive = false; - } - else if (m_lookup != null && m_lookup.getDisplayType() != DisplayType.Search) // show combo if not Search - { - this.setBorder(null); - this.add(m_combo, BorderLayout.CENTER); - m_comboActive = true; - // IDEMPIERE 90 - if (isComboShortList()) - this.add(m_buttonSL, BorderLayout.EAST); // add a button for short list items <-> all items - } - else // Search or unstable - show text & button - { - LookAndFeel.installBorder(this, "TextField.border"); - this.add(m_text, BorderLayout.CENTER); - this.add(m_button, BorderLayout.EAST); - m_text.setReadWrite (true); - m_comboActive = false; - } - } // setUI - - /** - * Set ReadWrite - * @param value ReadWrite - */ - public void setReadWrite (boolean value) - { - boolean rw = value; - if (m_lookup == null) - rw = false; - if (m_combo.isReadWrite() != value) - { - m_combo.setReadWrite(rw); - setUI (false); - if (value && m_comboActive) { - m_settingValue = true; // disable actions - refresh(); - m_settingValue = false; - } - if (m_comboActive) - setValue (m_value); - } - // If the field is readonly the BPartner new option should be hidden - teo_sarca [ 1721710 ] - if (mBPartnerNew != null) - mBPartnerNew.setVisible(value); - } // setReadWrite - - /** - * IsEditable - * @return is lookup ReadWrite - */ - public boolean isReadWrite() - { - if (m_combo != null) - return m_combo.isReadWrite(); - return true; - } // isReadWrite - - /** - * Set Mandatory (and back color) - * @param mandatory mandatory - */ - public void setMandatory (boolean mandatory) - { - m_combo.setMandatory(mandatory); - m_text.setMandatory(mandatory); - } // setMandatory - - /** - * Is it mandatory - * @return true if mandatory - */ - public boolean isMandatory() - { - return m_combo.isMandatory(); - } // isMandatory - - /** - * Set Background - * @param color color - */ - public void setBackground(Color color) - { - m_text.setBackground(color); - m_combo.setBackground(color); - } // setBackground - - /** - * Set Background - * @param error error - */ - public void setBackground (boolean error) - { - m_text.setBackground(error); - m_combo.setBackground(error); - } // setBackground - - /** - * Set Foreground - * @param fg Foreground color - */ - public void setForeground(Color fg) - { - m_text.setForeground(fg); - m_combo.setForeground(fg); - } // setForeground - - /** - * Request Focus - */ - public void requestFocus () - { - if (m_lookup != null && m_lookup.getDisplayType() != DisplayType.Search) - m_combo.requestFocus (); - else - m_text.requestFocus (); - } // requestFocus - - /** - * Request Focus In Window - * @return focus request - */ - @Override - public boolean requestFocusInWindow() - { - if (m_lookup != null && m_lookup.getDisplayType() != DisplayType.Search) - return m_combo.requestFocusInWindow(); - return m_text.requestFocusInWindow(); - } // requestFocusInWindow - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - if (m_lookup != null && m_lookup.getDisplayType() != DisplayType.Search) - return m_combo; - return m_text; - } // getFocusComponent - - /** - * Set Editor to value - * @param value new Value - */ - public void setValue (Object value) - { - if (log.isLoggable(Level.FINE)) log.fine(m_columnName + "=" + value); - m_settingValue = true; // disable actions - m_value = value; - - // Set both for switching - if (value == null) - { - m_combo.setValue (value); - m_text.setText (null); - m_lastDisplay = ""; - m_settingValue = false; - return; - } - if (m_lookup == null) - { - m_combo.setValue (value); - m_text.setText (value.toString()); - m_lastDisplay = value.toString(); - m_settingValue = false; - return; - } - - //must call m_combo.setvalue after m_lookup as - //loading of combo data might happen in m_lookup.getDisplay - m_lastDisplay = m_lookup.getDisplay(value); - m_combo.setValue (value); - - if (m_lastDisplay.equals("<-1>")) - { - m_lastDisplay = ""; - m_value = null; - } - boolean notFound = m_lastDisplay.startsWith("<") && m_lastDisplay.endsWith(">"); - m_text.setText (m_lastDisplay); - m_text.setCaretPosition (0); // show beginning - - // Nothing showing in Combo and should be showing - if (m_combo.getSelectedItem() == null - && (m_comboActive || (m_inserting && m_lookup.getDisplayType() != DisplayType.Search))) - { - // lookup found nothing too - if (notFound) - { - if (log.isLoggable(Level.FINEST)) log.finest(m_columnName + "=" + value + ": Not found - " + m_lastDisplay); - // we may have a new value - m_lookup.refresh(); - m_combo.setValue (value); - m_lastDisplay = m_lookup.getDisplay(value); - m_text.setText (m_lastDisplay); - m_text.setCaretPosition (0); // show beginning - notFound = m_lastDisplay.startsWith("<") && m_lastDisplay.endsWith(">"); - } - if (notFound && value instanceof Integer && m_lookup.getDisplayType() != DisplayType.ID) // for IDs is ok to be out of the list - { - m_value = null; - actionCombo (null); // data binding - if (log.isLoggable(Level.FINE)) log.fine(m_columnName + "=" + value + ": Not found"); - } - // we have lookup - else if (m_combo.getSelectedItem() == null) - { - NamePair pp = m_lookup.get(value); - if (pp != null) - { - if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " added to combo - " + pp); - // Add to Combo - m_combo.addItem (pp); - m_combo.setValue (value); - } - } - // Not in Lookup - set to Null - if (m_combo.getSelectedItem() == null) - { - if (value instanceof Integer && m_lookup.getDisplayType() != DisplayType.ID) // for IDs is ok to be out of the list - { - if (log.isLoggable(Level.INFO)) log.info(m_columnName + "=" + value + ": not in Lookup - set to NULL"); - actionCombo (null); // data binding (calls setValue again) - m_value = null; - } - } - } - m_settingValue = false; - } // setValue - - /** - * Property Change Listener - * @param evt PropertyChangeEvent - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (m_stopediting) - return; - - // log.fine( "VLookup.propertyChange", evt); - if (evt.getPropertyName().equals(GridField.PROPERTY)) - { - m_inserting = GridField.INSERTING.equals(evt.getOldValue()); // MField.setValue - setValue(evt.getNewValue()); - m_inserting = false; - } - } // propertyChange - - /** - * Return Editor value (Integer) - * @return value - */ - public Object getValue() - { - if (m_comboActive) - return m_combo.getValue (); - return m_value; - } // getValue - - /** - * Return editor display - * @return display value - */ - public String getDisplay() - { - String retValue = null; - if (m_comboActive) - retValue = m_combo.getDisplay(); - // check lookup - else if (m_lookup == null) - retValue = m_value == null ? null : m_value.toString(); - else - retValue = m_lookup.getDisplay(m_value); - // log.fine( "VLookup.getDisplay - " + retValue, "ComboActive=" + m_comboActive); - return retValue; - } // getDisplay - - /** - * Set Field/WindowNo for ValuePreference - * @param mField Model Field for Lookup - */ - public void setField (GridField mField) - { - m_mField = mField; - if (m_mField != null - && MRole.getDefault().isShowPreference() - && !mField.isEncrypted() && !mField.isEncryptedColumn()) - ValuePreference.addMenu (this, popupMenu); - - if (m_mField != null) - FieldRecordInfo.addMenu(this, popupMenu); - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - /************************************************************************** - * Action Listener - data binding - * @param e ActionEvent - */ - public void actionPerformed (ActionEvent e) - { - if (m_settingValue || m_settingFocus || m_stopediting) - return; - if (log.isLoggable(Level.CONFIG)) log.config(m_columnName + " - " + e.getActionCommand() + ", ComboValue=" + m_combo.getSelectedItem()); - // log.fine("Hash=" + this.hashCode()); - - // Preference - if (e.getActionCommand().equals(ValuePreference.NAME)) - { - if (MRole.getDefault().isShowPreference() && !m_mField.isEncrypted() && !m_mField.isEncryptedColumn()) - ValuePreference.start (m_mField, getValue(), getDisplay()); - return; - } - else if (e.getActionCommand().equals(FieldRecordInfo.CHANGE_LOG_COMMAND)) - { - FieldRecordInfo.start(m_mField); - return; - } - - // Combo Selection - else if (e.getSource() == m_combo) - { - Object value = getValue(); - Object o = m_combo.getSelectedItem(); - if (o != null) - { - String s = o.toString(); - // don't allow selection of inactive - if (s.startsWith(MLookup.INACTIVE_S) && s.endsWith(MLookup.INACTIVE_E)) - { - if (log.isLoggable(Level.INFO)) log.info(m_columnName + " - selection inactive set to NULL"); - value = null; - } - } - actionCombo (value); // data binding - } - // Button pressed - else if (e.getSource() == m_button) - actionButton (""); - // Text entered - else if (e.getSource() == m_text) - actionText(); - - // Popup Menu - else if (e.getSource() == mZoom) - actionZoom(m_combo.getSelectedItem()); - else if (e.getSource() == mRefresh) - actionRefresh(); - else if (e.getSource() == mBPartnerNew) - actionBPartner(true); - else if (e.getSource() == mBPartnerUpd) - actionBPartner(false); - else if (e.getSource() == m_location) - actionLocation(); - else if (e.getSource() == m_buttonSL) // IDEMPIERE 90 - actionShortList(); - } // actionPerformed - - /** - * Action Listener Interface - * @param listener listener - */ - public void addActionListener(ActionListener listener) - { - m_combo.addActionListener(listener); - m_text.addActionListener(listener); - } // addActionListener - - /** - * Action - Combo. - *
    - * == dataBinding == inform of new value - *
    -	 *  VLookup.actionCombo
    -	 *      GridController.vetoableChange
    -	 *          MTable.setValueAt
    -	 *              MField.setValue
    -	 *                  VLookup.setValue
    -	 *          MTab.dataStatusChanged
    -	 *  
    - * @param value new value - */ - private void actionCombo (Object value) - { - if (log.isLoggable(Level.FINE)) log.fine("Value=" + value); - try - { - // -> GridController.vetoableChange - fireVetoableChange (m_columnName, null, value); - } - catch (PropertyVetoException pve) - { - log.log(Level.SEVERE, m_columnName, pve); - } - // is the value updated ? - boolean updated = false; - - Object updatedValue = value; - - if (updatedValue instanceof Object[] && ((Object[])updatedValue).length > 0) - { - updatedValue = ((Object[])updatedValue)[0]; - } - - if (updatedValue == null && m_value == null) - updated = true; - else if (updatedValue != null && value.equals(m_value)) - updated = true; - if (!updated) - { - // happens if VLookup is used outside of APanel/GridController (no property listener) - if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - Value explicitly set - new=" + updatedValue + ", old=" + m_value); - - // phib: the following check causes the update to fail on jre > 1.6.0_13 - // commenting out as it does not appear to be necessary - //if (getListeners(PropertyChangeListener.class).length <= 0) - setValue(updatedValue); - } - } // actionCombo - - - /** - * Action - Button. - * - Call Info - * @param queryValue initial query value - */ - private void actionButton (String queryValue) - { - m_button.setEnabled(false); // disable double click - if (m_lookup == null) - return; // leave button disabled - m_text.requestFocus(); // closes other editors - Frame frame = AEnv.getFrame(this); - - /** - * Three return options: - * - Value Selected & OK pressed => store result => result has value - * - Cancel pressed => store null => result == null && cancelled - * - Window closed -> ignore => result == null && !cancalled - */ - - Object result[] = null; - boolean cancelled = false; - boolean multipleSelection = false; - // - // Zoom / Validation - String whereClause = getWhereClause(); - // - if (log.isLoggable(Level.FINE)) log.fine(m_lookup.getColumnName() - + ", Zoom=" + m_lookup.getZoom() - + " (" + whereClause + ")"); - // - Info info = null; - - // Reset - resetTabInfo(); - if (m_tableName == null) // sets table name & key column - getDirectAccessSQL("*"); - - // Replace Value with name if no value exists - if (queryValue.length() == 0 && m_text.getText().length() > 0) - queryValue = m_text.getText(); - - info = InfoManager.create(frame, true, m_lookup, m_mField, m_tableName, m_keyColumnName, - queryValue, multipleSelection, whereClause); - - info.setVisible(true); - cancelled = info.isCancelled(); - result = info.getSelectedKeys(); - - // Result - if (result != null && result.length > 0) - { - if (log.isLoggable(Level.CONFIG)) log.config(m_columnName + " - Result = " + result.toString() + " (" + result.getClass().getName() + ")"); - // make sure that value is in cache - m_lookup.getDirect(result[0], false, true); - if (info.isResetValue()) - actionCombo (null); - // juddm added logic for multi-select handling - if (result.length > 1) - actionCombo (result); // data binding - else - actionCombo (result[0]); - - } - else if (cancelled) - { - if (log.isLoggable(Level.CONFIG)) log.config(m_columnName + " - Result = null (cancelled)"); - actionCombo(null); - } - else - { - if (log.isLoggable(Level.CONFIG)) log.config(m_columnName + " - Result = null (not cancelled)"); - setValue(m_value); // to re-display value - } - // - m_button.setEnabled(true); - m_text.requestFocus(); - } // actionButton - - /** - * Get Where Clause - * @return where clause or "" - */ - private String getWhereClause() - { - String whereClause = ""; - if (m_lookup == null) - return ""; - if (m_lookup.getZoomQuery() != null) - whereClause = m_lookup.getZoomQuery().getWhereClause(); - String validation = m_lookup.getValidation(); - if (validation == null) - validation = ""; - if (whereClause.length() == 0) - whereClause = validation; - else if (validation.length() > 0) - whereClause += " AND " + validation; - // log.finest("ZoomQuery=" + (m_lookup.getZoomQuery()==null ? "" : m_lookup.getZoomQuery().getWhereClause()) - // + ", Validation=" + m_lookup.getValidation()); - if (whereClause.indexOf('@') != -1) - { - String validated = Env.parseContext(Env.getCtx(), m_lookup.getWindowNo(), whereClause, false); - if (validated.length() == 0) - log.severe(m_columnName + " - Cannot Parse=" + whereClause); - else - { - if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - Parsed: " + validated); - return validated; - } - } - return whereClause; - } // getWhereClause - - /** - * - * - * - */ - /*private String getExtraWhereClause (String text) - { - StringBuilder sql = new StringBuilder(); - m_tableName = m_columnName.substring(0, m_columnName.length()-3); - m_keyColumnName = m_columnName; - // - if (m_columnName.equals("M_Product_ID")) - { - // Reset - resetTabInfo(); - // - sql.append(" AND (UPPER(p.Value) LIKE ") - .append(DB.TO_STRING(text)) - .append(" OR UPPER(p.Name) LIKE ").append(DB.TO_STRING(text)) - .append(" OR p.SKU LIKE ").append(DB.TO_STRING(text)).append(")"); - //.append(" OR p.SKU LIKE ").append(DB.TO_STRING(text)) - //.append(" OR p.UPC LIKE ").append(DB.TO_STRING(text)).append(")"); - } - // Predefined - - if (sql.length() > 0) - { - String wc = getWhereClause(); - if (wc != null && wc.length() > 0) - sql.append(" AND ").append(wc); - sql.append(" AND IsActive='Y'"); - // *** - if (log.isLoggable(Level.FINEST)) log.finest(m_columnName + " (predefined) " + sql.toString()); - return MRole.getDefault().addAccessSQL(sql.toString(), - m_tableName, MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - } - - return sql.toString(); - }*/ - /** - * Check, if data returns unique entry, otherwise involve Info via Button - */ - private void actionText() - { - String text = m_text.getText(); - // Nothing entered, just pressing enter again => ignore - teo_sarca BF [ 1834399 ] - if (text != null && text.length() > 0 && text.equals(m_lastDisplay)) - { - log.finest("Nothing entered [SKIP]"); - return; - } - // Nothing entered - if (text == null || text.length() == 0 || text.equals("%")) - { - actionButton(text); - return; - } - text = text.toUpperCase(); - if (log.isLoggable(Level.CONFIG)) log.config(m_columnName + " - " + text); - - // Exact first - PreparedStatement pstmt = null; - ResultSet rs = null; - String finalSQL = Msg.parseTranslation(Env.getCtx(), getDirectAccessSQL(text)); - int id = -3; - try - { - pstmt = DB.prepareStatement(finalSQL, null); - rs = pstmt.executeQuery(); - if (rs.next()) - { - id = rs.getInt(1); // first - if (rs.next()) - id = -1; // only if unique - } - } - catch (Exception e) - { - log.log(Level.SEVERE, finalSQL, e); - id = -2; - } - finally { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - // Try like - if (id == -3 && !text.endsWith("%")) - { - text += "%"; - finalSQL = Msg.parseTranslation(Env.getCtx(), getDirectAccessSQL(text)); - try - { - pstmt = DB.prepareStatement(finalSQL, null); - rs = pstmt.executeQuery(); - if (rs.next()) - { - id = rs.getInt(1); // first - if (rs.next()) - id = -1; // only if unique - } - } - catch (Exception e) - { - log.log(Level.SEVERE, finalSQL, e); - id = -2; - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - } - - // No (unique) result - if (id <= 0) - { - if (id == -3) { - if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - Not Found - " + finalSQL); - } else { - if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - Not Unique - " + finalSQL); - } - m_value = null; // force re-display - actionButton(m_text.getText()); - return; - } - if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - Unique ID=" + id); - m_value = null; // forces re-display if value is unchanged but text updated and still unique - resetTabInfo(); - actionCombo (Integer.valueOf(id)); // data binding - // - // Don't request focus if value was solved - teo_sarca [ 2552901 ] - if (id <= 0) - { - m_text.requestFocus(); - } - } // actionText - - - private String m_tableName = null; - private String m_keyColumnName = null; - - /** - * Generate Access SQL for Search. - * The SQL returns the ID of the value entered - * Also sets m_tableName and m_keyColumnName - * @param text uppercase text for LIKE comparison - * @return sql or "" - * Example - * SELECT C_Payment_ID FROM C_Payment WHERE UPPER(DocumentNo) LIKE x OR ... - */ - private String getDirectAccessSQL (String text) - { - StringBuffer sql = new StringBuffer(); - m_tableName = MQuery.getZoomTableName(m_columnName); - m_keyColumnName = MQuery.getZoomColumnName(m_columnName); - // - if (m_columnName.equals("M_Product_ID")) - { - // Reset - resetTabInfo(); - // - sql.append("SELECT M_Product_ID FROM M_Product WHERE (UPPER(Value) LIKE ") - .append(DB.TO_STRING(text)) - .append(" OR UPPER(Name) LIKE ").append(DB.TO_STRING(text)) - .append(" OR SKU LIKE ").append(DB.TO_STRING(text)) - .append(" OR UPC LIKE ").append(DB.TO_STRING(text)).append(")"); - } - else if (m_columnName.equals("C_BPartner_ID")) - { - sql.append("SELECT C_BPartner_ID FROM C_BPartner WHERE (UPPER(Value) LIKE ") - .append(DB.TO_STRING(text)) - .append(" OR UPPER(Name) LIKE ").append(DB.TO_STRING(text)).append(")"); - } - else if (m_columnName.equals("C_Order_ID")) - { - sql.append("SELECT C_Order_ID FROM C_Order WHERE UPPER(DocumentNo) LIKE ") - .append(DB.TO_STRING(text)); - } - else if (m_columnName.equals("C_Invoice_ID")) - { - sql.append("SELECT C_Invoice_ID FROM C_Invoice WHERE UPPER(DocumentNo) LIKE ") - .append(DB.TO_STRING(text)); - } - else if (m_columnName.equals("M_InOut_ID")) - { - sql.append("SELECT M_InOut_ID FROM M_InOut WHERE UPPER(DocumentNo) LIKE ") - .append(DB.TO_STRING(text)); - } - else if (m_columnName.equals("C_Payment_ID")) - { - sql.append("SELECT C_Payment_ID FROM C_Payment WHERE UPPER(DocumentNo) LIKE ") - .append(DB.TO_STRING(text)); - } - else if (m_columnName.equals("GL_JournalBatch_ID")) - { - sql.append("SELECT GL_JournalBatch_ID FROM GL_JournalBatch WHERE UPPER(DocumentNo) LIKE ") - .append(DB.TO_STRING(text)); - } - else if (m_columnName.equals("SalesRep_ID")) - { - sql.append("SELECT AD_User_ID FROM AD_User WHERE UPPER(Name) LIKE ") - .append(DB.TO_STRING(text)); - m_tableName = "AD_User"; - m_keyColumnName = "AD_User_ID"; - } - // Predefined - if (sql.length() > 0) - { - String wc = getWhereClause(); - if (wc != null && wc.length() > 0) - sql.append(" AND ").append(wc); - sql.append(" AND IsActive='Y'"); - // *** - if (log.isLoggable(Level.FINEST)) log.finest(m_columnName + " (predefined) " + sql.toString()); - return MRole.getDefault().addAccessSQL(sql.toString(), - m_tableName, MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - } - - // Check if it is a Table Reference - if (m_lookup != null && m_lookup instanceof MLookup) - { - int AD_Reference_ID = ((MLookup)m_lookup).getAD_Reference_Value_ID(); - if (AD_Reference_ID != 0) - { - String query = "SELECT kc.ColumnName, dc.ColumnName, t.TableName " - + "FROM AD_Ref_Table rt" - + " INNER JOIN AD_Column kc ON (rt.AD_Key=kc.AD_Column_ID)" - + " INNER JOIN AD_Column dc ON (rt.AD_Display=dc.AD_Column_ID)" - + " INNER JOIN AD_Table t ON (rt.AD_Table_ID=t.AD_Table_ID) " - + "WHERE rt.AD_Reference_ID=?"; - String displayColumnName = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(query, null); - pstmt.setInt(1, AD_Reference_ID); - rs = pstmt.executeQuery(); - if (rs.next()) - { - m_keyColumnName = rs.getString(1); - displayColumnName = rs.getString(2); - m_tableName = rs.getString(3); - } - } - catch (Exception e) - { - log.log(Level.SEVERE, query, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - if (displayColumnName != null) - { - sql = new StringBuffer(); - sql.append("SELECT ").append(m_keyColumnName) - .append(" FROM ").append(m_tableName) - .append(" WHERE UPPER(").append(displayColumnName) - .append(") LIKE ").append(DB.TO_STRING(text)) - .append(" AND IsActive='Y'"); - String wc = getWhereClause(); - if (wc != null && wc.length() > 0) - sql.append(" AND ").append(wc); - // *** - if (log.isLoggable(Level.FINEST)) log.finest(m_columnName + " (Table) " + sql.toString()); - return MRole.getDefault().addAccessSQL(sql.toString(), - m_tableName, MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - } - } // Table Reference - } // MLookup - - /** Check Well Known Columns of Table - assumes TableDir **/ - String query = "SELECT t.TableName, c.ColumnName " - + "FROM AD_Column c " - + " INNER JOIN AD_Table t ON (c.AD_Table_ID=t.AD_Table_ID AND t.IsView='N') " - + "WHERE (c.ColumnName IN ('DocumentNo', 'Value', 'Name') OR c.IsIdentifier='Y')" - + " AND c.AD_Reference_ID IN (10,14)" - + " AND EXISTS (SELECT * FROM AD_Column cc WHERE cc.AD_Table_ID=t.AD_Table_ID" - + " AND cc.IsKey='Y' AND cc.ColumnName=?)"; - sql = new StringBuffer(); - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(query, null); - pstmt.setString(1, m_keyColumnName); - rs = pstmt.executeQuery(); - while (rs.next()) - { - if (sql.length() != 0) - sql.append(" OR "); - m_tableName = rs.getString(1); - sql.append("UPPER(").append(rs.getString(2)).append(") LIKE ").append(DB.TO_STRING(text)); - } - } - catch (SQLException ex) - { - log.log(Level.SEVERE, query, ex); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - // - if (sql.length() == 0) - { - log.log(Level.SEVERE, m_columnName + " (TableDir) - no standard/identifier columns"); - return ""; - } - // - StringBuffer retValue = new StringBuffer ("SELECT ") - .append(m_columnName).append(" FROM ").append(m_tableName) - .append(" WHERE (").append(sql).append(")") - .append(" AND IsActive='Y'"); - String wc = getWhereClause(); - if (wc != null && wc.length() > 0) - retValue.append(" AND ").append(wc); - // *** - if (log.isLoggable(Level.FINEST)) log.finest(m_columnName + " (TableDir) " + sql.toString()); - return MRole.getDefault().addAccessSQL(retValue.toString(), - m_tableName, MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - } // getDirectAccessSQL - - - /** - * Action - Special BPartner Screen - * @param newRecord true if new record should be created - */ - private void actionBPartner (boolean newRecord) - { - VBPartner vbp = new VBPartner (AEnv.getFrame(this), m_lookup.getWindowNo()); - int BPartner_ID = 0; - // if update, get current value - if (!newRecord) - { - if (m_value instanceof Integer) - BPartner_ID = ((Integer)m_value).intValue(); - else if (m_value != null) - BPartner_ID = Integer.parseInt(m_value.toString()); - } - - vbp.loadBPartner (BPartner_ID); - vbp.setVisible(true); - // get result - int result = vbp.getC_BPartner_ID(); - if (result == 0 // 0 = not saved - && result == BPartner_ID) // the same - return; - // Maybe new BPartner - put in cache - m_lookup.getDirect(Integer.valueOf(result), false, true); - - actionCombo (Integer.valueOf(result)); // data binding - } // actionBPartner - - private void actionLocation () - { - int BPLocation_ID = 0; - if (m_value instanceof Integer) - BPLocation_ID = ((Integer)m_value).intValue(); - else if (m_value != null) - BPLocation_ID = Integer.parseInt(m_value.toString()); - - if (BPLocation_ID>0) - { - MBPartnerLocation bpl = new MBPartnerLocation(Env.getCtx(), BPLocation_ID, null); - MLocation location= new MLocation(Env.getCtx(), bpl.getC_Location_ID(), null); - - VLocationDialog ld = new VLocationDialog(AEnv.getFrame(this), Msg.getMsg(Env.getCtx(), "Location"), location); - ld.setVisible(true); - } - } // actionBPartner - - /** - * Action - Zoom - * @param selectedItem item - */ - private void actionZoom (Object selectedItem) - { - if (m_lookup == null) - return; - // - MQuery zoomQuery = m_lookup.getZoomQuery(); - Object value = getValue(); - if (value == null) - value = selectedItem; - // still null means the field is empty or not selected item - if (value == null) - value = -1; - // If not already exist or exact value - if (zoomQuery == null || value != null) - { - zoomQuery = new MQuery(); // ColumnName might be changed in MTab.validateQuery - String keyTableName = null; - String keyColumnName = null; - // Check if it is a Table Reference - if (m_lookup != null && m_lookup instanceof MLookup) - { - int AD_Reference_ID = ((MLookup)m_lookup).getAD_Reference_Value_ID(); - if (DisplayType.List == m_lookup.getDisplayType()) { - keyColumnName = "AD_Ref_List_ID"; - keyTableName = "AD_Ref_List"; - value = DB.getSQLValue(null, "SELECT AD_Ref_List_ID FROM AD_Ref_List WHERE AD_Reference_ID=? AND Value=?", AD_Reference_ID, value); - } else { - if (AD_Reference_ID != 0) - { - String query = "SELECT kc.ColumnName, kt.TableName" - + " FROM AD_Ref_Table rt" - + " INNER JOIN AD_Column kc ON (rt.AD_Key=kc.AD_Column_ID)" - + " INNER JOIN AD_Table kt ON (rt.AD_Table_ID=kt.AD_Table_ID)" - + " WHERE rt.AD_Reference_ID=?"; - - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(query, null); - pstmt.setInt(1, AD_Reference_ID); - rs = pstmt.executeQuery(); - if (rs.next()) - { - keyColumnName = rs.getString(1); - keyTableName = rs.getString(2); - } - } - catch (Exception e) - { - log.log(Level.SEVERE, query, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - } // Table Reference - - } - } // MLookup - - if(keyColumnName != null && keyColumnName.length() !=0) - { - zoomQuery.addRestriction(keyColumnName, MQuery.EQUAL, value); - zoomQuery.setZoomColumnName(keyColumnName); - zoomQuery.setZoomTableName(keyTableName); - } - else - { - zoomQuery.addRestriction(m_columnName, MQuery.EQUAL, value); - if (m_columnName.indexOf(".") > 0) - { - zoomQuery.setZoomColumnName(m_columnName.substring(m_columnName.indexOf(".")+1)); - zoomQuery.setZoomTableName(m_columnName.substring(0, m_columnName.indexOf("."))); - } - else - { - zoomQuery.setZoomColumnName(m_columnName); - //remove _ID to get table name - zoomQuery.setZoomTableName(m_columnName.substring(0, m_columnName.length() - 3)); - } - } - zoomQuery.setZoomValue(value); - - zoomQuery.setRecordCount(1); // guess - } - - int AD_Window_ID = m_lookup.getZoom(zoomQuery); - - int zoomId = MZoomCondition.findZoomWindowByWindowId(AD_Window_ID, zoomQuery); - if (zoomId > 0) AD_Window_ID = zoomId; - - // - if (log.isLoggable(Level.INFO)) log.info(m_columnName + " - AD_Window_ID=" + AD_Window_ID - + " - Query=" + zoomQuery + " - Value=" + value); - // - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - // - AWindow frame = new AWindow(null); - if (!frame.initWindow(AD_Window_ID, zoomQuery)) - { - setCursor(Cursor.getDefaultCursor()); - ValueNamePair pp = CLogger.retrieveError(); - String msg = pp==null ? "AccessTableNoView" : pp.getValue(); - ADialog.error(m_lookup.getWindowNo(), this, msg, pp==null ? "" : pp.getName()); - } - else - { - AEnv.addToWindowManager(frame); - if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED)) - { - AEnv.showMaximized(frame); - } - else - { - AEnv.showCenterScreen(frame); - } - } - // async window - not able to get feedback - frame = null; - // - setCursor(Cursor.getDefaultCursor()); - } // actionZoom - - /** - * Action - Refresh - */ - private void actionRefresh() - { - if (m_lookup == null) - return; - // - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - // - Object obj = m_combo.getSelectedItem(); - if (log.isLoggable(Level.INFO)) log.info(m_columnName + " #" + m_lookup.getSize() + ", Selected=" + obj); - //no need to refresh readonly lookup, just remove direct cache - if (!isReadWrite()) - { - m_settingValue = true; // disable actions - m_lookup.removeAllElements(); - m_lastDisplay = m_lookup.getDisplay(m_value); - m_text.setText(m_lastDisplay); - m_text.setCaretPosition(0); - m_settingValue = false; - } - else - { - m_lookup.refresh(); - m_lookup.fillComboBox(isMandatory(), true, true, false, isComboShortList()); // IDEMPIERE 90 - m_combo.setSelectedItem(obj); - //m_combo.revalidate(); - } - // - setCursor(Cursor.getDefaultCursor()); - if (log.isLoggable(Level.INFO)) log.info(m_columnName + " #" + m_lookup.getSize() + ", Selected=" + m_combo.getSelectedItem()); - } // actionRefresh - - - /************************************************************************** - * Focus Listener for ComboBoxes with missing Validation or invalid entries - * - Requery listener for updated list - * @param e FocusEvent - */ - public void focusGained (FocusEvent e) - { - if (m_combo == null || m_combo.getEditor() == null) - return; - if ((e.getSource() != m_combo && e.getSource() != m_combo.getEditor().getEditorComponent()) - || e.isTemporary() || m_haveFocus || m_lookup == null) - return; - - //avoid repeated query - if (m_lookup.isValidated() && m_lookup.isLoaded()) - { - m_haveFocus = true; - return; - } - // - m_haveFocus = true; // prevents calling focus gained twice - m_settingFocus = true; // prevents actionPerformed - // - Object obj = m_lookup.getSelectedItem(); - if (log.isLoggable(Level.CONFIG)) log.config(m_columnName - + " - Start Count=" + m_combo.getItemCount() + ", Selected=" + obj); - // log.fine( "VLookupHash=" + this.hashCode()); - boolean popupVisible = m_combo.isPopupVisible(); - m_lookup.fillComboBox(isMandatory(), true, true, false, isComboShortList()); // only validated & active + IDEMPIERE 90 - if (popupVisible) - { - //refresh - m_combo.hidePopup(); - m_combo.showPopup(); - } - if (log.isLoggable(Level.CONFIG)) log.config(m_columnName - + " - Update Count=" + m_combo.getItemCount() + ", Selected=" + m_lookup.getSelectedItem()); - m_lookup.setSelectedItem(obj); - if (log.isLoggable(Level.CONFIG)) log.config(m_columnName - + " - Selected Count=" + m_combo.getItemCount() + ", Selected=" + m_lookup.getSelectedItem()); - // - m_settingFocus = false; - } // focusGained - - /** - * Reset Selection List - * @param e FocusEvent - */ - public void focusLost(FocusEvent e) - { - if (e.isTemporary() - || m_lookup == null - || !m_buttonSL.isEnabled() // IDEMPIERE 90 - || !m_button.isEnabled() ) // set by actionButton - return; - // Text Lost focus - if (e.getSource() == m_text) - { - String text = m_text.getText(); - if (log.isLoggable(Level.CONFIG)) log.config(m_columnName + " (Text) " + m_columnName + " = " + m_value + " - " + text); - m_haveFocus = false; - // Skip if empty - if ((m_value == null - && m_text.getText().length() == 0)) - return; - if (m_lastDisplay.equals(text)) - return; - // - actionText(); // re-display - return; - } - // Combo lost focus - if (e.getSource() != m_combo && e.getSource() != m_combo.getEditor().getEditorComponent()) - return; - if (m_lookup.isValidated() && !m_lookup.hasInactive()) - { - m_haveFocus = false; - return; - } - // - m_settingFocus = true; // prevents actionPerformed - // - if (log.isLoggable(Level.CONFIG)) log.config(m_columnName + " = " + m_combo.getSelectedItem()); - Object obj = m_combo.getSelectedItem(); - /* - // set original model - if (!m_lookup.isValidated()) - m_lookup.fillComboBox(true); // previous selection - */ - // Set value - if (obj != null) - { - m_combo.setSelectedItem(obj); - // original model may not have item - if (!m_combo.getSelectedItem().equals(obj)) - { - if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - added to combo - " + obj); - m_combo.addItem(obj); - m_combo.setSelectedItem(obj); - } - } - // actionCombo(getValue()); - m_settingFocus = false; - m_haveFocus = false; // can gain focus again - } // focusLost - - /** - * Set ToolTip - * @param text tool tip text - */ - public void setToolTipText(String text) - { - super.setToolTipText(text); - m_button.setToolTipText(text); - m_text.setToolTipText(text); - m_combo.setToolTipText(text); - } // setToolTipText - - /** - * Reset Env.TAB_INFO context variables - * @param columnName - */ - private void resetTabInfo() - { - if (this.m_lookup == null) - return; - String columnName = m_columnName; - // - // TODO : hardcoded - final String[] infoNames; - if ("M_Product_ID".equals(columnName)) - { - infoNames = new String[]{"M_Product_ID","M_AttributeSetInstance_ID","M_Locator_ID","M_Lookup_ID"}; - } - else - { - infoNames = new String[]{}; - } - for (String name : infoNames) - { - Env.setContext(Env.getCtx(), m_lookup.getWindowNo(), Env.TAB_INFO, name, null); - } - } - - /** - * Refresh Query - * @return count - */ - public int refresh() - { - if (m_lookup == null) - return -1; - - //no need to refresh readonly lookup, just remove direct cache - if (!isReadWrite()) { - m_lookup.removeAllElements(); - return 0; - } - - return m_lookup.refresh(); - } // refresh - - /** - * Use by vcelleditor to indicate editing is off and don't invoke databinding - * @param stopediting - */ - public void setStopEditing(boolean stopediting) { - m_stopediting = stopediting; - } - - // IDEMPIERE 90 - private void actionShortList () - { - if (onlyShortListItems) - { - onlyShortListItems = false; - m_lookup.setShortList(true); - refresh(); - m_lookup.fillComboBox(isMandatory(), true, true, false, isComboShortList()); - m_buttonSL.setIcon(Env.getImageIcon("LockX16.gif")); - m_buttonSL.setToolTipText(Msg.getMsg(Env.getCtx(), "ShortListOnlyShortListItems")); - }else{ - onlyShortListItems = true; - m_lookup.setShortList(false); - m_buttonSL.setIcon(Env.getImageIcon("Lock16.gif")); - m_buttonSL.setToolTipText(Msg.getMsg(Env.getCtx(), "ShortListAllItems")); - } - - actionRefresh(); - } // actionShortList - - public void setComboShortList (boolean shortList) - { - m_combo.setShortListSearch(shortList); - } // setComboShortList - - public boolean isComboShortList() - { - return m_combo.isShortListSearch(); - } // isComboShortList - // IDEMPIERE 90 - -} // VLookup \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VManagedEditor.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VManagedEditor.java deleted file mode 100644 index 53b6308ca6..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VManagedEditor.java +++ /dev/null @@ -1,37 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2008 Low Heng Sin All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid.ed; - -/** - * Interface for editor with a commit and rollback lifecycle. - * @author Low Heng Sin - * - */ -public interface VManagedEditor { - /** - * Commit pending changes - */ - public void commitChanges(); - - /** - * Rollback pending changes - */ - public void rollbackChanges(); - - /** - * Are there any pending changes - * @return boolean - */ - public boolean isDirty(); -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VMemo.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VMemo.java deleted file mode 100644 index 4b62803468..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VMemo.java +++ /dev/null @@ -1,336 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Component; -import java.awt.Container; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.util.logging.Level; - -import javax.swing.InputVerifier; -import javax.swing.JComponent; -import javax.swing.JPopupMenu; -import javax.swing.LookAndFeel; -import javax.swing.SwingUtilities; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.AEnv; -import org.compiere.apps.ScriptEditor; -import org.compiere.model.GridField; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CTextArea; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Text Control (JTextArea embedded in JScrollPane) - * - * @author Jorg Janke - * @version $Id: VMemo.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public class VMemo extends CTextArea - implements VEditor, KeyListener, FocusListener, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -1544247709358693141L; - - /** - * Mouse Listener - */ - final class VMemo_mouseAdapter extends MouseAdapter - { - /** - * Constructor - * @param adaptee - */ - VMemo_mouseAdapter(VMemo adaptee) - { - this.adaptee = adaptee; - } // VMemo_mouseAdapter - - private VMemo adaptee; - - /** - * Mouse Listener - * @param e - */ - public void mouseClicked(MouseEvent e) - { - // popup menu - if (SwingUtilities.isRightMouseButton(e)) - adaptee.popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - } // mouse Clicked - - - - } // VMemo_mouseAdapter - - - /** - * IDE Baan Constructor - */ - public VMemo() - { - this("", false, false, true, 60, 4000); - } // VMemo - - /** - * Standard Constructor - * @param columnName - * @param mandatory - * @param isReadOnly - * @param isUpdateable - * @param displayLength - * @param fieldLength - */ - public VMemo (String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable, - int displayLength, int fieldLength) - { - super (fieldLength/80, 50); - super.setName(columnName); - LookAndFeel.installBorder(this, "TextField.border"); - this.addFocusListener(this); // to activate editor - - // Create Editor - setColumns(displayLength>VString.MAXDISPLAY_LENGTH ? VString.MAXDISPLAY_LENGTH : displayLength); // 46 - setForeground(AdempierePLAF.getTextColor_Normal()); - setBackground(AdempierePLAF.getFieldBackground_Normal()); - - setLineWrap(true); - setWrapStyleWord(true); - addFocusListener(this); - setInputVerifier(new CInputVerifier()); //Must be set AFTER addFocusListener in order to work - setMandatory(mandatory); - m_columnName = columnName; - m_fieldLength = fieldLength; - - if (isReadOnly || !isUpdateable) - setReadWrite(false); - addKeyListener(this); - - // Popup - addMouseListener(new VMemo_mouseAdapter(this)); - if (columnName.equals("Script")) - menuEditor = new CMenuItem(Msg.getMsg(Env.getCtx(), "Script"), Env.getImageIcon("Script16.gif")); - else - menuEditor = new CMenuItem(Msg.getMsg(Env.getCtx(), "Editor"), Env.getImageIcon("Editor16.gif")); - menuEditor.addActionListener(this); - popupMenu.add(menuEditor); - } // VMemo - - /** - * Dispose - */ - public void dispose() - { - } // dispose - - JPopupMenu popupMenu = new JPopupMenu(); - private CMenuItem menuEditor; - private int m_fieldLength; - - private String m_columnName; - private String m_oldText = ""; - private volatile boolean m_setting = false; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VMemo.class); - - /** - * Set Editor to value - * @param value - */ - public void setValue(Object value) - { - super.setValue(value); - if (m_setting) - return; - // Always position Top - setCaretPosition(0); - } // setValue - - /** - * Property Change Listener - * @param evt - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * ActionListener - * @param e - */ - public void actionPerformed(ActionEvent e) - { - if (e.getSource() == menuEditor) - { - menuEditor.setEnabled(false); - String s = null; - if (m_columnName.equals("Script") || m_columnName.endsWith("_Script")) - s = ScriptEditor.start ( - AEnv.getFrame(this.getParent()), - Msg.translate(Env.getCtx(), m_columnName), getText(), isEditable(), - findWindowNo()); - else - s = Editor.startEditor (this, Msg.translate(Env.getCtx(), m_columnName), - getText(), isEditable(), m_fieldLength); - menuEditor.setEnabled(true); - setValue(s); - try - { - fireVetoableChange(m_columnName, null, getText()); - m_oldText = getText(); - } - catch (PropertyVetoException pve) {} - } - } // actionPerformed - - private int findWindowNo() { - Container c = this.getParent(); - return c != null ? AEnv.getWindowNo(c) : 0; - } - - /** - * Action Listener Interface - NOP - * @param listener - */ - public void addActionListener(ActionListener listener) - { - } // addActionListener - - /************************************************************************** - * Key Listener Interface - * @param e - */ - public void keyTyped(KeyEvent e) {} - public void keyPressed(KeyEvent e) {} - - /** - * Escape - Restore old Text. - * Indicate Change - * @param e - */ - public void keyReleased(KeyEvent e) - { - // ESC - if (e.getKeyCode() == KeyEvent.VK_ESCAPE && !getText().equals(m_oldText)) - { - log.fine( "VMemo.keyReleased - ESC"); - setText(m_oldText); - return; - } - } // keyReleased - - /** - * Focus Gained - Save for Escape - * @param e - */ - public void focusGained (FocusEvent e) - { - if (log.isLoggable(Level.CONFIG)) log.config(e.paramString()); - if (e.getSource() instanceof VMemo) - requestFocus(); - else - m_oldText = getText(); - } // focusGained - - /** - * Data Binding to MTable (via GridController) - * @param e - */ - public void focusLost (FocusEvent e) - { - m_setting = true; - try - { - fireVetoableChange(m_columnName, m_oldText, getText()); - } - catch (PropertyVetoException pve) {} - m_setting = false; - } // focusLost - - /*************************************************************************/ - - // Field for Value Preference - private GridField m_mField = null; - /** - * Set Field/WindowNo for ValuePreference (NOP) - * @param mField - */ - public void setField (org.compiere.model.GridField mField) - { - m_mField = mField; - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return this; - } // getFocusableComponent - - -private class CInputVerifier extends InputVerifier { - - public boolean verify(JComponent input) { - - - //NOTE: We return true no matter what since the InputVerifier is only introduced to fireVetoableChange in due time - if (getText() == null && m_oldText == null) - return true; - else if (getText().equals(m_oldText)) - return true; - // - try - { - String text = getText(); - fireVetoableChange(m_columnName, null, text); - m_oldText = text; - return true; - } - catch (PropertyVetoException pve) {} - return true; - - } // verify - - } // CInputVerifier - - - - -} // VMemo diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VNumber.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VNumber.java deleted file mode 100644 index 713871d31d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VNumber.java +++ /dev/null @@ -1,857 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.AWTEvent; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.EventQueue; -import java.awt.Frame; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.DecimalFormat; -import java.text.ParseException; -import java.util.logging.Level; - -import javax.swing.JComponent; -import javax.swing.JPopupMenu; -import javax.swing.JTextField; -import javax.swing.LookAndFeel; -import javax.swing.SwingUtilities; -import javax.swing.text.Document; - -import org.compiere.apps.AEnv; -import org.compiere.apps.FieldRecordInfo; -import org.compiere.model.GridField; -import org.compiere.model.MRole; -import org.compiere.swing.CButton; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; - -/** - * Number Control - * - * @author Jorg Janke - * @version $Id: VNumber.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *
  • BF [ 1739516 ] Warning on numeric field with range set - *
  • BF [ 1834393 ] VNumber.setFocusable not working - */ -public final class VNumber extends JComponent - implements VEditor, ActionListener, KeyListener, FocusListener, VManagedEditor -{ - /** - * - */ - private static final long serialVersionUID = -1826388236069159130L; - - /** Number of Columns (12) */ - public final static int SIZE = 12; - /** Automatically pop up calculator */ - public final static boolean AUTO_POPUP = false; - - JPopupMenu popupMenu = new JPopupMenu(); - - /****************************************************************************** - * Mouse Listener - */ - final class VNumber_mouseAdapter extends MouseAdapter - { - /** - * Constructor - * @param adaptee adaptee - */ - VNumber_mouseAdapter(VNumber adaptee) - { - m_adaptee = adaptee; - } // VNumber_mouseAdapter - - private VNumber m_adaptee; - - /** - * Mouse Listener - * @param e event - */ - public void mouseClicked(MouseEvent e) - { - // popup menu - if (SwingUtilities.isRightMouseButton(e)) - m_adaptee.popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - } // mouseClicked - - } - - /** - * IDE Bean Constructor - */ - public VNumber() - { - this("Number", false, false, true, DisplayType.Number, "Number"); - } // VNumber - - /** - * Create right aligned Number field. - * no popup, if WindowNo == 0 (for IDs) - * @param columnName column name - * @param mandatory mandatory - * @param isReadOnly read only - * @param isUpdateable updateable - * @param displayType display type - * @param title title - */ - public VNumber(String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable, - int displayType, String title) - { - super(); - super.setName(columnName); - m_columnName = columnName; - m_title = title; - setDisplayType(displayType); - // - LookAndFeel.installBorder(this, "TextField.border"); - this.setLayout(new BorderLayout()); - - // *** Text *** - m_text.setBorder(null); - m_text.setHorizontalAlignment(JTextField.TRAILING); - m_text.addKeyListener(this); - m_text.addFocusListener(this); - // Background - setMandatory(mandatory); - this.add(m_text, BorderLayout.CENTER); - - // *** Button *** - m_button.setIcon(Env.getImageIcon("Calculator10.gif")); - m_button.setMargin(new Insets(0, 0, 0, 0)); - m_button.setFocusable(false); - m_button.addActionListener(this); - this.add (m_button, BorderLayout.EAST); - - // Size - setColumns(SIZE, 0); - // ReadWrite - if (isReadOnly || !isUpdateable) - setReadWrite(false); - else - setReadWrite(true); - - m_text.addMouseListener(new VNumber_mouseAdapter(this)); - } // VNumber - - /** - * Dispose - */ - public void dispose() - { - m_text = null; - m_button = null; - m_mField = null; - } // dispose - - /** - * Set Document - * @param doc document - */ - protected void setDocument(Document doc) - { - m_text.setDocument(doc); - } // getDocument - - private String m_columnName; - protected int m_displayType; // Currency / UoM via Context - private DecimalFormat m_format; - private String m_title; - private boolean m_setting; - private String m_oldText; - private String m_initialText; - - private boolean m_rangeSet = false; - private Double m_minValue; - private Double m_maxValue; - private boolean m_modified = false; - - /** The Field */ - private CTextField m_text = new CTextField(SIZE); // Standard - /** The Button */ - private CButton m_button = new CButton(); - - private GridField m_mField = null; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VNumber.class); - - /** - * Select all the number text. - */ - public void selectAll() - { - m_text.selectAll(); - } - - /** - * Set no of Columns - * @param columns columns - * @param height 0 to use default - */ - public void setColumns (int columns, int height) - { - m_text.setPreferredSize(null); - m_text.setMinimumSize(null); - m_text.setColumns(columns); - if (height > 0) { - Dimension size = m_text.getPreferredSize(); - if (height > size.height) // default 16 - size.height = height; - if (CComboBox.FIELD_HIGHT-4 > size.height) - size.height = VLookup.FIELD_HIGHT-4; - m_text.setPreferredSize(size); - m_text.setMinimumSize(size); - } else { - StringBuilder s = new StringBuilder(); - for(int i = 0; i < SIZE; i++) { - s.append("0"); - } - CTextField f = new CTextField(s.toString()); - m_text.setPreferredSize(f.getPreferredSize()); - m_text.setMinimumSize(f.getMinimumSize()); - } - this.setPreferredSize(m_text.getPreferredSize()); // causes r/o to be the same length - this.setMinimumSize(m_text.getMinimumSize()); - int h = m_text.getPreferredSize().height; - m_button.setPreferredSize(new Dimension(h, h)); - } // setColumns - - /** - * Set Range with min & max - * @param minValue min value - * @param maxValue max value - * @return true, if accepted - */ - public boolean setRange(Double minValue, Double maxValue) - { - m_rangeSet = true; - m_minValue = minValue; - m_maxValue = maxValue; - return m_rangeSet; - } // setRange - - /** - * Set Range with min & max = parse US style number w/o Gouping - * @param minValue min value - * @param maxValue max value - * @return true if accepted - */ - public boolean setRange(String minValue, String maxValue) - { - if (minValue == null || maxValue == null) - return false; - try - { - m_minValue = Double.valueOf(minValue); - m_maxValue = Double.valueOf(maxValue); - } - catch (NumberFormatException nfe) - { - return false; - } - m_rangeSet = true; - return m_rangeSet; - } // setRange - - /** - * Set and check DisplayType - * @param displayType display type - */ - public void setDisplayType (int displayType) - { - m_displayType = displayType; - if (!DisplayType.isNumeric(displayType)) - m_displayType = DisplayType.Number; - m_format = DisplayType.getNumberFormat(displayType); - m_text.setDocument (new MDocNumber(displayType, m_format, m_text, m_title)); - } // setDisplayType - - /** - * Set ReadWrite - * @param value value - */ - public void setReadWrite (boolean value) - { - if (m_text.isReadWrite() != value) - m_text.setReadWrite(value); - if (m_button.isReadWrite() != value) - m_button.setReadWrite(value); - // Don't show button if not ReadWrite - if (m_button.isVisible() != value) - m_button.setVisible(value); - setFocusable(value == true); - } // setReadWrite - - /** - * IsReadWrite - * @return true if rw - */ - public boolean isReadWrite() - { - return m_text.isReadWrite(); - } // isReadWrite - - /** - * Set Mandatory (and back bolor) - * @param mandatory mandatory - */ - public void setMandatory (boolean mandatory) - { - m_text.setMandatory(mandatory); - } // setMandatory - - /** - * Is it mandatory - * @return true if mandatory - */ - public boolean isMandatory() - { - return m_text.isMandatory(); - } // isMandatory - - /** - * Set Background - * @param color color - */ - public void setBackground(Color color) - { - m_text.setBackground(color); - } // setBackground - - /** - * Set Background - * @param error error - */ - public void setBackground (boolean error) - { - m_text.setBackground(error); - } // setBackground - - /** - * Set Foreground - * @param fg foreground - */ - public void setForeground(Color fg) - { - m_text.setForeground(fg); - } // setForeground - - /** - * Set Editor to value - * @param value value - */ - public void setValue(Object value) - { - if (log.isLoggable(Level.FINEST)) log.finest("Value=" + value); - if (value == null) - m_oldText = ""; - else - m_oldText = m_format.format(value); - // only set when not updated here - if (m_setting) - return; - m_text.setText (m_oldText); - m_initialText = m_oldText; - m_modified = false; - } // setValue - - /** - * Request Focus - */ - public void requestFocus () - { - m_text.requestFocus (); - } // requestFocus - - /** - * Request Focus In Window - * @return focus request - */ - @Override - public boolean requestFocusInWindow() - { - return m_text.requestFocusInWindow(); - } // requestFocusInWindow - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return m_text; - } // getFocusComponent - - /** - * Property Change Listener - * @param evt event - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * Return Editor value - * @return value value (big decimal or integer) - */ - public Object getValue() - { - if (m_text == null || m_text.getText() == null || m_text.getText().length() == 0) - return null; - String value = m_text.getText(); - // return 0 if text deleted - if (value == null || value.length() == 0) - { - if (!m_modified) - return null; - if (m_displayType == DisplayType.Integer) - return Integer.valueOf(0); - return Env.ZERO; - } - if (value.equals(".") || value.equals(",") || value.equals("-")) - value = "0"; - // arboleda - solve bug [ 1759771 ] Parse exception when you enter ".." in a numeric field - if (value.equals("..")) { - value = "0"; - m_text.setText("."); - } - try - { - Number number = m_format.parse(value); - value = number.toString(); // converts it to US w/o thousands - BigDecimal bd = new BigDecimal(value); - if (m_displayType == DisplayType.Integer) - return Integer.valueOf(bd.intValue()); - if (bd.signum() == 0) - return bd; - return bd.setScale(m_format.getMaximumFractionDigits(), RoundingMode.HALF_UP); - } - catch (Exception e) - { - log.log(Level.SEVERE, "Value=" + value, e); - } - m_text.setText(m_format.format(0)); - if (m_displayType == DisplayType.Integer) - return Integer.valueOf(0); - return Env.ZERO; - } // getValue - - /** - * Return Display Value - * @return value - */ - public String getDisplay() - { - return m_text.getText(); - } // getDisplay - - /** - * Get Title - * @return title - */ - public String getTitle() - { - return m_title; - } // getTitle - - /** - * Plus - add one. - * Also sets Value - * @return new value - */ - public Object plus() - { - Object value = getValue(); - if (value == null) - { - if (m_displayType == DisplayType.Integer) - value = Integer.valueOf(0); - else - value = Env.ZERO; - } - // Add - if (value instanceof BigDecimal) - value = ((BigDecimal)value).add(Env.ONE); - else - value = Integer.valueOf(((Integer)value).intValue() + 1); - // - setValue(value); - return value; - } // plus - - /** - * Minus - subtract one, but not below minimum. - * Also sets Value - * @param minimum minimum - * @return new value - */ - public Object minus (int minimum) - { - Object value = getValue(); - if (value == null) - { - if (m_displayType == DisplayType.Integer) - value = Integer.valueOf(minimum); - else - value = new BigDecimal(minimum); - setValue(value); - return value; - } - - // Subtract - if (value instanceof BigDecimal) - { - BigDecimal bd = ((BigDecimal)value).subtract(Env.ONE); - BigDecimal min = new BigDecimal(minimum); - if (bd.compareTo(min) < 0) - value = min; - else - value = bd; - } - else - { - int i = ((Integer)value).intValue(); - i--; - if (i < minimum) - i = minimum; - value = Integer.valueOf(i); - } - // - setValue(value); - return value; - } // minus - - /************************************************************************** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (log.isLoggable(Level.CONFIG)) log.config(e.getActionCommand()); - if (ValuePreference.NAME.equals(e.getActionCommand())) - { - if (MRole.getDefault().isShowPreference() && !m_mField.isEncrypted() && !m_mField.isEncryptedColumn()) - ValuePreference.start (m_mField, getValue()); - return; - } - else if (e.getActionCommand().equals(FieldRecordInfo.CHANGE_LOG_COMMAND)) - { - FieldRecordInfo.start(m_mField); - return; - } - - if (e.getSource() == m_button ) - { - m_button.setEnabled(false); - String str = startCalculator(this, m_text.getText(), m_format, m_displayType, m_title, ' '); - m_text.setText(str); - m_button.setEnabled(true); - try - { - fireVetoableChange (m_columnName, m_oldText, getValue()); - } - catch (PropertyVetoException pve) {} - m_text.requestFocus(); - } - } // actionPerformed - - /************************************************************************** - * Key Listener Interface - * @param e event - */ - public void keyTyped(KeyEvent e) {} - public void keyPressed(KeyEvent e) {} - - /** - * Key Listener. - * - Escape - Restore old Text - * - firstChange - signal change - * @param e event - */ - public void keyReleased(KeyEvent e) - { - if (log.isLoggable(Level.FINEST)) log.finest("Key=" + e.getKeyCode() + " - " + e.getKeyChar() - + " -> " + m_text.getText()); - - // ESC - if (e.getKeyCode() == KeyEvent.VK_ESCAPE) - m_text.setText(m_initialText); - - m_modified = true; - m_setting = true; - try - { - if (e.getKeyCode() == KeyEvent.VK_ENTER) // 10 - { - fireVetoableChange (m_columnName, m_oldText, getValue()); - fireActionPerformed(); - } - // else - // { - // indicate change - // fireVetoableChange (m_columnName, m_oldText, null); - // } - } - catch (PropertyVetoException pve) {} - m_setting = false; - } // keyReleased - - /** - * Focus Gained - * @param e event - */ - public void focusGained (FocusEvent e) - { - if (m_text != null) - m_text.selectAll(); - } // focusGained - - /** - * Data Binding to MTable (via GridController.vetoableChange). - * @param e event - */ - public void focusLost (FocusEvent e) - { - // APanel - Escape - // hengsin: bug [ 1890205 ] - /* - if (e.getOppositeComponent() instanceof AGlassPane) - { - m_text.setText(m_initialText); - return; - }*/ - commitChanges(); - } // focusLost - - public void commitChanges() { - Object oo = getValue(); - if (m_rangeSet) - { - String error = null; - if (oo instanceof Integer) - { - Integer ii = (Integer)oo; - if (ii < m_minValue) - { - error = oo + " < " + m_minValue; - oo = Integer.valueOf(m_minValue.intValue()); - } - else if (ii > m_maxValue) - { - error = oo + " > " + m_maxValue; - oo = Integer.valueOf(m_maxValue.intValue()); - } - } - else if (oo instanceof BigDecimal) - { - BigDecimal bd = (BigDecimal)oo; - if (bd.doubleValue() < m_minValue) - { - error = oo + " < " + m_minValue; - oo = BigDecimal.valueOf(m_minValue); - } - else if (bd.doubleValue() > m_maxValue) - { - error = oo + " > " + m_maxValue; - oo = BigDecimal.valueOf(m_maxValue); - } - } - if (error != null) - log.warning(error); - } - try - { - fireVetoableChange (m_columnName, m_initialText, oo); - fireActionPerformed(); - } - catch (PropertyVetoException pve) - {} - } - - /** - * Invalid Entry - Start Calculator - * @param jc parent - * @param value value - * @param format format - * @param displayType display type - * @param title title - * @return value - * @deprecated Use {@link #startCalculator(Container,String,DecimalFormat,int,String,char)} instead - */ - public static String startCalculator(Container jc, String value, - DecimalFormat format, int displayType, String title) - { - return startCalculator(jc, value, format, displayType, title, ' '); - } // startCalculator - - /** - * Invalid Entry - Start Calculator - * @param jc parent - * @param value value - * @param format format - * @param displayType display type - * @param title title - * @param operator optional math operator +-/* - * @return value - */ - public static String startCalculator(Container jc, String value, - DecimalFormat format, int displayType, String title, char operator) - { - if (log.isLoggable(Level.CONFIG)) log.config("Value=" + value); - BigDecimal startValue = Env.ZERO; - try - { - if (value != null && value.length() > 0) - { - Number number = format.parse(value); - startValue = new BigDecimal (number.toString()); - } - } - catch (ParseException pe) - { - if (log.isLoggable(Level.INFO)) log.info("InvalidEntry - " + pe.getMessage()); - } - - // Find frame - Frame frame = AEnv.getFrame(jc); - // Actual Call - Calculator calc = new Calculator(frame, title, - displayType, format, startValue); - if ( "*+-/%".indexOf(operator) > -1 ) - calc.handleInput(operator); - AEnv.showCenterWindow(frame, calc); - BigDecimal result = calc.getNumber(); - if (log.isLoggable(Level.CONFIG)) log.config( "Result=" + result); - // - calc = null; - if (result != null) - return format.format(result); - else - return value; // original value - } // startCalculator - - /** - * Set Field/WindowNo for ValuePreference - * @param mField field - */ - public void setField (GridField mField) - { - m_mField = mField; - - if (m_mField != null - && MRole.getDefault().isShowPreference() - && !mField.isEncrypted() && !mField.isEncryptedColumn()) - ValuePreference.addMenu (this, popupMenu); - - if (m_mField != null) - FieldRecordInfo.addMenu(this, popupMenu); - } // setField - - @Override - public GridField getField() { - return m_mField; - } - /* - * BF [ 1834393 ] VNumber.setFocusable not working - */ - @Override - public void setFocusable(boolean value) { - m_text.setFocusable(value); - } - - - /************************************************************************** - * Remove Action Listner - * @param l Action Listener - */ - public void removeActionListener(ActionListener l) - { - listenerList.remove(ActionListener.class, l); - } // removeActionListener - - /** - * Add Action Listner - * @param l Action Listener - */ - public void addActionListener(ActionListener l) - { - listenerList.add(ActionListener.class, l); - } // addActionListener - - /** - * Fire Action Event to listeners - */ - protected void fireActionPerformed() - { - int modifiers = 0; - AWTEvent currentEvent = EventQueue.getCurrentEvent(); - if (currentEvent instanceof InputEvent) - modifiers = ((InputEvent)currentEvent).getModifiersEx(); - else if (currentEvent instanceof ActionEvent) - modifiers = ((ActionEvent)currentEvent).getModifiers(); - ActionEvent ae = new ActionEvent (this, ActionEvent.ACTION_PERFORMED, - "VNumber", EventQueue.getMostRecentEventTime(), modifiers); - - // Guaranteed to return a non-null array - Object[] listeners = listenerList.getListenerList(); - // Process the listeners last to first, notifying those that are interested in this event - for (int i = listeners.length-2; i>=0; i-=2) - { - if (listeners[i]==ActionListener.class) - { - ((ActionListener)listeners[i+1]).actionPerformed(ae); - } - } - } // fireActionPerformed - /**/ - - public boolean isDirty() { - return m_modified; - } - - public void rollbackChanges() { - m_text.setText (m_oldText); - m_initialText = m_oldText; - m_modified = false; - } - -} // VNumber diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VOvrCaret.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VOvrCaret.java deleted file mode 100644 index d243603617..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VOvrCaret.java +++ /dev/null @@ -1,111 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Color; -import java.awt.Graphics; -import java.awt.Rectangle; - -import javax.swing.plaf.TextUI; -import javax.swing.text.BadLocationException; -import javax.swing.text.DefaultCaret; -import javax.swing.text.Position; - -/** - * Overwrite Caret - * - * @author Jorg Janke - * @version $Id: VOvrCaret.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VOvrCaret extends DefaultCaret -{ - /** - * - */ - private static final long serialVersionUID = 1513269384035685427L; - - /** - * Constructor - */ - public VOvrCaret() - { - super(); - } // VOvrCaret - - /** - * Renders the caret as a top and button bracket. - * - * @param g the graphics context - * @see #damage - */ - public void paint(Graphics g) - { - Position.Bias dotBias = Position.Bias.Forward; - - // - if (isVisible()) - { - try - { - TextUI mapper = getComponent().getUI(); - Rectangle r = mapper.modelToView(getComponent(), getDot(), dotBias); - Rectangle e = mapper.modelToView(getComponent(), getDot()+1, dotBias); - // g.setColor(getComponent().getCaretColor()); - g.setColor(Color.blue); - // - int cWidth = e.x-r.x; - int cHeight = 4; - int cThick = 2; - // - g.fillRect(r.x-1, r.y, cWidth, cThick); // top - g.fillRect(r.x-1, r.y, cThick, cHeight); // | - g.fillRect(r.x-1+cWidth, r.y, cThick, cHeight); // | - // - int yStart = r.y+r.height; - g.fillRect(r.x-1, yStart-cThick, cWidth, cThick); // button - g.fillRect(r.x-1, yStart-cHeight, cThick, cHeight); // | - g.fillRect(r.x-1+cWidth, yStart-cHeight, cThick, cHeight); // | - } - catch (BadLocationException e) - { - // can't render - // System.err.println("Can't render cursor"); - } - } // isVisible - } // paint - - /** - * Damages the area surrounding the caret to cause - * it to be repainted in a new location. - * This method should update the caret bounds (x, y, width, and height). - * - * @param r the current location of the caret - * @see #paint - */ - protected synchronized void damage(Rectangle r) - { - if (r != null) - { - x = r.x - 4; // start 4 pixles before (one required) - y = r.y; - width = 18; // sufficent for standard font (18-4=14) - height = r.height; - repaint(); - } - } // damage - -} // VOvrCaret diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttribute.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttribute.java deleted file mode 100644 index 60bd77cb7c..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttribute.java +++ /dev/null @@ -1,524 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.util.logging.Level; - -import javax.swing.JComponent; -import javax.swing.JPopupMenu; -import javax.swing.JTextField; -import javax.swing.LookAndFeel; -import javax.swing.SwingUtilities; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.AEnv; -import org.compiere.apps.FieldRecordInfo; -import org.compiere.model.GridField; -import org.compiere.model.GridTab; -import org.compiere.model.MAttributeSet; -import org.compiere.model.MPAttributeLookup; -import org.compiere.model.MProduct; -import static org.compiere.model.SystemIDs.*; -import org.compiere.swing.CButton; -import org.compiere.swing.CMenuItem; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Product Attribute Set Instance Editor - * - * @author Jorg Janke - * @version $Id: VPAttribute.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *
  • BF [ 1895041 ] NPE when move product with attribute set - *
  • BF [ 1770177 ] Inventory Move Locator Error - integrated MGrigioni bug fix - *
  • BF [ 2011222 ] ASI Dialog is reseting locator - */ -public class VPAttribute extends JComponent - implements VEditor, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 3632142379826093036L; - - /** - * Mouse Listener - */ - final class VPAttribute_mouseAdapter extends MouseAdapter - { - /** - * Constructor - * @param adaptee adaptee - */ - VPAttribute_mouseAdapter(VPAttribute adaptee) - { - m_adaptee = adaptee; - } // VPAttribute_mouseAdapter - - private VPAttribute m_adaptee; - - /** - * Mouse Listener - * @param e event - */ - public void mouseClicked(MouseEvent e) - { - // Double Click - if (e.getClickCount() > 1) - m_adaptee.actionPerformed(new ActionEvent(e.getSource(), e.getID(), "Mouse")); - // popup menu - if (SwingUtilities.isRightMouseButton(e)) - m_adaptee.popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - } // mouse Clicked - - } // VPAttribute_mouseAdapter - - /** - * IDE Constructor - */ - public VPAttribute() - { - this (null, false, false, true, 0, null); - } // VAssigment - - /** - * Create Product Attribute Set Instance Editor. - * @param mandatory mandatory - * @param isReadOnly read only - * @param isUpdateable updateable - * @param WindowNo WindowNo - * @param lookup Model Product Attribute - */ - public VPAttribute (boolean mandatory, boolean isReadOnly, boolean isUpdateable, - int WindowNo, MPAttributeLookup lookup) - { - this(null, mandatory, isReadOnly, isUpdateable, WindowNo, lookup); - } - - /** - * Create Product Attribute Set Instance Editor. - * @param gridTab - * @param mandatory mandatory - * @param isReadOnly read only - * @param isUpdateable updateable - * @param WindowNo WindowNo - * @param lookup Model Product Attribute - */ - public VPAttribute (GridTab gridTab, boolean mandatory, boolean isReadOnly, boolean isUpdateable, - int WindowNo, MPAttributeLookup lookup) - { - super.setName("M_AttributeSetInstance_ID"); - m_GridTab = gridTab; // added for processCallout - m_WindowNo = WindowNo; - m_mPAttribute = lookup; - m_C_BPartner_ID = Env.getContextAsInt(Env.getCtx(), WindowNo, "C_BPartner_ID"); - LookAndFeel.installBorder(this, "TextField.border"); - this.setLayout(new BorderLayout()); - // Size - this.setPreferredSize(m_text.getPreferredSize()); - int height = m_text.getPreferredSize().height; - - // *** Text *** - m_text.setEditable(false); - m_text.setFocusable(false); - m_text.setBorder(null); - m_text.setHorizontalAlignment(JTextField.LEADING); - // Background - setMandatory(mandatory); - this.add(m_text, BorderLayout.CENTER); - - // *** Button *** - m_button.setIcon(Env.getImageIcon("PAttribute10.gif")); - m_button.setMargin(new Insets(0, 0, 0, 0)); - m_button.setPreferredSize(new Dimension(height, height)); - m_button.addActionListener(this); - m_button.setFocusable(true); - this.add(m_button, BorderLayout.EAST); - - // Prefereed Size - this.setPreferredSize(this.getPreferredSize()); // causes r/o to be the same length - // ReadWrite - if (isReadOnly || !isUpdateable) - setReadWrite(false); - else - setReadWrite(true); - - // Popup - m_text.addMouseListener(new VPAttribute_mouseAdapter(this)); - menuEditor = new CMenuItem(Msg.getMsg(Env.getCtx(), "PAttribute"), Env.getImageIcon("Zoom16.gif")); - menuEditor.addActionListener(this); - popupMenu.add(menuEditor); - } // VPAttribute - - /** Data Value */ - private Object m_value = new Object(); - /** The Attribute Instance */ - private MPAttributeLookup m_mPAttribute; - - /** The Text Field */ - private JTextField m_text = new JTextField (VLookup.DISPLAY_LENGTH); - /** The Button */ - private CButton m_button = new CButton(); - - JPopupMenu popupMenu = new JPopupMenu(); - private CMenuItem menuEditor; - - private boolean m_readWrite; - private boolean m_mandatory; - private int m_WindowNo; - private int m_C_BPartner_ID; - /** The Grid Tab * */ - private GridTab m_GridTab; // added for processCallout - /** The Grid Field * */ - private GridField m_GridField; // added for processCallout - - /** Calling Window Info */ - private int m_AD_Column_ID = 0; - private GridField m_mField; - /** No Instance Key */ - private static Integer NO_INSTANCE = Integer.valueOf(0); - /** Logger */ - private static CLogger log = CLogger.getCLogger(VPAttribute.class); - - - /** - * Dispose resources - */ - public void dispose() - { - m_text = null; - m_button = null; - m_mPAttribute.dispose(); - m_mPAttribute = null; - m_GridField = null; - m_GridTab = null; - } // dispose - - /** - * Set Mandatory - * @param mandatory mandatory - */ - public void setMandatory (boolean mandatory) - { - m_mandatory = mandatory; - m_button.setMandatory(mandatory); - setBackground (false); - } // setMandatory - - /** - * Get Mandatory - * @return mandatory - */ - public boolean isMandatory() - { - return m_mandatory; - } // isMandatory - - /** - * Set ReadWrite - * @param rw read rwite - */ - public void setReadWrite (boolean rw) - { - m_readWrite = rw; - m_button.setReadWrite(rw); - setBackground (false); - } // setReadWrite - - /** - * Is Read Write - * @return read write - */ - public boolean isReadWrite() - { - return m_readWrite; - } // isReadWrite - - /** - * Set Foreground - * @param color color - */ - public void setForeground (Color color) - { - m_text.setForeground(color); - } // SetForeground - - /** - * Set Background - * @param error Error - */ - public void setBackground (boolean error) - { - if (error) - setBackground(AdempierePLAF.getFieldBackground_Error()); - else if (!m_readWrite) - setBackground(AdempierePLAF.getFieldBackground_Inactive()); - else if (m_mandatory) - setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - else - setBackground(AdempierePLAF.getInfoBackground()); - } // setBackground - - /** - * Set Background - * @param color Color - */ - public void setBackground (Color color) - { - m_text.setBackground(color); - } // setBackground - - - /************************************************************************** - * Set/lookup Value - * @param value value - */ - public void setValue(Object value) - { - if (value == null || NO_INSTANCE.equals(value)) - { - m_text.setText(""); - m_value = value; - return; - } - - // The same - if (value.equals(m_value)) - return; - // new value - if (log.isLoggable(Level.FINE)) log.fine("Value=" + value); - m_value = value; - m_text.setText(m_mPAttribute.getDisplay(value)); // loads value - } // setValue - - /** - * Get Value - * @return value - */ - public Object getValue() - { - return m_value; - } // getValue - - /** - * Get Display Value - * @return info - */ - public String getDisplay() - { - return m_text.getText(); - } // getDisplay - - - /************************************************************************** - * Set Field - * @param mField MField - */ - public void setField(GridField mField) - { - // To determine behavior - m_AD_Column_ID = mField.getAD_Column_ID(); - m_GridField = mField; - - m_mField = mField; - if (m_mField != null) - FieldRecordInfo.addMenu(this, popupMenu); - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - /** - * Action Listener Interface - * @param listener listener - */ - public void addActionListener(ActionListener listener) - { - } // addActionListener - - /** - * Action Listener - start dialog - * @param e Event - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(FieldRecordInfo.CHANGE_LOG_COMMAND)) - { - FieldRecordInfo.start(m_mField); - return; - } - - if (!m_button.isEnabled ()) - return; - m_button.setEnabled (false); - // - Integer oldValue = (Integer)getValue (); - int oldValueInt = oldValue == null ? 0 : oldValue.intValue (); - int M_AttributeSetInstance_ID = oldValueInt; - int M_Product_ID = 0; - int M_ProductBOM_ID = 0; - if (m_GridTab != null) { - M_Product_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, m_GridTab.getTabNo(), "M_Product_ID"); - M_ProductBOM_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, m_GridTab.getTabNo(), "M_ProductBOM_ID"); - } else { - M_Product_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, "M_Product_ID"); - M_ProductBOM_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, "M_ProductBOM_ID"); - } - int M_Locator_ID = -1; - - if (log.isLoggable(Level.CONFIG)) log.config("M_Product_ID=" + M_Product_ID + "/" + M_ProductBOM_ID - + ",M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID - + ", AD_Column_ID=" + m_AD_Column_ID); - - // M_Product.M_AttributeSetInstance_ID = 8418 - boolean productWindow = m_AD_Column_ID == COLUMN_M_PRODUCT_M_ATTRIBUTESETINSTANCE_ID; // HARDCODED - - // Exclude ability to enter ASI - boolean exclude = true; - - if (M_Product_ID != 0) - { - MProduct product = MProduct.get(Env.getCtx(), M_Product_ID); - int M_AttributeSet_ID = product.getM_AttributeSet_ID(); - if (M_AttributeSet_ID != 0) - { - MAttributeSet mas = MAttributeSet.get(Env.getCtx(), M_AttributeSet_ID); - exclude = mas.excludeEntry(m_AD_Column_ID, Env.isSOTrx(Env.getCtx(), m_WindowNo)); - } - } - - boolean changed = false; - if (M_ProductBOM_ID != 0) // Use BOM Component - M_Product_ID = M_ProductBOM_ID; - // - if (!productWindow && (M_Product_ID == 0 || exclude)) - { - changed = true; - m_text.setText(null); - M_AttributeSetInstance_ID = 0; - } - else - { - VPAttributeDialog vad = new VPAttributeDialog (AEnv.getFrame (this), - M_AttributeSetInstance_ID, M_Product_ID, m_C_BPartner_ID, - productWindow, m_AD_Column_ID, m_WindowNo); - if (vad.isChanged()) - { - m_text.setText(vad.getM_AttributeSetInstanceName()); - M_AttributeSetInstance_ID = vad.getM_AttributeSetInstance_ID(); - if (!productWindow && vad.getM_Locator_ID() > 0) - { - M_Locator_ID = vad.getM_Locator_ID(); - } - changed = true; - } - } - - // Set Value - if (changed) - { - if (log.isLoggable(Level.FINEST)) log.finest("Changed M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID); - m_value = new Object(); // force re-query display - if (M_AttributeSetInstance_ID == 0) - setValue(null); - else - setValue(Integer.valueOf(M_AttributeSetInstance_ID)); - // Change Locator - if (m_GridTab != null && M_Locator_ID > 0) - { - if (log.isLoggable(Level.FINEST)) log.finest("Change M_Locator_ID="+M_Locator_ID); - m_GridTab.setValue("M_Locator_ID", M_Locator_ID); - } - // - try - { - String columnName = "M_AttributeSetInstance_ID"; - if (m_GridField != null) - { - columnName = m_GridField.getColumnName(); - } - fireVetoableChange(columnName, new Object(), getValue()); - } - catch (PropertyVetoException pve) - { - log.log(Level.SEVERE, "", pve); - } - if (M_AttributeSetInstance_ID == oldValueInt && m_GridTab != null && m_GridField != null) - { - // force Change - user does not realize that embedded object is already saved. - m_GridTab.processFieldChange(m_GridField); - } - } // change - m_button.setEnabled(true); - requestFocus(); - } // actionPerformed - - /** - * Property Change Listener - * @param evt event - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * Request Focus - */ - @Override - public void requestFocus() - { - m_text.requestFocus(); - } // requestFocus - - /** - * Request Focus In Window - * @return focus request - */ - @Override - public boolean requestFocusInWindow() - { - return m_text.requestFocusInWindow(); - } // requestFocusInWindow - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return m_text; - } // getFocusComponent - -} // VPAttribute diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttributeDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttributeDialog.java deleted file mode 100644 index e68cb9016a..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttributeDialog.java +++ /dev/null @@ -1,842 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.Frame; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.JPopupMenu; -import javax.swing.SwingConstants; -import javax.swing.SwingUtilities; - -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.ALayout; -import org.compiere.apps.ALayoutConstraint; -import org.compiere.apps.AWindow; -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.search.PAttributeInstance; -import org.compiere.model.MAttribute; -import org.compiere.model.MAttributeInstance; -import org.compiere.model.MAttributeSet; -import org.compiere.model.MAttributeSetInstance; -import org.compiere.model.MAttributeValue; -import org.compiere.model.MDocType; -import org.compiere.model.MLot; -import org.compiere.model.MLotCtl; -import org.compiere.model.MQuery; -import org.compiere.model.MRole; -import org.compiere.model.MSerNoCtl; -import static org.compiere.model.SystemIDs.*; -import org.compiere.model.X_M_MovementLine; -import org.compiere.swing.CButton; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CDialog; -import org.compiere.swing.CEditor; -import org.compiere.swing.CLabel; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - -/** - * Product Attribute Set Product/Instance Dialog Editor. - * Called from VPAttribute.actionPerformed - * - * @author Jorg Janke - * @version $Id: VPAttributeDialog.java,v 1.4 2006/07/30 00:51:27 jjanke Exp $ - */ -public class VPAttributeDialog extends CDialog - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -1062346984681892620L; - - /***************************************************************************** - * Mouse Listener for Popup Menu - */ - final class VPAttributeDialog_mouseAdapter extends java.awt.event.MouseAdapter - { - /** - * Constructor - * @param adaptee adaptee - */ - VPAttributeDialog_mouseAdapter(VPAttributeDialog adaptee) - { - m_adaptee = adaptee; - } // VPAttributeDialog_mouseAdapter - - private VPAttributeDialog m_adaptee; - - /** - * Mouse Listener - * @param e MouseEvent - */ - public void mouseClicked(MouseEvent e) - { - // System.out.println("mouseClicked " + e.getID() + " " + e.getSource().getClass().toString()); - // popup menu - if (SwingUtilities.isRightMouseButton(e)) - m_adaptee.popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - } // mouse Clicked - - } // VPAttributeDialog_mouseAdapter - - /** - * Product Attribute Instance Dialog - * @param frame parent frame - * @param M_AttributeSetInstance_ID Product Attribute Set Instance id - * @param M_Product_ID Product id - * @param C_BPartner_ID b partner - * @param productWindow this is the product window (define Product Instance) - * @param AD_Column_ID column - * @param WindowNo window - */ - public VPAttributeDialog (Frame frame, int M_AttributeSetInstance_ID, - int M_Product_ID, int C_BPartner_ID, - boolean productWindow, int AD_Column_ID, int WindowNo) - { - super (frame, Msg.translate(Env.getCtx(), "M_AttributeSetInstance_ID") , true); - if (log.isLoggable(Level.CONFIG)) log.config("M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID - + ", M_Product_ID=" + M_Product_ID - + ", C_BPartner_ID=" + C_BPartner_ID - + ", ProductW=" + productWindow + ", Column=" + AD_Column_ID); - m_WindowNo = AEnv.createWindowNo (this); - m_M_AttributeSetInstance_ID = M_AttributeSetInstance_ID; - m_M_Product_ID = M_Product_ID; - m_C_BPartner_ID = C_BPartner_ID; - m_productWindow = productWindow; - m_AD_Column_ID = AD_Column_ID; - m_WindowNoParent = WindowNo; - - //get columnName from ad_column - m_columnName = DB.getSQLValueString(null, "SELECT ColumnName FROM AD_Column WHERE AD_Column_ID = ?", m_AD_Column_ID); - if (m_columnName == null || m_columnName.trim().length() == 0) - { - //fallback - m_columnName = "M_AttributeSetInstance_ID"; - } - - try - { - jbInit(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "VPAttributeDialog" + ex); - } - // Dynamic Init - if (!initAttributes ()) - { - dispose(); - return; - } - AEnv.showCenterWindow(frame, this); - } // VPAttributeDialog - - private int m_WindowNo; - private MAttributeSetInstance m_masi; - private int m_M_AttributeSetInstance_ID; - private int m_M_Locator_ID; - private String m_M_AttributeSetInstanceName; - private int m_M_Product_ID; - private int m_C_BPartner_ID; - private int m_AD_Column_ID; - private int m_WindowNoParent; - /** Enter Product Attributes */ - private boolean m_productWindow = false; - /** Change */ - private boolean m_changed = false; - - private CLogger log = CLogger.getCLogger(getClass()); - /** Row Counter */ - private int m_row = 0; - /** List of Editors */ - private ArrayList m_editors = new ArrayList(); - /** Length of Instance value (40) */ - private static final int INSTANCE_VALUE_LENGTH = 40; - - private CCheckBox cbNewEdit = new CCheckBox(); - private CButton bSelect = new CButton(Env.getImageIcon("PAttribute16.gif")); - // Lot - private VString fieldLotString = new VString ("Lot", false, false, true, 20, 20, null, null); - private CComboBoxfieldLot = null; - private CButton bLot = new CButton(Msg.getMsg (Env.getCtx(), "New")); - // Lot Popup - JPopupMenu popupMenu = new JPopupMenu(); - private CMenuItem mZoom; - // Ser No - private VString fieldSerNo = new VString ("SerNo", false, false, true, 20, 20, null, null); - private CButton bSerNo = new CButton(Msg.getMsg (Env.getCtx(), "New")); - // Date - private VDate fieldGuaranteeDate = new VDate ("GuaranteeDate", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "GuaranteeDate")); - // - private CTextField fieldDescription = new CTextField (20); - // - private BorderLayout mainLayout = new BorderLayout(); - private CPanel centerPanel = new CPanel(); - private ALayout centerLayout = new ALayout(5,5, true); - private ConfirmPanel confirmPanel = new ConfirmPanel (true); - - private String m_columnName = null; - - /** - * Layout - * @throws Exception - */ - private void jbInit () throws Exception - { - this.getContentPane().setLayout(mainLayout); - this.getContentPane().add(centerPanel, BorderLayout.CENTER); - this.getContentPane().add(confirmPanel, BorderLayout.SOUTH); - centerPanel.setLayout(centerLayout); - // - confirmPanel.addActionListener(this); - } // jbInit - - /** - * Dyanmic Init. - * @return true if initialized - */ - private boolean initAttributes () - { - if (m_M_Product_ID == 0 && !m_productWindow) - return false; - - MAttributeSet as = null; - - if (m_M_Product_ID != 0) - { - // Get Model - m_masi = MAttributeSetInstance.get(Env.getCtx(), m_M_AttributeSetInstance_ID, m_M_Product_ID); - if (m_masi == null) - { - log.severe ("No Model for M_AttributeSetInstance_ID=" + m_M_AttributeSetInstance_ID + ", M_Product_ID=" + m_M_Product_ID); - return false; - } - Env.setContext(Env.getCtx(), m_WindowNo, "M_AttributeSet_ID", m_masi.getM_AttributeSet_ID()); - - // Get Attribute Set - as = m_masi.getMAttributeSet(); - } - else - { - int M_AttributeSet_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNoParent, "M_AttributeSet_ID"); - m_masi = new MAttributeSetInstance (Env.getCtx(), 0, M_AttributeSet_ID, null); - as = m_masi.getMAttributeSet(); - } - - // Product has no Attribute Set - if (as == null) - { - ADialog.error(m_WindowNo, this, "PAttributeNoAttributeSet"); - return false; - } - // Product has no Instance Attributes - if (!m_productWindow && !as.isInstanceAttribute()) - { - ADialog.error(m_WindowNo, this, "PAttributeNoInstanceAttribute"); - return false; - } - - // Show Product Attributes - if (m_productWindow) - { - MAttribute[] attributes = as.getMAttributes (false); - if (log.isLoggable(Level.FINE)) log.fine ("Product Attributes=" + attributes.length); - for (int i = 0; i < attributes.length; i++) - addAttributeLine (attributes[i], true, !m_productWindow); - } - else // Set Instance Attributes - { - // New/Edit - Selection - if (m_M_AttributeSetInstance_ID == 0) // new - cbNewEdit.setText(Msg.getMsg(Env.getCtx(), "NewRecord")); - else - cbNewEdit.setText(Msg.getMsg(Env.getCtx(), "EditRecord")); - cbNewEdit.addActionListener(this); - centerPanel.add(cbNewEdit, new ALayoutConstraint(m_row++,0)); - bSelect.setText(Msg.getMsg(Env.getCtx(), "SelectExisting")); - bSelect.addActionListener(this); - centerPanel.add(bSelect, null); - // All Attributes - MAttribute[] attributes = as.getMAttributes (true); - if (log.isLoggable(Level.FINE)) log.fine ("Instance Attributes=" + attributes.length); - for (int i = 0; i < attributes.length; i++) - addAttributeLine (attributes[i], false, false); - } - - // Lot - if (!m_productWindow && as.isLot()) - { - CLabel label = new CLabel (Msg.translate(Env.getCtx(), "Lot")); - label.setLabelFor (fieldLotString); - centerPanel.add(label, new ALayoutConstraint(m_row++,0)); - centerPanel.add(fieldLotString, null); - fieldLotString.setText (m_masi.getLot()); - // M_Lot_ID - // int AD_Column_ID = 9771; // M_AttributeSetInstance.M_Lot_ID - // fieldLot = new VLookup ("M_Lot_ID", false,false, true, - // MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, AD_Column_ID, DisplayType.TableDir)); - String sql = "SELECT M_Lot_ID, Name " - + "FROM M_Lot l " - + "WHERE EXISTS (SELECT M_Product_ID FROM M_Product p " - + "WHERE p.M_AttributeSet_ID=" + m_masi.getM_AttributeSet_ID() - + " AND p.M_Product_ID=l.M_Product_ID)"; - fieldLot = new CComboBox(DB.getKeyNamePairs(sql, true)); - label = new CLabel (Msg.translate(Env.getCtx(), "M_Lot_ID")); - label.setLabelFor (fieldLot); - centerPanel.add(label, new ALayoutConstraint(m_row++,0)); - centerPanel.add(fieldLot, null); - if (m_masi.getM_Lot_ID() != 0) - { - for (int i = 1; i < fieldLot.getItemCount(); i++) - { - KeyNamePair pp = (KeyNamePair)fieldLot.getItemAt(i); - if (pp.getKey() == m_masi.getM_Lot_ID()) - { - fieldLot.setSelectedIndex(i); - fieldLotString.setEditable(false); - break; - } - } - } - fieldLot.addActionListener(this); - // New Lot Button - if (m_masi.getMAttributeSet().getM_LotCtl_ID() != 0) - { - if (MRole.getDefault().isTableAccess(MLot.Table_ID, false) - && MRole.getDefault().isTableAccess(MLotCtl.Table_ID, false) - && !m_masi.isExcludeLot(m_AD_Column_ID, Env.isSOTrx(Env.getCtx(), m_WindowNoParent))) - { - centerPanel.add(bLot, null); - bLot.addActionListener(this); - } - } - // Popup - fieldLot.addMouseListener(new VPAttributeDialog_mouseAdapter(this)); // popup - mZoom = new CMenuItem(Msg.getMsg(Env.getCtx(), "Zoom"), Env.getImageIcon("Zoom16.gif")); - mZoom.addActionListener(this); - popupMenu.add(mZoom); - } // Lot - - // SerNo - if (!m_productWindow && as.isSerNo()) - { - CLabel label = new CLabel (Msg.translate(Env.getCtx(), "SerNo")); - label.setLabelFor(fieldSerNo); - fieldSerNo.setText(m_masi.getSerNo()); - centerPanel.add(label, new ALayoutConstraint(m_row++,0)); - centerPanel.add(fieldSerNo, null); - // New SerNo Button - if (m_masi.getMAttributeSet().getM_SerNoCtl_ID() != 0) - { - if (MRole.getDefault().isTableAccess(MSerNoCtl.Table_ID, false) - && !m_masi.isExcludeSerNo(m_AD_Column_ID, Env.isSOTrx(Env.getCtx(), m_WindowNoParent))) - { - centerPanel.add(bSerNo, null); - bSerNo.addActionListener(this); - } - } - } // SerNo - - // GuaranteeDate - if (!m_productWindow && as.isGuaranteeDate()) - { - CLabel label = new CLabel (Msg.translate(Env.getCtx(), "GuaranteeDate")); - label.setLabelFor(fieldGuaranteeDate); - if (m_M_AttributeSetInstance_ID == 0) - fieldGuaranteeDate.setValue(m_masi.getGuaranteeDate(true)); - else - fieldGuaranteeDate.setValue(m_masi.getGuaranteeDate()); - centerPanel.add(label, new ALayoutConstraint(m_row++,0)); - centerPanel.add(fieldGuaranteeDate, null); - } // GuaranteeDate - - if (m_row == 0) - { - ADialog.error(m_WindowNo, this, "PAttributeNoInfo"); - return false; - } - - // New/Edit Window - if (!m_productWindow) - { - cbNewEdit.setSelected(m_M_AttributeSetInstance_ID == 0); - cmd_newEdit(); - } - - // Attribute Set Instance Description - CLabel label = new CLabel (Msg.translate(Env.getCtx(), "Description")); - label.setLabelFor(fieldDescription); - fieldDescription.setText(m_masi.getDescription()); - fieldDescription.setEditable(false); - centerPanel.add(label, new ALayoutConstraint(m_row++,0)); - centerPanel.add(fieldDescription, null); - - // Window usually to wide (??) - Dimension dd = centerPanel.getPreferredSize(); - dd.width = Math.min(500, dd.width); - centerPanel.setPreferredSize(dd); - return true; - } // initAttribute - - /** - * Add Attribute Line - * @param attribute attribute - * @param product product level attribute - * @param readOnly value is read only - */ - private void addAttributeLine (MAttribute attribute, boolean product, boolean readOnly) - { - if (log.isLoggable(Level.FINE)) log.fine(attribute + ", Product=" + product + ", R/O=" + readOnly); - CLabel label = new CLabel (attribute.getName()); - if (product) - label.setFont(new Font(label.getFont().getFontName(), Font.BOLD, label.getFont().getSize())); - if (attribute.getDescription() != null) - label.setToolTipText(attribute.getDescription()); - centerPanel.add(label, new ALayoutConstraint(m_row++,0)); - // - MAttributeInstance instance = attribute.getMAttributeInstance (m_M_AttributeSetInstance_ID); - if (MAttribute.ATTRIBUTEVALUETYPE_List.equals(attribute.getAttributeValueType())) - { - MAttributeValue[] values = attribute.getMAttributeValues(); // optional = null - CComboBox editor = new CComboBox(values); - boolean found = false; - if (instance != null) - { - for (int i = 0; i < values.length; i++) - { - if (values[i] != null && values[i].getM_AttributeValue_ID () == instance.getM_AttributeValue_ID ()) - { - editor.setSelectedIndex (i); - found = true; - break; - } - } - if (found) { - if (log.isLoggable(Level.FINE)) log.fine("Attribute=" + attribute.getName() + " #" + values.length + " - found: " + instance); - } else { - log.warning("Attribute=" + attribute.getName() + " #" + values.length + " - NOT found: " + instance); - } - } // setComboBox - else - if (log.isLoggable(Level.FINE)) log.fine("Attribute=" + attribute.getName() + " #" + values.length + " no instance"); - label.setLabelFor(editor); - centerPanel.add(editor, null); - if (readOnly) - editor.setEnabled(false); - else - m_editors.add (editor); - } - else if (MAttribute.ATTRIBUTEVALUETYPE_Number.equals(attribute.getAttributeValueType())) - { - VNumber editor = new VNumber(attribute.getName(), attribute.isMandatory(), - false, true, DisplayType.Number, attribute.getName()); - if (instance != null) - editor.setValue(instance.getValueNumber()); - else - editor.setValue(Env.ZERO); - label.setLabelFor(editor); - centerPanel.add(editor, null); - if (readOnly) - editor.setEnabled(false); - else - m_editors.add (editor); - } - else // Text Field - { - VString editor = new VString (attribute.getName(), attribute.isMandatory(), - false, true, 20, INSTANCE_VALUE_LENGTH, null, null); - if (instance != null) - editor.setText(instance.getValue()); - label.setLabelFor(editor); - centerPanel.add(editor, null); - if (readOnly) - editor.setEnabled(false); - else - m_editors.add (editor); - } - } // addAttributeLine - - /** - * dispose - */ - public void dispose() - { - removeAll(); - Env.clearWinContext(m_WindowNo); - // - Env.setContext(Env.getCtx(), m_WindowNo, Env.TAB_INFO, m_columnName, - String.valueOf(m_M_AttributeSetInstance_ID)); - Env.setContext(Env.getCtx(), m_WindowNo, Env.TAB_INFO, "M_Locator_ID", - String.valueOf(m_M_Locator_ID)); - // - super.dispose(); - } // dispose - - /** - * ActionListener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - // Select Instance - if (e.getSource() == bSelect) - { - if (cmd_select()) - dispose(); - } - // New/Edit - else if (e.getSource() == cbNewEdit) - { - cmd_newEdit(); - } - // Select Lot from existing - else if (e.getSource() == fieldLot) - { - KeyNamePair pp = (KeyNamePair)fieldLot.getSelectedItem(); - if (pp != null && pp.getKey() != -1) - { - fieldLotString.setText(pp.getName()); - fieldLotString.setEditable(false); - m_masi.setM_Lot_ID(pp.getKey()); - } - else - { - fieldLotString.setEditable(true); - m_masi.setM_Lot_ID(0); - } - } - // Create New Lot - else if (e.getSource() == bLot) - { - KeyNamePair pp = m_masi.createLot(m_M_Product_ID); - if (pp != null) - { - fieldLot.addItem(pp); - fieldLot.setSelectedItem(pp); - } - } - // Create New SerNo - else if (e.getSource() == bSerNo) - { - fieldSerNo.setText(m_masi.getSerNo(true)); - } - - // OK - else if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - if (saveSelection()) - dispose(); - } - // Cancel - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - m_changed = false; - m_M_AttributeSetInstance_ID = 0; - m_M_Locator_ID = 0; - dispose(); - } - // Zoom M_Lot - else if (e.getSource() == mZoom) - { - cmd_zoom(); - } - else - log.log(Level.SEVERE, "not found - " + e); - } // actionPerformed - - /** - * Instance Selection Button - * @return true if selected - */ - private boolean cmd_select() - { - log.config(""); - - int M_Warehouse_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNoParent, "M_Warehouse_ID"); - - int C_DocType_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNoParent, "C_DocType_ID"); - if (C_DocType_ID > 0) { - MDocType doctype = new MDocType (Env.getCtx(), C_DocType_ID, null); - String docbase = doctype.getDocBaseType(); - if (docbase.equals(MDocType.DOCBASETYPE_MaterialReceipt)) - M_Warehouse_ID = 0; - } - - // teo_sarca [ 1564520 ] Inventory Move: can't select existing attributes - int M_Locator_ID = 0; - if (m_AD_Column_ID == COLUMN_M_MOVEMENTLINE_M_ATTRIBUTESETINSTANCE_ID) { // TODO: hardcoded: M_MovementLine[324].M_AttributeSetInstance_ID[8551] - M_Locator_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNoParent, X_M_MovementLine.COLUMNNAME_M_Locator_ID, true); // only window - } - - String title = ""; - // Get Text - String sql = "SELECT p.Name, w.Name, w.M_Warehouse_ID FROM M_Product p, M_Warehouse w " - + "WHERE p.M_Product_ID=? AND w.M_Warehouse_ID" - + (M_Locator_ID <= 0 ? "=?" : " IN (SELECT M_Warehouse_ID FROM M_Locator where M_Locator_ID=?)"); // teo_sarca [ 1564520 ] - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_M_Product_ID); - pstmt.setInt(2, M_Locator_ID <= 0 ? M_Warehouse_ID : M_Locator_ID); - rs = pstmt.executeQuery(); - if (rs.next()) { - title = rs.getString(1) + " - " + rs.getString(2); - M_Warehouse_ID = rs.getInt(3); // fetch the actual warehouse - teo_sarca [ 1564520 ] - } - } - catch (Exception e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - // - PAttributeInstance pai = new PAttributeInstance(this, title, - M_Warehouse_ID, M_Locator_ID, m_M_Product_ID, m_C_BPartner_ID); - if (pai.getM_AttributeSetInstance_ID() != -1) - { - m_M_AttributeSetInstance_ID = pai.getM_AttributeSetInstance_ID(); - m_M_AttributeSetInstanceName = pai.getM_AttributeSetInstanceName(); - m_M_Locator_ID = pai.getM_Locator_ID(); - m_changed = true; - return true; - } - return false; - } // cmd_select - - /** - * Instance New/Edit - */ - private void cmd_newEdit() - { - boolean rw = cbNewEdit.isSelected(); - if (log.isLoggable(Level.CONFIG)) log.config("R/W=" + rw + " " + m_masi); - // - fieldLotString.setEditable(rw && m_masi.getM_Lot_ID()==0); - if (fieldLot != null) - fieldLot.setReadWrite(rw); - bLot.setReadWrite(rw); - fieldSerNo.setReadWrite(rw); - bSerNo.setReadWrite(rw); - fieldGuaranteeDate.setReadWrite(rw); - // - for (int i = 0; i < m_editors.size(); i++) - { - CEditor editor = (CEditor)m_editors.get(i); - editor.setReadWrite(rw); - } - } // cmd_newEdit - - /** - * Zoom M_Lot - */ - private void cmd_zoom() - { - int M_Lot_ID = 0; - KeyNamePair pp = (KeyNamePair)fieldLot.getSelectedItem(); - if (pp != null) - M_Lot_ID = pp.getKey(); - MQuery zoomQuery = new MQuery("M_Lot"); - zoomQuery.addRestriction("M_Lot_ID", MQuery.EQUAL, M_Lot_ID); - if (log.isLoggable(Level.INFO)) log.info(zoomQuery.toString()); - // - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - // - int AD_Window_ID = WINDOW_LOT; // Lot - AWindow frame = new AWindow(null); - if (frame.initWindow(AD_Window_ID, zoomQuery)) - { - this.setVisible(false); - this.setModal (false); // otherwise blocked - this.setVisible(true); - AEnv.addToWindowManager(frame); - AEnv.showScreen(frame, SwingConstants.EAST); - } - // async window - not able to get feedback - frame = null; - // - setCursor(Cursor.getDefaultCursor()); - } // cmd_zoom - - /** - * Save Selection - * @return true if saved - */ - private boolean saveSelection() - { - log.info(""); - MAttributeSet as = m_masi.getMAttributeSet(); - if (as == null) - return true; - // - m_changed = false; - String mandatory = ""; - if (!m_productWindow && as.isLot()) - { - if (log.isLoggable(Level.FINE)) log.fine("Lot=" + fieldLotString.getText ()); - String text = fieldLotString.getText(); - m_masi.setLot (text); - if (as.isLotMandatory() && (text == null || text.length() == 0)) - mandatory += " - " + Msg.translate(Env.getCtx(), "Lot"); - m_changed = true; - } // Lot - if (!m_productWindow && as.isSerNo()) - { - if (log.isLoggable(Level.FINE)) log.fine("SerNo=" + fieldSerNo.getText()); - String text = fieldSerNo.getText(); - m_masi.setSerNo(text); - if (as.isSerNoMandatory() && (text == null || text.length() == 0)) - mandatory += " - " + Msg.translate(Env.getCtx(), "SerNo"); - m_changed = true; - } // SerNo - if (!m_productWindow && as.isGuaranteeDate()) - { - if (log.isLoggable(Level.FINE)) log.fine("GuaranteeDate=" + fieldGuaranteeDate.getValue()); - Timestamp ts = (Timestamp)fieldGuaranteeDate.getValue(); - m_masi.setGuaranteeDate(ts); - if (as.isGuaranteeDateMandatory() && ts == null) - mandatory += " - " + Msg.translate(Env.getCtx(), "GuaranteeDate"); - m_changed = true; - } // GuaranteeDate - - // *** Save Attributes *** - // New Instance - if (mandatory.isEmpty() && (m_changed || m_masi.getM_AttributeSetInstance_ID() == 0)) - { - m_masi.saveEx(); - m_M_AttributeSetInstance_ID = m_masi.getM_AttributeSetInstance_ID (); - m_M_AttributeSetInstanceName = m_masi.getDescription(); - } - - // Save Instance Attributes - MAttribute[] attributes = as.getMAttributes(!m_productWindow); - for (int i = 0; i < attributes.length; i++) - { - if (MAttribute.ATTRIBUTEVALUETYPE_List.equals(attributes[i].getAttributeValueType())) - { - CComboBox editor = (CComboBox)m_editors.get(i); - MAttributeValue value = (MAttributeValue)editor.getSelectedItem(); - if (log.isLoggable(Level.FINE)) log.fine(attributes[i].getName() + "=" + value); - if (attributes[i].isMandatory() && value == null) - mandatory += " - " + attributes[i].getName(); - attributes[i].setMAttributeInstance(m_M_AttributeSetInstance_ID, value); - } - else if (MAttribute.ATTRIBUTEVALUETYPE_Number.equals(attributes[i].getAttributeValueType())) - { - VNumber editor = (VNumber)m_editors.get(i); - BigDecimal value = (BigDecimal)editor.getValue(); - if (log.isLoggable(Level.FINE)) log.fine(attributes[i].getName() + "=" + value); - if (attributes[i].isMandatory() && value == null) - mandatory += " - " + attributes[i].getName(); - attributes[i].setMAttributeInstance(m_M_AttributeSetInstance_ID, value); - } - else - { - VString editor = (VString)m_editors.get(i); - String value = editor.getText(); - if (log.isLoggable(Level.FINE)) log.fine(attributes[i].getName() + "=" + value); - if (attributes[i].isMandatory() && (value == null || value.length() == 0)) - mandatory += " - " + attributes[i].getName(); - attributes[i].setMAttributeInstance(m_M_AttributeSetInstance_ID, value); - } - m_changed = true; - } // for all attributes - - if (mandatory.length() > 0) - { - ADialog.error(m_WindowNo, this, "FillMandatory", mandatory); - return false; - } - // Save Model - else if (m_changed) - { - m_masi.setDescription (); - m_masi.saveEx(); - } - m_M_AttributeSetInstance_ID = m_masi.getM_AttributeSetInstance_ID (); - m_M_AttributeSetInstanceName = m_masi.getDescription(); - // - return true; - } // saveSelection - - - /************************************************************************** - * Get Instance ID - * @return Instance ID - */ - public int getM_AttributeSetInstance_ID() - { - return m_M_AttributeSetInstance_ID; - } // getM_AttributeSetInstance_ID - - /** - * Get Instance Name - * @return Instance Name - */ - public String getM_AttributeSetInstanceName() - { - return m_M_AttributeSetInstanceName; - } // getM_AttributeSetInstanceName - - /** - * Get Locator ID - * @return M_Locator_ID - */ - public int getM_Locator_ID() - { - return m_M_Locator_ID; - } - - /** - * Value Changed - * @return true if changed - */ - public boolean isChanged() - { - return m_changed; - } // isChanged - -} // VPAttributeDialog diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPassword.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPassword.java deleted file mode 100644 index da1bae2c78..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPassword.java +++ /dev/null @@ -1,229 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Component; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.model.GridField; -import org.compiere.swing.CPassword; - -/** - * Data Binding: - * VEditors call fireVetoableChange(m_columnName, null, getText()); - * GridController (for Single-Row) and VCellExitor (for Multi-Row) - * listen to Vetoable Change Listener (vetoableChange) - * then set the value for that column in the current row in the table - * - * @author Jorg Janke - * @version $Id: VPassword.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public final class VPassword extends CPassword - implements VEditor, KeyListener, ActionListener, FocusListener -{ - /** - * - */ - private static final long serialVersionUID = -5450930268559211811L; - - /** - * IDE Bean Constructor for 30 character updateable field - */ - public VPassword() - { - this("Password", false, false, true, 30, 30, ""); - } // VPassword - - /** - * Detail Constructor - * @param columnName column name - * @param mandatory mandatory - * @param isReadOnly read only - * @param isUpdateable updateable - * @param displayLength display length - * @param fieldLength field length - * @param VFormat format - */ - public VPassword (String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable, - int displayLength, int fieldLength, String VFormat) - { - super (displayLength>VString.MAXDISPLAY_LENGTH ? VString.MAXDISPLAY_LENGTH : displayLength); - super.setName(columnName); - m_columnName = columnName; - if (VFormat == null) - VFormat = ""; - m_VFormat = VFormat; - m_fieldLength = fieldLength; - if (m_VFormat.length() != 0 || m_fieldLength != 0) - setDocument(new MDocString(m_VFormat, m_fieldLength, this)); - if (m_VFormat.length() != 0) - setCaret(new VOvrCaret()); - // - setMandatory(mandatory); - - // Editable - if (isReadOnly || !isUpdateable) - { - setEditable(false); - setBackground(AdempierePLAF.getFieldBackground_Inactive()); - } - - this.addKeyListener(this); - this.addFocusListener(this); - this.addActionListener(this); - - setForeground(AdempierePLAF.getTextColor_Normal()); - setBackground(AdempierePLAF.getFieldBackground_Normal()); - } // VPassword - - /** - * Dispose - */ - public void dispose() - { - m_mField = null; - } // dispose - - private GridField m_mField = null; - - private String m_columnName; - private String m_oldText; - private String m_VFormat; - private int m_fieldLength; - private volatile boolean m_setting = false; - - /** - * Set Editor to value - * @param value value - */ - public void setValue (Object value) - { - if (value == null) - m_oldText = ""; - else - m_oldText = value.toString(); - if (!m_setting) - setText (m_oldText); - } // setValue - - /** - * Property Change Listener - * @param evt event - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * Return Editor value - * @return value - */ - public Object getValue() - { - return String.valueOf(getPassword()); - } // getValue - - /** - * Return Display Value - * @return value - */ - public String getDisplay() - { - return String.valueOf(getPassword()); - } // getDisplay - - /************************************************************************** - * Key Listener Interface - * @param e event - */ - public void keyTyped(KeyEvent e) {} - public void keyPressed(KeyEvent e) {} - - /** - * Key Listener. - * @param e event - */ - public void keyReleased(KeyEvent e) - { - } // keyReleased - - /** - * Data Binding to MTable (via GridController) - Enter pressed - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - String newText = String.valueOf(getPassword()); - // Data Binding - try - { - fireVetoableChange(m_columnName, m_oldText, newText); - } - catch (PropertyVetoException pve) {} - } // actionPerformed - - /** - * Set Field/WindowNo for ValuePreference - * @param mField field - */ - public void setField (GridField mField) - { - m_mField = mField; - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return this; - } // getFocusableComponent - - @Override - public void focusGained(FocusEvent e) { - } - - @Override - public void focusLost(FocusEvent e) { - String newText = String.valueOf(getPassword()); - m_setting = true; - try - { - fireVetoableChange(m_columnName, m_oldText, newText); - } - catch (PropertyVetoException pve) {} - m_setting = false; - } - -} // VPassword - diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPaymentEditor.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPaymentEditor.java deleted file mode 100644 index 30c929d418..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPaymentEditor.java +++ /dev/null @@ -1,580 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2012 Elaine Tan * - * Copyright (C) 2012 Trek Global - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.util.logging.Level; - -import javax.swing.DefaultComboBoxModel; -import javax.swing.JComponent; - -import org.compiere.grid.IPaymentForm; -import org.compiere.grid.VPaymentFormDialog; -import org.compiere.grid.VPaymentFormFactory; -import org.compiere.model.GridField; -import org.compiere.model.GridTab; -import org.compiere.model.MLookup; -import org.compiere.model.MPaymentLookup; -import org.compiere.swing.CButton; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.NamePair; - -/** - * - * @author Elaine - * - */ -public class VPaymentEditor extends JComponent implements VEditor, ActionListener, FocusListener { - - /** - * - */ - private static final long serialVersionUID = 8092151387928370770L; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(VPaymentEditor.class); - /** Search: The Button to open Editor */ - private CButton m_button = new CButton(); - /** The Combo Box if not a Search Lookup */ - private VComboBox m_combo = new VComboBox(); - /** Column Name */ - private String m_columnName; - /** Lookup */ - private MPaymentLookup m_lookup; - /** The Value */ - private Object m_value; - - /** Indicator that value is being set */ - private volatile boolean m_settingValue = false; - /** Indicator that docus is being set */ - private volatile boolean m_settingFocus = false; - /** Indicator that Lookup has focus */ - private volatile boolean m_haveFocus = false; - /** Indicator - inserting new value */ - @SuppressWarnings("unused") - private volatile boolean m_inserting = false; - /** Last Display */ - private String m_lastDisplay = ""; - - private boolean m_stopediting = false; - - private GridField m_mField; - - public VPaymentEditor(GridField gridField, String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable, MPaymentLookup lookup) { - super(); - m_mField = gridField; - super.setName(columnName); - m_combo.setName(columnName); - m_columnName = columnName; - setMandatory(mandatory); - m_lookup = lookup; - if (m_lookup != null) - m_lookup.setMandatory(mandatory); - // - setLayout(new BorderLayout()); - - // Button - m_button.addActionListener(this); - m_button.setFocusable(false); // don't focus when tabbing - m_button.setMargin(new Insets(0, 0, 0, 0)); - m_button.setIcon(Env.getImageIcon("Payment10.gif")); - - // *** VComboBox *** - if (m_lookup != null) - { - // Don't have to fill up combobox if it is readonly - if (!isReadOnly && isUpdateable) - m_lookup.fillComboBox (isMandatory(), true, true, false, false); // IDEMPIERE 90 - m_combo.setModel(m_lookup); - // - // AutoCompletion.enable(m_combo); - m_combo.addActionListener(this); // Selection - // FocusListener to refresh selection before opening - m_combo.addFocusListener(this); - } - - setUI (true); - // ReadWrite - decides what components to show - if (isReadOnly || !isUpdateable || m_lookup == null) - setReadWrite(false); - else - setReadWrite(true); - } - - @Override - public void dispose() { - m_button = null; - m_lookup = null; - m_mField = null; - // - m_combo.getEditor().getEditorComponent().removeFocusListener(this); - m_combo.removeFocusListener(this); - m_combo.removeActionListener(this); - m_combo.setModel(new DefaultComboBoxModel()); // remove reference - // m_combo.removeAllItems(); - m_combo = null; - } - - private void setUI (boolean initial) - { - if (initial) - { - Dimension size = m_combo.getPreferredSize(); - setPreferredSize(new Dimension(size)); // causes r/o to be the same length - setMinimumSize(new Dimension (30, size.height)); - // - Dimension bSize = new Dimension(size.height, size.height); - m_button.setPreferredSize (bSize); - } - - // What to show - this.remove(m_combo); - this.remove(m_button); - // - this.setBorder(null); - this.add(m_combo, BorderLayout.CENTER); - this.add(m_button, BorderLayout.EAST); - } - - @Override - public void setReadWrite(boolean value) { - setReadWrite0(value); - - GridTab m_mTab = m_mField.getGridTab(); - String m_DocStatus = (String) m_mTab.getValue("DocStatus"); - // DocStatus - if (m_DocStatus == null) - m_DocStatus = ""; - // Is the Trx closed? Reversed / Voided / Cloased - if (m_DocStatus.equals("RE") || m_DocStatus.equals("VO") || m_DocStatus.equals("CL")) - { - m_button.setVisible(false); - return; - } - - boolean m_onlyRule = false; - // Document is not complete - allow to change the Payment Rule only - if (m_DocStatus.equals("CO") || m_DocStatus.equals("WP")) - m_onlyRule = false; - else - m_onlyRule = true; - - boolean m_isSOTrx = "Y".equals(Env.getContext(Env.getCtx(), m_mField.getWindowNo(), "IsSOTrx")); - // PO only Rule - if (!m_onlyRule // Only order has Warehouse - && !m_isSOTrx && m_mTab.getValue("M_Warehouse_ID") != null) - m_onlyRule = true; - - m_button.setVisible(value && !m_onlyRule); - } - - private void setReadWrite0(boolean value) - { - boolean rw = value; - if (m_lookup == null) - rw = false; - if (m_combo.isReadWrite() != value) - { - m_combo.setReadWrite(rw); - setUI (false); - if (value) { - m_settingValue = true; // disable actions - refresh(); - m_settingValue = false; - } - setValue (m_value); - } - } - - @Override - public boolean isReadWrite() { - if (m_combo != null) - return m_combo.isReadWrite(); - return true; - } - - @Override - public void setMandatory(boolean mandatory) { - m_combo.setMandatory(mandatory); - } - - @Override - public boolean isMandatory() { - return m_combo.isMandatory(); - } - - @Override - public void setBackground(boolean error) { - m_combo.setBackground(error); - } - - @Override - public void requestFocus () - { - if (m_lookup != null) - m_combo.requestFocus (); - } - - /** - * Request Focus In Window - * @return focus request - */ - @Override - public boolean requestFocusInWindow() - { - return m_combo.requestFocusInWindow(); - } // requestFocusInWindow - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return m_combo; - } // getFocusComponent - - @Override - public void setValue(Object value) { - if (log.isLoggable(Level.FINE)) log.fine(m_columnName + "=" + value); - m_settingValue = true; // disable actions - m_value = value; - - // Set both for switching - if (value == null) - { - m_combo.setValue (value); - m_lastDisplay = ""; - m_settingValue = false; - return; - } - if (m_lookup == null) - { - m_combo.setValue (value); - m_lastDisplay = value.toString(); - m_settingValue = false; - return; - } - - //must call m_combo.setvalue after m_lookup as - //loading of combo data might happen in m_lookup.getDisplay - m_lastDisplay = m_lookup.getDisplay(value); - m_combo.setValue (value); - - if (m_lastDisplay.equals("<-1>")) - { - m_lastDisplay = ""; - m_value = null; - } - boolean notFound = m_lastDisplay.startsWith("<") && m_lastDisplay.endsWith(">"); - - // Nothing showing in Combo and should be showing - if (m_combo.getSelectedItem() == null) - { - // lookup found nothing too - if (notFound) - { - if (log.isLoggable(Level.FINEST)) log.finest(m_columnName + "=" + value + ": Not found - " + m_lastDisplay); - // we may have a new value - m_lookup.refresh(); - m_combo.setValue (value); - m_lastDisplay = m_lookup.getDisplay(value); - notFound = m_lastDisplay.startsWith("<") && m_lastDisplay.endsWith(">"); - } - if (notFound && value instanceof Integer && m_lookup.getDisplayType() != DisplayType.ID) // for IDs is ok to be out of the list - { - m_value = null; - actionCombo (null); // data binding - if (log.isLoggable(Level.FINE)) log.fine(m_columnName + "=" + value + ": Not found"); - } - // we have lookup - else if (m_combo.getSelectedItem() == null) - { - NamePair pp = m_lookup.get(value); - if (pp != null) - { - if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " added to combo - " + pp); - // Add to Combo - m_combo.addItem (pp); - m_combo.setValue (value); - } - } - // Not in Lookup - set to Null - if (m_combo.getSelectedItem() == null) - { - if (value instanceof Integer && m_lookup.getDisplayType() != DisplayType.ID) // for IDs is ok to be out of the list - { - if (log.isLoggable(Level.INFO)) log.info(m_columnName + "=" + value + ": not in Lookup - set to NULL"); - actionCombo (null); // data binding (calls setValue again) - m_value = null; - } - } - } - m_settingValue = false; - } - - @Override - public void propertyChange(PropertyChangeEvent evt) { - if (m_stopediting) - return; - - // log.fine( "VLookup.propertyChange", evt); - if (evt.getPropertyName().equals(GridField.PROPERTY)) - { - m_inserting = GridField.INSERTING.equals(evt.getOldValue()); // MField.setValue - setValue(evt.getNewValue()); - m_inserting = false; - } - } - - @Override - public Object getValue() { - return m_combo.getValue (); - } - - @Override - public String getDisplay() { - return m_combo.getDisplay(); - } - - @Override - public void setField(GridField mField) { - m_mField = mField; - } - - @Override - public GridField getField() { - return m_mField; - } - - @Override - public void actionPerformed(ActionEvent e) { - if (m_settingValue || m_settingFocus || m_stopediting) - return; - if (log.isLoggable(Level.CONFIG)) log.config(m_columnName + " - " + e.getActionCommand() + ", ComboValue=" + m_combo.getSelectedItem()); - - // Combo Selection - if (e.getSource() == m_combo) - { - Object value = getValue(); - Object o = m_combo.getSelectedItem(); - if (o != null) - { - String s = o.toString(); - // don't allow selection of inactive - if (s.startsWith(MLookup.INACTIVE_S) && s.endsWith(MLookup.INACTIVE_E)) - { - if (log.isLoggable(Level.INFO)) log.info(m_columnName + " - selection inactive set to NULL"); - value = null; - } - } - actionCombo (value); // data binding - } - // Button pressed - else if (e.getSource() == m_button) - actionButton (); - } - - @Override - public void addActionListener(ActionListener listener) { - m_combo.addActionListener(listener); - } - - private void actionCombo (Object value) - { - if (log.isLoggable(Level.FINE)) log.fine("Value=" + value); - try - { - // -> GridController.vetoableChange - fireVetoableChange (m_columnName, null, value); - } - catch (PropertyVetoException pve) - { - log.log(Level.SEVERE, m_columnName, pve); - } - // is the value updated ? - boolean updated = false; - - Object updatedValue = value; - - if (updatedValue instanceof Object[] && ((Object[])updatedValue).length > 0) - { - updatedValue = ((Object[])updatedValue)[0]; - } - - if (updatedValue == null && m_value == null) - updated = true; - else if (updatedValue != null && value.equals(m_value)) - updated = true; - if (!updated) - { - // happens if VLookup is used outside of APanel/GridController (no property listener) - if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - Value explicitly set - new=" + updatedValue + ", old=" + m_value); - - // phib: the following check causes the update to fail on jre > 1.6.0_13 - // commenting out as it does not appear to be necessary - //if (getListeners(PropertyChangeListener.class).length <= 0) - setValue(updatedValue); - } - } // actionCombo - - private void actionButton () - { - m_button.setEnabled(false); // disable double click - if (m_lookup == null) - return; // leave button disabled - m_combo.requestFocus(); // closes other editors - - int windowNo = m_lookup.getWindowNo(); - Object newValue = getValue(); - if (newValue != null) - { - IPaymentForm pf = VPaymentFormFactory.create(windowNo, getField().getGridTab(), (String) newValue); - if(pf != null) - { - VPaymentFormDialog dialog = (VPaymentFormDialog) pf.getWindow(); - if(dialog.isInitOK()) - { - dialog.setLocationRelativeTo(null); - pf.showWindow(); - pf.closeWindow(); - getField().getGridTab().dataRefresh(); - } - else - pf.closeWindow(); - } - } - - m_button.setEnabled(true); - m_combo.requestFocus(); - } // actionButton - - @Override - public void focusGained (FocusEvent e) - { - if (m_combo == null || m_combo.getEditor() == null) - return; - if ((e.getSource() != m_combo && e.getSource() != m_combo.getEditor().getEditorComponent()) - || e.isTemporary() || m_haveFocus || m_lookup == null) - return; - - //avoid repeated query - if (m_lookup.isValidated() && m_lookup.isLoaded()) - { - m_haveFocus = true; - return; - } - // - m_haveFocus = true; // prevents calling focus gained twice - m_settingFocus = true; // prevents actionPerformed - // - Object obj = m_lookup.getSelectedItem(); - if (log.isLoggable(Level.CONFIG)) log.config(m_columnName - + " - Start Count=" + m_combo.getItemCount() + ", Selected=" + obj); - // log.fine( "VLookupHash=" + this.hashCode()); - boolean popupVisible = m_combo.isPopupVisible(); - m_lookup.fillComboBox(isMandatory(), true, true, false, false); // only validated & active + IDEMPIERE 90 - if (popupVisible) - { - //refresh - m_combo.hidePopup(); - m_combo.showPopup(); - } - if (log.isLoggable(Level.CONFIG))log.config(m_columnName - + " - Update Count=" + m_combo.getItemCount() + ", Selected=" + m_lookup.getSelectedItem()); - m_lookup.setSelectedItem(obj); - if (log.isLoggable(Level.CONFIG))log.config(m_columnName - + " - Selected Count=" + m_combo.getItemCount() + ", Selected=" + m_lookup.getSelectedItem()); - // - m_settingFocus = false; - } // focusGained - - @Override - public void focusLost(FocusEvent e) - { - if (e.isTemporary() - || m_lookup == null - || !m_button.isEnabled() ) // set by actionButton - return; - // Combo lost focus - if (e.getSource() != m_combo && e.getSource() != m_combo.getEditor().getEditorComponent()) - return; - if (m_lookup.isValidated() && !m_lookup.hasInactive()) - { - m_haveFocus = false; - return; - } - // - m_settingFocus = true; // prevents actionPerformed - // - if (log.isLoggable(Level.CONFIG)) log.config(m_columnName + " = " + m_combo.getSelectedItem()); - Object obj = m_combo.getSelectedItem(); - /* - // set original model - if (!m_lookup.isValidated()) - m_lookup.fillComboBox(true); // previous selection - */ - // Set value - if (obj != null) - { - m_combo.setSelectedItem(obj); - // original model may not have item - if (!m_combo.getSelectedItem().equals(obj)) - { - if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - added to combo - " + obj); - m_combo.addItem(obj); - m_combo.setSelectedItem(obj); - } - } - // actionCombo(getValue()); - m_settingFocus = false; - m_haveFocus = false; // can gain focus again - } // focusLost - - public void setToolTipText(String text) - { - super.setToolTipText(text); - m_button.setToolTipText(text); - m_combo.setToolTipText(text); - } - - public int refresh() - { - if (m_lookup == null) - return -1; - - //no need to refresh readonly lookup, just remove direct cache - if (!isReadWrite()) { - m_lookup.removeAllElements(); - return 0; - } - - return m_lookup.refresh(); - } // refresh - - public void setStopEditing(boolean stopediting) { - m_stopediting = stopediting; - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPostIt.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPostIt.java deleted file mode 100644 index b3b55171d3..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPostIt.java +++ /dev/null @@ -1,325 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.io.BufferedWriter; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.io.UnsupportedEncodingException; -import java.util.logging.Level; - -import javax.swing.JDialog; -import javax.swing.JFileChooser; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JSplitPane; -import javax.swing.JTabbedPane; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.StatusBar; -import org.compiere.model.MPostIt; -import org.compiere.swing.CDialog; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextArea; -import org.compiere.swing.CTextPane; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Post-it, basïżœ sur Editor - * - * @author Nico - */ -public class VPostIt extends CDialog implements ChangeListener, ActionListener, KeyListener -{ - private static final long serialVersionUID = -8314686583942866712L; - - /** - * Standard constructor - * @param frame parent - * @param header heading - * @param postItID - * @param tableID - * @param recordID - * @param trxName - */ - public VPostIt(Frame frame, String header, int postItID, int tableID, int recordID, String trxName) - { - super (frame, header, frame != null); - try - { - jbInit(); - setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - - if (postItID > 0) - m_postIt = new MPostIt (Env.getCtx(), postItID, trxName); - else - m_postIt = new MPostIt (Env.getCtx(), tableID, recordID, trxName); - - // Set Text - textArea.setText(m_postIt.getText()); - textArea.setEditable(true); - textArea.setBackground(AdempierePLAF.getFieldBackground_Normal()); - textPane.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - - String createdupdated = null; - if (m_postIt.getAD_PostIt_ID() > 0) - createdupdated = m_postIt.getCreatedString(); - String updated = m_postIt.getUpdatedString(); - - if (!updated.equals("")) - createdupdated += "\n" + updated; - - modifText.setText(createdupdated); - modifText.setReadWrite(false); - - updateStatusBar(); - - try - { - AEnv.showCenterWindow(frame, this); - } - catch (Exception e) - { - } - modifText.requestFocus(); - } // Editor - - /** Maximum Size */ - private int m_maxSize = 2000; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VPostIt.class); - - private CPanel panel = new CPanel(); - private BorderLayout panelLayout = new BorderLayout(); - private JTabbedPane tabbedPane = new JTabbedPane(); - private CTextArea textArea = new CTextArea(); - private CTextPane textPane = new CTextPane(); - private JMenuBar menuBar = new JMenuBar(); - private JMenu mFile = new JMenu(); - private CMenuItem mImport = new CMenuItem(); - private CMenuItem mExport = new CMenuItem(); - private ConfirmPanel confirmPanel = new ConfirmPanel(); - private StatusBar statusBar = new StatusBar(false); - private CTextArea modifText = new CTextArea(); - private MPostIt m_postIt = null; - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - panel.setLayout(panelLayout); - this.setJMenuBar(menuBar); - // Text Tab - textArea.setPreferredSize(new Dimension(500, 300)); - textArea.setWrapStyleWord(true); - textArea.setLineWrap(true); - tabbedPane.add(textArea, "Text"); - textArea.addKeyListener(this); - // HTML Tab - textPane.setContentType("text/html"); - textPane.setEditable(false); - tabbedPane.add(textPane, "HTML"); - // - // Traduction de File ïżœ partir du message File ; cf org.compiere.apps.AEnv.getMenu(String) - String textFile = Msg.getMsg(Env.getCtx(), "File"); - int pos = textFile.indexOf('&'); - if (pos != -1 && textFile.length() > pos) // We have a nemonic - { - char ch = textFile.toUpperCase().charAt(pos+1); - if (ch != ' ') - textFile = textFile.substring(0, pos) + textFile.substring(pos+1); - } - mFile.setText(textFile); - mImport.setText(Msg.getMsg(Env.getCtx(), "Import")); - mImport.addActionListener(this); - mExport.setText(Msg.getMsg(Env.getCtx(), "Export")); - mExport.addActionListener(this); - tabbedPane.addChangeListener(this); - - modifText.setPreferredSize(new Dimension(500,50)); - JSplitPane textPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, tabbedPane, modifText); - panel.add(textPane, BorderLayout.CENTER); - - confirmPanel.addActionListener(this); - panel.add(confirmPanel, BorderLayout.SOUTH); - this.getContentPane().add(panel, BorderLayout.CENTER); - this.getContentPane().add(statusBar, BorderLayout.SOUTH); - // - menuBar.add(mFile); - mFile.add(mImport); - mFile.add(mExport); - updateStatusBar(); - } // jbInit - - /** - * ActionListener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - m_postIt.setText(textArea.getText()); - m_postIt.saveEx(); - log.fine("OK - length=" + textArea.getText().length()); - dispose(); - } - else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - dispose(); - else if (e.getSource() == mImport) - importText(); - else if (e.getSource() == mExport) - exportText(); - } // actionPerformed - - /** - * Update Status Bar - */ - private void updateStatusBar() - { - String str = textArea.getText(); - int length = str.length(); - statusBar.setStatusDB(length); - int size = length; - try - { - size = str.getBytes("UTF-8").length; - } - catch (UnsupportedEncodingException e) - { - log.log(Level.SEVERE, str, e); - } - - if (m_maxSize == 0) - statusBar.setStatusLine(String.valueOf(size)); - else if (size < m_maxSize) - statusBar.setStatusLine(size + " < " + m_maxSize, false); - else if (size == m_maxSize) - statusBar.setStatusLine(size + " = " + m_maxSize, false); - else - { - statusBar.setStatusLine(size + " > " + m_maxSize, true); - Toolkit.getDefaultToolkit().beep(); - } - } // updateStatusBar - - /** - * Import Text from File - */ - private void importText() - { - JFileChooser jc = new JFileChooser(); - jc.setDialogTitle(Msg.getMsg(Env.getCtx(), "ImportText")); - jc.setDialogType(JFileChooser.OPEN_DIALOG); - jc.setFileSelectionMode(JFileChooser.FILES_ONLY); - // - if (jc.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) - return; - - StringBuffer sb = new StringBuffer(); - try - { - InputStreamReader in = new InputStreamReader (new FileInputStream (jc.getSelectedFile())); - char[] cbuf = new char[1024]; - int count; - while ((count = in.read(cbuf)) > 0) - sb.append(cbuf, 0, count); - in.close(); - } - catch (Exception e) - { - log.log(Level.WARNING, e.getMessage()); - return; - } - textArea.setText(sb.toString()); - updateStatusBar(); - } // importText - - /** - * Export Text to File - */ - private void exportText() - { - JFileChooser jc = new JFileChooser(); - jc.setDialogTitle(Msg.getMsg(Env.getCtx(), "ExportText")); - jc.setDialogType(JFileChooser.SAVE_DIALOG); - jc.setFileSelectionMode(JFileChooser.FILES_ONLY); - // - if (jc.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) - return; - - try - { - BufferedWriter bout = new BufferedWriter (new OutputStreamWriter (new FileOutputStream (jc.getSelectedFile()))); - bout.write(textArea.getText()); - bout.flush(); - bout.close(); - } - catch (Exception e) - { - log.log(Level.WARNING, e.getMessage()); - } - } // exportText - - /** - * ChangeListener for TabbedPane - * @param e event - */ - public void stateChanged(ChangeEvent e) - { - if (tabbedPane.getSelectedIndex() == 1) // switch to HTML - textPane.setText(textArea.getText()); - } // stateChanged - - public void keyTyped (KeyEvent e) - { - } - - public void keyPressed (KeyEvent e) - { - } - - public void keyReleased (KeyEvent e) - { - updateStatusBar(); - } - -} // VPostIt \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VRowIDEditor.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VRowIDEditor.java deleted file mode 100644 index ab294f3f57..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VRowIDEditor.java +++ /dev/null @@ -1,124 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Component; -import java.awt.Insets; -import java.util.EventObject; -import java.util.logging.Level; - -import javax.swing.AbstractCellEditor; -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JTable; -import javax.swing.table.TableCellEditor; - -import org.compiere.util.CLogger; - -/** - * RowID Cell Editor providing Selection - * - * @author Jorg Janke - * @version $Id: VRowIDEditor.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VRowIDEditor extends AbstractCellEditor implements TableCellEditor -{ - /** - * - */ - private static final long serialVersionUID = -787968703981149591L; - - /** - * Constructor - */ - public VRowIDEditor(boolean select) - { - super(); - m_select = select; - m_cb.setMargin(new Insets(0,0,0,0)); - m_cb.setHorizontalAlignment(JLabel.CENTER); - } // VRowIDEditor - - private JCheckBox m_cb = new JCheckBox(); - private Object[] m_rid; - private boolean m_select; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VRowIDEditor.class); - - /** - * Enable Selection to be displayed - */ - public void setEnableSelection(boolean showSelection) - { - m_select = showSelection; - } // setEnableSelection - - /** - * Ask the editor if it can start editing using anEvent. - * This method is intended for the use of client to avoid the cost of - * setting up and installing the editor component if editing is not possible. - * If editing can be started this method returns true - */ - public boolean isCellEditable(EventObject anEvent) - { - return m_select; - } // isCellEditable - - /** - * Sets an initial value for the editor. This will cause the editor to - * stopEditing and lose any partially edited value if the editor is editing - * when this method is called. - * Returns the component that should be added to the client's Component hierarchy. - * Once installed in the client's hierarchy this component - * will then be able to draw and receive user input. - */ - public Component getTableCellEditorComponent(JTable table, - Object value, boolean isSelected, int row, int col) - { - if (log.isLoggable(Level.FINE)) log.fine("Value=" + value + ", row=" + row + ", col=" + col); - m_rid = (Object[])value; - if (m_rid == null || m_rid[1] == null) - m_cb.setSelected(false); - else - { - Boolean sel = (Boolean)m_rid[1]; - m_cb.setSelected(sel.booleanValue()); - } - return m_cb; - } // getTableCellEditorComponent - - /** - * The editing cell should be selected or not - */ - public boolean shouldSelectCell(EventObject anEvent) - { - return m_select; - } // shouldSelectCell - - /** - * Returns the value contained in the editor - */ - public Object getCellEditorValue() - { - if (log.isLoggable(Level.FINE)) log.fine("" + m_cb.isSelected()); - if (m_rid == null) - return null; - m_rid[1] = Boolean.valueOf(m_cb.isSelected()); - return m_rid; - } // getCellEditorValue - -} // VRowIDEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VRowIDRenderer.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VRowIDRenderer.java deleted file mode 100644 index 847275b666..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VRowIDRenderer.java +++ /dev/null @@ -1,78 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Component; - -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JTable; -import javax.swing.table.TableCellRenderer; - -/** - * Renderer for RowID Column - * - * @author Jorg Janke - * @version $Id: VRowIDRenderer.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public final class VRowIDRenderer implements TableCellRenderer -{ - /** - * Constructor - */ - public VRowIDRenderer(boolean enableSelection) - { - m_select = enableSelection; - } // VRowIDRenderer - - private boolean m_select = false; - private JButton m_button = new JButton(); - private JCheckBox m_check = null; - - /** - * Enable Selection to be displayed - */ - public void setEnableSelection(boolean showSelection) - { - m_select = showSelection; - } // setEnableSelection - - /** - * Return TableCell Renderer Component - */ - public Component getTableCellRendererComponent(JTable table, Object value, - boolean isSelected, boolean hasFocus, int row, int column) - { - if (m_select) - { - if (m_check == null) - m_check = new JCheckBox(); - Object[] data = (Object[])value; - if (data == null || data[1] == null) - m_check.setSelected(false); - else - { - Boolean sel = (Boolean)data[1]; - m_check.setSelected(sel.booleanValue()); - } - return m_check; - } - else - return m_button; - } // getTableCellRenderereComponent - -} // VRowIDRenderer diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VString.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VString.java deleted file mode 100644 index 16d1f5a1e8..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VString.java +++ /dev/null @@ -1,440 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Font; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.util.logging.Level; - -import javax.swing.JPopupMenu; -import javax.swing.SwingUtilities; -import javax.swing.event.CaretListener; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.FieldRecordInfo; -import org.compiere.model.GridField; -import org.compiere.model.MRole; -import org.compiere.model.Obscure; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Data Binding: - * VEditors call fireVetoableChange(m_columnName, null, getText()); - * GridController (for Single-Row) and VCellExitor (for Multi-Row) - * listen to Vetoable Change Listener (vetoableChange) - * then set the value for that column in the current row in the table - * - * @author Jorg Janke - * @version $Id: VString.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ - */ -public final class VString extends CTextField - implements VEditor, ActionListener, FocusListener -{ - /** - * - */ - private static final long serialVersionUID = 4537820279343591025L; - - /** Max Display Length - 60 */ - public static final int MAXDISPLAY_LENGTH = org.compiere.model.GridField.MAXDISPLAY_LENGTH; - - /****************************************************************************** - * Mouse Listener - */ - final class VString_mouseAdapter extends MouseAdapter - { - /** - * Constructor - * @param adaptee adaptee - */ - VString_mouseAdapter(VString adaptee) - { - m_adaptee = adaptee; - } // VString_mouseAdapter - - private VString m_adaptee; - - /** - * Mouse Listener - * @param e event - */ - public void mouseClicked(MouseEvent e) - { - // popup menu - if (SwingUtilities.isRightMouseButton(e)) - m_adaptee.popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - } // mouseClicked - - } // VText_mouseAdapter - - /** - * IDE Bean Constructor for 30 character updateable field - */ - public VString() - { - this("String", false, false, true, 30, 30, "", null); - } // VString - - /** - * Detail Constructor - * @param columnName column name - * @param mandatory mandatory - * @param isReadOnly read only - * @param isUpdateable updateable - * @param displayLength display length - * @param fieldLength field length - * @param VFormat format - * @param ObscureType obscure type - */ - public VString (String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable, - int displayLength, int fieldLength, String VFormat, String ObscureType) - { - super(displayLength>MAXDISPLAY_LENGTH ? MAXDISPLAY_LENGTH : displayLength); - super.setName(columnName); - m_columnName = columnName; - if (VFormat == null) - VFormat = ""; - m_VFormat = VFormat; - m_fieldLength = fieldLength; - if (m_VFormat.length() != 0 || m_fieldLength != 0) - setDocument(new MDocString(m_VFormat, m_fieldLength, this)); - if (m_VFormat.length() != 0) - setCaret(new VOvrCaret()); - // - setMandatory(mandatory); - if (ObscureType != null && ObscureType.length() > 0) - { - m_obscure = new Obscure ("", ObscureType); - m_stdFont = getFont(); - m_obscureFont = new Font("SansSerif", Font.ITALIC, m_stdFont.getSize()); - } - - // Editable - if (isReadOnly || !isUpdateable) - { - setEditable(false); - setBackground(AdempierePLAF.getFieldBackground_Inactive()); - } - - this.addKeyListener(this); - this.addActionListener(this); - this.addFocusListener(this); - addMouseListener(new VString_mouseAdapter(this)); - // Popup for Editor - if (fieldLength > displayLength) - { - mEditor = new CMenuItem (Msg.getMsg(Env.getCtx(), "Editor"), Env.getImageIcon("Editor16.gif")); - mEditor.addActionListener(this); - popupMenu.add(mEditor); - } - setForeground(AdempierePLAF.getTextColor_Normal()); - setBackground(AdempierePLAF.getFieldBackground_Normal()); - } // VString - - /** - * Dispose - */ - public void dispose() - { - m_mField = null; - } // dispose - - /** Popup Menu */ - JPopupMenu popupMenu = new JPopupMenu(); - /** Editor Menu Item */ - private CMenuItem mEditor; - /** Grid Field */ - private GridField m_mField = null; - /** Column Name */ - private String m_columnName; - private String m_oldText; - private String m_initialText; - private String m_VFormat; - /** Field Length */ - private int m_fieldLength; - /** Obcure Setting */ - private Obscure m_obscure = null; - private Font m_stdFont = null; - private Font m_obscureFont = null; - /** Setting new value */ - private volatile boolean m_setting = false; - /** Field in focus */ - private volatile boolean m_infocus = false; - - /** Logger */ - private static CLogger log = CLogger.getCLogger (VString.class); - - /** - * Set Editor to value - * @param value value - */ - public void setValue(Object value) - { - // log.config( "VString.setValue", value); - if (value == null) - m_oldText = ""; - else - m_oldText = value.toString(); - // only set when not updated here - if (m_setting) - return; - setText (m_oldText); - m_initialText = m_oldText; - // If R/O left justify - if (!isEditable() || !isEnabled()) - setCaretPosition(0); - } // setValue - - /** - * Property Change Listener - * @param evt event - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * Return Editor value - * @return value - */ - public Object getValue() - { - return getText(); - } // getValue - - /** - * Return Display Value - * @return value - */ - public String getDisplay() - { - return super.getText(); // optionally obscured - } // getDisplay - - - /** - * Key Released. - * if Escape Restore old Text - * @param e event - */ - public void keyReleased(KeyEvent e) - { - if (log.isLoggable(Level.FINEST)) log.finest("Key=" + e.getKeyCode() + " - " + e.getKeyChar() - + " -> " + getText()); - // ESC - if (e.getKeyCode() == KeyEvent.VK_ESCAPE) - setText(m_initialText); - } // keyReleased - - /** - * Data Binding to MTable (via GridController) - Enter pressed - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ValuePreference.NAME)) - { - if (MRole.getDefault().isShowPreference() && !m_mField.isEncrypted() && !m_mField.isEncryptedColumn()) - ValuePreference.start (m_mField, getValue()); - return; - } - else if(e.getActionCommand().equals(FieldRecordInfo.CHANGE_LOG_COMMAND)) - { - FieldRecordInfo.start(m_mField); - return; - } - - // Invoke Editor - if (e.getSource() == mEditor) - { - String s = Editor.startEditor(this, Msg.translate(Env.getCtx(), m_columnName), - getText(), isEditable(), m_fieldLength); - setText(s); - } - // Data Binding - try - { - fireVetoableChange(m_columnName, m_oldText, getText()); - } - catch (PropertyVetoException pve) - { - } - } // actionPerformed - - /** - * Set Field/WindowNo for ValuePreference - * @param mField field - */ - public void setField (GridField mField) - { - m_mField = mField; - if (m_mField != null - && MRole.getDefault().isShowPreference() - && !mField.isEncrypted() && !mField.isEncryptedColumn()) - ValuePreference.addMenu (this, popupMenu); - if (m_mField != null) - FieldRecordInfo.addMenu(this, popupMenu); - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - /** - * Feature Request [1707462] - * Set VFormat - * @param strMask mask - * @author fer_luck - */ - public void setVFormat (String strMask) - { - m_VFormat = strMask; - //Get the actual caret from the field, if there's no - //caret then just catch the exception and continue - //creating the new caret. - try{ - CaretListener [] cl = this.getCaretListeners(); - this.removeCaretListener(cl[0]); - } catch(ClassCastException ex ){ - log.fine("VString.setVFormat - No caret Listeners"); - } - - //hengsin: [ adempiere-Bugs-1891037 ], preserve current data before change of format - String s = getText(); - setDocument(new MDocString(m_VFormat, m_fieldLength, this)); - setText(s); - } // setVFormat - - /** - * Set Text (optionally obscured) - * @param text text - */ - public void setText (String text) - { - if (m_obscure != null && !m_infocus) - { - super.setFont(m_obscureFont); - super.setText (m_obscure.getObscuredValue(text)); - super.setForeground(Color.gray); - } - else - { - if (m_stdFont != null) - { - super.setFont(m_stdFont); - super.setForeground(AdempierePLAF.getTextColor_Normal()); - } - super.setText (text); - } - } // setText - - - /** - * Get Text (clear) - * @return text - */ - public String getText () - { - String text = super.getText(); - if (m_obscure != null && text != null && text.length() > 0) - { - if (isReadWrite() && text.equals(m_obscure.getObscuredValue())) - text = m_obscure.getClearValue(); - } - return text; - } // getText - - /** - * Feature Request [1707462] - * Get VFormat - * @return strMask mask - * @author fer_luck - */ - public String getVFormat () - { - return this.m_VFormat; - } // getVFormat - - /** - * Focus Gained. - * Enabled with Obscure - * @param e event - */ - public void focusGained (FocusEvent e) - { - m_infocus = true; - setText(getText()); // clear - } // focusGained - - /** - * Focus Lost - * Enabled with Obscure - * @param e event - */ - public void focusLost (FocusEvent e) - { - m_setting = true; - try - { - String clear = getText(); - if (clear.length() > m_fieldLength) - clear = clear.substring(0, m_fieldLength); - fireVetoableChange (m_columnName, m_oldText, clear); - } - catch (PropertyVetoException pve) - { - } - m_setting = false; - - m_infocus = false; - setText(getText()); // obscure - } // focus Lost - - @Override - public void setFont(Font f) { - super.setFont(f); - m_stdFont = f; - m_obscureFont = new Font("SansSerif", Font.ITALIC, m_stdFont.getSize()); - } - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return this; - } // getFocusableComponent - -} // VString \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VStringBeanInfo.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VStringBeanInfo.java deleted file mode 100644 index 236a62f2b5..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VStringBeanInfo.java +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.beans.BeanInfo; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.beans.SimpleBeanInfo; - -/** - * Generated - * - * @author Jorg Janke - * @version $Id: VStringBeanInfo.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ - -public class VStringBeanInfo extends SimpleBeanInfo -{ - private Class beanClass = VString.class; - private String iconColor16x16Filename; - private String iconColor32x32Filename; - private String iconMono16x16Filename; - private String iconMono32x32Filename; - - public VStringBeanInfo() - { - } - public PropertyDescriptor[] getPropertyDescriptors() - { - try - { - PropertyDescriptor _display = new PropertyDescriptor("display", beanClass, "getDisplay", null); - PropertyDescriptor _editable = new PropertyDescriptor("editable", beanClass, null, "setEditable"); - PropertyDescriptor _mandatory = new PropertyDescriptor("mandatory", beanClass, "isMandatory", "setMandatory"); - PropertyDescriptor _value = new PropertyDescriptor("value", beanClass, "getValue", "setValue"); - PropertyDescriptor[] pds = new PropertyDescriptor[] { - _display, - _editable, - _mandatory, - _value}; - return pds; - - - - -} - catch(IntrospectionException ex) - { - ex.printStackTrace(); - return null; - } - } - public java.awt.Image getIcon(int iconKind) - { - switch (iconKind) { - case BeanInfo.ICON_COLOR_16x16: - return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null; - case BeanInfo.ICON_COLOR_32x32: - return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null; - case BeanInfo.ICON_MONO_16x16: - return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null; - case BeanInfo.ICON_MONO_32x32: - return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null; - } - return null; - } - public BeanInfo[] getAdditionalBeanInfo() - { - Class superclass = beanClass.getSuperclass(); - try - { - BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass); - return new BeanInfo[] { superBeanInfo }; - } - catch(IntrospectionException ex) - { - ex.printStackTrace(); - return null; - } - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VText.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VText.java deleted file mode 100644 index 9f4f568378..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VText.java +++ /dev/null @@ -1,281 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Component; -import java.awt.Container; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; - -import javax.swing.JPopupMenu; -import javax.swing.LookAndFeel; -import javax.swing.SwingUtilities; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.AEnv; -import org.compiere.apps.FieldRecordInfo; -import org.compiere.apps.ScriptEditor; -import org.compiere.model.GridField; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CTextArea; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Text Control (JTextArea embedded in JScrollPane) - * - * @author Jorg Janke - * @version $Id: VText.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VText extends CTextArea - implements VEditor, KeyListener, ActionListener, FocusListener -{ - - /** - * - */ - private static final long serialVersionUID = 189322325798427286L; - - /** - * Mouse Listener - */ - final class VText_mouseAdapter extends MouseAdapter - { - /** - * Constructor - * @param adaptee VText - */ - VText_mouseAdapter(VText adaptee) - { - this.adaptee = adaptee; - } // VText_mouseAdapter - - private VText adaptee; - - /** - * Mouse Listener - * @param e event - */ - public void mouseClicked(MouseEvent e) - { - // popup menu - if (SwingUtilities.isRightMouseButton(e)) - adaptee.popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - } // mouse Clicked - - } // VText_mouseAdapter - - /** - * Standard Constructor - * @param columnName column name - * @param mandatory mandatory - * @param isReadOnly read only - * @param isUpdateable updateable - * @param displayLength display length - * @param fieldLength field length - */ - public VText (String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable, - int displayLength, int fieldLength) - { - super (fieldLength < 300 ? 2 : 3, 50); - super.setName(columnName); - LookAndFeel.installBorder(this, "TextField.border"); - - // Create Editor - setColumns(displayLength>VString.MAXDISPLAY_LENGTH ? VString.MAXDISPLAY_LENGTH : displayLength); // 46 - setForeground(AdempierePLAF.getTextColor_Normal()); - setBackground(AdempierePLAF.getFieldBackground_Normal()); - - setLineWrap(true); - setWrapStyleWord(true); - setMandatory(mandatory); - m_columnName = columnName; - m_fieldLength = fieldLength; - - if (isReadOnly || !isUpdateable) - setReadWrite(false); - addKeyListener(this); - addFocusListener(this); - - // Popup - addMouseListener(new VText_mouseAdapter(this)); - if (columnName.equals("Script")) - menuEditor = new CMenuItem(Msg.getMsg(Env.getCtx(), "Script"), Env.getImageIcon("Script16.gif")); - else - menuEditor = new CMenuItem(Msg.getMsg(Env.getCtx(), "Editor"), Env.getImageIcon("Editor16.gif")); - menuEditor.addActionListener(this); - popupMenu.add(menuEditor); - } // VText - - /** - * Dispose - */ - public void dispose() - { - } // dispose - - JPopupMenu popupMenu = new JPopupMenu(); - private CMenuItem menuEditor; - private int m_fieldLength; - private String m_columnName; - private String m_oldText; - private String m_initialText; - private volatile boolean m_setting = false; - private GridField m_mField; - - /** - * Set Editor to value - * @param value value - */ - public void setValue(Object value) - { - if (value == null) - m_oldText = ""; - else - m_oldText = value.toString(); - if (m_setting) - return; - super.setValue(m_oldText); - m_initialText = m_oldText; - // Always position Top - setCaretPosition(0); - } // setValue - - /** - * Property Change Listener - * @param evt event - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * ActionListener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (e.getSource() == menuEditor) - { - menuEditor.setEnabled(false); - String s = null; - if (m_columnName.equals("Script") || m_columnName.endsWith("_Script")) - s = ScriptEditor.start ( - AEnv.getFrame(this.getParent()), - Msg.translate(Env.getCtx(), m_columnName), getText(), isEditable(), - findWindowNo()); - else - s = Editor.startEditor (this, Msg.translate(Env.getCtx(), m_columnName), - getText(), isEditable(), m_fieldLength); - menuEditor.setEnabled(true); - // Data Binding - try - { - fireVetoableChange(m_columnName, m_oldText, s); - } - catch (PropertyVetoException pve) {} - } - else if (e.getActionCommand().equals(FieldRecordInfo.CHANGE_LOG_COMMAND)) - { - FieldRecordInfo.start(m_mField); - return; - } - } // actionPerformed - - private int findWindowNo() { - Container c = this.getParent(); - return c != null ? AEnv.getWindowNo(c) : 0; - } - - /** - * Action Listener Interface - NOP - * @param listener listener - */ - public void addActionListener(ActionListener listener) - { - } // addActionListener - - /************************************************************************** - * Key Listener Interface - * @param e event - */ - public void keyTyped(KeyEvent e) {} - public void keyPressed(KeyEvent e) {} - - /** - * Key Released - * if Escape restore old Text. - * @param e event - */ - public void keyReleased(KeyEvent e) - { - // ESC - if (e.getKeyCode() == KeyEvent.VK_ESCAPE) - setText(m_initialText); - } // keyReleased - - /** - * Set Field/WindowNo for ValuePreference (NOP) - * @param mField field model - */ - public void setField (org.compiere.model.GridField mField) - { - m_mField = mField; - if (m_mField != null) - FieldRecordInfo.addMenu(this, popupMenu); - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - @Override - public void focusGained(FocusEvent e) { - } - - @Override - public void focusLost(FocusEvent e) { - m_setting = true; - try - { - fireVetoableChange(m_columnName, m_oldText, getText()); - } - catch (PropertyVetoException pve) {} - m_setting = false; - } - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return this; - } // getFocusableComponent - -} // VText diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VTextBeanInfo.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VTextBeanInfo.java deleted file mode 100644 index ce34170e37..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VTextBeanInfo.java +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.beans.BeanInfo; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.beans.SimpleBeanInfo; - -/** - * Generated - * - * @author Jorg Janke - * @version $Id: VTextBeanInfo.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ - -public class VTextBeanInfo extends SimpleBeanInfo -{ - private Class beanClass = VText.class; - private String iconColor16x16Filename; - private String iconColor32x32Filename; - private String iconMono16x16Filename; - private String iconMono32x32Filename; - - public VTextBeanInfo() - { - } - public PropertyDescriptor[] getPropertyDescriptors() - { - try - { - PropertyDescriptor _background = new PropertyDescriptor("background", beanClass, null, "setBackground"); - PropertyDescriptor _border = new PropertyDescriptor("border", beanClass, null, "setBorder"); - PropertyDescriptor _display = new PropertyDescriptor("display", beanClass, "getDisplay", null); - PropertyDescriptor _editable = new PropertyDescriptor("editable", beanClass, "isEditable", "setEditable"); - PropertyDescriptor _font = new PropertyDescriptor("font", beanClass, null, "setFont"); - PropertyDescriptor _foreground = new PropertyDescriptor("foreground", beanClass, null, "setForeground"); - PropertyDescriptor _mandatory = new PropertyDescriptor("mandatory", beanClass, "isMandatory", "setMandatory"); - PropertyDescriptor _value = new PropertyDescriptor("value", beanClass, "getValue", "setValue"); - PropertyDescriptor[] pds = new PropertyDescriptor[] { - _background, - _border, - _display, - _editable, - _font, - _foreground, - _mandatory, - _value}; - return pds; - - - - - - - - -} - catch(IntrospectionException ex) - { - ex.printStackTrace(); - return null; - } - } - public java.awt.Image getIcon(int iconKind) - { - switch (iconKind) { - case BeanInfo.ICON_COLOR_16x16: - return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null; - case BeanInfo.ICON_COLOR_32x32: - return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null; - case BeanInfo.ICON_MONO_16x16: - return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null; - case BeanInfo.ICON_MONO_32x32: - return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null; - } - return null; - } - public BeanInfo[] getAdditionalBeanInfo() - { - Class superclass = beanClass.getSuperclass(); - try - { - BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass); - return new BeanInfo[] { superBeanInfo }; - } - catch(IntrospectionException ex) - { - ex.printStackTrace(); - return null; - } - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VTextLong.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VTextLong.java deleted file mode 100644 index 2c9411006e..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VTextLong.java +++ /dev/null @@ -1,287 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.util.logging.Level; - -import javax.swing.JFrame; -import javax.swing.JPopupMenu; -import javax.swing.LookAndFeel; -import javax.swing.SwingUtilities; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.AEnv; -import org.compiere.apps.FieldRecordInfo; -import org.compiere.model.GridField; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CTextPane; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Long Text (CBLOB) Editor - * - * @author Jorg Janke - * @version $Id: VTextLong.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VTextLong extends CTextPane - implements VEditor, KeyListener, ActionListener, FocusListener -{ - /** - * - */ - private static final long serialVersionUID = 7954461878765188455L; - - /** - * Mouse Listener - */ - final class VTextLong_mouseAdapter extends MouseAdapter - { - /** - * Constructor - * @param adaptee VText - */ - VTextLong_mouseAdapter(VTextLong adaptee) - { - this.adaptee = adaptee; - } // VText_mouseAdapter - - private VTextLong adaptee; - - /** - * Mouse Listener - * @param e event - */ - public void mouseClicked(MouseEvent e) - { - // popup menu - if (SwingUtilities.isRightMouseButton(e)) - adaptee.popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - } // mouse Clicked - - } // VTextLong_mouseAdapter - - /** - * Factory: Start Editor - * @param jc container to get parent frame - * @param header heading - * @param text initial text - * @param editable if false = r/o - * @return edited string - */ - public static String startEditor(Container jc, String header, String text, boolean editable) - { - // Find frame - JFrame frame = AEnv.getFrame(jc); - // Start it - HTMLEditor ed = new HTMLEditor (frame, header, text, editable); - String s = ed.getHtmlText(); - ed = null; - return s; - } // startEditor - - /** - * Standard Constructor - * @param columnName column name - * @param mandatory mandatory - * @param isReadOnly read only - * @param isUpdateable updateable - * @param displayLength display length - * @param fieldLength field length - */ - public VTextLong (String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable, - int displayLength, int fieldLength) - { - super (); - super.setName(columnName); - LookAndFeel.installBorder(this, "TextField.border"); - setPreferredSize(new Dimension (500,80)); - - // Create Editor - setForeground(AdempierePLAF.getTextColor_Normal()); - setBackground(AdempierePLAF.getFieldBackground_Normal()); - - setMandatory(mandatory); - m_columnName = columnName; - - if (isReadOnly || !isUpdateable) - setReadWrite(false); - addKeyListener(this); - addFocusListener(this); - - // Popup - addMouseListener(new VTextLong_mouseAdapter(this)); - menuEditor = new CMenuItem(Msg.getMsg(Env.getCtx(), "Editor"), Env.getImageIcon("Editor16.gif")); - menuEditor.addActionListener(this); - popupMenu.add(menuEditor); - } // VText - - /** - * Dispose - */ - public void dispose() - { - } // dispose - - JPopupMenu popupMenu = new JPopupMenu(); - private CMenuItem menuEditor; - - private String m_columnName; - private String m_oldText; - private String m_initialText; - private volatile boolean m_setting = false; - private GridField m_mField; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VTextLong.class); - - /** - * Set Editor to value - * @param value value - */ - public void setValue(Object value) - { - if (value == null) - m_oldText = ""; - else - m_oldText = value.toString(); - if (m_setting) - return; - super.setValue(m_oldText); - m_initialText = m_oldText; - // Always position Top - setCaretPosition(0); - } // setValue - - /** - * Property Change Listener - * @param evt event - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * ActionListener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (log.isLoggable(Level.FINEST)) log.finest( "VTestLong.actionPerformed - " + e.getActionCommand()); - if (e.getSource() == menuEditor) - { - menuEditor.setEnabled(false); - String s = VTextLong.startEditor (this, Msg.translate(Env.getCtx(), m_columnName), getText(), isEditable()); - menuEditor.setEnabled(true); - // - // Data Binding - try - { - fireVetoableChange(m_columnName, m_oldText, s); - } - catch (PropertyVetoException pve) {} - } - else if (e.getActionCommand().equals(FieldRecordInfo.CHANGE_LOG_COMMAND)) - { - FieldRecordInfo.start(m_mField); - return; - } - } // actionPerformed - - /** - * Action Listener Interface - NOP - * @param listener listener - */ - public void addActionListener(ActionListener listener) - { - } // addActionListener - - /************************************************************************** - * Key Listener Interface - * @param e event - */ - public void keyTyped(KeyEvent e) {} - public void keyPressed(KeyEvent e) {} - - /** - * Key Released - * if Escape restore old Text. - * @param e event - */ - public void keyReleased(KeyEvent e) - { - // ESC - if (e.getKeyCode() == KeyEvent.VK_ESCAPE) - setText(m_initialText); - } // keyReleased - - /** - * Set Field/WindowNo for ValuePreference - * @param mField field model - */ - public void setField (org.compiere.model.GridField mField) - { - m_mField = mField; - if (m_mField != null) - FieldRecordInfo.addMenu(this, popupMenu); - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - @Override - public void focusGained(FocusEvent e) { - } - - @Override - public void focusLost(FocusEvent e) { - m_setting = true; - try - { - fireVetoableChange(m_columnName, m_oldText, getText()); - } - catch (PropertyVetoException pve) {} - m_setting = false; - } - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return this; - } // getFocusableComponent - -} // VTextLong \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VURL.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VURL.java deleted file mode 100644 index dbf6d1698a..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VURL.java +++ /dev/null @@ -1,537 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.net.URL; -import java.util.logging.Level; - -import javax.swing.JComponent; -import javax.swing.JPopupMenu; -import javax.swing.JTextField; -import javax.swing.LookAndFeel; -import javax.swing.SwingUtilities; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ADialog; -import org.compiere.apps.FieldRecordInfo; -import org.compiere.model.GridField; -import org.compiere.model.MRole; -import org.compiere.swing.CButton; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * URL Editor - * - * @author Jorg Janke - * @version $Id: VURL.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VURL extends JComponent - implements VEditor, ActionListener, KeyListener, FocusListener -{ - /** - * - */ - private static final long serialVersionUID = 8055870820325408717L; - - /****************************************************************************** - * Mouse Listener - */ - final class VURL_mouseAdapter extends MouseAdapter - { - /** - * Constructor - * @param adaptee adaptee - */ - VURL_mouseAdapter(VURL adaptee) - { - m_adaptee = adaptee; - } // VString_mouseAdapter - - private VURL m_adaptee; - - /** - * Mouse Listener - * @param e event - */ - public void mouseClicked(MouseEvent e) - { - // popup menu - if (SwingUtilities.isRightMouseButton(e)) - m_adaptee.popupMenu.show((Component)e.getSource(), e.getX(), e.getY()); - } // mouseClicked - - } // VURL_mouseAdapter - - /** - * IDE Constructor - */ - public VURL () - { - this ("URL", false, false, true, 20, 60); - } // VURL - - /** - * Detail Constructor - * @param columnName column name - * @param mandatory mandatory - * @param isReadOnly read only - * @param isUpdateable updateable - * @param displayLength display length - * @param fieldLength field length - */ - public VURL (String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable, - int displayLength, int fieldLength) - { - super.setName(columnName); - m_columnName = columnName; - m_fieldLength = fieldLength; - m_mandatory = mandatory; - LookAndFeel.installBorder(this, "TextField.border"); - this.setLayout(new BorderLayout()); - // Size - this.setPreferredSize(m_text.getPreferredSize()); - int height = m_text.getPreferredSize().height; - - // *** Text *** - m_text = new CTextField(displayLength>VString.MAXDISPLAY_LENGTH ? VString.MAXDISPLAY_LENGTH : displayLength); - m_text.setEditable(isReadOnly); - m_text.setFocusable(true); - m_text.setBorder(null); - m_text.setHorizontalAlignment(JTextField.LEADING); - - // Background - setMandatory(mandatory); - this.add(m_text, BorderLayout.CENTER); - - // *** Button *** - m_button.setIcon(Env.getImageIcon("Online10.gif")); // should be 10 - m_button.setMargin(new Insets(0, 0, 0, 0)); - m_button.setPreferredSize(new Dimension(height, height)); - m_button.addActionListener(this); - m_button.setFocusable(false); - this.add(m_button, BorderLayout.EAST); - - // Preferred Size - this.setPreferredSize(this.getPreferredSize()); // causes r/o to be the same length - // ReadWrite - if (isReadOnly || !isUpdateable) - setReadWrite(false); - else - setReadWrite(true); - - m_text.addKeyListener(this); - m_text.addFocusListener(this); - m_text.addActionListener(this); - m_text.addMouseListener(new VURL_mouseAdapter(this)); - // Popup for Editor - if (fieldLength > displayLength) - { - mEditor = new CMenuItem (Msg.getMsg(Env.getCtx(), "Editor"), Env.getImageIcon("Editor16.gif")); - mEditor.addActionListener(this); - popupMenu.add(mEditor); - } - setForeground(AdempierePLAF.getTextColor_Normal()); - setBackground(AdempierePLAF.getFieldBackground_Normal()); - } // VURL - - /** Logger */ - private static CLogger log = CLogger.getCLogger (VURL.class); - /** Column Name */ - private String m_columnName; - /** The Text */ - private CTextField m_text = new CTextField(); - private boolean m_readWrite; - private boolean m_mandatory; - /** The Button */ - private CButton m_button = new CButton(); - /** Popup Menu */ - JPopupMenu popupMenu = new JPopupMenu(); - /** Editor Menu Item */ - private CMenuItem mEditor; - /** Grid Field */ - private GridField m_mField = null; - - private String m_oldText; - private String m_initialText; - /** Setting new value */ - private volatile boolean m_setting = false; - /** Field in focus */ - @SuppressWarnings("unused") - private volatile boolean m_infocus = false; - /** Field Length */ - private int m_fieldLength; - - /** - * Dispose resources - */ - public void dispose() - { - m_text = null; - m_button = null; - m_mField = null; - } // dispose - - /** - * Set Mandatory - * @param mandatory mandatory - */ - public void setMandatory (boolean mandatory) - { - m_mandatory = mandatory; - m_text.setMandatory(mandatory); - setBackground (false); - } // setMandatory - - /** - * Get Mandatory - * @return mandatory - */ - public boolean isMandatory() - { - return m_mandatory; - } // isMandatory - - /** - * Set ReadWrite - * @param rw read/write - */ - public void setReadWrite (boolean rw) - { - m_readWrite = rw; - m_text.setReadWrite(rw); - setBackground (false); - } // setReadWrite - - /** - * Is Read Write - * @return read write - */ - public boolean isReadWrite() - { - return m_readWrite; - } // isReadWrite - - /** - * Set Foreground - * @param color color - */ - public void setForeground (Color color) - { - m_text.setForeground(color); - } // SetForeground - - /** - * Set Background - * @param error Error - */ - public void setBackground (boolean error) - { - if (error) - setBackground(AdempierePLAF.getFieldBackground_Error()); - else if (!m_readWrite) - setBackground(AdempierePLAF.getFieldBackground_Inactive()); - else if (m_mandatory) - setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - else - setBackground(AdempierePLAF.getFieldBackground_Normal()); - } // setBackground - - /** - * Set Background - * @param color Color - */ - public void setBackground (Color color) - { - m_text.setBackground(color); - } // setBackground - - /** - * Set Editor to value - * @param value value - */ - public void setValue(Object value) - { - // log.config( "VString.setValue", value); - if (value == null) - m_oldText = ""; - else - m_oldText = value.toString(); - // only set when not updated here - if (m_setting) - return; - setText (m_oldText); - m_initialText = m_oldText; - // If R/O left justify - if (!m_text.isEditable() || !isEnabled()) - m_text.setCaretPosition(0); - } // setValue - - /** - * Property Change Listener - * @param evt event - */ - public void propertyChange (PropertyChangeEvent evt) - { - if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) - setValue(evt.getNewValue()); - } // propertyChange - - /** - * Return Editor value - * @return value - */ - public Object getValue() - { - return getText(); - } // getValue - - /** - * Return Display Value - * @return value - */ - public String getDisplay() - { - return m_text.getText(); - } // getDisplay - - - /** - * Key Released. - * if Escape Restore old Text - * @param e event - */ - public void keyReleased(KeyEvent e) - { - if (log.isLoggable(Level.FINEST)) log.finest("Key=" + e.getKeyCode() + " - " + e.getKeyChar() - + " -> " + getText()); - // ESC - if (e.getKeyCode() == KeyEvent.VK_ESCAPE) - setText(m_initialText); - } // keyReleased - - /** - * Key Pressed - * @param e ignored - */ - public void keyPressed (KeyEvent e) - { - } // keyPressed - /** - * Key Typed - * @param e ignored - */ - public void keyTyped (KeyEvent e) - { - } // keyTyped - - /** - * Add Action Listener - * @param listener listener - */ - public void addActionListener (ActionListener listener) - { - m_text.addActionListener(listener); - } // addActionListener - - /** - * Data Binding to MTable (via GridController) - Enter pressed - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(ValuePreference.NAME)) - { - if (MRole.getDefault().isShowPreference() && !m_mField.isEncrypted() && !m_mField.isEncryptedColumn()) - ValuePreference.start (m_mField, getValue()); - return; - } - else if (e.getActionCommand().equals(FieldRecordInfo.CHANGE_LOG_COMMAND)) - { - FieldRecordInfo.start(m_mField); - return; - } - - // Invoke Editor - else if (e.getSource() == mEditor) - { - String s = Editor.startEditor(this, Msg.translate(Env.getCtx(), m_columnName), - getText(), m_text.isEditable(), m_fieldLength); - setText(s); - } - // - else if (e.getSource() == m_button) - { - action_button(); - return; - } - // Data Binding - try - { - fireVetoableChange(m_columnName, m_oldText, getText()); - } - catch (PropertyVetoException pve) - { - } - } // actionPerformed - - /** - * Action button pressed - show URL - */ - private void action_button() - { - String urlString = m_text.getText(); - String message = null; - if (urlString != null && urlString.length() > 0) - { - try - { - @SuppressWarnings("unused") - URL url = new URL(urlString); - Env.startBrowser(urlString); - return; - } - catch (Exception e) - { - message = e.getMessage(); - } - } - ADialog.warn(0, this, "URLnotValid", message); - } // action button - - /** - * Set Field/WindowNo for ValuePreference - * @param mField field - */ - public void setField (GridField mField) - { - m_mField = mField; - if (m_mField != null - && MRole.getDefault().isShowPreference() - && !mField.isEncrypted() && !mField.isEncryptedColumn()) - ValuePreference.addMenu (this, popupMenu); - if (m_mField != null) - FieldRecordInfo.addMenu(this, popupMenu); - } // setField - - @Override - public GridField getField() { - return m_mField; - } - - /** - * Set Text - * @param text text - */ - public void setText (String text) - { - m_text.setText (text); - } // setText - - - /** - * Get Text (clear) - * @return text - */ - public String getText () - { - String text = m_text.getText(); - return text; - } // getText - - /** - * Focus Gained. - * Enabled with Obscure - * @param e event - */ - public void focusGained (FocusEvent e) - { - m_infocus = true; - setText(getText()); // clear - } // focusGained - - /** - * Focus Lost - * Enabled with Obscure - * @param e event - */ - public void focusLost (FocusEvent e) - { - m_setting = true; - try - { - String clear = getText(); - if (clear.length() > m_fieldLength) - clear = clear.substring(0, m_fieldLength); - fireVetoableChange (m_columnName, m_oldText, clear); - } - catch (PropertyVetoException pve) - { - } - m_setting = false; - - m_infocus = false; - setText(getText()); // obscure - } // focus Lost - - /** - * Request Focus - */ - @Override - public void requestFocus() - { - m_text.requestFocus(); - } // requestFocus - - /** - * Request Focus In Window - * @return focus request - */ - @Override - public boolean requestFocusInWindow() - { - return m_text.requestFocusInWindow(); - } // requestFocusInWindow - - /** - * Get Focus Component - * @return component - */ - public Component getFocusableComponent() - { - return m_text; - } // getFocusComponent - -} // VURL diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/ValuePreference.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/ValuePreference.java deleted file mode 100644 index 977582d218..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/ValuePreference.java +++ /dev/null @@ -1,525 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.ed; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.Properties; -import java.util.UUID; -import java.util.logging.Level; - -import javax.swing.BorderFactory; -import javax.swing.Icon; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.border.TitledBorder; - -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.model.GridField; -import org.compiere.model.MRole; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogMgt; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Maintain Value Preferences. - * To delete a preference, select a null value and save. - * - * @author Jorg Janke - * @version $Id: ValuePreference.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class ValuePreference extends CDialog - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -6718115525965508049L; - - /** - * Factory - * @param mField field - * @param aValue value - * @return ValuePreference or null - */ - public static ValuePreference start (GridField mField, Object aValue) - { - return start (mField, aValue, null); - } // start - - /** - * Factory - * @param mField field - * @param aValue value - * @param aDisplayValue display value - * @return ValuePreference or null - */ - public static ValuePreference start (GridField mField, Object aValue, String aDisplayValue) - { - if (!mField.isEditable(false)) - { - log.info("Field not editable (R/O)"); - return null; - } - - // Set Value/DisplayValue - String Value = null; - String DisplayValue = null; - if (aValue != null) - { - Value = aValue.toString(); - DisplayValue = (aDisplayValue == null) ? Value : aDisplayValue; - } - - // Get from mField - // AD_Window_ID, DisplayAttribute, Attribute, DisplayType, AD_Referenece_ID - int AD_Window_ID = mField.getAD_Window_ID(); - String Attribute = mField.getColumnName(); - String DisplayAttribute = mField.getHeader(); - int displayType = mField.getDisplayType(); - int AD_Reference_ID = 0; - int WindowNo = mField.getWindowNo(); - - // Get from Environment (WindowNo) - // AD_Client_ID, AD_Org_ID, AD_User_ID, Frame - int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); - int AD_Org_ID = Env.getContextAsInt(Env.getCtx(), WindowNo, "AD_Org_ID"); - int AD_User_ID = Env.getAD_User_ID(Env.getCtx()); - Frame frame = AEnv.getWindow(WindowNo); - - // Create Editor - ValuePreference vp = new ValuePreference (frame, WindowNo, - AD_Client_ID, AD_Org_ID, AD_User_ID, AD_Window_ID, - Attribute, DisplayAttribute, Value, DisplayValue, - displayType, AD_Reference_ID); - return vp; - } // create - - /** - * Create the popup menu item to start the ValuePreference editor. - * - * .. add method - * public void setField (MField mField) - * { - * m_mField = mField; - * if (m_mField != null) - * ValuePreference.addMenu (this, m_popupMenu); - * } // setField - * - * .. in actionPerformed add .. - * if (e.getActionCommand().equals(ValuePreference.NAME)) - * { - * ValuePreference.start (m_mField, getValue(), DisplayValue); - * return; - * } - * - * @param l listener - * @param popupMenu menu - * @return JMenuItem - */ - public static CMenuItem addMenu (ActionListener l, JPopupMenu popupMenu) - { - CMenuItem mi = new CMenuItem (Msg.getMsg(Env.getCtx(), NAME), s_icon); - mi.setActionCommand(NAME); - mi.addActionListener(l); - popupMenu.add(mi); - return mi; - } // addMenu - - /** The Name of the Editor */ - public static final String NAME = "ValuePreference"; - /** The Menu Icon */ - private static Icon s_icon = new ImageIcon(org.compiere.AdempiereClient.class.getResource("images/VPreference16.gif")); - /** Logger */ - private static CLogger log = CLogger.getCLogger(ValuePreference.class); - - /** - * Constructor - * - * @param frame parent - * @param WindowNo window no - * @param AD_Client_ID client - * @param AD_Org_ID org - * @param AD_User_ID user - * @param AD_Window_ID window id - * @param Attribute attribute - * @param DisplayAttribute attribute display - * @param Value value - * @param DisplayValue calue display - * @param displayType display type - * @param AD_Reference_ID reference - */ - public ValuePreference (Frame frame, int WindowNo, - int AD_Client_ID, int AD_Org_ID, int AD_User_ID, int AD_Window_ID, - String Attribute, String DisplayAttribute, String Value, String DisplayValue, - int displayType, int AD_Reference_ID) - { - super(frame, Msg.getMsg(Env.getCtx(), NAME) + " " + DisplayAttribute, true); - if (log.isLoggable(Level.CONFIG)) log.config("WindowNo=" + WindowNo - + ", Client_ID=" + AD_Client_ID + ", Org_ID=" + AD_Org_ID + ", User_ID=" + AD_User_ID + ", Window_ID=" + AD_Window_ID - + ", Attribute=" + Attribute + "/" + DisplayAttribute + ", Value=" + Value + "/" + DisplayValue - + ", DisplayType=" + displayType + ", Reference_ID=" + AD_Reference_ID); - m_ctx = Env.getCtx(); - m_WindowNo = WindowNo; - m_AD_Client_ID = AD_Client_ID; - m_AD_Org_ID = AD_Org_ID; - m_AD_User_ID = AD_User_ID; - m_AD_Window_ID = AD_Window_ID; - m_Attribute = Attribute; - m_DisplayAttribute = DisplayAttribute; - m_Value = Value; - m_DisplayValue = DisplayValue; - m_DisplayType = displayType; - // - m_role = MRole.getDefault(); - try - { - jbInit(); - dynInit(); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - AEnv.showCenterScreen(this); - } // ValuePreference - - private Properties m_ctx; - private int m_WindowNo; - private int m_AD_Client_ID; - private int m_AD_Org_ID; - private int m_AD_User_ID; - private int m_AD_Window_ID; - private String m_Attribute; - private String m_DisplayAttribute; - private String m_Value; - private String m_DisplayValue; - private int m_DisplayType; - private MRole m_role; - - // Display - private CPanel setPanel = new CPanel(); - private GridBagLayout setLayout = new GridBagLayout(); - private CLabel lAttribute = new CLabel(); - private CTextField fAttribute = new CTextField(); - private CLabel lAttributeValue = new CLabel(); - private CLabel lValue = new CLabel(); - private CLabel lValueValue = new CLabel(); - private CTextField fValue = new CTextField(); - private CLabel lSetFor = new CLabel(); - private VCheckBox cbClient = new VCheckBox(); - private VCheckBox cbOrg = new VCheckBox(); - private VCheckBox cbUser = new VCheckBox(); - private VCheckBox cbWindow = new VCheckBox(); - private CLabel lExplanation = new CLabel(); - private CPanel currentPanel = new CPanel(); - private TitledBorder titledBorder; - private JScrollPane scrollPane = new JScrollPane(); - private BorderLayout currentLayout = new BorderLayout(); - private JTable table = new JTable(); - - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - private JButton bDelete; - - /** - * Static Layout - * @throws Exception - */ - void jbInit() throws Exception - { - setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - titledBorder = new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(148, 145, 140)), - Msg.getMsg(m_ctx, "CurrentSettings")); - // - lAttribute.setText(Msg.translate(m_ctx, "Attribute")); - lValue.setText(Msg.translate(m_ctx, "Value")); - lSetFor.setText(Msg.getMsg(m_ctx, "ValuePreferenceSetFor")); - cbClient.setText(Msg.translate(m_ctx, "AD_Client_ID")); - cbOrg.setText(Msg.translate(m_ctx, "AD_Org_ID")); - cbUser.setText(Msg.translate(m_ctx, "AD_User_ID")); - cbUser.setSelected(true); - cbWindow.setText(Msg.translate(m_ctx, "AD_Window_ID")); - cbWindow.setSelected(true); - // - setPanel.setLayout(setLayout); - fAttribute.setEditable(false); - fValue.setEditable(false); - this.getContentPane().add(setPanel, BorderLayout.NORTH); - setPanel.add(lAttribute, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - setPanel.add(fAttribute, new GridBagConstraints(1, 0, 4, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - setPanel.add(lValue, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - setPanel.add(fValue, new GridBagConstraints(1, 1, 4, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - setPanel.add(lSetFor, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - setPanel.add(cbClient, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - setPanel.add(cbOrg, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - setPanel.add(cbUser, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - setPanel.add(cbWindow, new GridBagConstraints(4, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - setPanel.add(lAttributeValue, new GridBagConstraints(5, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); - setPanel.add(lValueValue, new GridBagConstraints(5, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); - setPanel.add(lExplanation, new GridBagConstraints(1, 3, 4, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - // - currentPanel.setBorder(titledBorder); - currentPanel.setLayout(currentLayout); - // this.getContentPane().add(currentPanel, BorderLayout.CENTER); - currentPanel.add(scrollPane, BorderLayout.CENTER); - scrollPane.getViewport().add(table, null); - this.getContentPane().add(confirmPanel, BorderLayout.SOUTH); - } // jbInit - - /** - * Dynamic Init - */ - private void dynInit() - { - // Set Attribute/Value - fAttribute.setText(m_DisplayAttribute); - lAttributeValue.setText(m_Attribute); - fValue.setText(m_DisplayValue); - lValueValue.setText(m_Value); - if (CLogMgt.isLevelFine()) - { - lAttributeValue.setVisible(false); - lValueValue.setVisible(false); - } - - // ActionListener - cbClient.setEnabled(false); - cbClient.setSelected(true); - // cbClient.addActionListener(this); - - // Can Change Org - if (MRole.PREFERENCETYPE_Client.equals(m_role.getPreferenceType())) - cbOrg.addActionListener(this); - else - { - cbOrg.setEnabled(false); - cbOrg.setSelected(true); - } - - // Can Change User - if (MRole.PREFERENCETYPE_Client.equals(m_role.getPreferenceType()) - || MRole.PREFERENCETYPE_Organization.equals(m_role.getPreferenceType())) - cbUser.addActionListener(this); - else - { - cbUser.setEnabled(false); - cbUser.setSelected(true); - } - // Can change all/specific - cbWindow.addActionListener(this); - - // Other - confirmPanel.addActionListener(this); - bDelete = confirmPanel.addButton(ConfirmPanel.createDeleteButton(true)); - bDelete.addActionListener(this); - setExplanation(); - } // dynInit - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - dispose(); - } - else if (e.getActionCommand().equals(ConfirmPanel.A_OK)) - { - insert(); - dispose(); - } - else if (e.getSource() == bDelete) - { - int no = delete(); - if (no == 0) - ADialog.warn(m_WindowNo, this, "ValuePreferenceNotFound"); - else - ADialog.info(m_WindowNo, this, "ValuePreferenceDeleted", String.valueOf(no)); - dispose(); - } - else - setExplanation(); - } // actionPerformed - - /** - * Set Explanation - */ - private void setExplanation() - { - /** @todo translation */ - StringBuilder expl = new StringBuilder("For "); - if (cbClient.isSelected() && cbOrg.isSelected()) - expl.append("this Client and Organization"); - else if (cbClient.isSelected() && !cbOrg.isSelected()) - expl.append("all Organizations of this Client"); - else if (!cbClient.isSelected() && cbOrg.isSelected()) - { - cbOrg.setSelected(false); - expl.append("entire System"); - } - else - expl.append("entire System"); - // - if (cbUser.isSelected()) - expl.append(", this User"); - else - expl.append(", all Users"); - // - if (cbWindow.isSelected()) - expl.append(" and this Window"); - else - expl.append(" and all Windows"); - // - if (Env.getLanguage(Env.getCtx()).isBaseLanguage()) - { - lExplanation.setText (expl.toString ()); - this.pack (); - } - } // setExplanation - - /** - * Delete Preference - * @return number of rows deleted - */ - public int delete() - { - log.info(""); - - StringBuilder sql = new StringBuilder ("DELETE FROM AD_Preference WHERE "); - sql.append("AD_Client_ID=").append(cbClient.isSelected() ? m_AD_Client_ID : 0); - sql.append(" AND AD_Org_ID=").append(cbOrg.isSelected() ? m_AD_Org_ID : 0); - if (cbUser.isSelected()) - sql.append(" AND AD_User_ID=").append(m_AD_User_ID); - else - sql.append(" AND AD_User_ID IS NULL"); - if (cbWindow.isSelected()) - sql.append(" AND AD_Window_ID=").append(m_AD_Window_ID); - else - sql.append(" AND AD_Window_ID IS NULL"); - sql.append(" AND Attribute='").append(m_Attribute).append("'"); - // - if (log.isLoggable(Level.FINE)) log.fine( sql.toString()); - int no = DB.executeUpdate(sql.toString(), null); - if (no > 0) - Env.setContext(m_ctx, getContextKey(), (String)null); - return no; - } // delete - - /** - * Get Context Key - * @return Context Key - */ - private String getContextKey() - { - if (cbWindow.isSelected()) - return "P" + m_AD_Window_ID + "|" + m_Attribute; - else - return "P|" + m_Attribute; - } // getContextKey - - /** - * Save to Disk - */ - public void insert() - { - log.info(""); - - // --- Delete first - int no = delete(); - - // Handle NULL - if (m_Value == null || m_Value.length() == 0) - { - if (DisplayType.isLookup(m_DisplayType)) - m_Value = "-1"; // -1 may cause problems (BPartner - M_DiscountSchema - else if (DisplayType.isDate(m_DisplayType)) - m_Value = " "; - else - { - ADialog.warn(m_WindowNo, this, "ValuePreferenceNotInserted"); - return; - } - } - - // --- Inserting - int Client_ID = cbClient.isSelected() ? m_AD_Client_ID : 0; - int Org_ID = cbOrg.isSelected() ? m_AD_Org_ID : 0; - int AD_Preference_ID = DB.getNextID(m_ctx, "AD_Preference", null); - // - StringBuilder sql = new StringBuilder ("INSERT INTO AD_Preference (" - + "AD_Preference_ID, AD_Preference_UU, AD_Client_ID, AD_Org_ID, IsActive, Created,CreatedBy,Updated,UpdatedBy," - + "AD_Window_ID, AD_User_ID, Attribute, Value) VALUES ("); - sql.append(AD_Preference_ID).append(",").append(DB.TO_STRING(UUID.randomUUID().toString())).append(",").append(Client_ID).append(",").append(Org_ID) - .append(", 'Y',SysDate,").append(m_AD_User_ID).append(",SysDate,").append(m_AD_User_ID).append(", "); - if (cbWindow.isSelected()) - sql.append(m_AD_Window_ID).append(","); - else - sql.append("NULL,") ; - if (cbUser.isSelected()) - sql.append(m_AD_User_ID).append(","); - else - sql.append("NULL,"); - // - sql.append(DB.TO_STRING(m_Attribute)).append(",").append(DB.TO_STRING(m_Value)).append(")"); - // - if (log.isLoggable(Level.FINE)) log.fine( sql.toString()); - no = DB.executeUpdate(sql.toString(), null); - if (no == 1) - { - Env.setContext(m_ctx, getContextKey(), m_Value); - ADialog.info(m_WindowNo, this, "ValuePreferenceInserted"); - } - else - ADialog.warn(m_WindowNo, this, "ValuePreferenceNotInserted"); - - } // insert - -} // ValuePreference diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/package.html b/org.adempiere.ui.swing/src/org/compiere/grid/ed/package.html deleted file mode 100644 index ec4efba3ff..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/package.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - -Provides for.... - -

    Field Editor

    - - - -

    Related Documentation

    - -For overviews, tutorials, examples, guides, and tool documentation, please see: - - - - - - diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/package.html b/org.adempiere.ui.swing/src/org/compiere/grid/package.html deleted file mode 100644 index c77ff2e0af..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - -

    Package org.compiere.grid

    - -Implement datagrid, custom application dialog and tabpane for application window. - -

    Related Documentation

    - -For overviews, tutorials, examples, guides, and tool documentation, please see: - - - - - - diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/tree/AdempiereTreeModel.java b/org.adempiere.ui.swing/src/org/compiere/grid/tree/AdempiereTreeModel.java deleted file mode 100644 index ce26793f5e..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/tree/AdempiereTreeModel.java +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.tree; - -import java.util.logging.Level; - -import javax.swing.tree.DefaultTreeModel; -import javax.swing.tree.TreeNode; - -import org.compiere.model.MTree; -import org.compiere.model.MTreeNode; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Trx; - -/** - * AdempiereTreeModel provides a persistable tree model based on an MTree. - * - * @author phib 2008/07/30 - * FR [ 2032092 ] Java 6 improvements to tree drag and drop - */ -public class AdempiereTreeModel extends DefaultTreeModel { - - /** - * - */ - private static final long serialVersionUID = 8503954687681402088L; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(AdempiereTreeModel.class); - - private MTree m_MTree; - public AdempiereTreeModel(TreeNode root) { - super(root); - } - - public AdempiereTreeModel(MTreeNode root, boolean b) { - super(root, b); - } - - public void setMTree(MTree tree) { - - m_MTree = tree; - - } - - public void saveChangedNodes(MTreeNode from, MTreeNode to) { - int AD_Tree_ID = m_MTree.getAD_Tree_ID(); - Trx trx = Trx.get (Trx.createTrxName("AdempiereTreeModel"), true); - try - { - @SuppressWarnings("unused") - int no = 0; - for (int i = 0; i < from.getChildCount(); i++) - { - MTreeNode nd = (MTreeNode)from.getChildAt(i); - StringBuilder sql = new StringBuilder("UPDATE "); - sql.append(m_MTree.getNodeTableName()) - .append(" SET Parent_ID=").append(from.getNode_ID()) - .append(", SeqNo=").append(i) - .append(", Updated=SysDate") - .append(" WHERE AD_Tree_ID=").append(AD_Tree_ID) - .append(" AND Node_ID=").append(nd.getNode_ID()); - no = DB.executeUpdate(sql.toString(),trx.getTrxName()); - } - if (from != to) - for (int i = 0; i < to.getChildCount(); i++) - { - MTreeNode nd = (MTreeNode)to.getChildAt(i); - StringBuilder sql = new StringBuilder("UPDATE "); - sql.append(m_MTree.getNodeTableName()) - .append(" SET Parent_ID=").append(to.getNode_ID()) - .append(", SeqNo=").append(i) - .append(", Updated=SysDate") - .append(" WHERE AD_Tree_ID=").append(AD_Tree_ID) - .append(" AND Node_ID=").append(nd.getNode_ID()); - if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); - no = DB.executeUpdate(sql.toString(),trx.getTrxName()); - } - trx.commit(true); - } - catch (Exception e) - { - trx.rollback(); - log.log(Level.SEVERE, "move", e); - } - trx.close(); - trx = null; - log.config("complete"); - - } - - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/tree/TransferableTreeNode.java b/org.adempiere.ui.swing/src/org/compiere/grid/tree/TransferableTreeNode.java deleted file mode 100644 index 5606709f8a..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/tree/TransferableTreeNode.java +++ /dev/null @@ -1,65 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.tree; - -import java.awt.datatransfer.DataFlavor; -import java.awt.datatransfer.Transferable; -import java.awt.datatransfer.UnsupportedFlavorException; -import java.io.IOException; - -import org.compiere.model.MTreeNode; - -/** - * TransferableTreeNode wraps an MTreeNode into a Transferable for - * use by drag and drop type actions. - * - * - * @author phib 2008/07/30 - * FR [ 2032092 ] Java 6 improvements to tree drag and drop - */ -class TransferableTreeNode implements Transferable { - - public static DataFlavor TREE_NODE_FLAVOR = new DataFlavor(MTreeNode.class, - "Tree Path"); - - DataFlavor flavors[] = { TREE_NODE_FLAVOR }; - - MTreeNode node; - - public TransferableTreeNode(MTreeNode node) { - this.node = node; - } - - public synchronized DataFlavor[] getTransferDataFlavors() { - return flavors; - } - - public boolean isDataFlavorSupported(DataFlavor flavor) { - return (flavor.getRepresentationClass() == MTreeNode.class); - } - - public synchronized Object getTransferData(DataFlavor flavor) - throws UnsupportedFlavorException, IOException { - if (isDataFlavorSupported(flavor)) { - return (Object) node; - } else { - throw new UnsupportedFlavorException(flavor); - } - } - } - - diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreeCellRenderer.java b/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreeCellRenderer.java deleted file mode 100644 index 5f322ddcfc..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreeCellRenderer.java +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.tree; - -import java.awt.Component; - -import javax.swing.Icon; -import javax.swing.JTree; -import javax.swing.tree.DefaultTreeCellRenderer; - -import org.compiere.model.MTreeNode; - -/** - * Tree Cell Renderer to context sensitive display Icon - * @author Jorg Janke - * @version $Id: VTreeCellRenderer.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $ - */ -public final class VTreeCellRenderer extends DefaultTreeCellRenderer -{ - /** - * - */ - private static final long serialVersionUID = -7611138520740658446L; - - - /** - * Constructor - */ - public VTreeCellRenderer() - { - super(); - } // VTreeCellRenderer - - - /** - * Get Tree Cell Renderer Component. - * Sets Icon, Name, Description for leaves - * @param tree tree - * @param value value - * @param Selected selected - * @param expanded expanded - * @param leaf leaf - * @param row row - * @param HasFocus focus - * @return renderer - */ - public Component getTreeCellRendererComponent(JTree tree, Object value, - boolean Selected, boolean expanded, boolean leaf, int row, boolean HasFocus) - { - VTreeCellRenderer c = (VTreeCellRenderer)super.getTreeCellRendererComponent - (tree, value, Selected, expanded, leaf, row, HasFocus); - if (!leaf) - return c; - - // We have a leaf - MTreeNode nd = (MTreeNode)value; - Icon icon = nd.getIcon(); - if (icon != null) - c.setIcon(icon); - c.setText(nd.getName()); - c.setToolTipText(nd.getDescription()); - if (!Selected) - c.setForeground(nd.getColor()); - return c; - } // getTreeCellRendererComponent - -} // VTreeCellRenderer diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreePanel.java b/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreePanel.java deleted file mode 100644 index aa174fdce4..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreePanel.java +++ /dev/null @@ -1,1072 +0,0 @@ - /****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.tree; - - -import java.awt.BorderLayout; -import java.awt.Container; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Insets; -import java.awt.Rectangle; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; - -import javax.swing.Action; -import javax.swing.ActionMap; -import javax.swing.BorderFactory; -import javax.swing.DropMode; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JComponent; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenuItem; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.JSplitPane; -import javax.swing.JToolBar; -import javax.swing.JTree; -import javax.swing.KeyStroke; -import javax.swing.SwingUtilities; -import javax.swing.TransferHandler; -import javax.swing.UIManager; -import javax.swing.plaf.SplitPaneUI; -import javax.swing.plaf.basic.BasicSplitPaneUI; -import javax.swing.tree.DefaultTreeSelectionModel; -import javax.swing.tree.TreePath; - -import org.adempiere.exceptions.DBException; -import org.adempiere.plaf.AdempierePLAF; -import org.adempiere.plaf.AdempiereTaskPaneUI; -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.model.MTree; -import org.compiere.model.MTreeNode; -import org.compiere.swing.CButton; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextField; -import org.compiere.swing.ShadowBorder; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.jdesktop.swingx.JXTaskPane; -import org.jdesktop.swingx.JXTaskPaneContainer; - -import de.schaeffer.compiere.tools.DocumentSearch; - -/** - * Tree Panel displays trees. - *
    - * When a node is selected by Left Click, a propertyChange (NODE_SELECTION) event is fired - *
    - *		PropertyChangeListener -
    - *			treePanel.addPropertyChangeListener(VTreePanel.NODE_SELECTION, this);
    - *			calls: public void propertyChange(PropertyChangeEvent e)
    - *  
    - * To select a specific node call - * setSelectedNode(NodeID); - * - * @author Jorg Janke - * @version $Id: VTreePanel.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $ - * - * @author kthiemann / Carlos Ruiz - *
  • 2761420 - Advanced Search - * - * @author Teo Sarca - *
  • BF [ 2866493 ] VTreePanel is not saving who did the node move - * https://sourceforge.net/tracker/?func=detail&atid=879332&aid=2866493&group_id=176962 - * - * @author Paul Bowden - *
  • FR [ 2032092 ] Java 6 improvements to tree drag and drop - * https://sourceforge.net/tracker/index.php?func=detail&aid=2032092&group_id=176962&atid=879335 - */ -public final class VTreePanel extends CPanel - implements ActionListener -{ -/****************************************************************************** - * Mouse Clicked - */ - class VTreePanel_mouseAdapter extends java.awt.event.MouseAdapter - { - VTreePanel m_adaptee; - - /** - * VTreePanel_mouseAdapter - * @param adaptee - */ - VTreePanel_mouseAdapter(VTreePanel adaptee) - { - m_adaptee = adaptee; - } - - /** - * Mouse Clicked - * @param e - */ - public void mouseClicked(MouseEvent e) - { - m_adaptee.mouseClicked(e); - } - - - } // VTreePanel_mouseAdapter - - /** - * Key Pressed - */ - class VTreePanel_keyAdapter extends java.awt.event.KeyAdapter - { - VTreePanel m_adaptee; - - /** - * VTreePanel_keyAdapter - * @param adaptee - */ - VTreePanel_keyAdapter(VTreePanel adaptee) - { - m_adaptee = adaptee; - } - - /** - * Key Pressed - * @param e - */ - public void keyPressed(KeyEvent e) - { - if (e.getKeyCode() == KeyEvent.VK_ENTER) - m_adaptee.keyPressed(e); - } - } // VTreePanel_keyAdapter - - - /** - * - */ - private static final long serialVersionUID = 8238886431744822217L; - - private static final String PREFIX_DOCUMENT_SEARCH = "/"; - - protected boolean m_lookAndFeelChanged = false; - - private VTreeTransferHandler handler = new VTreeTransferHandler(); - - /** - * Tree Panel for browsing and editing of a tree. - * Need to call initTree - * @param WindowNo WindowNo - * @param editable if true you can edit it - * @param hasBar has OutlookBar - */ - public VTreePanel(int WindowNo, boolean hasBar, boolean editable) - { - super(); - toolbar = new ArrayList(); - if (log.isLoggable(Level.CONFIG)) log.config("Bar=" + hasBar + ", Editable=" + editable); - m_WindowNo = WindowNo; - m_hasBar = hasBar; - m_editable = editable; - - // static init - jbInit(); - if (!hasBar) - { - barScrollPane.setPreferredSize(new Dimension(0,0)); - barScrollPane.setMaximumSize(new Dimension(0,0)); - barScrollPane.setMinimumSize(new Dimension(0,0)); - //Begin - [FR 1953769] - bar.setBackground(AdempierePLAF.getFormBackground()); - //End - [FR 1953769] - centerSplitPane.setDividerLocation(0); - centerSplitPane.setDividerSize(0); - popMenuTree.remove(mBarAdd); - } - else { - centerSplitPane.setDividerLocation(80); - UIManager.addPropertyChangeListener(new PropertyChangeListener() { - public void propertyChange(PropertyChangeEvent evt) { - if ("lookAndFeel".equals(evt.getPropertyName())) - m_lookAndFeelChanged = true; - } - - }); - } - // base settings - if (editable) { - tree.setDragEnabled(true); - tree.setTransferHandler(handler); - tree.setDropMode(DropMode.INSERT); - setMappings(tree); - } - else - { - popMenuTree.remove(mFrom); - popMenuTree.remove(mTo); - } - } // VTreePanel - - /** - * Tree initialization. - * May be called several times - * @param AD_Tree_ID tree to load - * @return true if loaded ok - */ - public boolean initTree (int AD_Tree_ID) - { - return initTree (AD_Tree_ID, null, 0); - } - - public boolean initTree (int AD_Tree_ID, String linkColName, int linkID) - { - if (log.isLoggable(Level.CONFIG)) log.config("AD_Tree_ID=" + AD_Tree_ID); - // - m_AD_Tree_ID = AD_Tree_ID; - - // Get Tree - MTree vTree = null; - if (linkColName != null) - vTree = new MTree (Env.getCtx(), AD_Tree_ID, m_editable, true, null, linkColName, linkID); - else - vTree = new MTree (Env.getCtx(), AD_Tree_ID, m_editable, true, null); - m_root = vTree.getRoot(); - m_root.setName(Msg.getMsg(Env.getCtx(), vTree.getName() ) ); // translate name of menu. - // m_root.setName(Msg.getMsg(Env.getCtx(), "Menu") ); // @Trifon; this is the hardcoded way. - - if (log.isLoggable(Level.CONFIG)) log.config("root=" + m_root); - m_nodeTableName = vTree.getNodeTableName(); - treeModel = new AdempiereTreeModel(m_root, true); - treeModel.setMTree(vTree); - tree.setModel(treeModel); - - // Shortcut Bar - if (m_hasBar) - { - for (JToolBar jt : toolbar) - jt.removeAll(); - toolbarMap = new HashMap(); - Enumeration enTop = m_root.children(); - JToolBar jt = null; - Map titleMap = new HashMap(); - while (enTop.hasMoreElements()) - { - MTreeNode ndTop = (MTreeNode)enTop.nextElement(); - Enumeration en = ndTop.preorderEnumeration(); - boolean labelDrawn=false; - while (en.hasMoreElements()) - { - MTreeNode nd = (MTreeNode)en.nextElement(); - if (nd.isOnBar()) { - if (!labelDrawn) { - jt = new JToolBar(JToolBar.VERTICAL); - titleMap.put(jt, ndTop.toString().trim()); - labelDrawn=true; - toolbarMap.put(ndTop.getNode_ID(), jt); - } - addToBar(nd, jt, false); - } - } - if (jt!=null) - toolbar.add(jt); - jt=null; - } - //jbInit(); - for (JToolBar jt2 : toolbar) { - jt2.setOpaque(false); - //jt2.setLayout(new GridBagLayout()); - jt2.setFloatable(false); - jt2.setRollover(true); - jt2.setBorder(BorderFactory.createEmptyBorder()); - - JXTaskPane barPart = new JXTaskPane(); - //Begin - [FR 1953769] - barPart.setUI(new AdempiereTaskPaneUI()); - barPart.getContentPane().setBackground(AdempierePLAF.getFormBackground()); - //End - [FR 1953769] - barPart.setAnimated(true); - barPart.setLayout(new BorderLayout()); - barPart.add(jt2, BorderLayout.NORTH); - barPart.setTitle(titleMap.get(jt2)); - - bar.add(barPart); - //Begin - [FR 1953769] - bar.setBackground(AdempierePLAF.getFormBackground()); - //End - [FR 1953769] - } - } - return true; - } // initTree - - /** Logger */ - private static CLogger log = CLogger.getCLogger(VTreePanel.class); - - private BorderLayout mainLayout = new BorderLayout(); - private JTree tree = new JTree(); - private AdempiereTreeModel treeModel; - private DefaultTreeSelectionModel treeSelect = new DefaultTreeSelectionModel(); - private CPanel southPanel = new CPanel(); - private CCheckBox treeExpand = new CCheckBox(); - private CTextField treeSearch = new CTextField(10); - private CLabel treeSearchLabel = new CLabel(); - private JPopupMenu popMenuTree = new JPopupMenu(); - private JPopupMenu popMenuBar = new JPopupMenu(); - private CMenuItem mFrom = new CMenuItem(); - private CMenuItem mTo = new CMenuItem(); - private JXTaskPaneContainer bar = new JXTaskPaneContainer(); - private java.util.List toolbar; - private HashMap toolbarMap; - //private int toolBarCols=3; - private CMenuItem mBarAdd = new CMenuItem(); - private CMenuItem mBarRemove = new CMenuItem(); - private BorderLayout southLayout = new BorderLayout(); - private JSplitPane centerSplitPane = new JSplitPane(); - private JScrollPane treePane = new JScrollPane(); - private MouseListener mouseListener = new VTreePanel_mouseAdapter(this); - private KeyListener keyListener = new VTreePanel_keyAdapter(this); - - // - @SuppressWarnings("unused") - private int m_WindowNo; - /** Tree ID */ - private int m_AD_Tree_ID = 0; - /** Table Name for TreeNode */ - @SuppressWarnings("unused") - private String m_nodeTableName = null; - /** Tree is editable (can move nodes) - also not active shown */ - private boolean m_editable; - /** Tree has a shortcut Bar */ - private boolean m_hasBar; - /** The root node */ - private MTreeNode m_root = null; - - - private String m_search = ""; - private Enumeration m_nodeEn; - private MTreeNode m_selectedNode; // the selected model node - private CButton m_buttonSelected; - - private JScrollPane barScrollPane; - - /** Property Listener NodeSelected by Left Click */ - public static final String NODE_SELECTION = "NodeSelected"; - - /** - * Static Component initialization. - *
    -	 *  - centerSplitPane
    -	 *      - treePane
    -	 *          - tree
    -	 *      - bar
    -	 *  - southPanel
    -	 *  
    - */ - private void jbInit() - { - this.setLayout(mainLayout); - mainLayout.setVgap(5); - // - // only one node to be selected - treeSelect.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION); - tree.setSelectionModel(treeSelect); - // - tree.setEditable(false); // allows to change the text - tree.addMouseListener(mouseListener); - tree.addKeyListener(keyListener); - tree.setCellRenderer(new VTreeCellRenderer()); - treePane.getViewport().add(tree, null); - treePane.setBorder(new ShadowBorder()); - tree.setBorder(BorderFactory.createEmptyBorder()); - - CPanel treePart = new CPanel(); - treePart.setLayout(new BorderLayout()); - treePart.add(treePane, BorderLayout.CENTER); - treePart.setBorder(BorderFactory.createEmptyBorder()); - - // - treeExpand.setText(Msg.getMsg(Env.getCtx(), "ExpandTree")); - treeExpand.setActionCommand("Expand"); - treeExpand.addMouseListener(mouseListener); - treeExpand.addActionListener(this); - // - treeSearchLabel.setText(Msg.getMsg(Env.getCtx(), "TreeSearch") + " "); - treeSearchLabel.setLabelFor(treeSearch); - treeSearchLabel.setToolTipText(Msg.getMsg(Env.getCtx(), "TreeSearchText")); - - treeSearch.setBackground(AdempierePLAF.getInfoBackground()); - treeSearch.addKeyListener(keyListener); - southPanel.setLayout(southLayout); - southPanel.add(treeExpand, BorderLayout.WEST); - southPanel.add(treeSearchLabel, BorderLayout.CENTER); - southPanel.add(treeSearch, BorderLayout.EAST); - treePart.add(southPanel, BorderLayout.SOUTH); - // - centerSplitPane.setOpaque(false); - barScrollPane = new JScrollPane(); - barScrollPane.getViewport().add(bar); - centerSplitPane.add(barScrollPane, JSplitPane.LEFT); //hengsin, jxtaskpane - centerSplitPane.add(treePart, JSplitPane.RIGHT); - centerSplitPane.setBorder(BorderFactory.createEmptyBorder()); - removeSplitPaneBorder(); - - this.add(centerSplitPane, BorderLayout.CENTER); - - // - mFrom.setText(Msg.getMsg(Env.getCtx(), "ItemMove")); - mFrom.setActionCommand((String)TransferHandler.getCutAction(). - getValue(Action.NAME)); - mFrom.addActionListener(this); - mFrom.setAccelerator( - KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.CTRL_MASK)); - mTo.setText(Msg.getMsg(Env.getCtx(), "ItemInsert")); - mTo.setActionCommand((String)TransferHandler.getPasteAction(). - getValue(Action.NAME)); - mTo.setAccelerator( - KeyStroke.getKeyStroke(KeyEvent.VK_V, ActionEvent.CTRL_MASK)); - mTo.setMnemonic(KeyEvent.VK_V); - mTo.addActionListener(this); - - mBarAdd.setText(Msg.getMsg(Env.getCtx(), "BarAdd")); - mBarAdd.setActionCommand("BarAdd"); - mBarAdd.addActionListener(this); - mBarRemove.setText(Msg.getMsg(Env.getCtx(), "BarRemove")); - mBarRemove.setActionCommand("BarRemove"); - mBarRemove.addActionListener(this); - // - popMenuTree.setLightWeightPopupEnabled(false); - popMenuTree.add(mBarAdd); - popMenuTree.add(mFrom); - if(!m_hasBar){ - popMenuTree.addSeparator(); - } - popMenuTree.add(mTo); - popMenuBar.setLightWeightPopupEnabled(false); - popMenuBar.add(mBarRemove); - } // jbInit - - - private void removeSplitPaneBorder() { - if (centerSplitPane != null) { - SplitPaneUI splitPaneUI = centerSplitPane.getUI(); - if (splitPaneUI instanceof BasicSplitPaneUI) { - BasicSplitPaneUI basicUI = (BasicSplitPaneUI) splitPaneUI; - basicUI.getDivider().setBorder(BorderFactory.createEmptyBorder()); - } - } - } - - /** - * Set Divider Location - * @param location location (80 default) - */ - public void setDividerLocation(int location) - { - centerSplitPane.setDividerLocation(location); - } // setDividerLocation - - /** - * Get Divider Location - * @return divider location - */ - public int getDividerLocation() - { - return centerSplitPane.getDividerLocation(); - } // getDividerLocation - - - /** - * Enter Key - * @param e event - */ - protected void keyPressed(KeyEvent e) - { - - //CHANGED - document search - if (e.getSource() == treeSearch && treeSearch.getText() != null - && treeSearch.getText().length() > 0 - && treeSearch.getText().substring(0, 1).equals(PREFIX_DOCUMENT_SEARCH)) { - setBusy(true); - DocumentSearch search = new DocumentSearch(); - if (search.openDocumentsByDocumentNo(treeSearch.getText().substring(1))) - treeSearch.setText(null); - setBusy(false); - return; - } - - // *** Tree *** - if (e.getSource() instanceof JTree - || (e.getSource() == treeSearch && e.getModifiersEx() != 0)) // InputEvent.CTRL_MASK - { - TreePath tp = tree.getSelectionPath(); - if (tp == null) - ADialog.beep(); - else - { - MTreeNode tn = (MTreeNode)tp.getLastPathComponent(); - setSelectedNode(tn); - } - } - - // *** treeSearch *** - else if (e.getSource() == treeSearch) - { - String search = treeSearch.getText(); - boolean found = false; - - // at the end - try from top - if (m_nodeEn != null && !m_nodeEn.hasMoreElements()) - m_search = ""; - - // this is the first time - if (!search.equals(m_search)) - { - // get enumeration of all nodes - m_nodeEn = m_root.preorderEnumeration(); - m_search = search; - } - - // search the nodes - while(!found && m_nodeEn != null && m_nodeEn.hasMoreElements()) - { - MTreeNode nd = (MTreeNode)m_nodeEn.nextElement(); - // compare in upper case - if (nd.toString().toUpperCase().indexOf(search.toUpperCase()) != -1) - { - found = true; - TreePath treePath = new TreePath(nd.getPath()); - tree.setSelectionPath(treePath); - tree.makeVisible(treePath); // expand it - tree.scrollPathToVisible(treePath); - } - } - if (!found) - ADialog.beep(); - } // treeSearch - - } // keyPressed - - - /*************************************************************************/ - - /** - * Mouse clicked - * @param e event - */ - protected void mouseClicked(MouseEvent e) - { - // *** JTree *** - if (e.getSource() instanceof JTree) - { - // Left Double Click - if (SwingUtilities.isLeftMouseButton(e) - && e.getClickCount() > 0) - { - int selRow = tree.getRowForLocation(e.getX(), e.getY()); - if(selRow != -1) - { - MTreeNode tn = (MTreeNode)tree.getPathForLocation - (e.getX(), e.getY()).getLastPathComponent(); - setSelectedNode(tn); - } - } - - // Right Click for PopUp - else if ((m_editable || m_hasBar) - && SwingUtilities.isRightMouseButton(e) ) - { - int selRow = tree.getRowForLocation(e.getX(), e.getY()); - if(selRow != -1) - { - tree.setSelectionRow(selRow); - } - if (tree.getSelectionPath() != null) // need select first - { - MTreeNode nd = (MTreeNode)tree.getSelectionPath().getLastPathComponent(); - if (nd.isLeaf()) // only add leaves to bar - mBarAdd.setEnabled(true); - else - mBarAdd.setEnabled(false); - Rectangle r = tree.getPathBounds(tree.getSelectionPath()); - popMenuTree.show(tree, (int)r.getMaxX(), (int)r.getY()); - } - } - } // JTree - - // *** JButton *** - else if (e.getSource() instanceof JButton) - { - if (SwingUtilities.isRightMouseButton(e)) - { - m_buttonSelected = (CButton)e.getSource(); - popMenuBar.show(m_buttonSelected, e.getX(), e.getY()); - } - } // JButton - - } // mouseClicked - - - /** - * Get currently selected node - * @return MTreeNode - */ - public MTreeNode getSelectedNode() - { - return m_selectedNode; - } // getSelectedNode - - /** - * Search Field - * @return Search Field - */ - public JComponent getSearchField() - { - return treeSearch; - } // getSearchField - - /** - * Set Selection to Node in Event - * @param nodeID Node ID - * @return true if selected - */ - public boolean setSelectedNode (int nodeID) - { - if (log.isLoggable(Level.CONFIG)) log.config("ID=" + nodeID); - if (nodeID != -1) // new is -1 - return selectID(nodeID, true); // show selection - return false; - } // setSelectedNode - - /** - * Select ID in Tree - * @param nodeID Node ID - * @param show scroll to node - * @return true if selected - */ - private boolean selectID (int nodeID, boolean show) - { - if (m_root == null) - return false; - if (log.isLoggable(Level.CONFIG)) log.config("NodeID=" + nodeID - + ", Show=" + show + ", root=" + m_root); - // try to find the node - MTreeNode node = m_root.findNode (nodeID); - if (node != null) - { - TreePath treePath = new TreePath(node.getPath()); - if (log.isLoggable(Level.CONFIG)) log.config("Node=" + node - + ", Path=" + treePath.toString()); - tree.setSelectionPath(treePath); - if (show) - { - tree.makeVisible(treePath); // expand it - tree.scrollPathToVisible(treePath); - } - return true; - } - if (log.isLoggable(Level.INFO)) log.info("Node not found; ID=" + nodeID); - return false; - } // selectID - - - /** - * Set the selected node & initiate all listeners - * @param nd node - */ - private void setSelectedNode (MTreeNode nd) - { - if (log.isLoggable(Level.CONFIG)) log.config("Node = " + nd); - m_selectedNode = nd; - // - firePropertyChange(NODE_SELECTION, null, nd); - } // setSelectedNode - - - /************************************************************************** - * Node Changed - synchronize Node - * - * @param save true the node was saved (changed/added), false if the row was deleted - * @param keyID the ID of the row changed - * @param name name - * @param description description - * @param isSummary summary node - * @param imageIndicator image indicator - */ - public void nodeChanged (boolean save, int keyID, - String name, String description, boolean isSummary, String imageIndicator) - { - if (log.isLoggable(Level.CONFIG)) log.config("Save=" + save + ", KeyID=" + keyID - + ", Name=" + name + ", Description=" + description - + ", IsSummary=" + isSummary + ", ImageInd=" + imageIndicator - + ", root=" + m_root); - // if ID==0=root - don't update it - if (keyID == 0) - return; - - // try to find the node - MTreeNode node = m_root.findNode(keyID); - - // Node not found and saved -> new - if (node == null && save) - { - node = new MTreeNode (keyID, 0, name, description, - m_root.getNode_ID(), isSummary, imageIndicator, false, null); - m_root.add (node); - } - - // Node found and saved -> change - else if (node != null && save) - { - node.setName (name); - node.setAllowsChildren(isSummary); - } - - // Node found and not saved -> delete - else if (node != null && !save) - { - MTreeNode parent = (MTreeNode)node.getParent(); - node.removeFromParent(); - node = parent; // select Parent - } - - // Error - else - { - log.log(Level.SEVERE, "Save=" + save + ", KeyID=" + keyID + ", Node=" + node); - node = null; - } - - // Nothing to display - if (node == null) - return; - - // (Re) Display Node - tree.updateUI(); - TreePath treePath = new TreePath(node.getPath()); - tree.setSelectionPath(treePath); - tree.makeVisible(treePath); // expand it - tree.scrollPathToVisible(treePath); - } // nodeChanged - - - /************************************************************************** - * ActionListener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - // bar button pressed - if (e.getSource() instanceof JButton) - { - // Find Node - don't show - selectID(Integer.parseInt(e.getActionCommand()), false); - // Select it - MTreeNode tn = (MTreeNode)tree.getSelectionPath().getLastPathComponent(); - setSelectedNode(tn); - } - - // popup menu commands - else if (e.getSource() instanceof JMenuItem) - { - String action = (String)e.getActionCommand(); - Action a = tree.getActionMap().get(action); - if (a != null) { - a.actionPerformed(new ActionEvent(tree, - ActionEvent.ACTION_PERFORMED, - null)); - } - else if (action.equals("BarAdd")) - barAdd(); - else if (action.equals("BarRemove")) - barRemove(); - } - - else if (e.getSource() instanceof JCheckBox) - { - if (e.getActionCommand().equals("Expand")) - expandTree(); - } - } // actionPerformed - - /** - * Add selected TreeNode to Bar - */ - private void barAdd() - { - MTreeNode nd = (MTreeNode)tree.getSelectionPath().getLastPathComponent(); - if (barDBupdate(true, nd.getNode_ID())) - addToBar(nd,getParentToolBar(nd), false); - else if (DBException.isUniqueContraintError(CLogger.retrieveException())) - ADialog.error(0, this, "BookmarkExist", null); - } // barAdd - - /** - * Returns the top level parent JToolBar for the given MTreenode. If the parent is not on - * the CPanel yet a new one is created and added. - * @param nd - * @return top level parent JToolBar for the given MTreenode - */ - private JToolBar getParentToolBar(MTreeNode nd){ - int topParentId = getTopParentId(nd); - JToolBar parent = toolbarMap.get(topParentId); - if(parent==null){ - Enumeration enTop =m_root.children(); - while (enTop.hasMoreElements()) { - MTreeNode ndTop = (MTreeNode)enTop.nextElement(); - if(ndTop.getNode_ID()==topParentId){ - if (log.isLoggable(Level.FINE)) log.fine("add new category: " + ndTop); - parent = new JToolBar(JToolBar.VERTICAL); - - toolbarMap.put(ndTop.getNode_ID(), parent); - toolbar.add(parent); - parent.setOpaque(false); - parent.setFloatable(false); - parent.setRollover(true); - parent.setBorder(BorderFactory.createEmptyBorder()); - - JXTaskPane barPart = new JXTaskPane(); - //Begin - [FR 1953769] - barPart.setUI(new AdempiereTaskPaneUI()); - barPart.getContentPane().setBackground(AdempierePLAF.getFormBackground()); - //End - [FR 1953769] - barPart.setTitle(ndTop.toString().trim()); - barPart.setAnimated(true); - barPart.setLayout(new BorderLayout()); - barPart.add(parent, BorderLayout.NORTH); - - bar.add(barPart); - return parent; - } - } - } else { - if (log.isLoggable(Level.FINE)) log.fine("parent found: " + parent); - } - return parent; - } - - /** - * Returns the id of the top level parent of the given MTreenode - * @param nd - * @return - */ - private int getTopParentId(MTreeNode nd) { - MTreeNode parent = (MTreeNode) nd.getParent(); - if(parent!=null && parent.getNode_ID()!=0){ - return getTopParentId(parent); - } - return nd.getNode_ID(); - } - - /** - * Add TreeNode to Bar - * @param nd node - */ - private void addToBar(MTreeNode nd, JToolBar currentToolBar, boolean isLabel) - { - // Only first word of Label - String label = nd.toString().trim(); - // int space = label.indexOf(' '); - // if (space != -1) - // label = label.substring(0, space); - - if (!isLabel) { - CButton button = new CButton(label); - button.setOpaque(false); - button.setHorizontalAlignment(JButton.LEFT); - button.setMargin(new Insets(0, 0, 0, 0)); - button.setIcon(nd.getIcon()); - button.setRequestFocusEnabled(false); - button.setToolTipText(nd.getDescription()); - button.setActionCommand(String.valueOf(nd.getNode_ID())); - button.addActionListener(this); - button.addMouseListener(mouseListener); - currentToolBar.add(button); - } else { - currentToolBar.add(new JLabel("" +label+"")); - } - bar.validate(); - //if (centerSplitPane.getDividerLocation() == -1) - // centerSplitPane.setDividerLocation(button.getPreferredSize().width); - bar.repaint(); - } // addToBar - - /** - * Remove from Bar - */ - private void barRemove() - { - /* - * Sidebar Hierachie: - * JXTaskPaneContainer (instance variable: bar) - * --JXTaskPane (parentPanel) - * ----JXCollapsiblePane - * ------JXCollapsiblePane$WrapperContainer - * --------JXPanel - * ----------JToolBar (parentBar) - */ - - //The button in on a JToolBar - JToolBar parentBar = (JToolBar) m_buttonSelected.getParent(); - - //Get JXTaskPane for JToolBar (we want to remove this one from the "bar" if there are no more nodes) - Container parentPanel = null; - if(parentBar!=null){ - parentPanel = parentBar.getParent().getParent().getParent().getParent(); - } - - //Remove the entry from the JToolBar - for (JToolBar jt : toolbar) { - jt.remove(m_buttonSelected); - } - - //If we found the JXTaskPane for our toolbar and the toolbar is now empty, we want to remove the whole JXTaskPane - if(parentPanel != null && parentBar.getComponentCount()==0){ - - //Remove JXTaskPane from JXTaskPaneContainer - bar.remove(parentPanel); - - //Remove JToolBar from the toolBarMap.. - toolbarMap.values().remove(parentBar); - - } - - //Recreate the Sidebar - bar.validate(); - bar.repaint(); - - //Persist the changes - barDBupdate(false, Integer.parseInt(m_buttonSelected.getActionCommand())); - } // barRemove - - /** - * Make Bar add/remove persistent - * @param add true if add - otherwise remove - * @param Node_ID Node ID - * @return true if updated - */ - private boolean barDBupdate (boolean add, int Node_ID) - { - int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); - int AD_Org_ID = Env.getContextAsInt(Env.getCtx(), "#AD_Org_ID"); - int AD_User_ID = Env.getContextAsInt(Env.getCtx(), "#AD_User_ID"); - StringBuilder sql = new StringBuilder(); - if (add) - sql.append("INSERT INTO AD_TreeBar " - + "(AD_Tree_ID,AD_User_ID,Node_ID, " - + "AD_Client_ID,AD_Org_ID, " - + "IsActive,Created,CreatedBy,Updated,UpdatedBy)VALUES (") - .append(m_AD_Tree_ID).append(",").append(AD_User_ID).append(",").append(Node_ID).append(",") - .append(AD_Client_ID).append(",").append(AD_Org_ID).append(",") - .append("'Y',SysDate,").append(AD_User_ID).append(",SysDate,").append(AD_User_ID).append(")"); - // if already exist, will result in ORA-00001: unique constraint (ADEMPIERE.AD_TREEBAR_KEY) - else - sql.append("DELETE AD_TreeBar WHERE AD_Tree_ID=").append(m_AD_Tree_ID) - .append(" AND AD_User_ID=").append(AD_User_ID) - .append(" AND Node_ID=").append(Node_ID); - int no = DB.executeUpdate(sql.toString(), false, null); - return no == 1; - } // barDBupdate - - // Auto Expand Tree - nmicoud IDEMPIERE 195 - /** - * Expand/Collapse tree - * @param expand true if tree should be expanded - */ - public void expandTree(boolean expand) - { - treeExpand.setSelected(expand); - expandTree(); - } - - /** - * Clicked on Expand All - */ - private void expandTree() - { - if (treeExpand.isSelected()) - { - for (int row = 0; row < tree.getRowCount(); row++) - tree.expandRow(row); - } - else - { -// patch: 1654055 +jgubo Changed direction of collapsing the tree nodes - for (int row = tree.getRowCount(); row > 0; row--) - tree.collapseRow(row); - } - } // expandTree - - @Override - public void paint(Graphics g) { - if (m_lookAndFeelChanged) { - m_lookAndFeelChanged = false; - if (m_hasBar) removeSplitPaneBorder(); - } - super.paint(g); - } - - private void setMappings(JTree tree) { - ActionMap map = tree.getActionMap(); - map.put(TransferHandler.getCutAction().getValue(Action.NAME), - TransferHandler.getCutAction()); - map.put(TransferHandler.getPasteAction().getValue(Action.NAME), - TransferHandler.getPasteAction()); - } - - //CHANGED - SET BUSY ADDED - /** - * Indicate Busy - * @param busy busy - */ - private void setBusy (boolean busy) - { - JFrame frame = AEnv.getFrame(this); - if (log.isLoggable(Level.INFO)) log.info("frame: " + frame); - if (frame == null) // during init - return; - if (busy) - { - this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - treeSearch.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - } - else - { - this.setCursor(Cursor.getDefaultCursor()); - frame.setCursor(Cursor.getDefaultCursor()); - treeSearch.setCursor(Cursor.getDefaultCursor()); - } - } // set Busy - -} // VTreePanel - - - - diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreeTransferHandler.java b/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreeTransferHandler.java deleted file mode 100644 index 11790db96d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreeTransferHandler.java +++ /dev/null @@ -1,124 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.grid.tree; - -import java.awt.datatransfer.Transferable; - -import javax.swing.JComponent; -import javax.swing.JTree; -import javax.swing.TransferHandler; -import javax.swing.tree.DefaultTreeModel; -import javax.swing.tree.TreePath; - -import org.compiere.model.MTreeNode; - -/** - * VTreeTransferHandler provides the TransferHandler for dragging and dropping - * within a tree. See VTreePanel. - * - * - * @author phib 2008/07/30 - * FR [ 2032092 ] Java 6 improvements to tree drag and drop - */ -public class VTreeTransferHandler extends TransferHandler { - - - /** - * - */ - private static final long serialVersionUID = 2799737958477528717L; - - public int getSourceActions(JComponent c) { - return TransferHandler.MOVE; - } - - protected Transferable createTransferable(JComponent c) { - JTree tree = (JTree) c; - MTreeNode node = (MTreeNode) tree.getSelectionPath().getLastPathComponent(); - return new TransferableTreeNode(node); - } - - protected void exportDone(JComponent c, Transferable t, int action) { - if (action == MOVE) { - JTree tree = (JTree) c; - MTreeNode node = null; - try { - node = (MTreeNode) t.getTransferData(TransferableTreeNode.TREE_NODE_FLAVOR); - } catch (Exception e) { - // ignore - } - - if ( node != null ) - ((DefaultTreeModel) tree.getModel()).removeNodeFromParent(node); - } - } - - public boolean canImport(TransferSupport info) { - // Check for flavor - if (!info.isDataFlavorSupported(TransferableTreeNode.TREE_NODE_FLAVOR)) { - return false; - } - return true; - } - - public boolean importData(TransferHandler.TransferSupport info) { - if (!canImport(info)) - return false; - - JTree tree = (JTree) info.getComponent(); - AdempiereTreeModel model = (AdempiereTreeModel) tree.getModel(); - Transferable t = info.getTransferable(); - MTreeNode to = null; - MTreeNode from = null; - int index; - try { - from = (MTreeNode)t.getTransferData(TransferableTreeNode.TREE_NODE_FLAVOR); - } - catch (Exception e) { return false; } - - if (info.isDrop()) { - JTree.DropLocation dl = (JTree.DropLocation)info.getDropLocation(); - to = (MTreeNode) dl.getPath().getLastPathComponent(); - - if (from == to) - return false; - - index = dl.getChildIndex(); - if ( index == -1 ) - index = 0; // insert as first child - - } - else { // it's a paste - MTreeNode selected = (MTreeNode) tree.getSelectionPath().getLastPathComponent(); - if ( selected.isLeaf() ) { - to = (MTreeNode) selected.getParent(); - index = to.getIndex(selected) + 1; // insert after selected - } - else { - to = selected; - index = 0; - } - } - - model.insertNodeInto(from, to, index); - tree.scrollPathToVisible(new TreePath(from.getPath())); // display from's new location - model.saveChangedNodes(from, to); - - return true; - } - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/images/About16.gif b/org.adempiere.ui.swing/src/org/compiere/images/About16.gif deleted file mode 100644 index 29ccad7ce9bb08a78ec3f8f1138aceee3f7872e0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 756 zcmVL zl21rfVHCyB{oeDv(HS*$EEWGGB$5>g4w+(tZdyhVMFcGpq(!v|0(T*_s7<6oppY$s zptdcHX%Q(o(_oS%xUeRt1}z7N>Cz`X|FIitSqjHxk3cJgf-Fnynzb-kju zw5CgxRJVx&)7ulgLx*-fVS0>e;otxi>II{(@kD=DaaE-NXOUcvt0n)#AZ(06;R_T# zwhwX?04OkyQBv*;hRdrJ?x~h8k5@B2FT_JG`h$<0%{xq8m zFId{8lkn%(mrm&gsmda6vru*fP)UH3V79=@0%RPVjzA@5q3KOX%!Tar53}>g<18^V z0(Z$PfOm~O7pseF4+T!VU7s^=(x@? z&Z9d#@kp{Nf|7B_)GIiNAb2AJN+%)gQn0GUSO0|MJi2|u9NY57;{zNf#SW_tIH?(M zIsvi-UCXqT?5NW#}<}fPK01%$T!6Ee-PU_ m+ee4K&xEd#LMIfgP2m@oCO-g%nQLR5*>b zly7L2RUF4Zzvp@GbMM{mcGb=qs4D-*ux|BW*ZZ=wdynkA)$?*I8F#)TYf_6=98guVLuVgsc~O6u@6Nm#_kAv| zD0^$0pO4qB-V(Pg_V#s%`=7xRBeX59UsvsxC5e|Osjh3S&ZKCY@7_&IarkXXB`xRD z%1yh|8l3|QKt1O^**cNUM9bE;>(sx>xOd{13If*IHXBeLvh8$Ds%Ckdp<033^ctKs~@<#a1!; z^MP>c(gi>F=O1xG@3IN`ItutQftFg_+42mPHe^w1!SB}*u;Su4XMhg5w!uGP4;P4|0O2DT3z+~!%a zI#hGhQ1z#w>VpO)Yah+$FxesSb2y3nxb)RNFF!uKqwy`>e}gMTx_0nUb$!!g%kFxvT!>B(Beg-iq+^T07Jp8>s@oV2V4cpmB5m@31)#gc_9{a85;9%Fs zzU?l*{`7E&$Uj9m*^S8zKyDHOa2IZ7q`SwT{H3omQ_16$cz3ql+SS+NrY-LsDEV|nvdbcn~5b_px|DI`&sN*qEPNqbt7j^qzEdVSh>-B z1}VgG605NjO=K?&D1`#4+qOt_OD-tTkC0_M1Q|J5j zucIIM;pAv9A?hR-H7&V!RXnwHvq%(SiHnBJX*jdMB4T~fhI7Y4+ZjJ|I=tL{B+O^V zdk2Qu_Qa?30(`h>Y?VL$-7E1#diCPF?y;lDjt!3CG>XK4NL39KeJmn&F^Kb0D^*Xn za3JUL$WrR(c?w!&fEXZ<|<=5dCBu&BZe*eZf!#rayG66h>& ziDqCC(|xs|s)bqoSVRO6rrlzd0B80Bn4+Q^W}PVmz~8AG3Q8bB3jY8A002ovPDHLk FV1f#M3&sEd diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Account10.gif b/org.adempiere.ui.swing/src/org/compiere/images/Account10.gif deleted file mode 100644 index 946e2f76e18f792576bc6c9626e01338fa2e1a88..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 470 zcmV;{0V)28P)w{#SeqFd%pFJ)VUJIb1@_0QM+N8kCO9VK^CZ-d2i5 zh11jR8dH-=JCo_C)!bXM12ox|wPwX)^G%9Ei4gFFfWw$`$5>v5eIn!9|EwOFjXD5Hehq@}H0Mbp9&cAwMFk-Qiq2lV z@b&o1-F-O6DG%^Y0MHCz&uZF4Kc!hsh{PM`)eGOh+UNYT22=oezpbB@q}9){TL1t6 M07*qoM6N<$f;2$LwEzGB diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Account16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Account16.gif deleted file mode 100644 index ce11b27b7e5e4e6cc16a75a169a2375770136a05..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 815 zcmV+~1JL}5P)Fn?y}Dne1+yea_5gcYgEpkVUA4(C_7Y`abx66}G^| zOXp7y4Gn*rOeABj=XNTU^7W04jY|M$zd82+Kx1o6A3J({V9m0~)ao(*j!K0N(J+*)0kZnxXva-}3yH6(V9 zPlQ9NsuT(bHOpGfZfP+8`<;cEnc3?`Eb8TQx%88#kCZ*TKQUTPi)1oMaiQ2z-WUA{ zM}UJ8#vRa}LendM?ZgI^<&6A8mOyJK*0YOuc_ zt=mONNljH*b3LBdst=zvo8MjNcISKBIY3S6r5+kH&EN9z`1bxz=UkWG({UfGw)?9v_Qzb^nti7o`gsZ^}q^>VI4*Rc~6R*pqkAN2dng!WNIAR34hIBdvQi7C(t1!3( zYZ=Mnl)%mev|B!Ze16|ZS`4v_3IyspxHa2us3Ri?An<*J5CpzYa#=Fj|>8oKxLa7Mr%a*bGVAVB+zW8FE%k^bm0dIh= z0t^77AHuFvaP&Ybb$GjB3~f`@IKEF)h~}E-RqoYlcdo(h;^ug-fOSABy{B{_0mM&& tnT3%kBz(}S;Qj-po14N`FS!K>fVY-XEhvZ}W(NQO002ovPDHLkV1l)|cDVom diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Account24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Account24.gif deleted file mode 100644 index d5ae52789d56ba3f78e9b27056226704c15ba0a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1276 zcmV&wa010qNS#tmY3ljhU3ljkVnw%H_000McNliru)(Qv)ATr)*Y)k+E1c^yR zK~y-)mD9;@TSXke@$dM}dw!0$7u#(Tr%BZ%UD6^@OIR)(Sj18;^n&2Re}Rw?i;ya{ z6$kzV4j@iQfH)x}5T#{pDN9%q+9V}$634Y2$8WLUn;8yqQ9&Hik>>Q9`OHth-~0qS zTxZXpd0t9+&bI9_fk0^$B}wv$QtCV~J2)1+^y143K(h1o+R2kMdrsVQ5~UJ4ovrLw zUtfHxwz^Wy4rQ+eVHoxMy>r0aox(hD--Co6W1~)?P+)9yj35ZGZO5A2GwF4G-!2x5Bl%qZfo7}OZns!hMSXqEXk)bFq^*7X_RC7SB90uH7A3EgSy;S&c*pR}%)QrZwUzGd z?CeUj*(l`m1=;O(`%+3db#ThMa^-tUr4r-g-O0-j0e0kwwc)?`bFG^PB@v&E7g&a)04Se z(N#*yR0?4X7=r;4AU1{wbY1CSezo?^Vz>L|tMDyg0UGE7J!^ng++6OBy%Q5JOnF}3 zjpLLB+vu$#4{q8*kP$)*yRK98yh&T@(Z_?}>W6R*hz78--Ui1>r=P74K=)Q$E*p5S}tUymO7 zF3qmDk^_Ah9aJj;kaZ{nt|cYfaWH=HudEC(J|{sNhBgJW4<~d>2ESy8Bh6>tb%u{d zj@=={(rxe-Sdmh-uJ7;54iA$AAtp)Kb_dxR!`SbF-SZZ^|Aggf&G(PStc4-1l|DBP znwt%cVhLx^JYzX9IxWOx*|v|Dt7D)PDvU5mvYoln7-P^{gEHjS4W$)}4)9a1OVrkE z)%2C-JfCeXQv-T{vHCFVYE8A@KUB;Pm2<--gq6Z*gHZ~t6k2cNq*7REmm#-^pS8I( z(!_75)%GGEuU+P9643!dKwAkE>&B>T9Cxx^f7~{vG?Xup&SbD08_RL99UJMSak5$L zTn;iB=Ikz?ryKRwHS+Ai+8;xJ*SK{}7`-3mKtE>SV1311lP&VKKO$3mtT85zV7+b3{G3vkFDUin5;Pjn9H2LWU@+E*|4gh4WIf1^K&A+`1GWJ>1{nfA m#4QM0+lW8d!64IrKKb8L={4*Y#%ZMh0000AjQodNDi79I5|3(RJen zPo0{EhVu`FIhs1;8#^*ol`_^Ua5ZgRTEO;6WS?JG1xHlIrtQ_)g8XMypD%bh92XZL%@y~j=r?zX#<>_Ay zj?MhVvcApGd@i4rvfN_pU)QGW`q#B_OPRhKo8-;yZEvqm4`R9-*L?7~b=36Kx*Zc}(y&$D=J@HUQ8!MxuejCZ|M!i% z&Q&&tS9kw!Gf+%;qdi-?J-PWx^^%|^_nzBbuuzY(&i>xb{mF?f?{PSh>eAUR)UqCU&K<- zLSY*L70~U~ zEwqj)yQlwDosjGt?xn!xcaW3y+#1DV0j*<^k7Pss{?*e5woL@{{lY0A13~IN%>@!6br+S?15zv z{yd6it@`qpQH6~bQ4922qTaw@6N53jIq<~Lb2jt#4W)`L(`}|*bW3c~KDsrkSY-Xh z4Bd?cu!+fnZW6F{6}L(^Pa;5tE`tP!RG#UnrPLvtB*-AZCN;}(J{bf6bm>AR)B)%! zD_-Bk!T!bNivPa*;*-CbJmu{feElPY)4;XR2MhxJKqt`SeBIu-ggdN&XW#`W0x?hk xUI8t<lWKLH?ts?dkM&jkPg002ovPDHLkV1g?z-BJJm diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Assignment10.gif b/org.adempiere.ui.swing/src/org/compiere/images/Assignment10.gif deleted file mode 100644 index 5687a122231f5ec6e82b8e0fca92d5c88f1e6efc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 298 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u@pObhHwBu4M$1`kS|%{8c`CQ zpH@mmtT}V`<;yxP|+Sw7sn8Zsl9!MT!$P)T<*7}2y>Sz zw)S$AS$cjDDBBiy;?U(And%-s4jvPYCWLb5p4lGY62r>A?AQDAJwk$Er)R26wqytm zov6Y&{}bb_&8iXlAFA3KHLjF7S8uAYZNC2Y^1Ocj4U+zrJnjrrQaxuaW4Loq$aeYT z_J3@(4X?jCT{dCp;3$o)XJ5Rc*^rGPTenbV_f@Zz91hvN*Jdeja2&p{k>4XO<%#RJ rU-!hV)dOv18Gl(GWqbP0l+XkKvH5J< diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Assignment16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Assignment16.gif deleted file mode 100644 index 1a55d27d5ef01830a53ad8c84a63e153c853cd96..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 471 zcmV;|0Vw{7P)T zl0i!XQ51#0_hy`#5OrXX7FNefaVTMt_@6Zn zhi|y93xHCJe!oArC?1bT2`p;~+YUD2c^;1A%q1{QbCydXgav^;4Z|Q7i(#7P+@on4 z073|<1FG3-&}=nktPidFFMl8~mH;fkm`KtA_2qqfD*{uF2#h%d{7+4DaUzD&o09+l N002ovPDHLkV1fq$!Z-i` diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Assignment24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Assignment24.gif deleted file mode 100644 index a5df65948eace4f47fc280f22abeb33a82483912..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 501 zcmVexa(pHLNWp`H z{lnM>%d)7~>%RiOygm=-QZ(Q=PB?d6mtL=z8eCP?*jmh5gUkuS5^dgBk#&P%%S6@< zs?R2J?t4A2AGAzZZ%h-&y1{$x25R5{-Hk4qrXlRW2!gZRD+P9qut?@{6;H*ZQJafJ~05;Wp1BSRfu%*|8KPA zb+TnyxUL%uw%hI0fW=~QHbJ>urr+;}0o%5zR4SDH*aX>l^@b+0=tlQUTB$0gSOekLKyM{gGd05fK3Ov;LPPA|fKC zY=DX-)~AW6SkD~+AaH=BJszcL+Nco1sOQcKK#ZWI-JT=@0ZM^txuXZfYQ1vK-T(w# z?zTwftx{~JfHl}G4nRWTqQmD+aL$KJ^YyrNw;+-?*&EMV6>)qig5_ONZ%17yx3EnPtZ4B$rKzmj1%X%*JMWyE{ol`;0NaRjm%^Z;PW> zdrPNI01m(nz~$8k1Ny-Dbmg`DTsYaMQ7!U%% zf&>*S3wW+zL(o8}1VSivNYjLpR?s*Fr}ldcaUm2XBu0oQJ>9|YT>W(J(KYao4t4ub z%VZC!s(Qh;?F|6eO+zpKb>q~TYg5V5y|=CP+FCFi9CS8aQCuvfO+(MM)37c`M~0KT zZ+^&|GnG;~w)id|uGg%^SR(eIla6%(oRLCM!){EOhAvG*x7Vtx`oNBX{aPlQXeZ(w zNQXJ+L!9%JaNVkD=wDktzxV10fR&yaN8`~M##q3rS#to~--h#t>9n689<=n63I-`<3poHV)Ms~0B^r-TIF8FI#llH1b+Vg9PXGb{f&f%v zynk1E@^T~=J+20nosMIRYNh;iW#RFS&HCzR05*Vc-nG5kXo;h*Uzx=JINt%vS<`WU S6LahU0000MQ7!U%% zf&>*S3wW+zL(o8}1VSivNYjLpR?s*Fr}ldcaUm2XBu0oQJ>9|YT>W(J(KYao4t4ub z%VZC!s(Qh;?F|6eO+zpKb>q~TYg5V5y|=CP+FCFi9CS8aQCuvfO+(MM)37c`M~0KT zZ+^&|GnG;~w)id|uGg%^SR(eIla6%(oRLCM!){EOhAvG*x7Vtx`oNBX{aPlQXeZ(w zNQXJ+L!9%JaNVkD=wDktzxV10fR&yaN8`~M##q3rS#to~--h#t>9n689<=n63I-`<3poHV)Ms~0B^r-TIF8FI#llH1b+Vg9PXGb{f&f%v zynk1E@^T~=J+20nosMIRYNh;iW#RFS&HCzR05*Vc-nG5kXo;h*Uzx=JINt%vS<`WU S6LahU0000VNRK)B z%_Wv!Z&t7{{NZ3=U|@x*#cIGG5z`Llzh5u^5_d>s|8j2%bMl+#5ce{fGqLf#VNQPY z6{i7z=ZeTN@T(=Uy*asxnVnCO<^6?*zjH;n{>&9&{3Yi-!hh z=qu~Kh`B9g_;_c|cYdQT<|jK6n3Lc9!)d^KUW=(*Zx0uI;I)kBcz3$%$70Qb-+%rH z|7PM9|NHIDY1a4$htXZkg5-C`m%l#Cv;KL%@%QhaX&>1XbAPgmD@woJ9Qs1QeVxSn zo$A;EoCS%^`kR^m|9?gn5wR~vLw_;zr;2<%wd57I)iTcS_op%^zj=nu0Js;Jli&Oj z`hL0iF`w6I#{a*KIR3m|@QGcugZckY8UCNQYKTtCKj+J*yyUjdX8!k0nd$$Zb7J34 z_%J8G`9iD#%nS?+Y|xa(#=yY9j+E+tGB7awLc+fp7#RLhoErfXOUK8}-$``<0000< KMNUMnLSTYOwKiw~ diff --git a/org.adempiere.ui.swing/src/org/compiere/images/AttachmentX16_grey.gif b/org.adempiere.ui.swing/src/org/compiere/images/AttachmentX16_grey.gif deleted file mode 100644 index 6b710c29e49d54e832148f4ae5cab67a897a8567..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 777 zcmV+k1NQuhP)1iZX{Uk6c2QzHcrnC-(HQk^JgA8W5LrsWT4)e@YUv^%>Y)d3 zpcnP1@gm;1m}m@fNeV>*v@*2NPS>fO@zN$0ivE*#df)ry<@@I&BuT=*-t2tfw%KfQ ziK3W^?Z$)seM7UAK2Z(u`03nyCX)$jG@8q1*6azdg#$8~OvSS7KqwSC<*++f%CoYA zVPC*=zNMw*E&!Hg+3D5L>J6Lq-k5c8WH_76el{A7QkQ4X9LK$?)9Sjnx3_vK;Ixub9_M*}xhlZxca!aH z9kUx7Kj%8yJKa0n&P#{g`L*oV)@q%iC?x^BsRSr0>J5pasNz%nipj*`rT(#DpmK^_NGUxt-BdsU+Z<) zornHhu4X9Opf|pb{)*gT7|m4~K`7Gc)U(D$)B8kXf2l@u>}+1h^Mn1?@q^)VgVtiP zNQt8O4ge(x0N1=Lw(a? zEXD=$LjD6ul3fOUy?Z~g=N=jup8PKW03OcxZt3-g2SrgdL6YRrNVIQaVsZh1R8mo@ za(P5aBmf$K5`dav7)?5zrU0k_2mmqwvL)pJycfbME1L0PeTL>?VjP5(fZ>0lO&pB3TxAI4t44k05DVj=dW_P_^i8aG_W;>EuidU zy05v{mR-{HJ@p^+22MECsTw5X8%V|>cl_FU!(H7#6iF-?OcaUD?tN-d(89j}keunQ zuXWxY?L;!p|5-96h(#0ttb)OmE9#;pRh2^G=9&EdmiL83=sJ?|_*S2+_t-gJk4_^Q z=L!N7Me>*xFTG=591B|F-seE@x^2nHuD|#U_>P0`=wm|s>z?iL+>XERta#g^h_k6P z?`994nc(M#-$OEvn3wn0fFM;e>F8DSKEhLRvrq=%Dx zo;>SV{QNDw=+PdMTg!5KtY@cI-T}tWz?)*~#|b3kv83bi7e#gQ3jmO?=ZSCaTKE=c ztbCO!4xDtwM_xrT)^-AO+j?6xkNk(qwNNJj02u3;3|m^Ox+{)Drs#iTq#DFH$MeMVjQxxK14IST-r+CVn${|IIPfCm5(0PHT2 z5#MNWG)~7zy8oN(Z2+)u0CQU`yJ4H}JOEhCzt}kRf7y9|0OSc^_`QqF!T zK~xyiRm`z315p6S@n7G2cc%{LqLGje2u*cp7%I_$q$UxQe}b5e;ty!TWRi%%U=fqe zVkKQwP(dX~&bhYNcfISo_bfX2&Yye}`0IMth82>MY3M5q(Au5wArRfO!a>Ui0M>*3 zT+R&IcG;TF&nZfX{#kS6Q%&4#Cr=j+13`L_dO>b@aw?NZ7YI^Wkde`m;gr3~cx3!L zb|i~L;K%B_3K@q$=qVY?wuqGi00IEh>t(jr+)P&7^?M08FDRRMU))Hbcc)MlxgLzW$6T z43M%1a_*0xW&jWiVMe?Op$t6LLnKKDL5HKu8xSn1$+)Xg02rDmLT7ZoUr#8eqHe3@ zM@)&JkD}qa-bKrKKW6~oJM~N6aNb1V&cqQPS5oMN=?&Uvy+EPzb$jgo0$|po?((S< Q9smFU07*qoM6N<$f;VKxe*gdg diff --git a/org.adempiere.ui.swing/src/org/compiere/images/BPartner16.gif b/org.adempiere.ui.swing/src/org/compiere/images/BPartner16.gif deleted file mode 100644 index 10dfb4c7f32d624ebb9de6f94de66bf4a151cf77..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 801 zcmV++1K#|JP)@WN@)N90v~RpLJlbOitAoc4}#7WA=w4f?<{Ev?^fMARWP1K=rTMV$)cQ z0Kc2pwLHeo2Pfy_^7VYWIW&q_Dqr-FbpRKPwPzuwmd;prn%^DhIrzu~cJ;3m{ z{&CN9?+%TO9t!(Tsb|$3tV#u2YaPrk2e_ZTglg%_tmC?$)*I33!r0gMww7mFZ%=R? z`||$%gZ<3}sKt!ebQ;4aF5vS60p=b&$5NO=>j;HhfUzNSZ0Y6t_W-61nTmV-1E=p?~Ltxm;4&L=|YeG>&L?KEN17|L=1)_C$F#M5CH8?^@5 zXoyLXcDBLnD-pH;&>H|TGuqKVLe?=r3hfk_d$Im3gglfHwy?F-^8w3YQFeuMoRsM)7i@yMnwk5n+c&#iXoy+6Y(K fq;&uh{*B|`y+uTH#v!tQ00000NkvXXu0mjfhSg;f diff --git a/org.adempiere.ui.swing/src/org/compiere/images/BPartner24.gif b/org.adempiere.ui.swing/src/org/compiere/images/BPartner24.gif deleted file mode 100644 index 001fb00c67601b7d2c7bf77ab3e8ebbf87a415f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1040 zcmV+r1n>KaP)KUe?&1D#1k zK~y-)wUy6nTvZguKli@(W-^nRv1t=)Y^1emQcNLKP}(j+s|%@8q!tPlH!j33TIfKs32%?;XhzeLE0dqT}9H`AGFa1nuMm4%p~v4Waiy>&vB7}(k7)@c;T!r z=X3A(obSB{{-_0e6v8xQmfGW*e%;eYvzPt3p^Jn9i*UGo+f%6$(+Ue@x(2@P<6GPN1`>2(l zqZ;kRm3tUEvY()u9RB^i;u{+SH{@vl!C{sQePos0gqxlwEcX!MX_}zKx_YSv-wO zin<2s+o(^$bU@~F8v{q7Lp74+dAzYmx&)FT?L~a6j<^Igj|R2{^5|g61%Eed@nF=E z(aze~FpsLBX@YMpP|QU%YcbB4OB<^3x!Q^EZ(W?A5*c#o9By%nY;lS#nV}F_9xHZo z^Wp?o?v*}xL?5f!_3EdWt+hkPwq7yE8{e?&(1Sj{d2xcX$q9ZS>? zdS-3#;WMvCxnT6bfxY4NJ2A$F4%doN@4-97J1+b&OO|C^x;_UehzAw2c7r%cXr_WO|5o4u zyNP&QqfXdSLcGJM1q|ai?{aUxm&xfGDuRk%i7dsdfH4;IA$C(wyHP~}^$y8W#HZBb zCcjKfBiV`q5r;?yLCEs_6b3;R1@iabI0RUjuVRcv#UbifEViof=kXcDr>F|3pdzad z6z1k?&KMH`!TsRO#rNL5HpyqZo_d__o=q#f|A56PyZb7jD=-kEz);`ZA>%jhMoUwd zUISWdJ&;`Qfp^}{clDjy=qO5N|2$b8|8{geFso8}fUUV=_qP0&{sAQ`sYnjh00YKY zXQ0uXyLQ8;%T?eGFa!8UnRyl{0p-=`Ts_nSO`rkPfrK@_w|@YaGS9Vl=FwLG0000< KMNUMnLSTYS_4Bd- diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Bold16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Bold16.gif deleted file mode 100644 index c9cb630343784bbf9c994b3a3a53f8e7c621bbb1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 705 zcmV;y0zUnTP)4(6%e5&dwuVo>p%iUaB}c$=S$8n-#Om_{;}Af z!s%OYf}FD~k#g1RoHK_=h0`yt73+1^9wI}c@7z(I=#7K1Exu9;&)?^u?7cXnjJifsLX8A~{JUC-qGO*+K=`GSCzXF{RY~U4YnNN|TPf-Fc{qWpXv-3MDwU zEl5g>q_iB{5kib?SKn;A(b5gSZt+c6T!foOXOy2((iD6~eJapUSGgbun9_G<_S zG%x@oZ@)ot58PS<%!)ApVBEE3pQYLlN5pDTqG|)hl8xn@3ENSy9fBwff;`?_*C{FH~w~6&`N`f-P+#zq*uU-F?Y5k}|UWnw&pcm>7Pr npM&n+00000NkvXXu0mjf*d;l2 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/C10030HR.png b/org.adempiere.ui.swing/src/org/compiere/images/C10030HR.png deleted file mode 100644 index e5cd1f7b4f2af078ac66d545b1161c243fdaa76c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2878 zcmZ{mdpy&R_s8GcT;_hK2_=`5OS8F-Rn`!>#oUElQn}3~Yo<(=KCX$7OC%Pxa!EyD zTP{&9^U)_ha+^k!YO>{i`TG3%`{VaGkJouVUgvRM=kJs5;$$l!sw@fsfP~#?tm_^_ z_9PD#+Uq3dy@EXmgjqRS0YGC;(&pLxJr9a=wZ#B+gDT(l%)#K(u8shZs09GzQ~+4t z-Q(W;3LF5w2Lb@<9snps=LK}z?ClB#ow3CNyZ_aL_L~1riQrFr#{q!Bq5lMW@?|m) z07Q{?SSy@Y=d!V46v*;uG+1INP0>13tbm!v0Qx}*X^u6#{Fo` zMPFd&yCcWv%2TF@3|?63&4 za68qw1EuTOulK)MU)L>gD!Vrh^%H!mdQv7DSWIyY+83yYx4_HfT7-F9v0Vctk0na# zSYH4KU%23bXzK4rT+7!YiT8fLa^RAU{@N@IDR#GH$eunLcVg(r>DlbKM^5)0e8)k9 z{f8J5*ZZH&-Z18W&?|=x8uQ9)Gt&&opl`*+5S=26hS=8}-29J5%hjJJO&b)<)V!d$ z6h(F{@;V#cnev+%iGVT}m!JMgZ;Vy%VK$d|OA_7d-KZv~l5q){t3PsMRB}tL$~Qfb zJT?tPKYBIc7PY5UNE3rppNxdoN9tt6wNe{pcbPaYy!HD_7|zxXvldtcPR+)PPD~ z?m9H30fkV6ir1mgvcufID=X$qm7DK;dD_Sr{SaAWxmAE%^E!DGe-nQ1!ZkgYf^D$)(w94d21@sk+?rfJ@D-W zK*M-iz)vm+?F=N_51MPFH}|Fj2B2~T$AevAr|trxOIeEfRZwj6cz!dhBxV&eI%R); z8~&-~;k3h|e98R7wve6E&)f9ixxFRIpN<4sYO*Q>`tdobV*ENqGgF{ho3CviCZWAE zDpQPlkvl&2L_F2tP{&1SFz#7VZDBb)e>_-i$>RS1^X#lxNd zTR&WOOW0AoD1GdLdxodP2^YyT*)6mr&wRv}1%n^3&y=V#M%B{KZpV&h(5ZooksY?t zDJ--Y-vCDTFI^QMJD2LEu979sIr}zTY(XEi>#;Ru&~-(Z9_H%hmMWgtnLud4m>o@< zO;RF--<)U3#EzF!+EyO%?_Ba%ri^~^p4U;S;g`|JpSKGA7VIq3(OS)DwDw7U*$~z! zNpYD`sreH|o+mE84ky?cOxb9LSIKtbM6B)35@YDplhFzdMk4PI$SwJ+#~V)^M2-7- z1r!fiIPhZw@55*bp6bu+YEkLAft(FxjNL79G9^kl2UI)SE|bT3NqMvR4>%UR%aD;F zY8%z%9B>@;J<}4Wz{=h%uSp(EOh)WJ3ArbnbRFR8Du*bj*L21BAa+X@1`6g~?1Q|J zRBUsFV3M8C*e!ZSH$O@&aEg};%dAo-my*}LFN6{mWLE|;f01-&!W(3Wx#2#g?C+3d}F0ett)@F%T{-SFga!Fr~C?l2GM>Kj_J|k%V5UiQQLKcLw*vE`ZwC5qaxCPrgfnfti=RUmcP zTxZq-g(|5dBqX>R5U|o+g^uE>wqRXf-^%79F=#Vqv~6{?bd1Vuy}SF>-VPaZ&-d=t zst(r3rcx+gBfdHujn29J$uPo8{{w7Xn_&FKH9*qFCH z#|$7JnL8*74ToC%T@Ns2KJz2+XZB09IcKzz@!@FCnTRJCmiltFvzGshY&@(4Q2FU+ zg3X|3K|n==dSQ3c;s_9P@5&1+sf*e+&;xXShKAmxOltEP-n8|~M7r#PVek$5xrfr{ z(qpDcpHo=98jrpu+nCzrkh*uL1-sHIeM@xkH(KIub^Kg4Epp>Z>rold)o;{KS^Eir zSf3)l2#HFMl6qt5uq;$thk2%$J%uZI`TYzu7A6L`_qn{jaoNpdGOpT&YW6e(k?| zKc!Z@wO4$|`S?&&aBS!v00i6+sSh{OH-zKh#wa8lWsKOfC^-C>O@_t)2}DMRT)IH~ V{{#N}5x4dNfSt7ywhj|`<9~u|Kji=b diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Calculator10.gif b/org.adempiere.ui.swing/src/org/compiere/images/Calculator10.gif deleted file mode 100644 index 2a31f0ab06e4a34e3077c51848af0a87e38196d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 447 zcmV;w0YLtVP)t zkU?q`K@>n=*Hl+^PX=QY7l~mMvk+YxqVWJ;VO)Bw0oQ^{#WN_ga3vVcFyJC23Wmh) zFw%{#z*@UrQ2`ta92~sa-+z2~_VY`z zY<{`Wox9W1g}b~waeZGG&kmpOe4qc=wz8Jpqi+j#wjYrs0dQ~p&uRxbUyqJyL-W8o zpI?3a^qD_Zg{p!os(PKKEK45l?bWubYPqwu$?eS>s0y)h#JedLrMl&iAy}m*c#Tdgn zt{IQV3^#^|Xl+Ji`5~ngj4|{v;=LzyJ-#S8p3kYPt6=lNyG&J?OeQbdu6wy!F7LJ> p>`Ibh?%cW0?OEHlZ)daF`@iffvX(#w>Fxjk002ovPDHLkV1hVb$CCg6 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Calculator16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Calculator16.gif deleted file mode 100644 index 9248971a914ebd40b59fc3e5b0aa98cf24178447..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 686 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 N002ovPDHLkV1k;!#Ebv{ diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Cancel16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Cancel16.gif deleted file mode 100644 index 9beb8fcec140f157c945ea0c69220c7880f02741..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 878 zcmV-!1CjiRP)#ZWtGIbU=uGYE5CMTf6Tld+HEXp`jU6~=KFnlc`qMS6;&k*r+oM= z3-30x-JONE$Nuu1ZD zVbFA(uim+O)onR=kgX?A_;GZ!9M@_ed8%`Nhx^1ZCewq1$u|xhV5?MOX?i-W2f;=0 zVJYQ#sW&qjD$C0>9XiDJ^XL3<>sC3gRxbguVObL=hlkyyZ4=~jB+_Y~E-v!N!-va~ zg^Xp}^W7sON!PZCR#!>1wz9Ln&cf~6fvD1b`Lg3$7GXY5;>Z!!U%VhcI~%C#fT$|I zNU!NQQ@tZ2uA4{@6^kTVTM4$eK@~fSs1^zsZEb9BZ17-wJXF<-p6ZMN;HfS|K`^v% z^JY+~)kw6r6R)k2v~64w;$o4ewl;z=MyS^nvk)Vq1><~SAglueJsA2+Q7%|ZDuRvo1 zU*v+-)bwTFwQIIhE>oSFqB)g9RH+pTNJj^OY4ZK#WKgfyuXw6o{4>B888A%q>&%%m z&Yn0XT3NwPrwL3G5y6Qfs!L0l$B(mBuk+LFY#7J!u&4U1WT96KV=CR>@3x3gFBEW2 zoM01JoS6v)Cas`|bmFxGbTsGHoommr@fkxEgjR{7=b z-5`#l52GmhN;v)flqwZ|ou3ah zjz92J?|G^daTI;LI5!u*s?})f>0$HbOP&^sVGK7KlnsqpRxp3;nEE0+S?K!@5>NYv zQC{fk(lN^lvT#9FdEGGN!|z$>`5&B5jlpUbE;Y120h+YAyCRB#FaQ7m07*qoM6N<$ Ef^$rr6951J diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Cancel24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Cancel24.gif deleted file mode 100644 index d91a52dc0c631b17dc1132962d0b4495ab7c4221..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1268 zcmVb z(_KtcXBY?Y|8q`(bEJGzTCnXYW*5jzP+<}SUTJU_+_21y7Nf2Z0`V(uce|#6_)?uS$t6R-mWSp7ZQtEg~@E&7S0+yf@D;@B2RQ zOU#V_qlDDrGLh&Zy6}r6g}p?_J{0f}9rp;rjF;%*Wg_t%xSz-n2d+5CB=R@4*gBA#2T~(DVh~j69Fwf4OdF=JRF_=s+_<7j8?0=s-Z#Fo<2o?gS)b+Ny69|^dv4?EP$p#^ZSvQoCI=mpcfb8;k9eA*%vP^x|k0y zbymPBJg>aG`IFtdGiY=a91cUs%>~8dNK8xs>FLnSX58=Yj?GU^U2-xXT5hZgr-qbY zR@Sn0&z=nS`@z8=I1m6!5(I|>zjb%V)R!+i8krBS)^Au<1t0*Nn4f1P65#oH=ue(N z1i-Qk5P_JPmi*jR`d5~h=(N#pZ`skS zLv(I6W5rc?h)x+zrq(T=e=hOk$IzcWLz=?@gQ9>00h-T;_~az0xEQ+Kj)6OO)acC2 zPfq5x|Af6nCo_wR+BVkKN<2Ia%*-IYv=n5w{No8bTr%glM$_{~k3OjYNKEWIoWy zd{B)3lA!*~|SV*CYg2CS2 zX!P~#ADztmQ%7_%ABxV-UV7Nmqv|CkFgP4|@dLLk5=C{N9mMDE4&>;#!Lrm8@ znt|g0(g29b2mlBG1JD6z0JMw1fi*+qE^7&zMkJI4w*W>ot_V)PuW_F8bc8l-y z`EGlL?)3S1e}8y?eu9Q~f`)jEjB)Gh!2I~5{P?8#?qiLMaF&v4`RaL}m}d3eLh{&0 z^4Lh2k!z=q6uzS&^VU52;9;hkVxN{~>)xHlt2O%FTIRMHzM3NX$u9A_Ch@u_`o=51 zj1|C<7sQqxz>5^*qZzxUc(!#5vw0!p(6Qr&3Bh#|!E_VAaumF96s=zd<#`9OSO>G4 zh3MYba8rgr00001bW%=J06^y0W&i*H0b)x>L;#2d9Y_EG010qNS#tmY3ljhU3ljkV znw%H_000McNliru*$WW@7cC`7>LCCC0GvrgK~xx5V_<*)OBW|ccS{C1Fm^Ci*D%s-J<(Qcj6a)<|0sO0TlrO0da8wrm7m(!>mf#c?mVpZhK>-6+0049#6x6Mo#c}`u002ovPDHLkV1kxe^-ur+ diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Chat16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Chat16.gif deleted file mode 100644 index f6e83254b638a2b939e71f07b182dae793009080..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 422 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE9PK^lLGYXua=0dqb|0 z(0Aed#4mEkrXFFQVIkRU)!iwO@P)-K`H`TB-dCnMEei~^#gkV`ducIu)E`>3<^AjG zztK&BfkHBj6^DMzTFe^of29Ve$ooUjD*2X*ObOZ>y?Y%u!-GJf7{-VfofVRNRrl^& zA4u7ByT`KOXwIvCK3V<4ybKHqr#Hn33O05;u<$d!$H2qsdoZIxGtYU;WIu=L8{Rt1 zcMa9-|9(@J`Qv$g`5*Dqb~CuG?wq}|YY~H>BZuJ)ub;a966xg(BCQv{ZcM%SH|N!2 z9dFH+1n23Q)!EOlecrSASW_MIFQcQU1?I~ieR%rw>)mljBv$9#p2l!3b58*Q7;IDui+ui&r$;~AC~$Nu>2&ag&oQ z^ef~C5Gu_>h|W%zokf>%)owu#49v@ae)I6mFu-3E30gF5;|M@y2Hr(6U*4ZsW!eUx zMW$_Vu{Sgc-s|d($_R?q(+%FI~i1rhZUNX=h=B(dcfvJ25af{$zTAL zLasEmbE{TGYBlXS4*~-KTCLXjCqxJcA<%VQ8ciTL2uKK#=KU-1Fw_qh&}1?>Jy-_x zJ5D4LUfuvO7oI;H3-&{T;8v{)apA>$nFPM$VSu72P!we>xck-J6K=EFY|1rCq+ngw zJzzW@2c;C0Qp930Xqtv-H0sqFC+0)*t(ocf`?t$0OFICj2tUm)EZVUH~`%nDlouZG(%l5{WPX{YInl z4PXF(%MK3tzfj?_)9xJD*6EX5qquGyw{drV#N{|J2LLu;yXDgH4FJ^zsv<2PoZ(;7 Z=m*$0*IIZX`mz83002ovPDHLkV1ivx*m(c| diff --git a/org.adempiere.ui.swing/src/org/compiere/images/ChatX16.gif b/org.adempiere.ui.swing/src/org/compiere/images/ChatX16.gif deleted file mode 100644 index f6e83254b638a2b939e71f07b182dae793009080..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 422 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE9PK^lLGYXua=0dqb|0 z(0Aed#4mEkrXFFQVIkRU)!iwO@P)-K`H`TB-dCnMEei~^#gkV`ducIu)E`>3<^AjG zztK&BfkHBj6^DMzTFe^of29Ve$ooUjD*2X*ObOZ>y?Y%u!-GJf7{-VfofVRNRrl^& zA4u7ByT`KOXwIvCK3V<4ybKHqr#Hn33O05;u<$d!$H2qsdoZIxGtYU;WIu=L8{Rt1 zcMa9-|9(@J`Qv$g`5*Dqb~CuG?wq}|YY~H>BZuJ)ub;a966xg(BCQv{ZcM%SH|N!2 z9dFH+1n23Q)!EOlecrSASW_MIFQcQU1?I~ieR%rw>)mljBv$9#p2l!3b58*Q7;IDui+ui&r$;~AC~$Nu>2&ag&oQ z^ef~C5Gu_>h|W%zokf>%)owu#49v@ae)I6mFu-3E30gF5;|M@y2Hr(6U*4ZsW!eUx zMW$_Vu{Sgc-s|d($_R?q(+%FI~i1rhZUNX=h=B(dcfvJ25af{$zTAL zLasEmbE{TGYBlXS4*~-KTCLXjCqxJcA<%VQ8ciTL2uKK#=KU-1Fw_qh&}1?>Jy-_x zJ5D4LUfuvO7oI;H3-&{T;8v{)apA>$nFPM$VSu72P!we>xck-J6K=EFY|1rCq+ngw zJzzW@2c;C0Qp930Xqtv-H0sqFC+0)*t(ocf`?t$0OFICj2tUm)EZVUH~`%nDlouZG(%l5{WPX{YInl z4PXF(%MK3tzfj?_)9xJD*6EX5qquGyw{drV#N{|J2LLu;yXDgH4FJ^zsv<2PoZ(;7 Z=m*$0*IIZX`mz83002ovPDHLkV1ivx*m(c| diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Copy16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Copy16.gif deleted file mode 100644 index 8dd48c494924874a088590a749193994d075c22f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 498 zcmVl*+}S4tk-SEw(HMMH$UOFgT8OyWIuox(>z|!eNT?Q)#FJN+p=4fyzsz3(&M5 z1Oj8QEH>2c<<$iq9`D@|1fH*+ou9fEhcV03wkV2NSzd)@nNYt}lHgoRaN9}vHG1pg5Cj3DD1s1zdc6*S;N$b%7N-)ik diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Copy24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Copy24.gif deleted file mode 100644 index 345b2f1d7cbc2238e895eda7f3ce236f451d12d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 725 zcmV;`0xJE9P)o@C8T-_3a006Dl?}?!^Gg%N(Y>yRJWM=AgI&$DQBoaw5Gfxa| zHh)H-herpGZf^eM0fZm~A~V3t^_5{65)pllfQ!XK@ZIw~`E}<@e(~uNF*8lPs6?o2 ztj>-!R$YZ#Q@XxxO_e_Y9%Oq#_zDy>AY&Hu3$mMbYD+Kmoz6C|Vj#G>P0frC~Qc7s8 zA%uWG``g7cJ0P7-2aymFY}+1KECNw~7udE9B4O+-D_Fd0Z5LW=Sau@u$S#kdYD{C*72J`o)&&(zUFlO)G2LN1NUEuKh0hq95jXVG0 z{B7HUl;#yH;UH$AF;6 z<+=F}=GKmRDjTbxy4~)B!JDgph#3rM0jg^7z2(K{fBo7&#+023nteo900000NkvXX Hu0mjfy%<3* diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Customize16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Customize16.gif deleted file mode 100644 index 68f916c9d3793617c33986e1369c4a3be6c86508..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 440 zcmV;p0Z0CcP)5 zlf6mt?f z0AN0U2O!Ii0Db_~5TL5N0l&4)!JmNg@;GElVP^;Bwx7*8q z?>*!3c;%oBq}6J1dDjbupZkv#MS+>;<71A9P_G{bdzKDFb zl)rAmFc8MSGv<#PwIC$ec!LgofIb9>y+Q@lwOfZ)>WtLAR7oH+10&DF1E7i#74UT^ z=O%HY4h<)rY~{QA`FycW%#3rGIt%rjU>!x#^l&(g3tYr#t$p~uf8>JA_x+=mO4sW( zh{!H0^YoaW%g>jw)9CCml&2>S!-Vj|(%DY|xv2rmiUs+--iLl+4{ z?G|A~=Ohg>vv9>N%M}DMW!>HPeV%zbm|I~4O9R8eF!SL%Uk3g&6hQCgwr&w;ys}lf zIX1F%*Xv2Q_jYug8SU>IsAzqBV(1P`&UnCRf8PMZ!;e^5{(|GUxUTch+I8+M7rU?V zW_t34vrC+PH%AZz1VKm`?q)<3MMP26&l(YiA-R=YS&0X*u<(|l`}Zn3VP^W}j)^_# z_6NY#uC7z$Rx^mTh**raXl*fCh+`p13_7uhfHnqW4A$CV1<;djx7Tl^S>Kr5@mDOH z8zq#g#&c^~-&kgAv%q#=W$W-maC!CHfe5XaxietSj|8I1&`<#3&|j$e*lNa`-i+0@!$Xe002ovPDHLkV1g_FA-@0s diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Delete24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Delete24.gif deleted file mode 100644 index 86913615bb3182f2e7640227f447f2f90f82eb9a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1155 zcmV-}1bq96P)BRBg-*Y5xT1Q1C? zK~y-)wUu3nRaF$ne|w)Z=bpJU;~llJ8Pu^vC8fqpA4GzDFfxgPh{(k3Awmdx3ViRW zM53oa2vSQ!9qCOnNcw>ALGz>3oCRbX&dj~%YwxvsIOBCFf->5$VC}Www-^7l z*WU0yEpyx1ylv@AMV#%OnT)cy<>!@@zsuduM_Ih}z@DLxTHwvwmToQLY~POUgM?v~ zEKNz0gfI*NsKg~C2m<0bMns6?80Q?$Ii@BjF~+d#{bz}?c+G)5L#ND(FE3l2SJIO^ zwhwad>;;a0ehh2vw3!)xX~x*U#H=-Jc>D?G%*BZu!= z)0;Q1)6=tvfwijvmfO6NzWM07rx_j|Mpge)!$wE1vvK7ct zUI`|cDYFVVr!9D%d9qZ?6tRz!cwIJxE$KiK3V+$r10%#sOL470f8mB8^ttVhWkWn1CppMHI}!nh0Y8 zy5c@SC|r|fI!1fjY?d#03L98d1Qo$pOVTJTnEIWH)s8g%B+iG#ZF2xcM2XwxaQ5m4 z}HpNDu)M|=-p@gj%_ZPqe5UPQpnR>e^fk4#OaK8|Jsf~p|u85uvpn#HfP z>b_SH5f;u}%gRMB(B0WjXe%Vm1}chbS@HBF{x(zN%UM$71{13as*0%RTKyzb$tXpU zA`17qY&D+)6K7zh~lLjYmxE=Q?H0p z>MG^C;eCLDetq=Y;)m0>jt-qm9dK_5WI%nQ?hiL6*m>%!U+(Vnv=#C!xKQdy`UjEV VZeyRRi_HK4002ovPDHLkV1lJJD&znF diff --git a/org.adempiere.ui.swing/src/org/compiere/images/DeleteSelection16.gif b/org.adempiere.ui.swing/src/org/compiere/images/DeleteSelection16.gif deleted file mode 100644 index e7c11c833608c05b41a5da632473556f36771eab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 352 zcmb`DF%H5o3`Kv6K^_=9GKK-E0|QbQ5KAWz8%Kbp=P<|UH8_C}(9^Ing`_DeFyq1B zdiu_nb37fkyQ@I(0L-kasyoniUE8)z(}WNJET80}V4Yg>f&+Szz)vZPVniZ!4d;mB zkST92rjA(r*=zsErzaD5%bwCl?f1lRb5rIr4!L|H1yl44L`?NRo*{kA@|x~qerK)X TZ>gKi=8JgF5dS3#5MloU5&$!P diff --git a/org.adempiere.ui.swing/src/org/compiere/images/DeleteSelection24.gif b/org.adempiere.ui.swing/src/org/compiere/images/DeleteSelection24.gif deleted file mode 100644 index 2aee61d8da65287e5b3052de16740df5cfca9bc9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1016 zcmYL|e`p(J7{|Yt%cYktEy-OB!B%%2qjaTAHquyYk#xqcO4{WQ8T-*-I)enAQk~-} zLTtNk#5K4gMWhs|WyqLC!x(dHWn^upWz8^j4DH;Jox(Ft>E!;yzlpY zzR&Y{--mbi%Ux~H_50w%UjWs*=wybz&r@%N&dyS4jkdSYUmOP^%u`VxIJOTRv# zodNn{iheH8t}tDhqko9DY^663(`OTObA>LPr#~K1dk1}Wn(nUAD-mjLp#yz%Vl?jQ zj|oW?tAOrBs02fS0ukxpDTnlgD&FJz5`ra2rV1q7t`soFRbXEYb^vK>&cqNyD?^k4 z1+l+`q+;cq$B*CP>kKaGD12U(coK%n^8@kPFJt&t#a-?W%=N>T1Xgp9O9BOTd+qFeaL8gVf_=Qkpq*28KApK?Xl( zJ7Ys>GZeEdj@DMS55chb5d>g0PLx$hrn)^x7RFpY$LK}(>yACgn-h`o--YmqyWTMvm9K_G of0vZXu7B{-yu9O3xJjNDoE~S-Y-M0v8u{V)k>Bn-<;L^>0Tlpf=Kufz diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Detail16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Detail16.gif deleted file mode 100644 index 6ef8de76e0f5bf01c09da24a07c61cfe558d7a4b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 676 zcmV;V0$crwP)5 zl1oTbVI0MO-{a21M#B_R#9l-oXcPp6(?)2~B7y{4Mu9@O$#RS~LMu0okc%jC6BNCq zMPfd15iMrWDWnuP(IPA}ow0!)<9P4f`?UyPGZWN-v-$pq!}*{8hcSkHhP!mEu~WAd zo8?nd1jeIrclCk3aF;a@j#!~$nl%(P0Jzf98$5aR>}dqE;fU4n-v&x*nhu}wwKrd{ z4f;b9;fU2%OeY#6`YVQ=TOJkJo9%;vsn26nmF>ePxAA!V*2;(ZnPFo%AB#FaHw-$p z>A83xDHKX5gpddX0EtgSc(|1Lcd)Cxp7`{*Gd4M}fH9|HQD+7~1Grv}*vDrmsZm0K z5C{Q60m5V1o+G_9&%wGQR!!BO+NWc8C&Ce{BNlb~H9*c=C7oHocC*-S7Ns<$C1sQZ zLijB|M!48sj(1C=)P(9pYjao0(5pv%$FEw)G{Dl2Io>Bnm(2P=eF~WywGEfv2*dEE+1BNH1p0gO_(!va6Ym6#!ZeU0XL$ zmOyFA$XqYlC#eqYr*8WRCf~&E#M}5+`DMhod1o}n6nu_w#4?v#yZPlMNv2Zf#pvLQ?bsc$8%}?|wxEMGI60fdRAO~{ zc52bv6uF?Yza^+BugrY=o*FhT7dA)!rvyS0Urwj)#iE6g^YI%&-U+mBcICDJ0000< KMNUMnLSTZVNH5j^ diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Detail24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Detail24.gif deleted file mode 100644 index 6f3f65d33d303315f0d8d9dd03c7e7e2427d4950..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 930 zcmV;T16}-yP)b zm0M^XRTPH5HM8gBV(mpKDJa$_Z|#GH3N?w)f>s1UMXmZGQl%7pX-P>7f}&tiq(1aT zP)ljdLx@@mDPl`Bh9;&enie%Q#!J+svBm_`ljO{0&t5*9IdzgY(T8-w&&-B3-`fA$ zi`k;8T#fLq3ibbj8=Hf!`X=+>l7rQ;d2QV-?>9CVb}uOyV8_ERRIj^vt-Jr}^J`7#mgi;JV)-V&XlM@pz)^Qubt9p3w))KZP8v6Cty-~c zRl~=9ZT*|}%9hiw>&TVBk{`E*J%R4u*)k_V)uAX(9bH4M2p)H=X<%%8)E(<;`P*81 z@8<{N{{IBOvg2J&{nVa86~&Rd6sHcSmeg5NwcJ*BHyV2!{p9dWDJ(v9>J8g5$L0J= zsk213L}W|EX-H&4k~AVoLt+~ery;Q|@y+iixR{RdYHa50=@ zc;Z`>a*MNG;dVYeab$LCdg4%TZMthga6bIN!w)=6m3OItX9Q0?*00)%Kf9c^j>EIlQ#1Qc zA57l?;H7zB5ee#>%FD+$>_Y(0NEvPf-v}qi-lVpshC8o+i1CprJ$AfhX7ZQl+3(t2 zH&6>05s6eaF&WeV1%>gq+V-!$Z0APe-Os&PsP>n$@w!Jj_x-uF^Rtr^!@atFw9gFz zHT*jWDk5oR$3Ecq9kAr&;el~2&q-4lO(_RF6KKCrtkj_?;y0348J zvVd8%$N30LAs>C(5f2Uy_MAE5UP~ip7D;y%aK4(KDFy_}Bhr4nHU9O7(L-n7bFEo! zk}1x<%d6Z9Rkb2Q1|nz80wzuLs~`JES_Y1~?yQi@K`QVBC;_3W>YRUtl<7g%+ko=a zR2)dofzERo0gsvHJbx-T2`ZcIWI30drM=oU{7yr^Gp$0mfk1^mbL{;)t4+=xoY*Awd>X| IP-L(M01QEOx&QzG diff --git a/org.adempiere.ui.swing/src/org/compiere/images/EMailSupport16.gif b/org.adempiere.ui.swing/src/org/compiere/images/EMailSupport16.gif deleted file mode 100644 index 7c68cb8d35d52dd168e8e236fcec3a3f8942c2b1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 619 zcmV-x0+juUP)x~Vjlni0r*Ko zK~y-)t&>e?6Hyd}zey&^WXPmVQ`0OWh3ZNaOEGCg5G|%+ih>mde-K@XNWqN=?gepU z5em|cx~cn8LG8-6__Ii2P>g6PSZu1`B4f&%Op?jC5Tip9Q1tHJdFLG7z4tu$$CCb( zXqVkl@b5#C`>|~SW=7H~&*XOG8#k{H0=b`Ox2w+lVxGOpY}V%sM4?;-F>jaoCU+8F zy>jgrXyu?*L>TcQTTTm!k5y`SQ&7#woy6}8c}luYrDB5hl7apLvCVNTX_xAU7sXzby1-Ub)&hq5(9Lvie7#$rW z)YF6CucE4Ps0S&2x`(^;imp(M*+(No$H(r!akLN)_acPJx$_rLRn;+@ucd8lR3|XS zI$eDUR#vBxG|P4vD2l@HaDs<(v+N%^0Duqz!!R%mgTmX_96oXs#jiCrEnCvXp#Z6asU|jc`xahV!Zb}30!`f28abPV zg{Pc2dAbQTtU4DjO|ZDMgkcB=y~QA#$#5v0rd~C%8x5>l6$y!k)nMn2?G)EPcWyz~ zbrQ)vKQ3gSgXjSiRin2rhOX;v4JPkQPhI|tk2uNysP7V2y6Y6gd4d1{002ovPDHLk FV1h5`60`sS diff --git a/org.adempiere.ui.swing/src/org/compiere/images/EMailSupport24.gif b/org.adempiere.ui.swing/src/org/compiere/images/EMailSupport24.gif deleted file mode 100644 index 96ae0e907765f8db0b231e5ccaab461bb9b13da8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 946 zcmV;j15NyiP)d|u#YOs1TCZ>O|UE4JNYYG)=DZ+NypzIFJ&d$tx9=fycKj@)}zvLa>dwHMt zd++yV6t;jY=geKXLt8kZybKBVea_UF@WKt@20;6S^!_O zr{!JYiOKQTfGv!^$k!V{C@ zuLEC1Xat5~ScUs^?J98X=aY0j+_kQ%JA@`?Zz>}5sX};4v!^|+4jqorTrSrD-suOZ z{Kb0q2X=SwCs1EWpzV}_f7aAWr`}QIKbL{uwYoxmJvuT*Hk)mV-Wl^yV|kE8{4jxP zv;m4DrLIDFKac>>s;fUbGDaqose|e>7AT5I)=^08_=ULIhT8Hd?#4xZ-4TWMBx?Y% za>A!aN5)A1lqLuQf*`>6eSF`q^cQZ-GdDNOYA%OcvUp_Qdn8g%kn7MEsL)WpaWCa0g(3O>CR86IAXFEcO zhL5ZP1~|~y&)M^5=;`jkb=}ImloBMY=2r3j5(l3ds@eFiu->B6-}eNUE~UBg=R(6G z!!UUB@Y`FWTf$OGRx-;FQ#kVe2M8f*o?-g(MP@FX0H-q2(Fs629_Jn+ zA7$+LzJKEQ)Ul)7Tdag(_*s-_{f}M+tn!8r0P%7&qcQ*cKP!7I{!!f3lftS U;Y_NNVgLXD07*qoM6N<$f)BaF9smFU diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Edit16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Edit16.gif deleted file mode 100644 index 188e1c12bd2de0029c75eefc6c7c4753b86b7d9b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 574 zcmV-E0>S->P)2^qNERY3;<4ZcwkNNp7Zp5;AjKf{B7T6H z7K$;wTN)8fToCQSV$+QqO#Q&sZ0iseT9M6oFhjF#YAe3W{|(Ih&u?blgZ~U+lHy(Z zfEnP}R(g1dys47_mq#z10cH*!ci4`$5?D>W0r2hlIkux$PfFdaJ1vdV-c&$Y6qM6=z7>zUrb8|$BG>39|jmV1jOTU#EGRpi+xRHO?}@de@`-W?HM1Qj5D_ogg}SY zdLN|}^?H57O9w%Kn@Oz|d&_(+O?3c05d+({v28n2?E5}$CdJ@bk;TUuUX_^(h)oH!))dmc3|x7NH+_f7=kKWb2fXhZ zrnAjAMhLXlWV2a*$wSOL4(~qIS$aJMy=iu>tN_|Hp>9hMh9SE@rg`+GoBO#O-SQ{L5?nn?G7$uQNU|ANHWktGp13@enLu*Z~ zRzquzloG8qLI{Kqt=k(B1Emy><7_&0#$ zSad^gZEa<4bO2OuZ){>=axHUddSzrFX=8703OzkNJv}`=Jv}`=JqijaV<{jqFfcP9 zN?~htVjw4KX>Dy`V<#X}bY*F7WpXSa3TSk6a5^t9YH4k4VPh_Bb#rNBXklz@E@OHM z3S)9*VRU6=Aa`kWXdrZGWgtgMO;9WfXmoUNIxjDGcXuvlX>D*WZ*pfA^S=}T00PrV zL_t(I%bk@=OcOyE$A7z9f}k8)4>Wr)97u>K^rBY|q9&Yt#6%C^m4hZE-iRkdLO??B zqA@B24utZE9?+0Td{BBqL@W-^^t5oBw<>^9@+! z?LZtQ=9ISsA%qY|iFQ2M+DR=BZ^h{+hl&)s;7y<&sNEAi<9Bz( zo=#`z%UFHMWMXB z97&Q8Vk?bhWo5{+jA0l62qADUHFNvXD9azZn4DSH0VSIXfWpE;G))6QQ54$^Hpdl3 zAruPn_4&meXdps#x?eF(eSMwT&MIo!yaeBMGUgAF47|$bcNf^I zl9G~rp{uK_JJ7eCe3|>T2f8nKKgU_8ty|FP#TfCK0kpFZpu3*`g6$kpJR>7KYbK>FMjER378h^GZx}+0L;L0!`DX>o#b;ImhVcRZf;& z=8Ve)fXn4V)3od@+~yco@G(2bLI{Kq*(KlFUV(Z0BuOHZ$>4UonGYt|=KO)JGU@;d z?3N-)5|Sj@UTIT#d3ogL=bPOEKm&9@a+pOU7K`EY`8cdBlUrvM4j`S_NDMxG_PB~8 zDzT9m1kz?2%zEqqP5?!~amz`ObFj=!$^a=K0VKEkyPgu+@^J{T**5+e<1e0KqsC65 RdYJ$K002ovPDHLkV1gVmuRH(% diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Editor16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Editor16.gif deleted file mode 100644 index 188e1c12bd2de0029c75eefc6c7c4753b86b7d9b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 574 zcmV-E0>S->P)2^qNERY3;<4ZcwkNNp7Zp5;AjKf{B7T6H z7K$;wTN)8fToCQSV$+QqO#Q&sZ0iseT9M6oFhjF#YAe3W{|(Ih&u?blgZ~U+lHy(Z zfEnP}R(g1dys47_mq#z10cH*!ci4`$5?D>W0r2hlIkux$PfFdaJ1vdV-c&$Y6qM6=z7>zUrb8|$BG>39|jmV1jOTU#EGRpi+xRHO?}@de@`-W?HM1Qj5D_ogg}SY zdLN|}^?H57O9w%Kn@Oz|d&_(+O?3c05d+({v28n2?E5}$CdJ@bk;TUuUX_^(h)oH!))dmc3|x7NH+_f7=kKWb2fXhZ zrnAjAMhLXlWV2a*$wSOL4(~qIS$aJMy=iu>tN_|Hp>9hMh9SE@rg`+GoBO#O-SQ{L5?nn?G7$uQNU|ANHWktGp13@enLu*Z~ zRzquzloG8qLI{Kqt=k(B1Emy><7_&0#$ zSad^gZEa<4bO2OuZ){>=axHUddSzrFX=8703OzkNJv}`=Jv}`=JqijaV<{jqFfcP9 zN?~htVjw4KX>Dy`V<#X}bY*F7WpXSa3TSk6a5^t9YH4k4VPh_Bb#rNBXklz@E@OHM z3S)9*VRU6=Aa`kWXdrZGWgtgMO;9WfXmoUNIxjDGcXuvlX>D*WZ*pfA^S=}T00PrV zL_t(I%bk@=OcOyE$A7z9f}k8)4>Wr)97u>K^rBY|q9&Yt#6%C^m4hZE-iRkdLO??B zqA@B24utZE9?+0Td{BBqL@W-^^t5oBw<>^9@+! z?LZtQ=9ISsA%qY|iFQ2M+DR=BZ^h{+hl&)s;7y<&sNEAi<9Bz( zo=#`z%UFHMWMXB z97&Q8Vk?bhWo5{+jA0l62qADUHFNvXD9azZn4DSH0VSIXfWpE;G))6QQ54$^Hpdl3 zAruPn_4&meXdps#x?eF(eSMwT&MIo!yaeBMGUgAF47|$bcNf^I zl9G~rp{uK_JJ7eCe3|>T2f8nKKgU_8ty|FP#TfCK0kpFZpu3*`g6$kpJR>7KYbK>FMjER378h^GZx}+0L;L0!`DX>o#b;ImhVcRZf;& z=8Ve)fXn4V)3od@+~yco@G(2bLI{Kq*(KlFUV(Z0BuOHZ$>4UonGYt|=KO)JGU@;d z?3N-)5|Sj@UTIT#d3ogL=bPOEKm&9@a+pOU7K`EY`8cdBlUrvM4j`S_NDMxG_PB~8 zDzT9m1kz?2%zEqqP5?!~amz`ObFj=!$^a=K0VKEkyPgu+@^J{T**5+e<1e0KqsC65 RdYJ$K002ovPDHLkV1gVmuRH(% diff --git a/org.adempiere.ui.swing/src/org/compiere/images/End16.gif b/org.adempiere.ui.swing/src/org/compiere/images/End16.gif deleted file mode 100644 index 6a8d206a84cefcbf2557f01fec30cf5eaa1b8bac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 829 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 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Exit16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Exit16.gif deleted file mode 100644 index 1ce05410f521a7662e00f7d1918f9db4aed6e7f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 594 zcmV-Y0~ zq_PgKaRlMO(t&ilb17mS5{lAfU|ASue!hQq2L3Y?z;rro-`w1My}Z2aDy6hi>SRM* z*F;gYozLeVA08gQ8-VNU>rb6dXT05RxwyDMYt1Q@Jz0ifM(v)OF$-V+4Dv4wqs z9l>(B{XLJ5j~HV})0EL@L{(K7V-AMQyp5;d z7pUu+!C*kI*F!`OJnw!25C9FZSS-F-Yf(xOMG;{b5{4m3l8~k;aU2sx5n5}KB*9wC zdcFS95M){QxhRTX!{P9~bIyA2t#dAL&RG%B0LB;>1c58dvdZ)PXP)ODnr%F>r3MJ! g?&|G0;9yaH18*bMv2|+vV%O8@`> diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Exit24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Exit24.gif deleted file mode 100644 index 58e9c418632f432f1e4ae6de331c541b97f2c1b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 907 zcmV;619bd}P)()a43RTNSc6c3W<;pU?cJPHTf)(!tRP-3R5In zieJEAAt4f*12GURv@r;G>+NN4{-oKN?B06e63D>IGCS|Q?>x`@%)1Nx&x4dFyvTF_pPrt64gkEM zCR|@%|Mczc4U|$4LeOkBp_H177tT4f))+5SJpyzprLZFm#r(=vkYh6JQ1VIgDndWzkTy`pNW{iPz z4k3i|Yq#6TvdsCsr=VJq%g?fkq?CAgct8*YPDy#5gE0mvWkp@n4RNj_CrN^fiwj&` zT{+*Urzad99wJRsL{WrU9hkq@SL`je33hjP(QGy`7z`W=-}kY!w1mlI0l3?prVvYAw(L-@o-~fW3;!o_h+};RWtu8 h=J*4#W=i&t<1hC4sS-BYD5wAc002ovPDHLkV1g_vogM%H diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Export16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Export16.gif deleted file mode 100644 index 9bed1436efffee1a483904588473674318598b1f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 866 zcmV-o1D*VdP)UFWod3@ax5SUXmoUNIxjD3X>Dy`V=irVb7^B}VQg$JV|oe-V{&C- zbY)~9cWHEJAarPDAV*0}P%H{)baZe!FE4j@cP?jXZE!Aca%X3X$43AF0#`{yK~y-) zosv&TlVKdkKkwW8GjsCJ;cHs9iJC|qA~d!H4G(FMMByQX#3HCzjd|)|VIB-21Mwh5 zhom5c6$M4zBB6t3c_^}jnrK;u`YN**_QtOTUJ`MufOw3D}O<$@%J>jc9glCx%%Yp!W_TTZru}!8;pKg ziIreduQu~|jz3q2r))jc$I(uWGxwCOmnKd+iq~);5l0swcK8o_Q>AwF0Fa+$sjC1L1r-H%nUmZ19?@7`$l=NgGB#(d76639 zVRT)`nOBmOcy<+0;@U>{org457jm@9jjroNqtWCOEdZuz5{X0r&~+VM*XccPrR92n z<(R?A+A^9C9Y9r8LZJ|mNCcbBmiPxgzgH^C_adwe_&*qa^)k`Gv&$^mj1Hi7? sSDjmaE$V6yvJn)Y-+LKoV`H@c1eLz@t3P|Tod5s;07*qoM6N<$f{Xxk=>Px# diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Export16X.gif b/org.adempiere.ui.swing/src/org/compiere/images/Export16X.gif deleted file mode 100755 index 9bed1436efffee1a483904588473674318598b1f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 866 zcmV-o1D*VdP)UFWod3@ax5SUXmoUNIxjD3X>Dy`V=irVb7^B}VQg$JV|oe-V{&C- zbY)~9cWHEJAarPDAV*0}P%H{)baZe!FE4j@cP?jXZE!Aca%X3X$43AF0#`{yK~y-) zosv&TlVKdkKkwW8GjsCJ;cHs9iJC|qA~d!H4G(FMMByQX#3HCzjd|)|VIB-21Mwh5 zhom5c6$M4zBB6t3c_^}jnrK;u`YN**_QtOTUJ`MufOw3D}O<$@%J>jc9glCx%%Yp!W_TTZru}!8;pKg ziIreduQu~|jz3q2r))jc$I(uWGxwCOmnKd+iq~);5l0swcK8o_Q>AwF0Fa+$sjC1L1r-H%nUmZ19?@7`$l=NgGB#(d76639 zVRT)`nOBmOcy<+0;@U>{org457jm@9jjroNqtWCOEdZuz5{X0r&~+VM*XccPrR92n z<(R?A+A^9C9Y9r8LZJ|mNCcbBmiPxgzgH^C_adwe_&*qa^)k`Gv&$^mj1Hi7? sSDjmaE$V6yvJn)Y-+LKoV`H@c1eLz@t3P|Tod5s;07*qoM6N<$f{Xxk=>Px# diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Export24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Export24.gif deleted file mode 100644 index 340a87eec0d97d7e9fc9ac9b7c20d633979c624f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1097 zcmV-P1h)H$P)8u~JNUE6!| z#2YuP{GhkzhOxN$E&{%OK02M}gBOk-=>$&YqKHmvugYZ>qS4HDBauk%$%)1O=@%4g z^LYM%pGYKv#bTkgy`?_q7^t?{>;Qx#VTz^V|8%+pHJt|FvEyf0NG3UZY##u!EE5a{ z-N2BT2}zO=MG;rUM!NSm=EOxopx9_)bZCI?{f)RPHs<(>lG%l^)Ck}ffh~7z z+Ds~yQZfEtJS9m62VqCa75d)2a?=a<>@&^8I$=Sn|S$RoITuwI0CRPhsmNOsASccJ9iqUAyo7XIVDbyC?@pxDZ*7la0)@T5xrl!8u~JNUE6!| z#2YuP{GhkzhOxN$E&{%OK02M}gBOk-=>$&YqKHmvugYZ>qS4HDBauk%$%)1O=@%4g z^LYM%pGYKv#bTkgy`?_q7^t?{>;Qx#VTz^V|8%+pHJt|FvEyf0NG3UZY##u!EE5a{ z-N2BT2}zO=MG;rUM!NSm=EOxopx9_)bZCI?{f)RPHs<(>lG%l^)Ck}ffh~7z z+Ds~yQZfEtJS9m62VqCa75d)2a?=a<>@&^8I$=Sn|S$RoITuwI0CRPhsmNOsASccJ9iqUAyo7XIVDbyC?@pxDZ*7la0)@T5xrl!UFWod3@ax5SUXmoUNIxjD3X>Dy`V=irVb7^B}VQg$JV|oe-V{&C- zbY)~9cWHEJAarPDAV*0}P%H{)baZe!FE4j@cP?jXZE!Aca%X3X$43AF0#`{yK~y-) zosv&TlVKdkKkwW8GjsCJ;cHs9iJC|qA~d!H4G(FMMByQX#3HCzjd|)|VIB-21Mwh5 zhom5c6$M4zBB6t3c_^}jnrK;u`YN**_QtOTUJ`MufOw3D}O<$@%J>jc9glCx%%Yp!W_TTZru}!8;pKg ziIreduQu~|jz3q2r))jc$I(uWGxwCOmnKd+iq~);5l0swcK8o_Q>AwF0Fa+$sjC1L1r-H%nUmZ19?@7`$l=NgGB#(d76639 zVRT)`nOBmOcy<+0;@U>{org457jm@9jjroNqtWCOEdZuz5{X0r&~+VM*XccPrR92n z<(R?A+A^9C9Y9r8LZJ|mNCcbBmiPxgzgH^C_adwe_&*qa^)k`Gv&$^mj1Hi7? sSDjmaE$V6yvJn)Y-+LKoV`H@c1eLz@t3P|Tod5s;07*qoM6N<$f{Xxk=>Px# diff --git a/org.adempiere.ui.swing/src/org/compiere/images/ExportX24.gif b/org.adempiere.ui.swing/src/org/compiere/images/ExportX24.gif deleted file mode 100644 index 340a87eec0d97d7e9fc9ac9b7c20d633979c624f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1097 zcmV-P1h)H$P)8u~JNUE6!| z#2YuP{GhkzhOxN$E&{%OK02M}gBOk-=>$&YqKHmvugYZ>qS4HDBauk%$%)1O=@%4g z^LYM%pGYKv#bTkgy`?_q7^t?{>;Qx#VTz^V|8%+pHJt|FvEyf0NG3UZY##u!EE5a{ z-N2BT2}zO=MG;rUM!NSm=EOxopx9_)bZCI?{f)RPHs<(>lG%l^)Ck}ffh~7z z+Ds~yQZfEtJS9m62VqCa75d)2a?=a<>@&^8I$=Sn|S$RoITuwI0CRPhsmNOsASccJ9iqUAyo7XIVDbyC?@pxDZ*7la0)@T5xrl!* zm0wI-Wf;bv@0?TGa|&zA8L%}w=!OVv9aAYdvV<@i5E5d+e>h|Xp|iA%xn0b_glV#6 z-rx)|25*ef7~%zYxOjnoZj4@fLq}-h&8Ti!`O^((OMA}udclU(jo>bJu_t-&p8US& zdz0t;7!l!dNO&yNClW0EUn6784!{OriHO#=@yGyF02@0dW{g=iO>@26)_S$Q-Fp&1 z-a|Yl#+cL7=ox&y^IrrLeKl)2$ZdpRcTZPKiY3e+TeImPY`PUt3#q zy!h$jOD@-8EgZgX0WkCcm@y^-*nRBSQO~}ov`aPBHGBGc{YoN{z=ijR?|T>kTUlAz z!9$f5BYTUS^=HqWwUq3ChWUEBIFPmDduB(utNgI*V8y7W71zFd=A7)@>tu=4diL2l zs;WL)Q(GO{t*ZV&px^Xj^-X@^}kWb=2$iTHD%Qk##+d<#-H40Oi^M0A{lpQgd^2VSRnwYi5i2 za!1D-a!X6AC6nI3-PJh27)+)d0040U6NHL}hT|Uv13^Vm6eJSsAR-8Y2+ldcHq*M@ zZbNXp-GX9OS`U%>HO>FpTqs3K>Vklf809 zWM1c-Q%28FGL@v*VvGg`L%&5Lk)mKQ5bW}GE?)coT2j|_G7N)~$pmrEsjItFpPQT8 zvjxr?%h>o>RZnmC52GK9tS>Du5$Bv@vDCngNPUryNL#{xT5`&(gr)7I-Vf#KicKxBGnG4PAIIdF$3q z-sRf_vmM@JF&d59uUxs@7r(nQYI8V#nfUbcHv!zq?i2v)$jEU0jp&UrT{pDJZ@%5X zUE=?ad3t*Kz{0}9J|fz+jYnKrS#eBFO_dW-!A^;@#Q@|0NdK#156T399tHeJdh&jd ZzX4%jw82MZjEDdL002ovPDHLkV1m+b)?WYs diff --git a/org.adempiere.ui.swing/src/org/compiere/images/FastForward24.gif b/org.adempiere.ui.swing/src/org/compiere/images/FastForward24.gif deleted file mode 100644 index b9c2c6c8ed130fd6f665aedcbc63ba4d9281dfca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1025 zcmV+c1pfPpP)BDxGycfX}yyMEQ{?`%KiS-q-%_}j6!iRg!= zt=GL&r^t%p3IvYr$t59^&y=Zn+P>1Lt~*i0BO%>}q~-L${0!~XR*Uu`_vb>#8Vl9J=2-+h0$ zprBwf5{b-Hb#?XnlG61*9uM>&7MleY2}A^k-GRCJc^o-<=;lNygx1z~9gH-R$s{Z* z1psin@}R0VoC|(p^!4@LG)!|>e9ky4d_JEA00css)37WHmX$;zVIpqCk(Zl?=bw8) z2a!%BKqMf9fTF5UR262zfFvYrs@bfqS+j11!{ONC^ZA5aQBh$H3|<5PNRkXm2uP9w z&1OSsYA2!Iut z*)!~#9WygC-0p8Teh>fl#UmAu?rx}W7z1G5xo!-Er^4*_w;R)uNPl(JV@)^3N+6SfiEM3W6aD`+{jI+MSw*B9Myfa700000NkvXXu0mjfp}gdd diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Find16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Find16.gif deleted file mode 100644 index fd7f0b07a558cb6d59af96bebb672bf1abe96c88..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 935 zcmV;Y16cftP)&ujZZ2vcpl1 zMZ@GK2apA{PG?ddXEM`!?RHyZ=kcza{{|ocz_G78)~3_xTfzOGVc*@!;z&{~D4M34 z#HCy|oAJK^O5@u;x%xm;z_nWd04$M+pY+%HrNI}599Zr)1O{&1Fr9gQ zRx^nN(=^?Ylb_Xc3crTMTm|}8W6tGCdm-gHU zoivEbfP*V-h@Y#f29hN4c>od3S|m}D80SwWrl%O%n5zs-y=aEVV!4n`6c;!WFs{rR zhNug$8$G1gD4`4AaS<H7=eg9>uBL$90I_nW$UopHtf^aCQMJwQhI406Q(#?y zO-@ZpM5e?TYiVd$*M}u5U8hd09vd6~!{hc8oX&FDU*~sLS6AD5dV3x{dHP7z^Tsz$ zm;I-vElqH5_&#iSZzKKk>qUmIhNJ7$iG2Xj914Xt0)Xc8`7QxKZ+qL(^TA-S6B++< zPs?7gTFc=3v)=)}CSYu?u#}a#&H(^gTU%RH&GN(C?nC&$dI>wJW|L@7q6Gi|002ov JPDHLkV1n1##MS@+ diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Find24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Find24.gif deleted file mode 100644 index 4e522b23d8a42b180ae98bad8987eeb977314a64..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1267 zcmVDTAjLaB+%Yd6 zk9Re0dWW32a4X-d2sw)^O9q9&f$6DKD(jyH%hK8k)4@XrXqmgLZpZeWq5CS1#gvXM zZ*L{-=OWs$Y8TfnsYsPim2XqV^o(lgSHcPH_ukQml79^4H#crI9X#}DCji^Mz&rr# z_~8A3e{S8f8;W4uNXz0IOJ|JuoD#8^IFV9N%AngMQO~IQT3)C5T;51g#?k;w6R@5^5L(>1YOvB}oR)3$97Q zgb-dg4Df=$$1{4`EOH!(pc;(jIYM${>HNs4OOf-0!xTmVUJ!Ty;5foh3Z|6mW>FAD zj0eK z)tk}Mo6*b}#vwuoH^MVSC_{n=+#t-Vj7FZWdZ?5rN=)^7eP{0l<_aEv8SFSYwA%0C zC9AZ^VAKXiI4~wKM$L>+J0&pXa=9|6+x_gyr`%l2;ja_%_*ih#b~||@7@AdG6|kBG zb@pSG@{MS|ZggnSElJXK@B~^e?}~&6wm4m`S60_JAgD3wn(9tmxzf9&a>m1lFZcAO zCIkb(OKV>I?a!V|n^&%cj-)T{!aj$8`Df=ehp= zew*E1qTNo!8y=Za`R(2CJBCp6zCCjW25$c1cDZv7N2$p_*YB7PKRqbSM~N85fJnsmA~@7wb_fVG2zgNq3v5@Re| zQBiRkz|p3__HP;+8}|~9y|-cgMs#&`fl_K*xY(VE#bQ;*emH*Xp5UU7xIo`gTvv-0^o|D zC>9EgtG+{hku3}W1z?Qlf`#*^RXtvHM3!Z*5*u6A*4B23OfdM#1VFyX=W+0O>V*Py d-2eYI{sF*Z|Ipo-va0|9002ovPDHLkV1mNbUMBzm diff --git a/org.adempiere.ui.swing/src/org/compiere/images/FindX16.gif b/org.adempiere.ui.swing/src/org/compiere/images/FindX16.gif deleted file mode 100644 index aff8fce6209ef054abe4bbec57cfd8f9d7b6d1ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 903 zcmV;219<$2P)m z?|D28{faDh+jb?JGtFzoV*V-|=i0fmV;k5KQmyD8=zG`W^9u$ZYE$==*c#_dl%70IQzfs|B`C26u+j`i58p;GkGr_QB`(sXHXs>1WG} z9Kh&ifKE(~YlP5u+S>OPQU#GDAP%Jjlu}3%1*HV*7BSrZP*&5Lj!aCBx7Psx!Y^!Z z>rPnmS_Q;rjDj->f-?xlz&QhF5{xp>cmr(!aB?dUXl~MWS!EO?NdjZFq^MzxNhsPV z`Zd2BKxZ9r=FCTzg}c@LT8FPk^UC7Unwg1bi$=;U=X&<<=-lQi^|mVI-kz@3jt#49 zZG8oLZ~h7H%|8JEWX)0``Y@Bcy_AmMSxP;#%FitT`0ny`cwCa(%&ivz{8I-s2O80L zD1xPx)rGmJz9P5;AsA%Yg{dp^vuUEv_8p4ABOJA4tZ)F|*8!0|p%X!kf1K1~+CW$1 zUM5jWDFI^=IA@sG*Vo!#eld3Y?p-sTO8k26?AU|N0I3z9fAQ)2sxR ziCmCKMe>V6OFp|w7ViILP%hy*@@nN?4;A_(*V2xd;psA`TS2ab5ZAm z(Jvj-G_L>%0tg;^>*(m4$Bvu_pt8uG(Em58X<7+Dt~OT`r33({j=v6%$5RB50D!C0 dzf9Hk{0C)qCXfult^fc4002ovPDHLkV1h5pwE+MC diff --git a/org.adempiere.ui.swing/src/org/compiere/images/FindX24.gif b/org.adempiere.ui.swing/src/org/compiere/images/FindX24.gif deleted file mode 100644 index 986df47d49d7cea16f56a38a6372911f2b903802..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1459 zcmV;k1x)&hP)&wa010qNS#tmY3ljhU3ljkVnw%H_000McNliru)(Qv)A^;?aUrqo31wcte zK~y-)eU({kRAm&$|KE1+oqg*jQ(9@MD4V9WL4(Gn62zEjFg9X>OCo~A0CA~}yr7A3 zjY|~QC)Y#?kr(iRC6cHK0xn<|X@TiFU1p{;(>vSUJ|Bk0p%qW^&q=b~mfF+Fa&5Eks z=kY~cRW(<+BB7v&3CWpc0gd>>Zo6tYHfW?1W7DNl;UxfvySsK9^TGU5_A@Rv z`vO&WS4Wp+)0TTi&mj*GIag@f#7g9l$`n{OT-zKGLWxd}U)X9I#W4VX%m=fw1*Fa6 z@$IU=`dXqp-jrTKjsPHpfDi&oDF`XM=72bcLydsf%>=coXJ<2+yVl)#_Q>I5mvv16 zsEqS_J^qM?ssU3kAwLIWjDpV-qZGEJW=Xno9)FdhxjbzETIP350VsltJA&a_mds&> zP%0TKLm8!DjFo|mf^!DO%kM>t6ddj?1pL9302==b%sFSvBH^IduwhV2E&(YxFKe#z z%3QLg0jAnsud5M2WWn&Bd*+1$lamvEpFd<>w~VYlKc0#I(lZhBx`a>_P8p*Vfb6&- zx=L`$Apr?sU^E>+doGr(qExL|f`7reys`G#m-hjHSku}PTzgx4{6zoMgr*82I3t{w z2e)x;)6I|XcwYm6>#nKCrp^xCv8;?C%@ly#0%vLi%VCXkA&+zg{JATfyn5{#Zx0Aqwf@p#gkus z@lE2g%L9NThmYAEcilN|7{yc}Kf9zhpe$NkrPhQ!+*KD)eOCoUsLm&=8+=B6t)@4R zTs$`!A0L{@=L>B@@b!-4Xid#a`g(i%^vl2iaP-JAbNPyE2N@-UGpU4?*E7r~%!Y_o zTJEQM6Dg%UQxijD=g;+>NY5m`9~?aYi`(tKDHIAWQWT|C2*umj*zm_3oK#ps=MLt< z&IfAh>!Yg_Rk?;SRt*Vmm}Xwr_0i#>k={cGf4JCoV{2XW(&nAPVBn!>bP>}u&5p%l zpC=N@7x#U;KS89Fd!>{xP4m2}sviMR0Eh~)OH$k0+d~Hq9N10>k&}~?J&!*2$eHVJ zSiQ5RrsnowFi2f)P4@Tw{Z%HDd79?(rS0#1c4#|e?EZ?bS%vtVYHMpfT=8r=c&zu~ zXf%4;nLp1CojQ5?<9IxNGMmjpaLz2t>I9&1!?bYX^Z<5lxo5R$nm=T-*+Y>?W%mqAfPpb_e-`Cs!JEe3FA*4H*Ox_Z^7<)UN&g3`%jK-6A z_^I~-Yg$`w-SNbRzW`(^ye9w<4u@B5+V*a>VOXfC4#4mC=K%}@K+j*jqfJdqdNr5k z8y}Cy&;316gyT3emDXh{txG*ukW$LM|MiDSDW~S@vU)*EDZj)2#6OIRL(lBYYF_{V N002ovPDHLkV1hnbtw;a> diff --git a/org.adempiere.ui.swing/src/org/compiere/images/First16.gif b/org.adempiere.ui.swing/src/org/compiere/images/First16.gif deleted file mode 100644 index 70f2c996cd72a79328be5bd0ef9b39cc86be7086..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 636 zcmV-?0)zdDP)L zlTS!gQ51)N=l*%UXM%2Q)F>(p+zgmdf)8?0hB*|-MC$(Y7uSP)<6hBvp%pb#VTA`mW=f8m3=A+VF$gz+5g|*fW9a=~fVCub#hVuLlKG!y<+UFWVr@ zx}I*`6F`LLL;b0)!-tO1O8E;`N}ti*)<%831DzmD?+S1|ojsB`IeM-?t-lsNLXv_Y zi4Wgq(ARs$>S*s8bv>PJ3UEE0w6rsoxp>?8Sy_bP08%N`;|ezT7d{op$Nz_$1Jr8{;^A=dpOl#Zx*NxBimVOIKWYqfyp}XTIm^nr{$U_L)(rG}9&-Pp{q+QR5*>L zlv`*VWfaGM=ete1xCvK~WohD|mbGAy019XhA_RQv2eQ zeJCjUWK;sy8%Xpe0jmhjIAg8g`DbgoG}BVs^O7CC zqkH#5U8QY7;v1Yf`)lpgnIFF%KN3B*R-9VvFdVc)TRU&tf9Liv_-Xn}PEMa-NB7;q zmQAIyEcc>78f`c;!B*K8>jDq{(`k`BrMy~e*%YPTNK6E!Jem!i++xo zzy4@Kog)YwDu4@%zc8PiqxZf?i=r3{%eJ^CI4oNc#pu3!9=~zphEAE9okS~xbCw`* zBvM6Nk9CUQ=DuhBh7P%R=iW|HjD}?^t1A|UZ!hf%@9Mtap050WQ4VVy&N&jP)6i9n zQy3>0r}(*Yf^A*fU1@9gZiL}BRI68%?Gsxz-TKk%L>+Xw+8QRc}RGokTHTy@&{i5|jpI1mgr*GxD-vq1sr;?=+LhiXvABOVf;q z1Sy6nt^wdZ`1E5n>Ipt+#S}y&5RtY{X)+*S)3r(Gc;G#B59wNF~js|YlJ zNJJXh+~gAI9Mk}pUORSZ<7M7>HWQIE55(fV&lKmO*)vO~(jjSJl8y!tXDWd@Q1{*^ r%ldJeMCV2Z)u~I8gU30z_c_?VT>lh;8N^;v00000NkvXXu0mjfa%8Zh diff --git a/org.adempiere.ui.swing/src/org/compiere/images/First24D.gif b/org.adempiere.ui.swing/src/org/compiere/images/First24D.gif deleted file mode 100755 index 96f98dd205a9a00552849995142907842ec93a17..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 917 zcmV;G18V$R5*>L zlv`*VWfaGM=ete1xCvK~WohD|mbGAy019XhA_RQv2eQ zeJCjUWK;sy8%Xpe0jmhjIAg8g`DbgoG}BVs^O7CC zqkH#5U8QY7;v1Yf`)lpgnIFF%KN3B*R-9VvFdVc)TRU&tf9Liv_-Xn}PEMa-NB7;q zmQAIyEcc>78f`c;!B*K8>jDq{(`k`BrMy~e*%YPTNK6E!Jem!i++xo zzy4@Kog)YwDu4@%zc8PiqxZf?i=r3{%eJ^CI4oNc#pu3!9=~zphEAE9okS~xbCw`* zBvM6Nk9CUQ=DuhBh7P%R=iW|HjD}?^t1A|UZ!hf%@9Mtap050WQ4VVy&N&jP)6i9n zQy3>0r}(*Yf^A*fU1@9gZiL}BRI68%?Gsxz-TKk%L>+Xw+8QRc}RGokTHTy@&{i5|jpI1mgr*GxD-vq1sr;?=+LhiXvABOVf;q z1Sy6nt^wdZ`1E5n>Ipt+#S}y&5RtY{X)+*S)3r(Gc;G#B59wNF~js|YlJ zNJJXh+~gAI9Mk}pUORSZ<7M7>HWQIE55(fV&lKmO*)vO~(jjSJl8y!tXDWd@Q1{*^ r%ldJeMCV2Z)u~I8gU30z_c_?VT>lh;8N^;v00000NkvXXu0mjfa%8Zh diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Folder16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Folder16.gif deleted file mode 100755 index 901edc9624a23d92a9fcbc0c9c450bf37409da18..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 498 zcmVT` z=fK?B+ueUcgw&mTx8?fP8#5oZ_IS4UlwPlQrCO;yj|7yQi?lwqqD*+(cr$(Vs9LE# z0Eh#m(;1HB@{s`NLMd=l3Z)da7uEYf05Hbjc`mO%_Gxx9%%#H)XKp%DNa@dEf@UYf zg64HNtq;9mzz z0TxYQt&biCWrx3zi1`R0A}FO05k$Zj!CGNxeauK0j4VSdL!1G*==LU59h96xI zMByWh2N4hikuew;S(yNSb=sUhdyWrZ|BROccMMviB*Wb(P{I#8i on>e<%XnEP;xA*VLo2x9V1Hy;2%BQg6_y7O^07*qoM6N<$g5ayrIRF3v diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Folder24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Folder24.gif deleted file mode 100755 index 54898f33c7f0992eca68104aa314e0f5665e18f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 800 zcmV+*1K<3KP)R%y*?+yM7;Evf-hN}Y%hW2BTqN{Ld+4bhMv9UL6|zPr0yIp=VT zz*jos;a_!&uBEl%svC2-lm`x z5k!PvFLy{n9kQv)0lHESv`F$==E=QTh)fcZItusP5;`=UMv&T$H&K0_wI+98rAvf zsr_^5*l+;>*czfU=Z2HXIdD#0eeaLioA&gVAD>(T4UpX6!=$Q5Z&!8wma0xnbpkd4 zCT8{kvwOf8r~m~L(BoY1oSOrk88d^{N_q{v0_Gd4!Vkbcu$}a&+&6x4SW2Cb=`ivor ze@<*lr4P)^+`#iZve^t;YmDQNBnh3(b)LWdMD=w*cP9cX{BXbBFSxEtemGAM)LH&q zW3$yDj$_)bCXJv$yWRb5M5B!+olY}2ILO+X&+^I&+LU?qah;d*9TF77qa$Degp^~r z|L`%HKEt)ix0x#bC*mRaKiV35bAumO>7I1rdf-4t_m?#W! zU6;{90c$PB7(@ieakw>o1`)-Z`G9l9Lu_qFbXx1&yLpkTlSQ;rn7)3Oa(RKpN*S#b zN@CYEUd9inZk-zjhYTPiu36= zb6bqgI9i}I?t0-a&f(tYyqtT_Riu=X1ZZ}47Q--5RTTh1f}|))T%0hluImU9!zqbs z#c~PON!nTuIFHmZZ-pX3IE12U2q74Ga^c^=VW7P9KwPe=<@HL(t*y`K>g-qpI*koU zg5Kd#RH?9MhyBm3=<4jC>U1>#Sx)C)aZ~#M&FxW z)WP9s{!-&l08}k9uA#6%L4pz+-}IuZ0HoVDaWsDynxX4)l?FT>Dl4m^@$lDCXuL<| zi9^eJ7<*8zV|f5`Cl%Y^anx-k| z=H{ejS<_$^9fh^B$Mb!~KBcAQseIYiy5LSjRby^7 vZHa4DMO)Z2F(YvISpX}YuJ^b3Us3%Ac>f4g>k40#00000NkvXXu0mjf_n=fy diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Help16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Help16.gif deleted file mode 100644 index f25fc3fbf106af60de59581bf2e6fba58d489bf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 932 zcmV;V16%xwP)n<^0M7t*KyZHC1w??>xEt=fabLR*P`s^00F8@s%vX0ly3W2Q;1iYQ`2d{1 zn56SU!aH>A*UV&krU`gE?uNYufcfLL`>KjUEiXOnoQe)`qCG}W|1bb+O7eK1#?QvJ zs|dgU_0&(D106tZ+zosBJd?&v>qnWFmUKydqeslSKE)YIWlRZ)Gjda>n*%4R*)(?6s}$J0tF zrB0rXshXW1sfM?{P>GRo72Li*T~yy3kh%V?FTe2QhE1d6Y3FzU6LKF3;uj?|T^;O;NgH2_-9*%2UxlCj?MeRpHZ4w8sFjOr1-Y$4FjHVOs`O z6+Qs2{*%TqbaEVv&fkX!tu7E!h&mkz2FsQcy_m!>B&KO#Sq7GA5DFBqd&fqUQXD+m zfn!?;p^>;U$?D=fJf(uyMMMYXO4>Md`aVN{(Y9gut;(G&D3o z09{?N%Y*_27>1l9_a8%EHtR(M(E9O_Gnox*SF!%CmFQBU zOF`};huu%zOT%N;EOv}x2@;w%)hg>aX0MU5~e$Dv-j=Valc(v;nT_sm!fGJ@x&;<^^bV( zeDYmpd~&)e>v=ba>Hp#^rKnR%1p%a#U9+>RDDSDtx55KmK}&J+V?8*X6yHGikZo z&c|OLZ1y}x$74lpGJWptNd<#_&pi`j+jpliO&!zJ@qoi6)qJwEn6+CD@WYWyec*-D z0@${RZ5ix7aDl}$^O-zmXa*1=-8ulX=S~iAq@;=-$HUMSrlGUOaK{(L@i*%g#5u&#GBD|4MSHLhC){wrlDh* z20q(h_0maw;ES~_*p`W98Ca%4UE^H}Lw+HpnAcnJL?BU^@29e^1*J4}UG>Q@Qs1(6 z`D7+Pod>|RrhCLn>aZ;X+cYpuo%*Kxj2)GO=XqlR6wn4pAp}yBC{06Y5j*9>s$0eyG!6E&rsBUx}$36LASDZLiTJOxC8o)ACDmjo& znc$U0V^|Xj^Xj4kva>9Fwu!DZq$UwkU>l0UU=GD+t2%*_2fl?YA4GJB0uD5W8VKxu--Q->4q_hbF$eI0*XYS>tNVAGCX z*1yMQrVwI#R)+cV7aNvjOdmIt^H*+ht@%DTTH4WdjZyvqjL6HPFffQSWewh@FAsFI zcXWU7AoL+HDZ?`Tv)+u@*&}w$nG*EPpB6I1qw_@mh(Q2UH~d9;%`NxnnJdY&r8Tv; ztB!4Gtv+@cX!Sg=?U7(1L^d!G7^G+94Cxn`yU@tY37c6@6`(S51di);wl*hP8>_lo z8!xxk96t@-ZQu@Y8@TCtUgB{TE5HVPKvr7)fXuYn2~ugjpWfTk>hvCf{SCq*=OFh! Rj6eVY002ovPDHLkV1hz8a+v@C diff --git a/org.adempiere.ui.swing/src/org/compiere/images/History16.gif b/org.adempiere.ui.swing/src/org/compiere/images/History16.gif deleted file mode 100644 index 39ab127405bb6e9201c77c980e555a7a6ebe6718..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 970 zcmV;*12z1KP)4W>fwM+mYPvMc-FEIDw=W`b>#lF@1w0^S=`fz6&C+(>4xFBjLr=3i$SUx}W z_gZ9NvnfgV#55ZRs1L2D}l)H6q?QjSRIB3>7vNy z4%-UWf0#)wZ%dN$9h*+clFOxDV~l;7NG7lNd|pzlp2FAbN2%~TTuk6f@-@Uq0x$-3 zVs;?siju*(RT=0#%&_T{?5t+qJ<#>YtV|05hstoe4K(Xzj746@n^$kar}sgkz<{nG zI^@Hnoax!x6*a%N`jD-y*kHr+?;D}XcZ|T8tdSg;0LEkQ;iah$L5T_>1cVUa+(C~j zqsuAzXSboWTjfm&00@D>WS9E#a5`^2cBV63C=?aQpT*pp;=@VFB4}7Myd~wgW~91c+3#1}u8^ zV#lozr|Sp+1o?a(D=RCQpPxfGJdBBnBo-GJQ7V-{2!YkIp(@md5RUZ!0=|7*x9Xdj zavybCxVv-*S6`ihVHhBUV0=6d!#IbY9vv=4M)t|EXqwFoPI%WBri;F0@)oSI>KUTlqTU)#X;FO&CAOX+-Jm-zR@`iUf@wVRx zUzAmk7nCutTjrgXWm?C@NBil`rNiyzpSj)I0bo6qiJq180_b=3jhxf`&yOrlUOUYk=CrVBvQ3?>59<0H>OSd zz@$pF{m^Qf))lIjG-*j&3ZnvvLc)s;@tk1d*iLLeFZb@lk`N)Sz0&z`b##B{=zq`u zUcqOq-u~zS&;)GIH0?H}l)aEsO1*mE*|{J6zq8`Apqi$2eQVbbwjf-giKwWQ=VTBB z-rN}g{Z{D89lvtgSAN>pzIJUWH=V|g zHgR$M0-YVbe7|QEaXX68Lm1%*wjI&xYs}_1Pqf{gh|TS8YM2}R$_DRm$A>&A<~!^J zjsm7ah%MdU6H(hGb?qc|i4NX-_YDGn27soP=h=MEP9i3ZoSEXC(-}f?R*jsza^t7p zJaj&uG{{N9lJy%sv)J%`IJuFiF4O zj^n4(*j9nCnPYVLJ+^Gz!*{m-7SoKPX#yn!T-T$q&SrI!!-=uHk)51g6*kI$Skofp zqQ;5V`(IjKzwWD5^K0VD+2674{;fDsi_ziZ{P5vJ+`I0_07xlON&%p2g5qqIrld{k zdX;je!pZYB<@K!}oi~=;Tj#QbExPa7&X;cA#i5tFF-?=7?fIBxi97H-k7~7w5H|-& zDTQTf_<`ix8&`1l!i1)jzPVf~3@(C&ptewv)F&d;IS%`JPXh|m3=;$a!^6Y8{PL@G zb#=0H=R+u^P)Z>L_<>KYV^aN}MUoZYJ7?Uij!`H}bfGW|fs_hO(+GlqR4PSZ-%}hu ze3+h|9&9^CS69~}-1ik$*u)P6fceY5>8iG*V?Q2Q+!6!$(6`+<=)`m%4Zuzyny?@pVH}jm3%wfN6%vWG2|Rub&rR{0)tb zjdXW!K`BKd5$DM#`xqP?q~pF061GKpY8Dmvpj6=&upGLPFMaoo53gw}>LV1VQ|y1? z*9;8wlT0S@eSdK(Hf`F(!Gi~BYg+?oSXP+viK}EM^S%tc^ioR;r+LHqsTuDliJF)e zjYOEtTxDxd56!nXE@~;IT#RJ0j;g1K#~sGfISw5e z0)764(*d(^ap+yuaPK2^HR15NOhrU2i!ZOLCu&(}x{hI*=(;Gm`ThjaZOiG>_edmR_?AZ~Z3IyU7a1=-YElr(I41}D9`9o+kehqIPw~B4JZNLf@I*zdV}zrlUOUYk=CrVBvQ3?>59<0H>OSd zz@$pF{m^Qf))lIjG-*j&3ZnvvLc)s;@tk1d*iLLeFZb@lk`N)Sz0&z`b##B{=zq`u zUcqOq-u~zS&;)GIH0?H}l)aEsO1*mE*|{J6zq8`Apqi$2eQVbbwjf-giKwWQ=VTBB z-rN}g{Z{D89lvtgSAN>pzIJUWH=V|g zHgR$M0-YVbe7|QEaXX68Lm1%*wjI&xYs}_1Pqf{gh|TS8YM2}R$_DRm$A>&A<~!^J zjsm7ah%MdU6H(hGb?qc|i4NX-_YDGn27soP=h=MEP9i3ZoSEXC(-}f?R*jsza^t7p zJaj&uG{{N9lJy%sv)J%`IJuFiF4O zj^n4(*j9nCnPYVLJ+^Gz!*{m-7SoKPX#yn!T-T$q&SrI!!-=uHk)51g6*kI$Skofp zqQ;5V`(IjKzwWD5^K0VD+2674{;fDsi_ziZ{P5vJ+`I0_07xlON&%p2g5qqIrld{k zdX;je!pZYB<@K!}oi~=;Tj#QbExPa7&X;cA#i5tFF-?=7?fIBxi97H-k7~7w5H|-& zDTQTf_<`ix8&`1l!i1)jzPVf~3@(C&ptewv)F&d;IS%`JPXh|m3=;$a!^6Y8{PL@G zb#=0H=R+u^P)Z>L_<>KYV^aN}MUoZYJ7?Uij!`H}bfGW|fs_hO(+GlqR4PSZ-%}hu ze3+h|9&9^CS69~}-1ik$*u)P6fceY5>8iG*V?Q2Q+!6!$(6`+<=)`m%4Zuzyny?@pVH}jm3%wfN6%vWG2|Rub&rR{0)tb zjdXW!K`BKd5$DM#`xqP?q~pF061GKpY8Dmvpj6=&upGLPFMaoo53gw}>LV1VQ|y1? z*9;8wlT0S@eSdK(Hf`F(!Gi~BYg+?oSXP+viK}EM^S%tc^ioR;r+LHqsTuDliJF)e zjYOEtTxDxd56!nXE@~;IT#RJ0j;g1K#~sGfISw5e z0)764(*d(^ap+yuaPK2^HR15NOhrU2i!ZOLCu&(}x{hI*=(;Gm`ThjaZOiG>_edmR_?AZ~Z3IyU7a1=-YElr(I41}D9`9o+kehqIPw~B4JZNLf@I*zdV}z4W>fwM+mYPvMc-FEIDw=W`b>#lF@1w0^S=`fz6&C+(>4xFBjLr=3i$SUx}W z_gZ9NvnfgV#55ZRs1L2D}l)H6q?QjSRIB3>7vNy z4%-UWf0#)wZ%dN$9h*+clFOxDV~l;7NG7lNd|pzlp2FAbN2%~TTuk6f@-@Uq0x$-3 zVs;?siju*(RT=0#%&_T{?5t+qJ<#>YtV|05hstoe4K(Xzj746@n^$kar}sgkz<{nG zI^@Hnoax!x6*a%N`jD-y*kHr+?;D}XcZ|T8tdSg;0LEkQ;iah$L5T_>1cVUa+(C~j zqsuAzXSboWTjfm&00@D>WS9E#a5`^2cBV63C=?aQpT*pp;=@VFB4}7Myd~wgW~91c+3#1}u8^ zV#lozr|Sp+1o?a(D=RCQpPxfGJdBBnBo-GJQ7V-{2!YkIp(@md5RUZ!0=|7*x9Xdj zavybCxVv-*S6`ihVHhBUV0=6d!#IbY9vv=4M)t|EXqwFoPI%WBri;F0@)oSI>KUTlqTU)#X;FO&CAOX+-Jm-zR@`iUf@wVRx zUzAmk7nCutTjrgXWm?C@NBil`rNiyzpSj)I0bo6qiJq180_b=3jhxf`&yOrlUOUYk=CrVBvQ3?>59<0H>OSd zz@$pF{m^Qf))lIjG-*j&3ZnvvLc)s;@tk1d*iLLeFZb@lk`N)Sz0&z`b##B{=zq`u zUcqOq-u~zS&;)GIH0?H}l)aEsO1*mE*|{J6zq8`Apqi$2eQVbbwjf-giKwWQ=VTBB z-rN}g{Z{D89lvtgSAN>pzIJUWH=V|g zHgR$M0-YVbe7|QEaXX68Lm1%*wjI&xYs}_1Pqf{gh|TS8YM2}R$_DRm$A>&A<~!^J zjsm7ah%MdU6H(hGb?qc|i4NX-_YDGn27soP=h=MEP9i3ZoSEXC(-}f?R*jsza^t7p zJaj&uG{{N9lJy%sv)J%`IJuFiF4O zj^n4(*j9nCnPYVLJ+^Gz!*{m-7SoKPX#yn!T-T$q&SrI!!-=uHk)51g6*kI$Skofp zqQ;5V`(IjKzwWD5^K0VD+2674{;fDsi_ziZ{P5vJ+`I0_07xlON&%p2g5qqIrld{k zdX;je!pZYB<@K!}oi~=;Tj#QbExPa7&X;cA#i5tFF-?=7?fIBxi97H-k7~7w5H|-& zDTQTf_<`ix8&`1l!i1)jzPVf~3@(C&ptewv)F&d;IS%`JPXh|m3=;$a!^6Y8{PL@G zb#=0H=R+u^P)Z>L_<>KYV^aN}MUoZYJ7?Uij!`H}bfGW|fs_hO(+GlqR4PSZ-%}hu ze3+h|9&9^CS69~}-1ik$*u)P6fceY5>8iG*V?Q2Q+!6!$(6`+<=)`m%4Zuzyny?@pVH}jm3%wfN6%vWG2|Rub&rR{0)tb zjdXW!K`BKd5$DM#`xqP?q~pF061GKpY8Dmvpj6=&upGLPFMaoo53gw}>LV1VQ|y1? z*9;8wlT0S@eSdK(Hf`F(!Gi~BYg+?oSXP+viK}EM^S%tc^ioR;r+LHqsTuDliJF)e zjYOEtTxDxd56!nXE@~;IT#RJ0j;g1K#~sGfISw5e z0)764(*d(^ap+yuaPK2^HR15NOhrU2i!ZOLCu&(}x{hI*=(;Gm`ThjaZOiG>_edmR_?AZ~Z3IyU7a1=-YElr(I41}D9`9o+kehqIPw~B4JZNLf@I*zdV}zzpi=LK3kbe)ph6$1us|E@0bs(3;j70N?ldxwS=dZZ43B3h07Tynj^2Yc@GQ zog*HPBZLSEeBTewh7gSA^VD1y1GodMPMto({n9-)s&51E$;vZU9zR8k5p<`8FhN|A1evk_=AdpfbrNok-0q9`y@lykUZ{9CDA`)68V_>uX4$tQ( z0GBRKb2S=6>TxbhlkH7H6&U>${F{F7rSIMjqS-ib^#eg962Z1@5{U!?i4YKr#c&*F s0J1DA{1>jzIOV diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Home24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Home24.gif deleted file mode 100644 index 9d62109aa882298fb18a15b3f9b601fbefd92beb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 920 zcmV;J184k+P)N8$}d{znSbhwHxDYoIqVfZ6Q@OqN+eBG*T}dAfPI0Em>6}2+CjJQ?(TW zm49G`R7eFUAc!1-pwc>0FFp6r0|y#HIS@e)krOqEokCo@@$L+VU9Z+nokZ$LqurgE z_q{j2d2d#5h&B&7pc;O@ISs$@ylo!dng_jO+j_^g^*rd%(Y{R_1Oo@=> zreUp@tvn3$(VaWdcx`c!&{1{2$mK!M*1dZSWV2oKhk=Xzpx(*~(lC&PLTCFFZJW(X z1t|oB7ccgdMfQT~Y89DIN6-Avr*fCtk zq4DuYY@B|LmtH*1srojnSFcjEZPqIl5ow^B4TN?`RtaqoZ##Fff4c`(3@=ZsYqt{n;$z_wTbXI~z{`*`@LAvu9@>E-lTS zTltGmKl@})1UJ6=8l@E1znn#jKD5_D7)Q|l6F$FojY>Mr(3vyk50;m2#HC<-Y3YZ{ zlcl)}gF!KjjGRUYfe?Xj-}lj4qlKieFpjsfh{(T(esCMDHI>N{g_Ey-!}9X8rRZpw zNF*>#6T>htO%tV51g~!G0Py?YoA|zpY#hhY&(he4gQb*6DM`px3{gWVg;ENS1b_Uq z1;E4lV?5Cx*$`xxh)dB29F2oJ5-4&sTLCne%kj?nQQl7;Me5_cD@``mh=a2P1>zZ@ z2cs7l`bj21DFwiz`X*v~tNT)_)%H}f5gU*lZ7s_plgS{E1bo5p@Gy-=gNccWJsFcq zMP<+cbO$IxDbklGOSR|u+x+~~O%w3qp?Boy4-eplP_H2%8P56P+MV#d4QvDd0UN;M u*qW~USUe?*0L<8~h#Bgz`(f8lNB=)*W>zR%=q5h^0000kSC&LBJ zfVRcM$?V1P3B6PcAX~#mZX7Dr0E-up6>u&Ai1M4+$6px*d6g)50zul{6fOZfD5 zx^(<(+NuITAZTdtF*`7sbB~Mx0Ae$D>fg&k;5u>{h0Ft(%sL2>YF!TkK|`BOGW-0q z$<55rD9F$#2!Mm7ygZedyZydz;2gN<0Fly!zty-=mBaVpcsEVu>hcW{d1#Z{npnGY zBY*fjmK0%?8^t(;YR@+XG=oH^Fxc%lEVS$r0NiT$nf{@pT|4*Ae2zV-96O_3`)`13 k>$j#pJbyuT?P=Bf1qBx3B`dxp6aWAK07*qoM6N<$g68)pi~s-t diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Ignore24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Ignore24.gif deleted file mode 100644 index f37c6963d5a09fca4392a9c624171b6ebd8ed75f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1011 zcmVTE&9H7IvbZ+cqG6s%a3~8qyOAA9sH1p3h*yWIRf(}TT_~f(C;C};eLubYT zdu`WXWhbb`N1!U*0DeU>2Hvo6!?f^IgOT&sH`K)G_nOsCV7VQX(^bIpI0&KGGpZvz z7Dg~^g!=q)rI;`6edIy=#qfmsLn6sa9l;kCM-By$UY?v8N8K8OPu|D5zr&u0tdwe|HPw60!GtvqM83Cg^n%=@1wQ3jwc zeiV8k83PxWkjEA3x3NGm|N8;^k5q_W_{_)MwQ5yN996=1&+${)_|4qlOX9y9tjUB! zlGJ9Y+}*V8#-

    wJV+jRz;EmK$?Few+vtafY+_6&a^C1bfcXAO|mFi6$?@k%mI@& ziWQd%=bZo`XHNId`g|nRr0T}nCJR=JjdK9H0n`PQ1K>(aPq!|jx^^M^d{CnM^fx2X zTK0?2m(@Et{_fi!;%flfzo!b81D9K%lKWy3b20!DjY|6B2Z2uleP%hnT(LJ+*<0^? ziiFs{19hz6q{U;!<*}@)P^J!PfvJPC;n!KeSFFHc!|e?JSZq^|X&uiA00079NklA#8@14=B zGfocZG|p%#r86nomzJ(9+7z^CCA4hY9}q!XF=$nbTI5axYgdqgkq{{g7KmRUgo|lS^2<`BRFY(RoWbRJ z!lzzinkGsq092kQ8bCn1#Gbv$wae{DY@!WO!c`&88XXLM9c6aSVRl_Iv*s|hxK#+K z^C`@&vU&e`jNzG`V*mp{N=Zv)CuQ4}j8FH{ zwiU0(%cs$|RG&Yf!j&YISYl5%aT`^jqz)KIub>oCNosrz)cBs|=zhN+UDrr# zZc?rp2qDlkfe;`as|fHMZJ<=nqYmHZ~+_Sz?_wGkh7DbUBB+t3a`F(tq8E z$7lM7CI(PSlTO9~B{ZX$y_Ja}Aax?ZTdY<#e)RPL`+&$E8%O~e1Hj|)V47yZu-olM zN~Hl3NCM73Wd&f&&CNcao}Q|+EZeP=)Rk14LLm?cO~^!I>mzWGg%lVi039#^FW}0? jTDEQhyV>=v|6TD9SEBP|lG(e900000NkvXXu0mjfkPkPX diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Import24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Import24.gif deleted file mode 100644 index 44641e887bfaab3a8f77081400af3353e43c92c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1098 zcmV-Q1hxB#P)&wa010qNS#tmY3ljhU3ljkVnw%H_000McNliru)(Qv)A}A3(_p|^21J_AJ zK~y-)m6h9T99100Kj+M3W_PpMO?E?@O;=NEE@FzULTOcOD>f)CLf>k=ASj5me}NDB z;EPH{@j;GFY(9GQ@Q#DKc5Wf_;kTsc%CtKcwhvv7UhUl0#?J?iQP_KcH{bj6#2;5? z-(DAd^8G#L)#5qxlJOPSss`;xQgl|k==nRwmRdXa&Bs@qg+SXjSAsZhePI>n25`kA zpTGOh9sPa%3}*JBJb}(jxGhJ_-a|Fjzslb*44OYx&}wxi=HSra;4{xYeHW&>B>@SdONr*fX%KC9xc_5Rz@F0Uqpq zj^=!vnYkGT>_d!?|3#*}mwWS%vG1M(Scc~4u;#=_j^{^u*d{0WZFG!s{YC-Fm1_jI zrUx0xoy3_=^4a;*+%6vCfm@!SJKaN1&sG{OpI1K_C1Fb{g(>RQBIV)?GH|d=i3XI{ zFafdL1s#TjXnIpSc(UWQ8zRW%atI+XrDl41nnt66A!Rhn5+N2VyilKQ2ilgwVKkQ; znUsQDx{YeJic$(`7^K>5k}(6<^H53=G)rk9z7p|&Kmkk%y-C6MqjPAjnJovZD`5w! zRWrZ)v0{|VmGPie3jo91%uZbJ1Ml54KYXsy0oMXsZd>wp`*FX4F8{SJr&pbB^!L6>wbqV(+O7*RvSbMh53JODVWnpw>WFU8GbZ8({Xk{Qr zNlj3Y*^6%g00OH?L_t(I%axK#NK|nY#=rmEJLA1N*GDEB)OrZasDZh+oSvYeh-b)!X&wkCqi5%=xUSx|_F{6#zu1AgWFc?@DNvi{=o` zb31h=C3AB8Z6^Sj!X$=0S8gvrAf%45EJH13#vp`HP#BtSD3rqJ8l3DdD$D`Ha;MgE zVZf?F;{_`ZSZ+ivaM`C+Z(3 zy#C(dnS~`$HdpLVs~B>P!OCIcuN!O=LdQG1`sJDF`RueL>!EAy12@kc&bs9OG9O}C zlIXN&Rr?p0a@>O>s=)e6!>h0VgJY)~t7IxXFDosw6duS%G|xfRb@-M=47tYf&NZUN zanj`{?Kd7o1OPy7T|;7sZgB-3|fr;X0czA^&R5dAdz!r1Ht08mwZ p@_LOR#2;B$Sa_Y67yBrZ={HtPHeP&+9RvUX002ovPDHLkV1i2wZan}1 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Info24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Info24.gif deleted file mode 100644 index 07cf0102d3f31149f1eaf2abea4d9859fbb270c6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1204 zcmV;l1WWsgP)`rIfZuf&ys#RNoP>@O?X+RM~YSd~{Bjo{oAmKqx3?b@+ zB>Lc!F_P6_)P$9dLSoP~MieDJpok$9L!o8C0CA;2yZzYjot>SXnLF19*95A&5dX=^ z&B@9Aoqx{Fy_cYdw(r;_0^~(P<)=C4%i-E#2+}MeB+i-jExo;y%*tMiv(KHo`EI}`sNM-W)^U6hY^z_LY*QvY^i$+e|5qSHKU5^CAt>14R*s9vp zgZM-anipW4xfR=ST$k{r?S8SnNv6Yx4wjRXH=c+^BggB4x9`}s5P}$gY3J)Lmy;H* z&SkKw%kOF)k#TT`bGWHO#f(p6t$@#?ZCbui+xz~WoN1K0W6?oK6?Y`h^>Lx1mF?^LlB5T2{8#FR!*;^HLs+*98STogpj{6%$c*aE*OHC%od8BjjC)o zF3->8%4VxywIxan#(7RR?4;$eqR%VK4&y`s36#oaMWA%5?kE6$B9orw3!1%_N1~-w zoxzq+lSjvsJu_v@X`goT^cj*gJl1p*MjbveqG%_i;+Y12LTgdf|x_e0lp?2qSz>CMTx(Ni<`FYO6a z@RfbN%f+l-nFus0>R2MP$8p>ri>7^`QI%HfrgL1CJOigkPFZJ0M-T7cx96kVi~@k` zyf*sV$d$~@q?ftGF)D0I^NIunQ_ZSu1Bio*ZP`@PI&$Q@X_q;#{MXI<7dRG;*qk{- z-wY2+L7%sE{P#Z+h0I(F6^L_fA`ytkFZ@i2u=e1AgDoy&TVv6Pc}L(XJYkf}$*HO9 z4HU+sXGVT_S4p za81XjkG?aq?!gLtN}R7-H-HTrp2D(aD-dX==*s4@U=b(N~YssOv{)|?OgM}GmYk}@P);g7$B*xv3;Y$KPYD31R5prz8&oPAlSEY97r}lc zlu|x3`@K#6vIGvE_D?|L1#lS2u(7shxI#+l5s|mU#2~)Ex|y3@C|`R1Vr9(#x+*VU zxwykX?&dr;`^_>F<}GhDb))q7SLxJA`(YTxF#ztJGv?+lkPzbRyWc13*&}DJ)jq#^ zdHCEtkxn|x!-w2Lh=gqjIsLv`-~1lts?*00gcHY(;zRZ0b^^AB(oS*w`~w?+$fTX? zK?KrZ444TV97^5!S!>{vo_OTHUe+CwZUzh(sX-H?!n2NKI>li_+4JJZ1lf28!^W6}YQofYZ2Y_bK z)~;iNhydEQLDpbq5E;6MNMF7W4U;GHw0FNu`tz08&a10CuZQ)ARr!pPzXP0Dk~mDZr_O`SVZ!0000< KMNUMnLSTZSC;vGB diff --git a/org.adempiere.ui.swing/src/org/compiere/images/InfoAccount24.gif b/org.adempiere.ui.swing/src/org/compiere/images/InfoAccount24.gif deleted file mode 100644 index 9bcd02f6b7b724d7bb4d94c518d949c575b029ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 960 zcmV;x13&zUP)&wa010qNS#tmY3labT3lag+-G2N4000McNliru)(Qv)BMn0$60!gQ15HUp zK~y-)wUke2oJAPMpLgc_x5>A0ce9D^wg}rASd0X13!cPyC|ZaOMJ0-;RPfS+C!vB0 zA`+F-9(vInN-ZTU2p-f5B`Qc%dT6{Ds+0&;Bv~c6CfRTI`!nCn>!F)%quq)%4!ko1 z^YEK@9^Q9=|8vx8vtF$>yK6g{*12;Z+W?*f@Em}LwhJtnIm66PZMO?TYpski3)>DR zB0)s?8y)h}N$}Fi{{$}dRFsB@!w+uBilmnnH1Z;#S*EFyNih5Gz?NlYgb-6b70lWq za&3@*;`DpNtG}GRO*PMC7A_pWIXDP{Kq)odOF+4&89?;Fk(E6kei_WYd3JsB+a+Dx zQObMIJUc}_!P#s!=Qz%(o87+a@t-Qc{b6SE`Ju77i|yB5c)Kw+`PPPs6OAXP9=jo2 zj*mYWS(bIdw(aqYt^3-8)%`CGR`-A2xcr$aKl(ZijXYd&GtS)Z${i!C8;W+8@`c|U z!TnK?{=Cw<{fZ+v-8Xh8M(?>B-(ULSTIZEYr5q8RV#YEUwv^(qloXCkzH{7wGp=jD zUmDI=R@Y-+gEJ+0uNiZjo^%Kmd_IpC5xgA6>N0@E>%j%?kb^KW+Q5JSx;mk=+r)O@SJx((g%Cm;-ph=^ZpK>c zLxKbrODG{o1Gv=H&&<3#ST2{(6VYAF_|7nkTlmQg z5jK-KJTY&-K)w6IT5ZJed}|-^E>z4Yp9T&OuxanN3r9* zrs~v5#G6scEjUz8JyvYgga>b#sU`QrO0c#1IjBdV1*Y?%o|m1Xaa#U4T8o)0t7;6{=WyK2NB)L*Ce=qaEn8 z5r(ckWNB#$RRusq=s>kl&-TwhzOqN;ro6$MQv?uP|$bz0attPv$2^i3u?kqEXzh!i9{l( zYWW_FF+qWdVB0ozhmP%kM51yr9S53qst{AdQO~%V|_dz;%;0+jw_9^EjkkyiT|@9QjMDH}iip zzukHJH1Houj-wmrYSX}#yB`4AiD{i_DNmyBTU#WW;>6o;%B?E!-xKQ}5F36Z zB1UZRfkapL+lvqJpR5Cqg}HNZpg zz|0`gry%Fi&RuG;^6+7SZ zr-$+Jaq`1mc(?6lYuhhq^CKczjLviRhv;AeT)8xZZrjJw++U>IGb}BZu+~zkR45b* zWHK2<1OVUnnLcN^a;2RohM%OP!y&5g#7R8{yh{R{?Y@Vgx=gw~gG3?et#@LrWoT%K z!NEa91ZyoK!szJejqxLh2!62UXHsjd7(DjXt4yw@_+#u_+|aVBG{1X0IQ``-yzu-9 zN~Kc#wbt5yT26#iDn(~!XPi%f&z$*??wze%ql4?KA@#suf{RQ{e9Y02x9IKdO~7ud zUa!ZeXnbJ|&gWlbV&W7*7{p0yV9%cCu+~zoRtdu}hKdMEDYDsYqD1S!BZpt-$TP=T z@hfq%Ewc@+9Yh4r^AM2)q;cE~j{A6iex7u?mFneHvfg$sSFTeo&mkhr&d#EgqFgSc zl)`ZwrluzWn4b9=V+=FD{km}}0KzatYmG66<>lqr_kBMR*Gh3CHtaXXYzzkCpOnkx zVsBtzAQ1ru_dW!`zT8j(xDMRk-;cExt@XM^8+pw-@Zh6~x!TO__HVkQtMj|&`&a=j sKnmCbq?;aq5D0);L%iu({#Ud92D&W7W77&x8~^|S07*qoM6N<$g7f#ArT_o{ diff --git a/org.adempiere.ui.swing/src/org/compiere/images/InfoProduct16.gif b/org.adempiere.ui.swing/src/org/compiere/images/InfoProduct16.gif deleted file mode 100644 index f87c2a9662fd955e34f8e27413cfa9becc010de9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 439 zcmV;o0Z9IdP)GKF`j=Kf`k;t!{qX;wyQP2Q2ual2c4#8H@6Qjz(o#_NTq#w_sr{CxR@y*2msq#K?7)*tx9Qy z#14f~>{l{Pk<5Z;U6cbvX5uEnaiWwi28cZ?;8_+PV!yRWi34%1FS?Pk8fdLiTFtDB z;||y7ov|(L?-#fSru)BaU7~Rip;9nssRB|&#ZY)lj*s4GX+B69Z22RxIEXH ho^!L}00dA5{0knEs~4Y2aNGa@002ovPDHLkV1iO$t1AEi diff --git a/org.adempiere.ui.swing/src/org/compiere/images/InfoProduct24.gif b/org.adempiere.ui.swing/src/org/compiere/images/InfoProduct24.gif deleted file mode 100644 index acfdec98eb7bfe2d745ba3675bad6b98f7b73b8f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 693 zcmV;m0!safP)9=cm+m;UqMCYzb;&iwXypZA%C|8$w+gT}^A8CVAD6YOsRadUUe zjs!P0b|T>6LcR84dZzLe9U(;_vF`Qh>G?MBwz<2N3zd4 zf3ml?|0+H@eF?m2?rwFncjaK+?HkwY+Yj#F-CSK;!Fe4EzSFo#b-MKU-G|R|7@s@` zJ`Muks?Jt7=NIZU4}MHwuL6eJT$O9{wI_%1$-QA<5+{6*&-wE8a3l-`O&icyUB)`O zva&Q$b`(?zda3D$S7$ATNo@o}DpGq4eNSr$>O^*IGaVD6&|);gT?i0ekcR9cjlQrjx-^1SMtr<>TEOhcH6 zpo1yfIgj^(>zvhqxfD)01xJ#!XB1_+60x{gLqz+j2rX0;mA|T^N`#__{XGlJ0$sqD z!-_9jZ4SO2SotGCa7x$carOc|3|D#>It74)E>!>k0}e?< zK~y-)Ws*xwTxA@^f8TfSyqLLnU?K?8$|G1EY%rF-;-axT+?a~Nx*!@hCPY`YH6|=g zV;Ucc#zal5HL;66@DWW+qb{%oO;sobI#?^(5$Q~)%nZZKy~7N5zR!(qD4yi(&N=@_ zj$jjx92gnWk{1QyVU!LCLwZ_@8&$P_=AF-8e`T{?Y%um{_;mNaM|-yS#tBEl2mx9{ zaka$ERDw&F=F@}2=Z^I}k_sYql2G!rxxsv4aCpEj8;Vt*gDAdsXNui%jCkNd8aq?X zjm?!eJ-u_)(7&t*w_Qm9jXpj&JYe5gE71N>h-mfgyVkVpEw*lJp?7bNXu~dpz`G5| zr=!3QdE~&z(C&RZc9yh9TUR43TjHC~L`sPe0y7XpvP7kH0;e<+1pR{q2DbOcSuSU3 zZEdEI|A+YFr$}dgcRx!ADqbI+=qHt|a`M9ms(A98snL7Fkua7QLMesMXHj;Ggz79t zUfPD=-pg}sIc(cP$QaUp5W~C4!qmsnp%?mt5~vpfnwlEO7xE~js40!(6gm3d??htV zOiWCmltOETVH%i*1f>PgWdbW&6Dzw_Iy%~^RMt>RQ7jhe?(XL0!>@Af+Er?`8d6HM zQfLiGG_W8A;-XV>So}MUQVP%W@H~%0hYpiSB*QJv%5E8_kF0oOuSo0O-88Yi?mS`RxAv zkNN-nW071T&;4y%2nK=#gCYFB05|{2kiWjd$q&xz*`?X{r{;f}1F{CdOmaH!H~m+Z zu4eW$HN>KAEv->#4UcH#K>>F>S)(m+mZ=t@1%`Q)zt z=kL2`>r-|9x)v#bCe_ X$s}Y37Q!~)00000NkvXXu0mjf?g64A diff --git a/org.adempiere.ui.swing/src/org/compiere/images/InfoSchedule24.gif b/org.adempiere.ui.swing/src/org/compiere/images/InfoSchedule24.gif deleted file mode 100644 index d676ffd4632b2e2271a9906e6d871eed2c14df31..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1411 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 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Italic16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Italic16.gif deleted file mode 100644 index 977ea821763ea983ac5b9ce3a71a57eecdbc63cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 619 zcmV-x0+juUP)A_ax+;G6&e0r*Ko zK~y-)&5}<@lW`cwzrW}A?j6fwGBVSsRnwNXEoL!@f)0gJ6eJ-b8WBZC)FFxv>*yh* z2pUx6AuM+55FToyKQxITtOnV_4x58A5D}*0^xZpu&)dP03Uxx4p7Zm3`0#zcz(0;y z?qb8~2VP0?GqWWDKoXh#-EDSlImdys4_!L6fh)&%$?cxi7#%lo{zhB}04jA{b0MNT zSfoxI^xG<&4qUpO;ECxXEM@>eNduSR?A^P=T^Xvc7MCN>I5#;%-^OOZtWeS*c=CSO zv(D9cZ2va8*7JrZCXFa7MrI@rR=hO8-+r&Dyv*Ktt|df0Pd{1ducP0EZk}RRn3`5g z8~9r9cy&onF1GEVSIJ@Yz5SvJtQtOacg$K!A#W&HY7s!7`L0U<17})x%gjg~k7E67 zvI-4GJH`NjnK5N3@IoQh9Ej*_=T!5)pv}_kc>X$NnFW&oB)vy(%@v0v=M6>t)8G$) zz7oB``VEy;)oVmDJr1{fz3^?_j8zUBoGUbxm)RgmP&6?-pTRt!_Q=g}RfV%L=-)z* zUwpKN(%A)DDs4J@d^_pa7c>Cac(|*HNOacL)luSo7DJhAQ54O!=~y`TH(=ADE^97} z-wdP>*9(S0@z_fUK?-U%kd0r>E%IS=@LiuSh)nz!^8-%6&rs(VEJXkS002ovPDHLk FV1jmq3Q7O~ diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Java_anim.gif b/org.adempiere.ui.swing/src/org/compiere/images/Java_anim.gif deleted file mode 100644 index 036dd8637b5939669586a2ad6e0fb776b3c8aa66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9817 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 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Last24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Last24.gif deleted file mode 100644 index d81e0714028b5b46bedae59ccf5b3f2b710d8452..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 907 zcmV;619bd}P)b zl~HUIRTPH5b7y9EFk;lAC}@RfBn`1xADT#un)F2zj5fv^6MZD;lMh%B<6||A-6x5@ z8*PG`N~2M1QUn8oVnm2WLt-m2f`UW{Y`g5vow>({*_|%h?aBi;xyhV6=X~d%lXK>Z zs&Xxsxh7P=Z}p;YI5>l{a>;1nY&2$XyDBis%GbBPOX4i4OGsQy>Jn0CNt`84tGu&& zq-EmP;JT!Pvma7RD%6q+aazrvAMM(*WaL%XSdjna*9NR83tgj{*{Y6q-Lxcl0pd_x zcA|<+Yi$+hHSXUY98kx@4O={_sxDM@I2=y19jBM6CiA&Z-^)QRT?}6xdec5~1y~)s z?zr{t-mOo(w#@eeQcc3tB{)sMIE=42SEb4Yf}+8A@Z!*`p(`01B$$Q{?@1cSlRjG?6=W3KTX@N+k3%FurklN+6;-ABM1$J&=7=%plEn-?I6FL{5hUIb>c9} z&SumV;HYF(9fSM7`{d8lf1T7dE4n!s|B4h`1`7>A=n;g54XX#3FIV;JV+YQtV=yXN zZ3(W!%jy{Tc;9+lPLUs!;y?daxauanRBO_nufAS&7Nzd4JxTU4?$*2Y5< zUyN7Q-L#30>sI3zgrI0xv3wQx-q6p)XCG8-91le$JF^(0WgkZ+J9TOP!pPqJla-!Z zHWT{GSr%MRPsihYIyG6jSUx`zmF!fjcxg95n|1_ydV4lLw&8*MipCR;fB!@6$kD@l z502WwrQ&jM-*E67%BsbD5agL>pE6=#_xOaX&-s58iSWmvF?$y@|J{_%7lyKqF-8y% zJWmi$>b4*P+qSGXs*2WoS)HP(lBUYr<8O3|h^MNlpJft%<2D}=;iKcD0C<69+c$WA zJ%Nx9h*L6PqNIuA$*%1Ui3Jgf8;V`y^y&Na;Xw?D5sb-zBGUM}tQrc=HB{$eiK?c} hHEw?uwOdVB)j$5Qjbb zl~HUIRTPH5b7y9EFk;lAC}@RfBn`1xADT#un)F2zj5fv^6MZD;lMh%B<6||A-6x5@ z8*PG`N~2M1QUn8oVnm2WLt-m2f`UW{Y`g5vow>({*_|%h?aBi;xyhV6=X~d%lXK>Z zs&Xxsxh7P=Z}p;YI5>l{a>;1nY&2$XyDBis%GbBPOX4i4OGsQy>Jn0CNt`84tGu&& zq-EmP;JT!Pvma7RD%6q+aazrvAMM(*WaL%XSdjna*9NR83tgj{*{Y6q-Lxcl0pd_x zcA|<+Yi$+hHSXUY98kx@4O={_sxDM@I2=y19jBM6CiA&Z-^)QRT?}6xdec5~1y~)s z?zr{t-mOo(w#@eeQcc3tB{)sMIE=42SEb4Yf}+8A@Z!*`p(`01B$$Q{?@1cSlRjG?6=W3KTX@N+k3%FurklN+6;-ABM1$J&=7=%plEn-?I6FL{5hUIb>c9} z&SumV;HYF(9fSM7`{d8lf1T7dE4n!s|B4h`1`7>A=n;g54XX#3FIV;JV+YQtV=yXN zZ3(W!%jy{Tc;9+lPLUs!;y?daxauanRBO_nufAS&7Nzd4JxTU4?$*2Y5< zUyN7Q-L#30>sI3zgrI0xv3wQx-q6p)XCG8-91le$JF^(0WgkZ+J9TOP!pPqJla-!Z zHWT{GSr%MRPsihYIyG6jSUx`zmF!fjcxg95n|1_ydV4lLw&8*MipCR;fB!@6$kD@l z502WwrQ&jM-*E67%BsbD5agL>pE6=#_xOaX&-s58iSWmvF?$y@|J{_%7lyKqF-8y% zJWmi$>b4*P+qSGXs*2WoS)HP(lBUYr<8O3|h^MNlpJft%<2D}=;iKcD0C<69+c$WA zJ%Nx9h*L6PqNIuA$*%1Ui3Jgf8;V`y^y&Na;Xw?D5sb-zBGUM}tQrc=HB{$eiK?c} hHEw?uwOdVB)j$5QjblqmSPh$Xq6F|top!k!85yaC05g@e;9K{S^ z5s&}~C^P{1ObikR4GfJ8Oe_o>3<(Dsm{_?)Gy)blG%~RQbpTa0fRr*QC@?fIGBbgg c4GjzoY&;wZ2N-ZE2Aa&s3^ZB60jSLy0JCHorT_o{ diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Lock16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Lock16.gif deleted file mode 100644 index dfa89a9e991cbec999bdd2e6851a12839058a4bc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 731 zcmV<10wn#3P)Sa0007dNkl7J(uI$ zIofTcM(&W{BA9XE2rVMp7Px8G+MTo!=?5}@LbDu(0XHJirl8zK5ECM_DQ&J65vZdJ zbM81(IOe(M-1nUGKF|BK&>OmFk)O?X@xbTd`%QR;i=SNpIP9EzH_Nh9h8^)^KU?%#iFFxYsz zuA6hfZve?N-&0^|etzN8-pf6{Utb??Z*Tt`Lf8WGUaxmz@%XXVHEQSj;Kt?J*C$t3 z*3?Y|s(K(vlEr?1j_ZQ~!{KmAL{0-sz}ccG&ir!Y*Uj$q6nUP{1Ft++p)5=3cDr9V z=dL{1*=a@OtJRe?ncP48`0S6P(dcSu!_n#K?#x3t4D9|Z_~fH=CGZXZjRDpE`~X>& zxk>#_2w}z-cgs81miu1vBQDLdwrS!^xs}mCg4my1*V^IM=k5>x&OzE;Xm*qRHh69M z47ZXH!pz3k$EGAazSx~P`bOI6W+EX%TdF7_h}Hga>-|WpCOhQP{NUKvu__*H7LP{X zCIFYubFx4G{&x!}J|KyknC_uk5!E9yCaOoJMAajqB!rrWdsF!NL-qc*k928 z1iC{EV^nLR)QB{wj8Sb6@q{*jEke>s++-cI1c-ou2@t>pvj7NY0;ZVh(=?0(2M`rv zG+qP;5ENnrGkY;XjG$&u%ltn&06}P*@guFhOA}kb^i@==C#!3PYK_J*8UxW9G*Oy5 zMM7J50HSeo=ibKEzxTG^)My>mKoCJBK1o$X6jj48%#5aPtFovr{R2z^l10`Q+I#>2 N002ovPDHLkV1fseTOt4e diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Lock24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Lock24.gif deleted file mode 100644 index 007af855555dd393926412bea5564c6b62a86236..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1041 zcmV+s1n&EZP)wse2x000B9NklePUxx|M=Rb+B7D)FZZ5vXU4^QNmFf#i#RaMnZx1xW`=K$<1Y5$M;}yx$AD+d z?BP7m*EE~W{+XE>X*Qb;@BKyK2jB=$KX~Af{1d}10_=c|z#DNKZ%>kBRnncfO1VtA zTtP&bnwsXX$w?ZGhE7aOG(rep0&fGC4jwo(k5yWv_!Ypr)oS&L^&8eleSQ68dB*ke zab{;TqR6qjzn`I@A$*=kqobn(Cr_T(Jv}|M9C!&x7bR#{|4x!5Pj1^bOeg}!M@FdE z>z1bJWiy*-KV4a=RPNn0xXEpPbco^Y!|`|D9({JUIXectK8F|Gq56L3+}8E$HW0@# zBgc+$`t<2~nx-$B*$&{Tw(s!X?>zg{+0m0HzNeaWGBB_P;PJit_Vg^;K~WUzDwWFe zfr0zDe*GHtdYwGa_a8iP=&L&vb8hdxJ^6*P3!kjpxR%=T9^yD&DI)g+XYNRlrl|)$ zOOmAHa^rWhESmz3-9>C8A%yXpH*WUTdTYdSyyC6|ufDSX6mV+yu9x|b7JwV2Qn|0I z+J$p2UWgm9G$!3iH`Qu_YYE?$nt&wfqNCi28MctXg%E~;u`BiW|CqdTbc?6&h0I5r zJC-eT&E_l)%X<ypY9m`HPZV zJtE4;{3d_%9*^MM;c9KoLtVWO0)}XTiXbY8C?X4@&gDWO3(kd+?Y_Gsu`v^W*(IcHIGS-YL05wx|@rV5rW5uGC!Xgi%%W@<++6_ ziley0#ibtbM?ubkTmwx}38)5CJgNa{$5!r935a@BJl-oB4N_TF!*EgQ-+!M2GO!eE z8Z-q9paD~l>D>8NZnx!zxdO8?X6|+snX%+HPoUQFrM41)>MdU&;ic<9tmUd;W=lG& z=(Y|FK>vpkNef)mmV88|xe=*?O3{*Jd=DVtY7jMXlH;O46lI_ui*h3M5apl+!~v%P z)dG!-LTi|&m|2U!S_D_~*{SK@&K&OUS@8gvL$!)&gi58oSQS(~B6)kkJfe!JU?!*u zB1WEPjE$ZL?EL&+^!Z!#it?HWJ4NX&1Vlg-igsKqUqll>0&o5ey31$FXZ5Ic00000 LNkvXXu0mjf1Gw{v diff --git a/org.adempiere.ui.swing/src/org/compiere/images/LockX16.gif b/org.adempiere.ui.swing/src/org/compiere/images/LockX16.gif deleted file mode 100644 index 7400865f4901979ae62981de26cee06ca3c0727e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 798 zcmV+(1L6FMP)pSZQLU)8r0R=fHD#7DtK5ao~0!FNz{+Ew>(uqFm7O-)^R;KHz|73ihZny5YVNt&XP*HaP|`pN@LKCb`zQ8~udl7qY&OsB?ChK} z#ynjV#Zz${pKdgoS4!m)wOZ|7U>xv(+-wj!oz7%mrGN0prG{y@+h^Z+?X4Dn(0=iy z7e3B==K18og^C<6fq5r|&8 z@ML|D-k#{T$5fOzqC>Y`Joe$Mi1ScbupX|vZx7Pj2l-0htzlvM?A-CC)3Xafne>;F z7vDQLQyV=tJ1}(TurVD`(%TN9Fy2|LwK#9dO&AnCQ0rygkaXjCeKr2zi8G(RALYrl z0SWH$`yP9FxLmr1xT`AoblAHL?=yaPo8o+iEzns$x%d2h`pDYVZ$6Jiyr8rwWx@Rb z#bv}N1e+1O!P^|~bFA&*y}=b83HKnB#CsPsD1~Uv|3D;&c4m8%(qR984Qm}movpQ< z=+gYjCc2V{gx$COcX(G6m%e!S=g0?8@DE|Nt3S_w-$%|7L|Kz|H|VcSATHot`kQ1TXuEP)im`)Il4aapun4JNM(9Hxdi^Z$#e)2T zlOKKfi5PRYzW06`Fk`&;PXWdl^E<%ThrVh9_H}i2?OMKkdDz|4jfhaKRcX{4gkeZ$ zXMwi13^#AyWboV|qt{2rMdTIW%>I1`nt;uKgsGKES{&fbLT6#umMvSudQ|1Yg$rD| zc*##qP1TbmDFcDEw!6Q-KeP6UwQPOnX@bD^{dM`uL0~&@Gi^}==m>!f5U0t!wf3b| zt5%1`z{vR#1_uYHYPH&-IF3&NGe8IojE;`JF+M*2;&a=#g{vN0X~zB@TUD*ro&~;b z0Th}JT$)^LtsNLxGQge535JG-s8lL%JLit=-*>>bY$SX3?mihs(V_Fh=Xb2%w2rRs zE~?eqra1s>fuISf*X#YYTD`Bmqk~(wZ&NH5E6%x}<`z#?27WG;%6Jc*oeKa~?%BIL zo8EVTxerh-m$Q{hB^TI$Qn`ex-rB$KK>Y#5NjLM7h>*|aX>aeq7&?F^AR+B%rUgJ- zTNd>~;$i^hztynDQYdth$z%Xpow_C<00h9ei40+{iRxusqeR9wg5#gjS6SazUhF+b zy@%GJX?!?)yiiY;a_-bcW+uj1$gMSjA3rFbA4dj{oLIAIr#IgF*GEq693H=N^oPD> z+g5b-KZ&u5YK&@vibI-F5>y@H5=0Xu%{50HJBm|9u3o+!6?z_h^{o&7EQNrt&0Olm z*ySrWzfZ0`13Cd(LbZn12C8uyqq|^

    t}?K(vlZgh+!%?5WolGjV%1SDBrB9QZ8+ zjEhTZZJV({9^4<0oC6sHt)LR45~r(=QztR1X-?wQVM3gAg4sY2=17vr18M>9;#pxH zr5?m30(c8}Ny_5=JQ6&JB-(Vq!be_Ss`Ci|3Oxgbrh{L@Y;Rr_Jbunu`Tw#u41kNF zG3LgJ&$)=rr7!yYIGCQiRy4*GL%4fF4b0o>TNO5U-87HqzrR&;|J=0ZTA!Ia9t05Z z#^FgISOlyF+Y3^~*a%}|tTwRlIP|f1KqAED&DNbFdRGf9d)z%i>Q03#{v){ZY u!V>p@FQ-U)-I5n=>FPaIfWyFPfPVn%-L*Wu2JiL&0000Y diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Logo.gif b/org.adempiere.ui.swing/src/org/compiere/images/Logo.gif deleted file mode 100644 index 7e98bb06962ae0a52bfeaa643cb04aedf6a2b67a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10127 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 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Logout16.png b/org.adempiere.ui.swing/src/org/compiere/images/Logout16.png deleted file mode 100644 index 60a6e40e6e50d99f0accb9dc16c5a46c844b04bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 507 zcmVVxbs};LS^G#7hrhW27~XW)l=kl8uKYHfszB8F(-6%=0|+ zynmp}6Y7v}JQQzqx^bKwu3JKDjn?NB3Mb6Wd}@1VJVZGXiC|ggy+Yz{;&^%zfLg8Q z|1lIo2!Rk10A(pm+YAsiS_0YsgpChxh{p%1*XwPHmaVXC6|~S)1*q#&hAwifzkf|4 zG0gV%4~oU&e}brmlmhp>60E`gx4mF_!(|pnpEEHr$?WWB948NeX`4tX+H3Il^ePZX zg%W+r_g$$}NG6khL3?Z>z4jdozfZ6pMG=Oia8?E&K0d@$CQBxh=KA^{`TVgDP!grW zL4uLp!`sAs3pktoiPk#UXRm?LO7L;+?X8W}m+xK^>^M2fWfy>IwTkPO0FYscGL4Rd z#8f5=faiH!US9F*;DGc_nzhw+UM61<>yKf!v@x&?hLY;(vw>>v@Q=5(waN0=C6-bv xjJ~Sy3QW%CLBm}Dq8~&ViyG-3~GdKA-mTQfJO>_VN002ovPDHLkV1nh%QQFHeTbIxjvNAl}x>?!!$)qY<>uMc3Zm!KqUxb0S(0u`n&OWR~W7 zs%7cbQ{ru{G&dh1olfV+j~_pg1BiuMS(>s-^kFj1v*C}cQ-(j%77WtTa*XTOJLv80 zqr1C{&dx4G2}%o=SS2%%_164dpg)nIr>6_Qe+%8+U3r^w6xz`n2SkB>;Le@f1OnU1 zWZWXVQi9S7Q568a(I|6&h&sT&74e%uBr-@%O%1M_DLv5)1H%BzGO@%e1ze6qN}SFW zh(CV(kYI2puDe)vhTp&aK(v5iAWAT;-?<~FFCHz)q^lPOvLApx;Q8}W>g(&vM*gcU zFE8f~J;T5h6H&7E9`vnz8yXsLUAM&Ux-O|yiiL#*w5_lmjcqGzTVt&U0PF|emJ^P} zVvLQwXK>^J^O+QZ+U-ZLFV~EA+w-YyVHU|i_?Pt%tbHGab z1&5^a+FUmdNd@kXwZ%tROFFJ>Q*!zI&R_A==FP^f@-i~)|I20A*?&KNrgrv}l!w`~ zS-W;DV_2Rr!zN$cO_)z&Zy0B$7WFVdQ&MBb@09MjczW@LL diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Minus24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Minus24.gif deleted file mode 100644 index 45e5c2a8e98cb67489bf7a5df5a423d27aff8663..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 252 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fY)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHisK6gRtdxyHI`pirl$i(`nz>9>CFZQ5?)tP;KpJ*&bQ%kKV6pXhPsZ)QwBze<6)o`Lu?1IrnmCtIy` q#6K4lsK|Z0yY!dH&rr{xgWTashPVA$C(8gG#o+1c=d#Wzp$Pz5QChkH diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Multi16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Multi16.gif deleted file mode 100644 index 86de1ff369fe501d6bfff94c32ea264ca44e09f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 482 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 Am;e9( diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Next24D.gif b/org.adempiere.ui.swing/src/org/compiere/images/Next24D.gif deleted file mode 100755 index af237881737d5135e8e8422acb00c75bf0682c58..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 874 zcmV-w1C{)VP)b zluv9FRUF4Z@6AkiR?`^3q=kcRIEa9rOf+pFX*408I6yEl9E>rfUNj~&C3;1pG!{>C zRudZpBQ~)nM3E3^i6RM6G%A%1Aqd7&s<7SJd4GN$c6K{mc3U~{l3(8M&Ai{|_uhAY zzfmH>{TTYbP=T=Bi-D2o2A-~Eqcwj`jhgOz0^{j=d*~yqH#l#xKE-*9^9Jh;sY^I? z_^q~y+k*j6oc`koRl7jdE|9vU;Xk)=&kC2h$DvUFYu^fBL0GIBk=k0svr;uJ3tohH z1Ydh1f^pRqPu$RW%Sd!mJcEslp-M!2EaLHaywogp6%t!+>=_u27LTquH8pAmmw>&K zv7YWnpWd_m&0-itII*$w7B3dGM~8y<2?@7|3K|{2E4$u^MZlOU6DP(OW^es@u+CF? ztprS@z?B?XuR|}V~&+MNb zHSf06cVxO13Kb>zMdVFu3ol3{eJG}%Dj8A znWI{j&6a(tQ>o~}_Ge${4IirLi}S|`LX8d;O2Ol+wo#eWGBJ7dx-<5P>4P%Y%xGC| zXAa11ZOq{0iKG7%+$uJ#=_l+^LmGcpW`)fh{(QV#P0h|T2a?~~#kZ6qKL$p^ovS<7e7yVlmmUZr#V4PASiU)X zbKmLF^n>N%mVlK~3J7wh0p0gnu=kPP-r=C2RB5JkGPrVwv69l^J{2?=xrkD(9GpGejHe0~d!BGy_>^HAX4r1D@(|SwSuh9HYtY1@S zmi1jjg60#aKq?~su8-GF=ghAstHWImE|P=&2Oa>1Tp;d96#xJL07*qoM6N<$g3Ao0 Am;e9( diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Normal16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Normal16.gif deleted file mode 100644 index f79387f0b2da465f4dcfb8082f45ff8fdcc2eae4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 541 zcmV+&0^|` z$daHeE5dUA<`V`^4mM_Cey${3F2yjwEOoK6q7=XHw;zB0K6>_c{`LDWzl#g=>6oT2 zawEzBW+nzRF+m=^JC9#K`t$qutQT)So)#D8WB&i|UxaboOm@5m7^lr-5)Iw7n=-zqo;?KXo|CgLyp8n_G z-+yP`ym@_rn~O_~k%`d-XEbVuPGaZeVw>gfZXI{w#zTf*KfW>dW6pS?;{QdRQjg^T}_3HK8M}B<&7IkG+@nd9#`q7hn#rRnZ{{8+LrXAA0;p&>o z_b3MZ|MzeA=?mBIF)%PZ`@_ca6y2}Cetw&B^6cdk3=9nK7#SFTlAZPq;$||c`_?kz fNr{x_Bl-dWohPz;A>zt#00000NkvXXu0mjf;vxt= diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Ok16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Ok16.gif deleted file mode 100644 index caa44b5049d959cf9a7694c45cb44fdbb278336c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 626 zcmV-&0*(ENP){4jS-Z5L(c|=3j8IP(;yaC`GjG zs>;F%+2ka{cyXA8v zrN-a(`^STo<@W8L;RjFSC2eZ58W9pQ_W+;!2&oIxY<^@*k0g@TlAANLxrM}e<MVq0?y_y^edGEi6uM&dla+X0;rR$_iy;m^+d5 zw#sYC($sY3<%E)vDG@*j;KPA!n@0PfTimD|SpuPCj4=v96af%i(54wcZmqruRW*~k zswOol2q?JcW8m3nw@ssEb&DGn*8%`m(D@tAk99T{^pt>XG) z$2zNzQziZ=A&lgkb^B9o*D9|420k<8p``B&axJSf|GeC@|LJpm1Ax5dNw1t*Bme*a M07*qoM6N<$f+b-iI{*Lx diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Ok24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Ok24.gif deleted file mode 100644 index 027d18f53194005ce4fd7feb1cacdd34079a2f86..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 936 zcmV;Z16TZsP)rlw3&J^L?ECq}sjrCW$9hBY3;Tn5Lvb!x^KyB%hAhV| z8)n;2+CN!iKiJ#|Gy1Q%5WKm#GFwAdYlLzO* z9noC6I#=U%g4;|0L@*fxAlSsTEC=1e8b5M?DJAbNU77ph+B^E%+B&~`|6Y0~?l_`Z zzB*rX#UzK3AQ0^SofFFdicQcBAMgV_pU-`_vRb-%X=YyL3Zl~A3*TN_XD1@{hT>8> z&E?9QHBY|5$-2NkO#~2+VOUT9)q3t5V?O2ehGO|b?%S2s(#?hWMKM;Ggd=lIdZ_eX ziqsp5yY2`tcr%>A1&BcVpKd9Fwt;@ydhTbLxwW|w8vg!=V|T8sUjC@Guq2B4aR3%l zxRBCiQlZl8jw00?4$tLebNQ`OZM-nc1+me)~`>$F|gAsmC}ugu{q93BFoI-7$sR3QM#+Qw>rK)f&&1* z{x0tHgRsh7Q_iablhQpL4oA3fq-3t5%GAu*^7PaKlaBXdfCz|_U4(I0Z$Iw%X{wLm z0Ko6xOYQY4eccbjs&I8#DUV6%9g9dQSusCJ((wQ~m`;mfyn{iwr~iE1@ss2v4geeg zUPOjfA+xfl9OgO-L?cQH7n}=#EXWd!jW8H?&>QshACEeI9H*z^hk@gfsOm^tc0J96 zumB8-V-F4gVcK5jZWPRE{~0000c51Uox{ZvFPmABOQO@lyk*M)EF8k`(QBS3i09%n#3r zpBXqU67(ap_3&?hFo@2LpX)uSHxw@vy&uw42XT~sa`d%&J=Q-U(WIS3N#DKz0000< KMNUMnLSTaOowC6I diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Online10.gif b/org.adempiere.ui.swing/src/org/compiere/images/Online10.gif deleted file mode 100644 index c47e987718e46c6eb6d3a949fdf8a52819e0f378..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 496 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 DBA=*} diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Open16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Open16.gif deleted file mode 100644 index 1e074cd024aeaa1f774c335ad66fcf8187d5e587..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 523 zcmV+m0`&cfP)cVPQ;zF0Y6Y-;<5;ZC2-aEN-Ul%u85)#z*FfcH~`@T9H@$2A2@QE^U{K zOU+5f<~ZY!b4>9sJdaqU|7ecRED(i4_ZM({dP3`~*KF>d7ly8JK diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Open24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Open24.gif deleted file mode 100644 index eaf4be873c63a5cb5ee2f61d2d34ae716d0728c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 803 zcmV+;1Kj+HP)ScD^+j%uo^mMtvIBZL4UP=taglKVvK$&#eLnW<~QR$x_CCjv{0XYB_Z)Ya8v z7{-oulu~Xl1@Ju-3TlTNU1f_)i=<>ZlWTRXWo>^2RV}#z(iPpDx!k>pq1hRHZw2Nf zkyWj|t%GPZ%G)`(b>-r|JbdrraH|!FWHMQ8;l~2OP>`7JBAM3k`D1$mZLCs>XQXZg zeBp3Nb2Yh0#1pW(zZVyctjM%(@hd}aPrxut-S77^ITxg}tp&M9&`Nt5iB!gHO1!#h z1<*BJlSq=LimSGq)r5wWAdw&itW)LgLWrW;x<|0vEcgOp4e(h398SA;c{y~nrTIAa zsyh6U6lvWoc#0f_K#;o&M4oSBw}Z|ybVD*R{q5%)wk0$CslM1Yhi(WLO_ hZ)E3T7J2jE#BY~zIS>GK8g~Ey002ovPDHLkV1llKYW)BJ diff --git a/org.adempiere.ui.swing/src/org/compiere/images/PAttribute10.gif b/org.adempiere.ui.swing/src/org/compiere/images/PAttribute10.gif deleted file mode 100644 index 9e916d9625da5f030943fe279e8fe00e1907e4c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 373 zcmV-*0gC>KP)*Mt0JM=TkM}686PpN3*UAd86A+-`Uy%z3 zsRwVJL+)521s+vT`Oy<3)&a|<0`&cV&=^C*zs4C2Q^tqQeV%a=&<=;8{ghwDo*&0D z5NN9$ld$Uoa~Z(;`s}`37AuZ1qC`XiA_Agiss|rEz*5nc3qUsB_0N~w5ukqo*nwr& T>UlM!00000NkvXXu0mjfMmv_I diff --git a/org.adempiere.ui.swing/src/org/compiere/images/PAttribute16.gif b/org.adempiere.ui.swing/src/org/compiere/images/PAttribute16.gif deleted file mode 100644 index 87094f954aef2a0275cbe16643007d513bb2e8ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 453 zcmV;$0XqJPP)+AS{<7qPi zB(y6Ms*reHp!wq6ygnp*a}o+zPy02F{IzUKxxo=^O%`aHOCSQq=kQr7@#YzkU;+dX z`AWTWSoad9f$O?#Tpch~tA?hqmfZFUt2Kx@%EeLYR}Eg@Y?S>nps`V)4;WTTv7IgO zI<|s{AUb^g21MWF(6$;TFa%g$3f9vzA`L(AOGVFGw%t;;W$9h*iUTGv*a^+(O3&^2 vH*Y`-cm$m8-`L;tE(~3ZPBXe{r8MyeW8ILayrsW;00000NkvXXu0mjfG$q5{ diff --git a/org.adempiere.ui.swing/src/org/compiere/images/PAttribute24.gif b/org.adempiere.ui.swing/src/org/compiere/images/PAttribute24.gif deleted file mode 100644 index e018cfb6574923cc661b4daebddff1ec01c3f87c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 737 zcmV<70v`Q|P)&wa010qNS#tmY3ljhU3ljkVnw%H_000McNliru)(Qv)BRh0ABE7s31SWyx z0O!kqmD^midxF!;8zJE8Xfkm>5)I!*dZZ#yxAlu+v9u1n%5ARIJAz&4;`sQ;`ohBe zN-8zoH{E^f2iffQb8El&0C<_(T&sC&LEpZM=g%eAuVgN*Tu4o$9q9|6Pfrnx1a7>3 zyJhyQgL}ZcPT;v%Jhn12nk1M1K7hOeC=$al&W(20>$kn0Fa*Rk zAbnvHTbs6>fq`mAKm?zcayoVsEZ91+bg;$U4^IY^0=`6U@i;KkA3RE{2?6H zN^oZ8AEoHg9LL}o(?8>nwwBDi@!{aSXb8m;i=> z3ZOl3$kZ!QLD(5fkY0@K+Fj6RB>|b#p4%7fA=+EJ}Tp_=ccO7po zh_uz4FH}@3Wy`5o%B|)JU{?#selpV z999e4AAw`Q_A1iLAq2#LurDX&>&ES#{GRc~h1GyM;P}Cx00000NkvXXu0mjf8(~Z& diff --git a/org.adempiere.ui.swing/src/org/compiere/images/PageSetup16.gif b/org.adempiere.ui.swing/src/org/compiere/images/PageSetup16.gif deleted file mode 100644 index 9aad200e7b5ec68f7d9773b6b14f096868c3b968..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 775 zcmV+i1Ni)jP)itCYIW^Zf1M;o%1W5RU-g z_n!tqu+BLL5#g~2V+;Twr9_e>D@v)juIs@guPeY9gAj|Wa}HUSp(qL@NrLtDb#Tt% zc^*8^`#~A+4xB?ui7*Tih9S~41pr)LUZN-pNGTBnLD%FL1w;gEEqc8k0HD|FK`DhS z%b>MJnx^RY`!L4*UP03|$g&Kh(FoRBD5Wr+PGO9J)*4DFXsuzb#rI2QM@L6no12>l zLWoyoSsvth4#pUW2yNR!N{Kj*vAesAD2mWD4aVc~`?{__TwPtg7u(z0@Amii|DMfe zf1IA4qN*yCW!Xs;LSR0hqpB*TX$sCcc6N3S;wMjDe;f{Dc5-r3?CtGE*4hp@ncTq` zi6nE-?Fcm&u5V^#^B;&1nK)=jNy9^I_JO`!`fgCx3{;LPG<+5qNycdh^3kA;60z?kvmYJv{5)mv}+}%ySh~e<#Utd0d`ZEZE zRmNDr7z?envTe0*t>xBQ=HM*A3}R`69u~GH=al;sY_#a$LoCrdn!s7q{002ovPDHLk FV1fr_VNd`7 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/PageSetup24.gif b/org.adempiere.ui.swing/src/org/compiere/images/PageSetup24.gif deleted file mode 100644 index b8fc10e7ad1a6e401c8b618143e5ef2af9d1caf0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1241 zcmV;~1Sb25P)>|H}VTekp>AOQIP`4(4-;);s6Q3(Z+V1 z*dDLfvpX~Q9E$yrV{DNt9nJkb=iK+c=N-d|cK7bx?-v&rKL8Bx&{Xws)RnERt)Fk* zy7lStb${|e9LFCu8V#H0IU@4E0Tvb(s!J9yA z&ZnlP5D|)^0H9W@@#@tpy4^0jySpqcEwQ}3jB^g>9B~}u{i(TPPl1RrrsHqB-RAP; z%Q)vyRd#lE==b}RJ#icpMbW$6Kvl8UPMjTkOg1++Nz;@hNeCg(Y&MynpXU_l&ki6W zY;JBcKR?gx?Ce|f=gyrY%Q66pqQHAkk|dMF-YGz@*JFKsoyU(Kv$C>6tyV)-dH(!4 zPo6x%IY(KRhzMz#Qms}e(4H2=1FWvDE{Mqcsv22qIXpb1+wJoD^=sld#u&rl;o*d; zBEtUuK3SIW;>8P$F*xVQ^W5CNefwi$Om2+%<<6ZuZ_MiIYVGRPt6yKccJ1RRilRr4 z9+{#j=yW=iWl2#Kgb+~Gw`dtf5zS_kix)3WD80SC&6O)xv?z-F;lqdD{Qlc-U-)XZ z`uX+i*FU^;=~4`^wzh_Ij-n{o-`^*MfQU@4Kc=R0j)Q{(_V)H@Hk(*$$@836t7VKa z$yB9sh(Ht9J9W@j;i9lCyry< z?KTSw3$)v9j4_kyx7Kq1{{2lKLRj41-WrpX!C)|Cib51QTCD|8&>>Y=UOLY|8yocd z86gy;=^leYhJ=zhi3vg2+ua2NA%sOQA|}f+tTm`YSrk;Ks%P?gW~N5HUZ>M}iK4vM zc#kBh&}cNMR4M>$Z*5VQC7~>hRaN@^K7ao47j7gI3TK-4o>r^H%E}7$dVN&M5zaZR zwPabw)2B~S6+#Gjk-+qH6(2c%c<=yYEO8vYRXnN+swj}>IeDI=suX!nnjT=RrB<84 zS&R3c<>h4n%3*+^lM5Fvu(Y&(cDqQM*cd|`4d39T=!LSxZ)|LQySDbz zCs7ogB8kcvLLI|3qN|>?QPx95l%go*<>uCReq&?ftG(UV?M7qns`uVRkvHB)#z)Rr zV~vO)K}=9F5@dw0Afh^alVL|hR8>_}RYhb!J^1zLsQ;xm#{9asfACqFcF*?*gE&po z*(}RygTbIy6va$gmeml#l!!#C>W1i;V2ml8bA9LBQ55-Jk|YO}%2c<}XzV6QoP+69 ztJS|x`%@So1}Z>xWR;OcqjD&K!N`tAmI3)_ebW8~^%9P_fWZPlDqB9?#%D^>oA$FjP8SXdVl!5?|TnYO4RbBH?=GA zTUy2|reO<?=@r%h} zW6#cJQfPC~s>mwxzQ}>D!BbZalds_8_h}r7_JCAa@f4F))r6lUrCf(hQ;9=;jU5L& z+1FnmP_XjQREAhnABYqX00}@!0U-tMq%XJx@e~^h8rvWApSa|&uWz9Di?6_?1E%N@ zl4EB68Hfl3f`qGnd$iXb;n;2VsHt)P`R?O`My|Agci-NCF&}hI2Ui3vQGjU{P_$N1 zwo6b*g`Wk{x;wF^0p~U>`wvX#H%c-OZ~=##s0b5Wa!4-09SO%4;Ep?Tu9$V#I5TQr z&Mtkq{`h6ugzb~9dlQg)8A30C1pt3Qg&t7B3bbY+H`>YWThbX9oF#2!=nK7F-=6arTX3U&+XWy2~<%(BYwFX|c pI#R>7P%^)q3wROKeC1m2{1b zl}%_|RTze!@0@e*&7V^HBN&Y|1&xTHg2tGcEZQg$sloamid{(QrYma`p)R6`8xe$x zE=)JAVs%lCB0?>;8x67IczQ|E_9Y~NZ8{U=yn5|bNt zZ{FN-`>T5f542e0(zO_A*m+=BT65yYyKmi^zpwkzroe@3VKxTmpO<#Qo$9}PN9Ubg z_Xgiie@@TlL5!nPUT}-K{lP!##V{MR`u1A(tAcYQ;T_gAofzD<^P1~6-C!rCJ_VE{ zO?Y9~Tg^rcf*`V-pKddeGBNcDMl99@d@*?#BMu`5 zYb=66M96P>ym1t{;b7mot2ey7qkmV+`Nb)IK6?gh0-Om*H6=|GtZ^8z_|#xB$4MHa zD6$$jKjIFyZ|rzxApcm)!!tZo00$ zhq5n{niALwE`qSx617;GS}jp)^&B)CQmI@XtfQKK{hHtR*X)JiW5*8{*M}YSbUs87 z1lYjfLPHRlDtrlQago7TL4k#H%e?#y8Bg9ja)0mkw!Y3Mr7-(3 zYAQUqh^+o!nj9Hs){H z=}ylcLsNMD&@1I~F^*P_E-*KL76XJLlGGgAOs=NizD)j@|COP{pFB8!alR|pGZbnf z#AOW%WB!5iMHYZ^rc$=oSgzquXnvZ7!rRH-LgDnu&rXb&7mKAv<@GDAIZiV9I`7ewn;fJhF#0jl@vQT*g_QU!iIgs_I1~i>lhOu8{-W_eYbl%HYh8>o&{o zBxWuf-PgfmU=b*(s!IKhkt#g^qHK3{6G$e_R6k`ID61~NDss8UR75P*@7&g@Hcf4! d1W0rh$lr11Sh~C<&aD6d002ovPDHLkV1hiw#cluq diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Payment10.gif b/org.adempiere.ui.swing/src/org/compiere/images/Payment10.gif deleted file mode 100644 index 04a3e556f46118f5391c15111dcc4d16217b31f3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 311 zcmZ?wbhEHba(ZRXHToom{y0jtfV3{U-zz{|P!5r6!i7rYMwWmSiZnd-?`2DE?$& z<`Q@@KD(nvNCic>nayDxkoER4n-*JZ)~|(AtBUpxWAz5Y>LU1 iMIVHB#2H+2TXNwK)3UzDhZn{e*)zB{x7a%}SOWm)!J9+? diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Payment16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Payment16.gif deleted file mode 100644 index d694f7260cb1cdb9cb1252e55abfd15bc770706a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 804 zcmV+<1Ka$GP)&hxDjzHxDs)p7@3Wau@T16 zK%5veNhaxZs=CwFU0qe*qh^twA>ib~-Q0UP_uQAo8Md;zYyl&{G~fam&|bW`)IN<9 zXAuY?-UuqeyFn1VD5VU95Xai+t(Dc~Pl3kb%_a3jf|b=}uNqX}_dNfzEX#SYe}I${ z3#e2ouhnbyx06Bg3Ggw1{e08;HLxJhVM7t4%?V`Lo0|mBaQSrS32!Nj0?vGtlc9pSuor#$X*Ir&& zz;PUm)>w{%BV3w$J2ZZ|MWhVg_#9ExX#*7?5n5}CqF{b@p5Kz6c(A>R@B0{|$N=U;k-_1|ytZ}Y&AM4gXry!u|rb-oczP^y~e`+MiSPk;~_=K6Aw@d*fx#8$~K>kfuq} zkK>KIjk`xt=i4v8YkUFpMcUdhdEC0aw)W$ljm@3)uYb66`{KE=>ZO17rY_D+T^So4 zc}nKeiu?UmH%@kUTgQLj+Y7gV955De?$kvZKm*0_$n0Ux9>x?f0Mg-i8Ve|&0+^vc iGV2r(LyR7}0eA=i9%raAXM3^$0000TxGt zyMDC{e16I@5CJDZ6S#Bbaj*T6(=wuF~#wh~p8)7_4;!fg*|`YPA~KY=+KJ z=SGqwKm6%Wes*W35qv`N&(>vftt4~TT;`9K9f zniu#agXgN%g>#+bV^H8laMqsUEY>=lbvO}v{T{>N5a3($0{TCx4+g{1;o)Hhz#5Bq zL7X6RigSX9JAD=*NfN|M<*^M!L>Xhid#rO)VfSwnHx(D>2||T7 zPz;6x+O0OpWWpp(0Ybn5=!GX=_{B`{$`39BP_J+Q?o;tc7bV%dIC$8iR4g)a!cjNE zc(A%e7>2Vpf>Ols7;7!1Qc-|BFb16d&Ue56Djwc@=l6W|D_^6r)1dX?&2PA{uw2UL zmd>nfC{(~?&>;u|`Ug#{^#oCbE3Pthnl!a&9k8^th=>Cy0u~VcmwL)-HH(vgI2n`6 z=Q)4j(igsd`OD}q!dinfDS_4mL5PkbtP^hCc!#Y!w}}&>yu8W!xpTBzZH%?)^a}=n z(jpFj>dN`^pXUBQw>Um()7-jCp^zsCPlZJUk0%T@p^kX!;w37za~y2nrO|BCZe@wb z2?vLVf1XbXEzTj%18}BxhGwHdGL9Jy2jC1r6ak8p&H;oWp^gYcjaQnLvl}EQXDDoc zz;3UH4BMk83wHhIFMjElIt>2mJ+EuAmcb|{HI{zAiwClqh+g-I$vBJ7l~5Ri1&;~Bij9#YH`OdELMW`%?lfueCaa}?|<<8Nw@t+EzV&ri1&yWtTmKN zWsHDNCipl;1qz)nQ&`=^4mvnz@hHSYrdVNfq2^a=wQyx^BaCu+4jNmwebl|tZ0_x9 z5r;7z5l=FiV5}iNYWhqZv9j@5MG%t2F&Jt|#I?9FC7?sK8 zk!frslL^i_+WQZ<_x{7~XgF+iy8XA`_`~ftff1l|E(&or!8^yjtqnZYVDbCduL6Y^!I;t`MI;(3gvI!yj9<6?DPRYTXJj5rOH#AYiDzruU5 z+V;Jbg{kQ~saR^%XGQLA$MNu}u_5<6ErYa{H(KlEUq7SW{oe;8N0&*wHV@VsGrnJb zj-Ub{5v-5L`P0c{^5p1m_hZ&`ZIh6ak&y(~1*-LBf5B^7Q3YrRmcyF;Mz^5qG0Q>_Q+n7hmi)!cT|6FkAON{jSt(_u!Lq7!B=^4B;IBq%dL`6}O%gpGjO3}J1 z4Y?KfzQ;%l3Rp(0FF*F|EI&io>j^)N99Xu9ZE@HjcqrgTrepSr)S!;v7$d z7#j|r*sm7k|1`qSzwL6X$#3JGkN$s>{Cx9Ec6v|es;&OpMC)hUh7@^ocW)~11Nx1@ M)78&qol`;+0M{XYA^-pY diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Plus24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Plus24.gif deleted file mode 100644 index 306d3d89291bc35b7515b84a7eb1ff06b1f5329a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 386 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fY)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHisK6gRuhm*3iZ7#JA&JzX3_EKa|jYUs`EDAKau+CLy? zi@+M4HE-T~2{!%fF%eU2Rrtr`$+ht#Kg;butkJqUIYqsDTetSMc0GD4&0VZ$$iDj^ zcSK4;qIlYK+p@Op8xHIdY@M(vte#=X;bglVS!w&M3lo?#x8GfGInN+$f!M>DAMIOA znaw{+m};&Pd|uwG={#9$v7SHQPorKX;p2w+@~lEJGV%d4COG`+yc+pl?Q0p&hhHx% zs_NXCj1!sC4@ru!o$EZ*BKam~ZJRCYgz~EG!LoDAzMqtj-?6)X#if&b4~0HFA64r* zdCrP$A#2v_CeL!e)0TEsbx%m%HuLZsx9@VyGwpQ0G4+|u-1z09ZZGvO>qslQD~3RTPE4z0bM#zIksPV-g%~qiAcHACMq|ji7`; zx}*?)L9~vL!rD?$u@MVX=0~J(QUt-mM#+dX@bYHf4eN!=J9ab^YSSV0qbJ zx&PX9fnjs_zVq`(Z@k+ywfv4k?pp>2W4UfplXH$*T;6)b3l#^kUR#j&z%w-(0)OE_ zg40vera#m3O(KRC_j#G|k7oZ5rcOqTG1ZcYB8DFy+|co#`;tu2&!>q`u~i5c9>d8G z-&+6hR@6nQWs^6n!rp!pl(48XIVYZ8zH^)I>Q@jMyySBy0e!uYc4x0r3+B0{oe729 z>^YX28ntoL=7Rt21>1aFujQ&yO_xaRB|LY8oKQwA5NXWov)B1IfpCY_iE1eYl4@#q zOFNsFlyk*Qm?0`rmiv?G?W936GlRXoD~}#OIeEKl7r%7f;;8L*e(T!#VcRYK=(@$z z?xmflO_L6{+V#K2WFxU$!p@ICX44Xme`ms9c@#r7RVL>t00000NkvXXu0mjf=o~1q diff --git a/org.adempiere.ui.swing/src/org/compiere/images/PostIt24.png b/org.adempiere.ui.swing/src/org/compiere/images/PostIt24.png deleted file mode 100644 index 496cd3b218f6dccaea1d884e455936114f88c905..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1426 zcmV;D1#S9?P)t)vC8RnzAr{BAE z2wwLxAKhMqB~EzXt-7bqJ-6zaB+erPl;iKTG^d`b5C1j+_{KJc9<#|`@7N+ll9`$8 za*hP@X8+qNZ+}YwNrGzqIt2&dd=59Wf+Qpn%|AX-CilPk2T&aT@K>7r;(L<12uW_` z`)BRRo+BU%u(6kKymTuqPM7uY{x+!^7Nvff%^vPtICB*;K*VgF^5$nI_gf)bY`9W|q-)wXxr^07mWlq|~r zN7Fp`i3sy}PRAD1BfPqf=bBI=lqfdB2tvu)=J5845wAr#oMg-f^!m^4ZEo%S`Pyjr!RXq}-wlSN2kYzApU%fT)of40(-TOB zUA?{qF8ZqTfI~Qh3mN?|$>H z?0Cm`e9Jap{@BVAW`{4zB2*ehDJ|o7rflDqm!>Y@n2pW1f8a|Qbm`WxJTte}J)HhC zLnwz}$sr-Cch{h(kEe_!ff;5&*buV@Xh9i>4A{~HC)0KCij*8P5KdSRED)Jc0X2ip zw@VV7o*3AWl!wS1sk=onKp4;ijki`Z7*Ev6Vm;h@VBPI?LI*-9CO1}!xPQ=q1STx^ zu_#D^^PhUmU*7o0V(r|93~}}SoM*UXtT^@iYrbxI>+16Yg$R5ZM~`( znERPUX^9j-!Yp+MWWYp_F&W0JYu9%X zEYxunO|2MTpQpVt7gu@!S^3vd+l54cwOs|4@sucZwh957n_EF>QByHtBAQw;xn}-f z5=hD7@Mx}pHJvdu_fc9SQ4lQ_LCEHJ-p!yn8-bOeHDbKI(DgEhl?1A)nwB=VFb%6+ zgd1VdHmPlkHBF&ygVI7NqO`dqfCElSb$DJssQdlbmDUdU&r7&~Wv$o%MU>4)|9t%7 z;lX$#XMa@J^OV07*qoM6N<$f?d0;AOHXW diff --git a/org.adempiere.ui.swing/src/org/compiere/images/PostItX16.png b/org.adempiere.ui.swing/src/org/compiere/images/PostItX16.png deleted file mode 100644 index 59d340cc71887141376c1da2188f6290f04f324c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 853 zcmV-b1FHOqP)=^MBtzGf5^*XC{|PGMSmA(_Cy~!AixA z3PKS?aa#&*+_@Coh@j$5apA^Yg^1wBjYY%@Xr%_!P-@khcG1{NCP|xQW-__V%zycg zi#8(Ip3Qq!?+ecZ03L$?tls=g#aiP7aPISWHE4Vh3qa8PHLR{}+kwN{_Hx<2qkdxD zmP;Wke|?=25fNiNBZ7%z7m4a+rDLO@-Q@ibKRGL^3wrIhCHk{zs%woKqT#&aM%k}k zMX6%|eCzkWeCE^}lXK-0^R3~9?dPUBK2v(C)rorqK=q2&?rv~#@lU$C(u|E|7#`@2 zzx;ObdjZdA>(gj`rAd8zpCg5Sj8&Yo+Ssmz!UInL@81t&JS!rCa|tohQWXObMR6#` z+SHRz%$^<}$rg`o%c-@#L~YA!FD6ro#M$|8-r}X_pLr!{{?ZP1E`{s2e~N>>i&4R+rD|PW^|D>hJ2}tE&39-no9kef;LD zQDgNxr+QhP{;Xm9e5iU!Uw`fN2ORjAotc;$86PKUlb%KnoFi=SkRI%jr_a1#);9O# z#`RTP3*wdtD3wZS7Qg~b9xa>zWuOkBgO|+;;4;tAuibB?wuxwvO@&BE1J)yd&i2oahpmeGH<{4 z)klT??x|xl<;PVd6h!Xv7Ep(}7VSozIE=Br;9I<%y`ZyR-B=Ysto1CQ&S?yS{KwXT fY1R0D_7veCQDt1k8zMPT00000NkvXXu0mjf)S{iq diff --git a/org.adempiere.ui.swing/src/org/compiere/images/PostItX24.png b/org.adempiere.ui.swing/src/org/compiere/images/PostItX24.png deleted file mode 100644 index 8633a7fa8f29e23924398e00f9a4aa295ffad82a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2557 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 R>M8&L002ovPDHLkV1i=@C_MlG diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Previous16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Previous16.gif deleted file mode 100644 index fa9a7d71b5615dde4c5f702f95df533adadd56e0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 652 zcmV;70(1R|P)5 zlTT<9K@`TnH@h?0jfHw>O#jh>1nt2m6SAzrkW<%*%=Q}tRboP9pC%r$9&(LA+0sq)ybQD9srhR zz3Fxu)^6aqJl)?FN%nOeOgb)4?+M_zJQ@)DvRBSb2FFH|!GH*69hXP{3*flC1BAti zbJNzAm&ca3iTKDR3xq|-Y2`eKx?tij|4I5$vH1yqf%5H^Fb8J54jK)5$VM-C5%i8b<|k&Kxh=#FG>Ox&>r z4?sb}hlkg>1-vahgJcyDBP0eg&{{(&pkA-x@zeQAv9vj35<}`!ZpEItce&w-qk8xH z6RRw9@QrP7!N5#{!3lE@ZdYYZTfgiFi6Lb!&3aDLCbZTHrTP~zgJ5t59%w*hOb zluc+{RTRg6=YG6-nK4FWENw9c#kNAwg^Z<6Qfw))AhxL#BepICrCGR3Y*ImRp({T? zTnLJSb>SjV3*th8NWh2|-MFv{h6ar?CQOCaPCGO2Slu7MmO%Abnk;~-!>l)Pfcm^zkmlP{Y%^L=sSi%YWmx|!0380>y~0* z!X3S>RDStj^=N5m&yix!t>xo;CxRE&i<7mwVsI>|6icO+%I^m*!Zwe4fYlJz4V3of(`Acij|t za8kNcXJ-!Yd!{F~EiPRA5oa9Mcz#{_o<>q_+~<$(9_igu z-fDhX`VMP+#~q09!@?JoZYj#ZgF{=4chi+o@#}(XciZ=>{X@I^cU1gOwXd;a@y=5S z0(@Xl+s1h1+`?JDjm9&mi}M7%StyFV1zn^1<@}STD_2 zPkb2qz|m+g64?gc8w5}VPHP+$-&z05^zF;s0 z5J6S3R*2gge)DD|*VlIy_(o=o(1`y=ZHx;9;{*{wQ$_3zc^d?arI}tr3>YgoZ!k`X z+bOa(cXe0DvN;hcWNXd10ScNznkY%6XaeX;Oi@G%BC<-P%YcCIe7nvZRXET)ib{&H zAR;W^9;E5Y8`BNMKqMk@Hg~xMHV1V;{p8!n%WEH)dL|-g3M8Vcnc_S&8?$7l;~l-E z9gl$|Qwg+zwyLK8c{V#qY|b;N?QBVN@FWLU&B6W!?MVva87!da00000NkvXXu0mjf D@Zg=6 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Previous24D.gif b/org.adempiere.ui.swing/src/org/compiere/images/Previous24D.gif deleted file mode 100755 index b0a0cd721f2a06ddc54808de9e6c7e43626c6512..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 877 zcmV-z1CsoSP)b zluc+{RTRg6=YG6-nK4FWENw9c#kNAwg^Z<6Qfw))AhxL#BepICrCGR3Y*ImRp({T? zTnLJSb>SjV3*th8NWh2|-MFv{h6ar?CQOCaPCGO2Slu7MmO%Abnk;~-!>l)Pfcm^zkmlP{Y%^L=sSi%YWmx|!0380>y~0* z!X3S>RDStj^=N5m&yix!t>xo;CxRE&i<7mwVsI>|6icO+%I^m*!Zwe4fYlJz4V3of(`Acij|t za8kNcXJ-!Yd!{F~EiPRA5oa9Mcz#{_o<>q_+~<$(9_igu z-fDhX`VMP+#~q09!@?JoZYj#ZgF{=4chi+o@#}(XciZ=>{X@I^cU1gOwXd;a@y=5S z0(@Xl+s1h1+`?JDjm9&mi}M7%StyFV1zn^1<@}STD_2 zPkb2qz|m+g64?gc8w5}VPHP+$-&z05^zF;s0 z5J6S3R*2gge)DD|*VlIy_(o=o(1`y=ZHx;9;{*{wQ$_3zc^d?arI}tr3>YgoZ!k`X z+bOa(cXe0DvN;hcWNXd10ScNznkY%6XaeX;Oi@G%BC<-P%YcCIe7nvZRXET)ib{&H zAR;W^9;E5Y8`BNMKqMk@Hg~xMHV1V;{p8!n%WEH)dL|-g3M8Vcnc_S&8?$7l;~l-E z9gl$|Qwg+zwyLK8c{V#qY|b;N?QBVN@FWLU&B6W!?MVva87!da00000NkvXXu0mjf D@Zg=6 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Print16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Print16.gif deleted file mode 100644 index 35c37bd73e16399b34048ea7bf8bda1659e218d3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 544 zcmV+*0^j|KP)m+%5D|1leTGT$1j$B5 z!fdikRugwB1Ui2tf$2`Cs$6Iq+eAmSpceO1_tfEhRq&rnel8l#`XLbf#oW=|JNFK@ zx{YSt#c`b3&tE*t)KL_Mns&sgw?H zR_E*#-}iCOW%^qVthMxdJ!;i`RF#jN58SHVMnvfM`;^P&KMMeOo`Es;DWUdV+^XA;@yOt3anNuJkLw5{>pnpK~-_iVXe&w ioE*P-eg7YR^T{{CBiU#D3&XQS_>F(*SdLE{yog~A=ANb%=MOW3QUR8fz zJ@`(h>V3?Pj@$?S{7lA!qeqS%|E!tW(Gd|5(ONfj5s~cZh}2{J&}f6%*;#VA9023v zPf<#7;J`tYQrNalTU%T0$(L+ktrmT2Yb#Sz&q$?GB$G*|rk-KjHkM^IeE`6T6DP4OYdJVrHRAq(zMgo{vTz&+$8ks` z60BdpA%@moMeUlp;QoQWGr;rOh;7@(wr#d=-$7?*CzfT!USrRrwQ2=88n`of{vrUy zVi5pi3|ed2+ka*A=5{>K!*yL27Z>9>U6~BPo&JHo(^aNg4qcefGd3~7_}Cc6=!QS` z7uzP2$*^bdKHj~1%fr7O0-U`tcxkvAtyIl*UHMXT97i0-k(rqp=^yBmC90S&2#XO$w@jo zwvbM*1u6;sDn%I90T&7dy1Fv_)YeL2zJLWtq#h9=2m?M8iI zy}t&Cs>!_TK<~GdqaX-xUb%er91y5Fr78uq0GoiHfpx%-k(+3a0g8YF{14=S5}>28 v`ZX`g_ccHwYLijF3f9q6=|-(tUO_$rB9yL?Z@7iG00000NkvXXu0mjfkWG&7 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/PrintPreview16.gif b/org.adempiere.ui.swing/src/org/compiere/images/PrintPreview16.gif deleted file mode 100644 index ab92a309ced4cee5fa760fe2f7c56c734be171cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 779 zcmV+m1N8ifP)le zK~y-)rITAolK~XRf17iwmJMB6)2#@REHx{q1y-}n%r5jGmHAK+5m;dbT_|jl^wOI} z_0mJyU9Bk5E_NYliHMcDsbO{@b***L2|Nlh>VN^z-Tmv6qSz}r6)?#JFIQ&F51hh4e_p?1k#niTbrRT?F3QP%f4o%{2%V+lP-p84<<=AXC zWU`R8jf_xYK6W^1ZgRNA_6573X6K4oOi?RY6tAJVSBCZDH!{*Q@OX#D@4)49o=RJo z7T)~HPiEp&YG6miA>W%ho^dQ{nyo6Yazx!zj=w z1l~LS#7v9EG&8`9CJP4rOy2hPAP53LnF1gfME~-2E9+M0Q`zJ~XPClp0JLg3@5Dj! z=0{O+p_~=Vv&k|o$KzRoTrTI_`LkvPK)@fs;c(DnZ6P;l0S`MpxE*%1(__g`QPB9f zmT585X=r#ztS*lB_IBo_B!{xFYv(R3mPS6dJ)tN&j*R3P>{uGZ)r;pzh)=*D@S{{I zsk~f)-QJHN`a%yWIy#1&mAO1hIOFZR>W_>d7Om%jKZ}KA#W0UXM&B!(cFw zIC~CZVPOF1bg{&}iKFsT1pupZa*2qD_)X(+bIEm};2*yE#xL4m1oI!MF{}Up002ov JPDHLkV1kRAYSRD! diff --git a/org.adempiere.ui.swing/src/org/compiere/images/PrintPreview24.gif b/org.adempiere.ui.swing/src/org/compiere/images/PrintPreview24.gif deleted file mode 100644 index 75f43aa64b78262e7b1d1cbee090daa9da0f5e59..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1131 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 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Product10.gif b/org.adempiere.ui.swing/src/org/compiere/images/Product10.gif deleted file mode 100644 index 3cbddd231bdc00b41ecf4c5851cfa988e7176f6c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 347 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u_bxCyDx`7I;J! zGca%qgD@k*tT_@uLG}_)Usv{PTE=|PZrH> zcmExJfYpJ0K|!g!TK<$&Rwf^h4ZDpE6tWZ;ggjQfJh(LNj)UTrwuas7oy*<#9pMN$ zyei7XfFbbPbk{V2GaDEbB@Xu3=&#(gUgE|JhKIi&|J``K-~4Xsq@Jpm=Y6^#eg7)V p5%#}``^CC{r#^iPoy&OC-dVHI`Oc}RbfBLZJYD@<);T3K0RWh4igW+~ diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Product16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Product16.gif deleted file mode 100644 index f87c2a9662fd955e34f8e27413cfa9becc010de9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 439 zcmV;o0Z9IdP)GKF`j=Kf`k;t!{qX;wyQP2Q2ual2c4#8H@6Qjz(o#_NTq#w_sr{CxR@y*2msq#K?7)*tx9Qy z#14f~>{l{Pk<5Z;U6cbvX5uEnaiWwi28cZ?;8_+PV!yRWi34%1FS?Pk8fdLiTFtDB z;||y7ov|(L?-#fSru)BaU7~Rip;9nssRB|&#ZY)lj*s4GX+B69Z22RxIEXH ho^!L}00dA5{0knEs~4Y2aNGa@002ovPDHLkV1iO$t1AEi diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Product24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Product24.gif deleted file mode 100644 index d96276895f629c250dce6863492c7bd92f6a16f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 592 zcmV-W0A z6qJ;UNH&RgJ(t2W-tpKbHXUwu^=9VWH+SyX@V`ISRebQ|-7YX4!Fl}S`0dFcfe7Dw z@pLf#{fDDo5$l8hK3@(NxOaPl{e#0!k+p2@^v&z%0BmoqkMjD}%V+E#98UA5a{<2p zJmci^w=01X7(#)#`{-fkJU2cUs=bw2sHk_g8^e`IP_dxCFm_wi-?Ua-d<9jt7fJsh zAb}YuH$Y861hSD9g^n6%sZmi{Hn=Pn!*>uDo2a&L4c(9&p?qN683>=8pCzCwLDcpc zV+EA`SJN&Zb{8k=FZpN*R9-4sYAuj;9DGqMuM}{r>1i_50xM6H8T0u?%JDhWfK7ne z?6j48GHl{obsgk6zbNA1t=kG(Ola9m-rMN!$C11Xr@Bf|e`~A=VlJmju z@_!aF+ZQd9sH*US5G=|U*xq)S!Cwu)GEsE5yMN)j%}Ye~8W+x-{CYBzX>L1=eXF^Y z*#KxNJvFNzSfqaSHsaz*;>q>%b(QC5lS`S!?A@+Ve6LT*7&3PQ>!Dct-&&lYl3dc*1QDYuFiXB%fvUj|U;2 z#g)6Pc&Za!mPzc60q7bBBdy75=f7vLtD49*bdp`L0Xw<^=i9SH7qwRF8n4_D0Lvue zjW=&LG8a_}ImX)efKU)ZkY2eDoIHB^g7DQg{@F6ApK}0R6E8=amQ_1LA7MvVkgZ#f z5L2hvj<01heh<#@XG9m)M|EB4ol^kIq^@G&vitS#z7RNh((QXo#f1?D;+ky*8GYF~_e#=M0sEoUF) zzS{eEcY@Dw~qax%?3bg>?HKPMtc%(9jS&ckZOOx0k-YKDKV%%J}#=Cr+Fo zyJ|0}I*gpBs=m3t|1mbt8bEh@daJ4xm%b9)b3Ch9E%oPCV@L#?YD8TtSejj{IKr7^G9i`(r6VE69b zSe8XB7Ne`H3n2u#z{oL3Q$H@;<}@nM``qIBe@ zkKcg<2RL@@7~yc3qeqWo7{=7NFNVGR378zC!c*{QUjKf}#Q4Pks=_0o#cLAs(rKh> zFy6kaRCLlWRlw2+EVcngu4=ZXH1p{~OO`BQ$BrEwI&=tCRm+Ocl)|#VAcJ+t z(Mv>XV>P(_~&a>^&`6qiQ_+<+Hw6@6N9@2JH%QA}3+Oca1TFbQOUERZYu^0(U= ki61CG0GL*0*x$B%4=3XEQPtwWDgXcg07*qoM6N<$f(_BmO8@`> diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Redo16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Redo16.gif deleted file mode 100644 index c3b0df03964aed629787aa2e00d5c1deb0ce3628..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 591 zcmV-V09!@1|a7y6KHYMyRt(@|#< z{cBq{wZeZJJbqvRywOcgMZ;bX8R({V0eC(qv{bfm zby!V}<`4o^j$zq9DScbv%ILiw6A^$HfESPQ`SbEnPO8~uyxOOpbRU~FfUe28J$qL8 z@C5Mk;kD~GW0^Bpm31snBktM&3_1-q+s@zOgv6zhyDTl6DE{o}owMVUv2>RDuXiL` z4H7gMZdG_i0!QlYIz4!@dkqC(K-FfCk4>lJ)_b!1Rd%EVnj)wji8Jm)7Zot;7MWwG z*gs|t5o;aT9wf2Ok6$@g1dX*be!bT##gp?c3Eq+E#Mh2RWxi- zG;9IzHaQf6fo=!vH>>VST}Z(FqG7KdPT<2cMZ+#dZlbEl2Y?p^`wGFq1RKr0vRaV6 z7^XIV*yPVOq9g;1-Im=i2krW;ncR=mZuykZ)veF3J9a;RB)EwqzyeSOHl8Hi?*hE} dMW^#GgWuOnx&>a(HQoRK002ovPDHLkV1oBE0Zsq_ diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Redo24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Redo24.gif deleted file mode 100644 index 576cfc76c6b8868e648ad44ad39afc63b8bf8e81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 810 zcmV+_1J(SAP)Mk1> z`U_^^N1>pg6c@#|3$fG|YiXJ$n2F6tGdDB$x=F%hn54CM;4pB{;W_WTbLIm77_qo6 zV{!f9ZhZ{ofC*eB7tyf0KEy|{q6Bl6k1*U$y(rY z2aFL&C2-pYQwdhG0AfHi8m+>^rooGW;8$_?B@bLP4eqD`f?r&{blN6RC}nLzy7fhuY^Vysu|@671MM;m?f^g#cuMw$kj$?_ zQ5d>A4+CJ(C~dZG+SEm;EocaB zvd4tBj#g}?6LMyDISb&7X>c+PP5_{g))d+htUyIX8Int%vo3(Uroq2^>$Y2{LXQPO z8(Lw@oLiEr10ZxN!N2*p#{=Ei>n}|JR*%lRxj&^e0O08pBrAPX9l#6nxM}c&_pF&> z0zgvAFTbsY3Bs_bIpYb_;JQzg^krSKI+^7+@pyVi>2zE!)lw)s`AoZCfvdjMDo@4# zMqV{kDYBm*MDgSemP)K;Vi(4vBDs+nvsPuimx<#A6Rc6a_=1(VL#SBii8JN1u7Mw@YEpiqcE2IvN2)jB=4-W`}#p z$^MeIaB2_{04DN*na7rz?<0?t?!I&E4l(pe7h4Oj+}FaDqDLqq(obrrMT(7exidfK oI@KW*ux>%w=!*4jL!A|W0rDI=0Gne09{>OV07*qoM6N<$g6d&rbN~PV diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Refresh16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Refresh16.gif deleted file mode 100644 index 3fd71d6e5929ba0c40db1960e36e9acba9d7e525..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 912 zcmV;B18@9^P)oWowDaEkzU!j%l38$)o7}}cCnx7z zVrKYAWwOsS=-Lqw-t?qu)r6QQ!notg696vQmg&~r9t3cLe1UW(yG7H)Ku^~yeO+g> z(bg0Jm{BNJFfw+(d}sQhCl&9uE%R)8S2n|p?*PPznUTt5*BiPR+1l3~ipPS`iO?Jk zARN#U4H*a;0yD)$9M29{3dM>Y4K?&WE>{g^G!Zl7)jelV^{i|AG#D_%trsJC8h7YDw+>Nu`!(E)&&KfE(t5U!_KF)uRXGsl%@ z#;0eK6ZhtiUhin`+P8I6C=m!d1ufk}o{_gOutKfI-_b^R{JP z`QzJ2^LHMWS&9G(o-t)@yh1Uq9cxfG6X$C)H~ghbOC7?WrZ-yyL0>0QOs`0x)U>uAAQg z>;&LGL0Gpf^PVr@oj>}%1`wDT7wv!4sq=s3q*Oh&WftpMhqGg=O68@F-$%x80Ep=T zKm-sG?*3PXAs8nI|0Dok)RR-0Y?z4d_HJBzCO6*s&6^5?o^0No>h2ra)My_p{u2^&LcltM%9%NL@3OcL;J5G-fbF(raxE|ezb zm1#^AXBfx-?>jR)yR%CSkD4Z}F=^Tmf|{770@hEqO%szQ{n9is zHEGgX6eKmafTT2OwXsKHJW8z!1VLK`LOl=`0dax7=XjrfU?CiS@JlE8XOfv`e)F4W zo|%^s5&n;jKTAy&;^&>EBHBBo`5EO|sKj&=J z5_Cb3Xb}|nqocOcn7QVqeWz0dr@u@KTRZD39?SzX23GoBb3MSyUw(0^ZDmff>~gB$ zoI%$O1VRQLJess_^m+m#;{k~=9QJeN3zwvG=)Bz$Vg)gg)ls`=U>nzH zUSF+63=0$fFk&_?ZmD@ zc?Mck^<7DVOM82J@iOh}mUc1b4RX!_VG$97nd)|hN(wTZg)gK^L_o+OY+avgFUrrb z_dk3R^J-BR>*^ggbs>p)FV8M3)z7(9XZ@K@nhF@qVOPSI5Z_;`t>7V!6wio%`?=P> zA3pu2HQ3fOOioq8(0B+>0w&hyr!z(7uq*-D9-a>d!)pV>lgu3#<6WMedPCPuFCab# zfSWZH-uC*6wktK|<%Vu;{QXK_`-vYrg7FTH%p?t$ZjC~bI4mJpWT7z$sG36^%FIZv zjn(W8V7$*Fn|I;FwAEE~>4te|Dxga-4h2KwAqW6=g~PIlDMA(iFxz8Gh+v}2@nwv| z{_|(`Ig88U z%-%Ny0HAWkqWLbWYDiTyjEIJ7LTO$Sn$F*e42=4Y zwjJNqu+UBx&J;-%$5e;!r^&ELn(+IpY_e?4oS!pp)0T!Qkdf#F1JK<+Mx3!##qTsP zUG&@%p0g~mVbT}eef!?vhrU2Kn{nKoz45Fth%o?ba^f&J9>kEBT0b&DOv1B6Yh(lH4dhQNwwkZ<1V>QD&5vpGVo|a|^hIHgFiABV;(0R{` zR|+$w;{0^28<*3^uZbcVE|zw(r3W-b^98;e$VZ)-gBS*1HciDJ$>!YH7P5%l`C5O zT5zU1RmBKKOo<2(5#OJqeXYj^t~PZ82t^YlqTmdet=@g?&6^GTF9WaxQ0GL6Mv|Ov zB_X3AA?O|U21fh50QBfwN1{+4fCv%MqNRy3Ce4A(LT%lQu} WX_ARm@ zR-{yDA&9A%CMFUuCfvM8A|F7%fS>s|c)sph0 zwnVG*<5~pO+7dcAz&?AZJbiqVQt2M2oi^pw3LvP)fM7&GgjTyrrM#BREzoSXD2x<) zg)9i5lEefcxtKMZhb2WKf>FJo6hQ>U2xy+j0<=dF?>>I!z>% diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Register24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Register24.gif deleted file mode 100644 index 72dcd36f6c2ac853b19db2fd1753e52f24316f27..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 853 zcmV-b1FHOqP)&wa010qNS#tmY3ljhU3ljkVnw%H_000McNliru)(Qv)Bpngdlo0>`0^&(T zK~y-)?Uc`N8&wd;Kl65-dXr!hJFy8)6(VYs*1)L(gv0?(hy(l!{1g2fxbtUlmX1trSF4eux5%@sGszCb8Y!eKQ=qZETXFs_K!EM(^qE?B~sXXLjI!%S~SS=(9_} z$IqGjWeAiO77AZ%Ufy^v#J~P*ktAs~1Sl3SvD0kO?(_ixEMNc2>|AWExJx&_XM!<>UJ4<0C8-D&APF&;&}g!8t*hp4C5i*d#dYIR1H-{ z1Q0A5qEF;TOD&=)d6|Wum z5D*^^8BfNnRn}*~LXte3#=;b=s&soDI^8yz&oG0*pq~pdueShRl`Kp7;m$6zDOcC3 zsOlNmiK9|pqr6(7ci1KK8JFu@m>FuCOCXpkK^PLB#B@4;^V*f2IqB0h#fbyJ0VweO zUW*%_-(-{+sRpF#NX?O1Kx)%{qK?!8QVq`bk6Z(6rq&@q|1{(F?IXUv^*g_GAM)1q zCNC`i!8s-JH@!mYL!zI5o9mYkn?=-Sq*z*Ty!p}+Ujc{RBZ~fn51REem`uOb`wS7` z@Fe4YZ^GM+@?0BkmW4ZRDn+QO;sm15h@v7_n^!2;Y8><@=gOveha68l<3xFIG?~kI zeKDNYMODIfyA!UimU(@v#HXKJr&?P@EhBL982cC=6hMS!^{|)_1a7WdR6S;JaL_7* z_xA6Vu3fuIW2?%}_6CD^fcF_|mGV4TK=O)@#;5fAp3VBa6iG6{IpOY4cUQvUFpfr} z5#N6I&9pGyV;Er&K5OL$D9)yc9|lc|nKf<9@eUiWd>3GuTC!a5vdfWYEazjncPj5ZQX%+1 zt8B*4=d)!cdDz4wr^#OMYfqGz$1LDFF>|#>*O?AGil(WEs?wLLy{Gj2J_@opDm%`dlax3yA*@*N$G&*ukFv>P8+2CBWO(qz zD0k1@kN>hhb1_6`&wrCswzINE(evt-5C1B^STi2@PmdKI;Vst0PQB6!2kdN diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Report24.png b/org.adempiere.ui.swing/src/org/compiere/images/Report24.png deleted file mode 100644 index c9baeda2c491d2c9e10d6145ce24147895fef3e3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 654 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 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Save16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Save16.gif deleted file mode 100644 index f1d7a1985923fbe1f4717bd66985cceddd7f36e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 561 zcmV-10?z%3P)5 zlfR1-K@`V7GrPHjTF9HM`NVrQkDDElJ zh*(^!7J*!0<8G7eGMko`R|gs-Q{;YB;P_L1kWtz|QptJbUx`b_^gI`2FHBL4;MM*X{!l14cwR z_2@Z-zp4MN%F8SOFM*S{?yhVGkayn~0~8TqI2^8IPLgDaz=$YO6pI7cr1adIE z!Cnt0mkIxCb2uup1VxKFQ zFHx`8snu$;Ypta$OY%HtclSN{+6LaY0I-KRs*1G{?RJ}fzfZ5%quFdCB8Z476IU8FiYblx2x?4(A+YSrS4Zs8Cf4L!4Be*iJVj%d%NOmSsz3 z=Nti0RVweN0oIr=dq01j-|Vb6##tauQ#zdv-h0wCT{1i8Ai#-ZYcm3K@y^S2WB63J ze)C-Xt!_+AATT`#yRon%hQOY`kc+7sk?`XW{qqkxXGvR800000NkvXXu0mjf#Dw-o diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Save24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Save24.gif deleted file mode 100644 index af79de8525364f8e53d0a700bd2cd873701744a5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 787 zcmV+u1MK{XP)L zmBDLNR}{v7XXd>iqedFjE-XY+aAVt*=(?e+f{?$U;KtUKF5^a_P;gNSQrrZ@RqVRp zN~vf!-2}|08y7+w43>dFCYq6Z^X~b&xbMx(GghYc!0_(7@4erA_niBkYv;cG`I@_b z2N*fT!FY4-U*9os%&rvfe(maoB`b?AXYc<2?uG;sl0XiU;hyi^LCPEnHTM#~es!JK zq2kWH^;-pC9W#FWW1CNI-+YUZ>Ep?%%Y43g44_*8mfT6nIr06i_X1ag%mF9>Qp!u7 z`})#*f%$2j%Q<0M6{x&oHSFn?6 zPF*}l?p*xw_iQT2u0q*h^%YbRbEj#R=~81W-8whvbF5NU_gwK z7$YGBVvJ2OkP87FS8fkYjvJ^n1~=QLiQV1Z7PJ9p#T_K!K$RvGSCs=}lkDy7O(=R7 z*s>t2d$KX^ZU!%(_XkH$9PjbG|7rvYAshftLPyW#NcG{Pu|W#KmmAMsJpAnBM@K*Y z@CZ+Vot+&*2rMlvvA@4h2!X+1&;qBrXmhhOm~{c+g1DamWRf`h&D}Ew4+O^+wtwl4 zPQN!oYP-`gHa|EI)~!!W%TTys2VOSo03~n;I1C(_xB?7;y@}szAWCXg`ya3A>w_7z R_{#tQ002ovPDHLkV1nrGbVL9E diff --git a/org.adempiere.ui.swing/src/org/compiere/images/SaveCreate16.gif b/org.adempiere.ui.swing/src/org/compiere/images/SaveCreate16.gif deleted file mode 100644 index 749a2ab3eedc851d19b43e7285bffaf2e6aab1b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 612 zcmZ?wbhEHb6krfwc*Xz%|NsBLyyMW(O$T4U{`BhAhc|CNRM*s1R@Efu)|XE`+BE-c zQf_@lQPbmB-yXmE8kyJEvFu9Q;tQrJi!IX^JLRwPF5BQ+v2pMD7e}wXJ$&W$$(!$u zQkEE}EH+MAWRkkXBz3WA+ESC$MW$(s{p)uGH}CN)S(2PzS6otBR8qQPMef9j761Q# z-n41s_qQrqu-y;!GFF2QS^_G@xQ-Te0^X3?L+n7 zADtW4X8--M@bmlGe}63g@Mgik-}^tl+x_9~fp>3TfBf+N!~1uy!fakg*u9Q+coXaV zA<^|syzAQp_qR!&Pjez4=f^!Rh`U{pcd@!uEBVEjNqQt~+MK{AwoJ->Q(9)mzJ1zS`m-fgWv*t_ zu`)5$QxFu;;K*Q%kBen>GPbohR1)G$&At*B6V2jaSF zi&r=I+04sHEgb!_cK1Ro3KdvQ^`exLPEJx~koL`&b34ijJO|+CR&w YNG0=Ii}yZQe&EsS!;jY;d$#e!bCc91CaH@})0UW}FEdSBY?HCTuVhJfZhn4Y zaduA5`gK|J=NCWAer^|YxegKncqKT{r#5r_j}>r z??qofO#1SE+Sd=WKEI#+=^YTw`S)wa` zp7}{h@{`h(r{!r+D>I%}XFsdWeO90Utg-NUQ}Oeb(id&zFFGpUE}H&!@r*xz{(SoM z>Ep+bA3l6||Ni~EckkZ5ef#Fko7b;jzk2oR-o1M#PoCVjZ{POq+qZ4owsq^)jT<+v zTD5A)k|p!z&1-9GYieq0Y;4TQ$pJf3!NBpKA#{R5 z;GzWwg(Qs@XgEG%S=cUM+~d*wtY@ZC%CQbk=4ajF{3;4=A{Se`Pfpg@8N;DDDWFpz z`^t$qp226?rYU(ha2(jY+<%^Efs@Y1#@@M$JtniwQ23I_$#1`yZNh~ssqGA&-#Kob zD$VW@*DJDk`XPA26^5Wm3_lAGFKuO$;5%Vzz1&aMs$#3g!N4aSeUhpg4i*>M`{g#5 zeLOeQSd~LiD|EsI4Z(+uj5f_|ieY;!ye24zZ_-)mnAF(JRBkl;sf|0In6mW@lZT1T zEleyrpH}c4i0qrA>)-a{g<{JDHa1S4AB-XyUz6?^K02}C5ervOyIRl|felFvcdr#K zI&3TXU#(%mG=crj{m%RTRDNlB(U#8tym$8RXAh6_Z`il5);#wK`~1iYTiFvD-Y-nQ V7HO+`xrxKEi5by)&RG(o*4iD diff --git a/org.adempiere.ui.swing/src/org/compiere/images/ScreenShot16.gif b/org.adempiere.ui.swing/src/org/compiere/images/ScreenShot16.gif deleted file mode 100644 index 1de6b72814827519c7e67d59e4a7135c199c6166..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 772 zcmV+f1N;1mP)*4)zv{r-vZ8@`VG37tRCc@E-V|asc-B_R?PO#>Z*eQsA7qfCzsa7VhJ} zXYTD@w+6vl!5G8-{{E*Qe(=%021r`*E86e8|MfS&VoZY-L99?Uf=W|bPi^wqw|&Ct zknW{~x9`5lm8~nszzX2H?!~%ZQkFTcvRG>|#?mx~mv3(Kc(TCnbVxgjR@iWKbb{~s z0f1TobXNq5yd=*{^1PxbDy}{EG&g(CvvhoZJ1l5|Hm|;P9qkI9=Y;?oAd14IX)N=( zK`Dc^f>OfOtCvXv#m);U*=f#e*AtQ?U^H$}N_ppiAPD05d`VR;QEGLljg6RgJ7hRK zVIxtzcWVo!6h$#bISvBB?(VMA0G{WCqw$=@!Xjds%__js?;lYV6MWw%j$@)I!WctU zm89)f*ffo=0kqcPU{H|f3yd*1jv~vJJbd^kVd&B{OPZ!e1YFnSMsJI>OBxB^)-KTAdE@mr-+A}$C(mwgZ&p=>AZV@0veW8|&%eC) z{dYfn1q^}ldgw`Mz)6xgwbpJf>V;d^OFI}0vx9?!AAf%I%Y$r^9RoQ~pFh*T)B+M9 zbsQ&*;wUO-WeKcnvL5~~z}nYmQFj0V8o-|Q=lTaaSUwa(+!ta10000&wa010qNS#tmY4c7nw4c7reD4Tcy000McNliru)(Qv)B@6r;5CH%H1bRtC zK~y-)wUx_`RmT;Ezq;+qxpmVtSg2{YY1_f3!IxMFC6V7DPrx)YCUIWFNIXLxAu~bF)?mK;uHFEp!@87_CC9=8Jt5S94i@RNvld#TKZOLX|2ED|6~H-=FOX8 zbMyRQZEfw`a5RLJK!}$kQ{r&ii7)R@#O8Xzl?$V|xQ?U%r%0K}9?DM5nDCbB_^Svkc)lk?!=KG|$S>^k0gZ;Pu}FR-#Q zdM~Ba1JD3UDMd=F)_SVxl(K*rBQYjoj0<>3Y`-$%pGU`dU62ijAR0ykm{v6h2S=os za-)qn0Sh5@f>lVgZAT0X*aEspa{5f44?p~XukIgk@6nXmJg_!=gJA@FK z)>;5a0Iii0LJU)auJg?2j``ftb)K$sbe-e!rENxog3Yr7s#(YWQA=SY=g;-&2KLbdGoC1{jHp}o?tla;he+! zV5Af;N@0u=Kpog`dGSB$k&N(i>w#KNZF-oG8qAUuWcglM& zuV25u0BfyfN+NGthjRfb7r+oAb=_jE-nxsA@VL zc<&crDWz~OX3w5A%x0Fl_QaR~jWLG%_s1wDNJ$VvgL94$+_Gx~N^3S>U1N21q?@K$ z2_eW6u(ioFGmkMDLS_gA2!Q}*Gr^rZhk!r`vFK|7QYeHF^ankD{lNu>qs(+&H}qlo zVj&PF6J~Sk6j!fZ{F$62QWE&!5r9@|Ip#0SXhpAYkV-1={i;%G0iHEYD9hs6mCNg= zE?rt7Ek}7dBqGIV>e)7^LMW@fT;fLLmtGXV%GW&g>Oy*G!$ z!CTha&tr_TX&NSzNqYSFF#zfp#9skfmSt_8XL-}Ky}GVNJ)4QH>*C)2K{FnY_jh-H z{QBF!fA^QYCwpU{1!};)^n?7&Bv1mQ?bk1yKXc~HM%gPz+L*G)^L|xT)qLKyPbZUu zhu{D3j~L@IaI}QS{|0`3FM$lmmu|8wGuB!MIG_XOfCs|KXY)V6zZ4^0YVMc!|FC}p X2On&3me8bF00000NkvXXu0mjf4dqo# diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Script16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Script16.gif deleted file mode 100644 index c923098eacfdfac51bbc6162656a5b098335f367..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 516 zcmV+f0{i`mP)#@I|S_<`|JP!0g*{W zK~y-)m6N}Y+CUJ-e}h({49)`}3JNz!$6G{-s8a9X3|k zq-mPN3xWzrF{aq#tLNQNG56d=B)csTfT{!2H@TQ%1m}PVq6NET3{>6+kRk)k41xs` z2mBEO#OCh)i{;~dmHVPtDHT&t(d>`pw~EyyiFy3_$ZofL2S6Q%0^>~oCNaHUk01!> zbUIwG*S7#tY($@O$P z;rl*O6ah4I0MGOAJdaAHV)aXfYPHH>Fkm{JVvON(xd5?u$zR0000#@I5U2X4Ilsj0|H4z zK~y-)wUysXBUcp1Kj+SfDpC}g{^Kgu{a6j zVN0L;=Kc+fe?Yrinz}6e;)9No8krkWQIiH-(ubLh8wWJ&T<^QNRo?8rt8JAxyFH$H*XzN-0fu43`3Qm_0um=D(dLbu z1-e~kXJ`9317Hz}7BL`(_V&_K@Gkt0jRf~fAW4*xu%gFu>tu+H26sV}BzQ>}sy|2> z4pzg!N~z=n5kXWek0?Z-sWoeBYc!i01*jqL0q`GxK2HKsZ|EI?p{bjcHcPm!i|3Wl zx;ZrJ0r2Oa-6xyPCe;^_=q(XK-NY+-xUS3L;UT$Pj-ppYhv9#d;^gGywliXlwbqop z2wJb#F-?=Dr6s1PrzsYT93LOQ9h`K9C`2Nt7egD32Bv9Zno->+CMIwkheDyi&CTo4 z;J#iK&^k<@VHhS*(=@rfyd;;)vADR1<2by0@e0>B^vnK*5=S^%WeX(lHpxxT&zAP9oLT-W`20Q|-MJef>}Fua9cTwL@)+wC^z=jSXh zFEc(q&hG9mN-470Y!ALORAa3*g7DzMclf?fI-RD|>CkGmsMqT>8V$78wA*d8))7spv(eSIC@_sL{3?C z#D~PTZGL?82;cWvSy{odEav9s7#ka-R;v*N0p)TTbIcq)glyX$>S$_eifXk=p-{ke zU5<{9*xA`32m-3r>cBis4*5@8o~M+0__p8A&CP3GzIcV>I8pkae28gAKZd{S$KU?^ z_?KTt4O0V10q?~t6))*Yx4OFezHQr248!5 zlRZwuKoEuBShkdo6Ce-`g&oB%5D1AAAQ1N;1q8tjkfK1KNiIPN7oddNiR2Ov5h<~E z_fdp3{)rVb&8)pM-@G@{3Q0UZ4Mtk4OKcFX>yB@(@46s~{@~tdt!a#*F@{=eYOSf1 zqEd=kmNCmRrfJGFO}SVs_%Q4nl5l^40st@X2}ET1qmqkpcDR%GSO7!>B7!7IO2xkK zV>+FdzDri@f#k|*B7z_Yns?E7Q-Rnx+21PNIsZ`*$1&nK&TTd-5E1ykpBLKVPN(xX z(Q%pq7E)}k=0*TX0KjB2soAg*MG+jw$!k|yXt&!X1sBJAc>Vao`Oz-kKEKy1r~+;C zY&KiDbCm>MlzSK^K=cW00000NkvXXu0mjf50ACM diff --git a/org.adempiere.ui.swing/src/org/compiere/images/SelectAll24.png b/org.adempiere.ui.swing/src/org/compiere/images/SelectAll24.png deleted file mode 100644 index e6331c6e9b996a186d54116bdb0280b70ea60908..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 645 zcmV;00($+4P)D zl|7HsKoEwXiK8TZ2m&ZI1t+8^aZ*qq!AS^FQBc5tphhQwkmwJNMB!-YDES9mOAoZR z<0u6Yw6v!viPs*AVB=3XZluwA$GgwIGdq?=Rf+BO_+=9iPG|c3*^6~Nsl^YI!_hln z2^<5*BJy7jEZ@8xfB18ZDyquCXkWuHRAY=9V>F5)4Z|?;IBty5AP6)F0^MvjiLcjd z9gSZF2c!Lqs!Bbbi-@pTENC{Hgkgw?AR@`T^q99!r-RfaB;1y=o?jp$eEzm1ilRzb zetv7`eBq!{Fu-g!%fx%V9WhN(53=l<8W}Y7{%i>P=QYrMW;Cxr) zZ8#hjI;0Yu?uxh+Rf$*I=eGSKPD!Zssar{N4)rtrozkKJx&8r-J{gF|BBCv>Hj46QY z^?H)_J-burph|H166W)HVXyopEyI0Kvo&i(cVux9&j fjD4l5tNi|7!U+Lk41T1`00000NkvXXu0mjfGwmdp diff --git a/org.adempiere.ui.swing/src/org/compiere/images/SendMail16.gif b/org.adempiere.ui.swing/src/org/compiere/images/SendMail16.gif deleted file mode 100644 index 66afdb713b9a076a7c802b17770fe8b176668d1a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 626 zcmV-&0*(ENP)v4ff`0000TbVXQnLvL+uWo~o;Lvm$dbY)~9 zcWHEJAXI2&AV*0}Q14_VZU6uQ=t)FDR5;7UlFMpSQ51&1z0Wy;rkAvhX_DHsYNeo{ zX5dKr1kN1#1kQW|UqZo|4xD%`(un~TL{O-gVj~4Dh?SC-+MF~ulhdAa_FfLOmSRDv z1OLh5hsC!RKR^6$DG@2}7;A+_J0OY;Jqb_%2qOE>gqJ{x{IJ#vuNGIhG5eNg>l-IC z+nha-MIl&gF~$(bF~%5-F<4`9Jr{T9`o}LD+?<`KH#J0|kf&8|(3hKHx;XLcT@gV< zP)bqX+~nz#5^fY*7M51Ic6W}!bcWAgJ1lPm9Lx7}>rok3LvbpH<7h+#$8l&jn^db+ zwASeP4;8N7nPc+kDDBYVxf)Qkx-rF5$GQIS9WNGE0EOqe)O?@S)e2*UF{}vgv)7+k zuJ|mk)ye15^!BIdY=zh;;6dpP-C&!?&pUWq6|{zAGD&{)FrMcTMbU1Eext+1D>LLq z^K`-xFAg|=Iz@4Eh|I_^L&I6>wRQYj9qlA2jE{5w-tFBG_mk&2WOEr(gNM+L%Rnkk zPjY~IqlI7f34*QP0ghHUS|bAG_hp)Ei)iia*%7fsVMHdI-3w^9yM&!K9N^$PY1S7+Je+M|I^iIR#IQ}<)G3G#k@5v|bc|W4KdH?_b M07*qoM6N<$g1AN$Z2$lO diff --git a/org.adempiere.ui.swing/src/org/compiere/images/SendMail24.gif b/org.adempiere.ui.swing/src/org/compiere/images/SendMail24.gif deleted file mode 100644 index 37f606e797e85b9f62e734a9e8e2378261d1e650..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 942 zcmV;f15x~mP)WFU8GbZ8({Xk{QrNlj4iWF>9@00R<9L_t(I%k7j~XjE4e zhQB$P$fOAqCzod4v?_HFEUmUx>qD{NB?>CFtp?_ymOd4t5Dlc7i{dGv=3>+G}6zy7_>{ujK4 zkAR2_eSX7V4qyQ7$GYG<3kU+EfD#}KlmnxI9Pm$YNOB3V9a!F)>LQ*<0uY}bq_WhY zwL)o)(HiY9rC!EbdpTNb=GHC%5kW)(BJ#P2Ji2=GzKor}UiO^5CC4wPW$gU*(%zAk zLKtI2DJ4oNaU4f%+ZL_0*tRX(o3@Argn-Y0Z(CDcRq;fUb@dB5+15kLuiflevy=rZ z_HyfP54LTS%jK|b8^>{QT^HANQA%Nq!Llq`E}S3i)px*-)>PNq@kEkUU)PenbPvZh zboC9e?L<3U6JM~n;UMjueHdeg9A9IMArJ@<3Wd0E?kw+3nTqSWSin~Y&)lqvCz7oF zW**JgyD`QL`%^nl-)4VfoF%Icar@p&a*V+kLnsuYx%o5`V==0#tI6eZ1b+V`BMVpV zW964~csig4$$q)>7Xa_a-W*oshoe7nrfE5o#@7t)9XoQE4?dhmq#{B|Nhuo|*Ae{r zMkjAY%h|f`M*xb0MJ)UDV*m_Zp+mr!p!Nws;TS~SzAeKf4NtP#YCe~!jT&KpY@T=W_j}XDdF-kk&1{X z$QUf34pt2IVN;9bW~2 zo%4FUc}vrC;5XnJ@DO+g^aH)XpTL0ci)vs_u%K8EK=RZTL@BU}@;9X$*bN-;N%boP z{|)RaoNfR!fG5CXKS=|{{*;sdJ2poQRz46B&!!_yY>dHm-H|8Gs~#!505F}9eL*kt Qwg3PC07*qoM6N<$f=WFU8GbZ8({Xk{QrNlj1+3MgYKATls8GayP~Yjt8ECu(VJ zZDC_4AX9W@X>Mh5Co}I@0005SNkl)(8U!C>$i_{ANvESF31eP4Xv7tiy=bzN~?SBx=YjFItpELv*;zFx7l)^a|d zugLcVPN$RX_xn%;>rzB1#b`A8$N{ZZD~hf6kEhd#a=HAFJe^K4#{3h|T7Ln)hZo6Y z5@QS^f`||V0V0C$`+o_RMGyp`?Vnb++XbN4>j7{)9+}VQ0EkGGDU3rQfKI0~vqEBs zMxzmZ3M)`bAtD%Kh{xk7r2y#n`%l(jFn9%Cwbo);7Q^9?)oMjPpQltRvE6R*eLt!| zM95~d;XZtey>F7^I24OTX0sVeDdO=sg+d`ZmlkfOAR-hB1tyaT?RFd6wsBpT#bOav zVB0o_!{PB5>-9R-YBlP7E|~=c< zHk%EJM1u8tO)M6RHa6V5D+`CiflMX?K&4V4l}gcUHc6#Y)M_=->GVyaOM&N?mzN*> cKb`^p0DMpp{`zwTlK=n!07*qoM6N<$f&;Gw9smFU diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Server24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Server24.gif deleted file mode 100644 index a0d7118d2b3ee09b902b02f25369aff80311477d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 878 zcmV-!1CjiRP)G7|s*06ug@ zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj1+3MgYKATls8GayP~Yjt8ECu(VJ zZDC_4AX9W@X>Mh5Co}I@00089Nkl`L+Js&rULA}*l|ILsJ!*Ct=>$UgZYOUq!>PoD&Vy%^azb{FWNRlKH$FcN!Ju$|J zF-G?G_C#wfz|Y^LYON)X2EMqftE=O{xYqhTfa5r< zudkO*ismV$h~pRl&+{m;<_$7J3CxoUo$s1 zM-T+u-ri!Z9dIuq%*@ObM_au*6_=Nn1VO;T!2wH4OL(4#@B0JIJUu-fekw$S`T2SF z_xIV_+M-sgkt7MNR%^gD`kUbXJ@}T&$-?J0%TRN${zsG@Am;X zK0an*VuFi{3#O;1xxc?>a&nUM^K&*fHb~R73jPi-PaQjeR|Jbji3n3uQ*=5VeBUQY z5`5pM-ENbnX=$LsasXRRUjZZ46h(xQkr9$4q1WqSt>y9Ykt9ioqUgEfEIDVu@p$pu ztk>%R)a&(fuash8VF9HSi;Iip{8o z5LGF~C@==p^1YjXFw2+ZnK_j#`}unUbb!x5%>Su>0mO8*sIxgpp#T5?07*qoM6N<$ Eg5e~Kj{pDw diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Setup16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Setup16.gif deleted file mode 100644 index 58f19c68b047fb2fddff951c60bb56bf03bd7191..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 964 zcmV;#13UbQP)Mh53JODVWnpw>WFU8GbZ8({Xk{Qr zNlj3Y*^6%g00R(7L_t(I%XO38Yg=^~$3MSwPLsAtn`TYYCTZF(TW5)|MYO{g6tSR_ zx`G!QDjh=@h|`;a7ybcK5CtzqLF`2th|CKu2!p|-IB;cXI%}s(yER#tmt$T|UQUv8 za?bI>RotMT+vnlK!}B~}as0%GuK_=>4~LS8hU0KulBMN~iwj>rS{DG1N@kvXj0^A1 z)9-duX|zaZRc>r#xt%Gl2_ep1TwGXxNO1bXS2MO{{^GJs@z(3l5{(5>?`KfFA?Wji zt`Z#?=K97iKdx?+5aOjhi2@+gy{cHIIDdAQez(PNXbfKFV zFP~b5HKkInd!BmXD5*??_*4|zd9WCuQ7v;k`8Yxd9LHfdSD@W$5f1to%-?+)I3Vfu zCeue^NZt_DMjN$mpm!|lx`EM95#nE+5Q355FzdIraQ7(m*2+F0qD123j@D?2aNj+= ziko6Hz~4PCx|U75+$Cw6bUFqDUJtsiGZ_t1Y#BI`R0obI-T_asWmqFq6QjgqVRo{+ ztfp%ixM&$3KE0H}EiBH@AEjQe^Xng5Ffc)ID^&z$B}JAl?UtJuwgSLJEXv#yL2|`1 zC9R3p5$sfKR8>XOG_2OFj>mBNP2T9mW zhPg$pWnWmxVos4jgp7a^{02+1-BvSs4N$9LMfDU32@n<&O&f{GI3j m*M9P$3HD?8!Bg(T$$tO~BVE)oqR18i0000eh}uxleqiy}2zAP&&iqCgwK z56xp93inAy``GlQ3u**43a5?jqEZ$#R;@UR5m<>7OQL1j7A1>XNY0Fg!)+!Hkp$I< zFK~hTa=!E9zX$&j0MDI%V;Fdsr<~5gz6sm5dw~W(6+%n{?*V_gbm3h3+iJx2<4L%? z!TV(_)zNog-(I@nAwq!$>KqE2W{JmZ8uuQqF*&h9b6y%09X5d@_G@sY~iVs`QPn1zPh(OA%ytRr3>d)wpsF%(6(f3 zarpF5^u%DCf~I2VDz;VS&ddYCiC!w@5>8pr6$HDyNj$QL8d7vAn?Lra@hdBD!R!ur zw+*LGA88!^ZVFY?II_QsmGuJAj(r4M!bp;WS=1249EMS(w>v?L&xOZbM@}zAGbZ)F zouAa-f>~)x@DM=vU>`3W>L%72V5qNy(GSN71Y1D}oDK!WA=Bs&l1hdd+MlAK-iyoS zA{uaTpfAoBhtK>#Z47=NK-mJH02u6x(b*nAk_7Mk=f4adK7kNm+h7BdkTBODFrHaP za`~a6b9|@|MUjd4CA#8!c-)p8_)J|J-d21(6xmbghy*bWop-LkPon=AHelIXU>jPtjO_~m?0_Z3DLI@9jkPRg+lg+J z$QFuh=w)=HjB1oH)HQ6|{=a!`4)|DH*`T$#5r-mkuls-p`02LCxIC_^UaTmZQKC^^ z!lyV`Tmw&2+c!4UYLrx)TFpY1cl2PICSB1G{}}s(?;L8OW9GIAxVOP?t82M4*>%+8N_ZQcwuY=Bb1b~3w$7?4CaOn%=RD--$M3b9PZ69~ikI^&@UDx^G=I69W z<1A0SrJw6*w9zE!(_gWQ;gye0es;%I4*HNid7@e3RTXL~! zR@f|-(TgQqmP%(!9r;3mf)Zwaah>@4SFR@KC%b_^E4x1U)B9ge-BBFMLATr4;CK4) zt*$Y8<2FDv_m$-r$NoCJ&Dsf}OnQ7a*xo<* z=&Kul$J6%1vMoD=+sDk(CM&v)wpqq7E10HRc!_qNa)^0PAcF-MOcV`AcCnvw@tSp6TV80qIG3Gav(zBVljh|2741de= zc=;e)6=%<$?F16QGe8nZSeDfzglH2&c(*5KWMsq!$Ye5Hym(Rk`ts$cZ8GNC+J2>+ zKYxC8OQ{EN0$v~lGy(3rckfCI3kv{ZX=#a>nHd6s09W69lXyICr&1{scnI7AJ_IHc zkX1%TMt0(2>x!*LV)yErpPwh4PLs`M$>nn7ayh1^rnq+Pn%ELl5BPybK>r$F20#B; SW(_6)0000$i6R diff --git a/org.adempiere.ui.swing/src/org/compiere/images/StepBack24.gif b/org.adempiere.ui.swing/src/org/compiere/images/StepBack24.gif deleted file mode 100644 index 2a5e703062ac0a26ebf405086d134437d7696ee2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1048 zcmV+z1n2vSP)Q;h903ad)KmeHkBX2|^a;vK9QxsW>#}lhWG{?-=-G+%M2Y?qqf|+OU z($@jx16UDNRV_Sp_}~?0b`sIjmlwyYiRf0gaw3uecz4zAY;ffoHJ8V~IlT!e1IXXI zx9+H(qgRc8b@^>UQDm8!okK%I4rX>LiY%vX0TBsA!%OwKcQ-B1W0=f0M_EdCJ|)FvRqKRr>42EpzwHKU*F0j4+jd5Hb0jc zFvmZJQa1R3?V;`4N*^qKx3RI&6AnjQwr!h& zuoj}cygc>s9aa4v(|oC?r`IYkuQZmH7SkC>U!L3TW&n^R831s9QIT4+dslbKL#5B2 z>^qq>^E{??YaXdo3eKEd0KlGowckctqN@!J`}KG{=9-`X8`)7(6a`{MWo43xAc+!) zh#uQkajC1T%YLGIr)wp4hZYwt2!a4XZ~y>;!5}(2jvJ!ra4s+31~Wr&IFL%E*1@4r zC@GW&0?BN}k}NrWzWapCxkwN|Bp`Fh=BDSNYnn3_k0BP1A+ef3GHGuB2ZO<+@Ms3S z<}nu+l{|H-|I{yo9}V7+BzeimHJ~agWLW_KoOt7P437-oltpE^!0UtIazodg&@_Fc z;xfPA1^_XAdG+=6vmd-S*mh%Xwy(9V<@VKUSAW-3J*8(oIQ_?;uf6zk>#r9teK9Lb zO5B-~3r*2BfH5_7y*Sbow&U>_N1DR+)YSE2W)_**Jvlj9)_UxP&pJBW=NGJnS!U*N ztQgm~oTwr)x`ZZ)tl!AKD5=e3LhSZ(q(i zzweyyob&sLbB>jOup+E0NzDE$A|fIH1b}nSIU}Ny>;*HNbA1_SclJ2LIgkGfsnce& z6-koBVzJl)5#44ENB(_v^>zEh;qX-=x|}6QWn%!8}v(XqL9^TsO=KT`h!fK^0f&t-0K1G=t*K$%ki zG8kznild~r=eTX(zF^(@4K-gpw&l@1j4?6ivt~_YS^o#8?M;o1dm5V>&Qw)ZZ2(XT z0N{WiEDo6rC%-x$7s@GQg&J3KjHE-YETvc5$$jM-w8;H(_5!W?S%ge8n z96Q$i;HKL37oT`)>ua)XW2sb!11>r$7i zKOBjEBryp@gg_vW7K)3Djm#bZX2}fMYKJJY*x=xYf9z`6dGpSlsojDg%o7o;78!YY zmh|Yg(VutheEy!ku(10;*TGkPK5vMKz(i^BDO6Q4CMPo;6-Ab~{K=)Mk&*M7yUg7= zeD?g6p`ju7jqkq&0L;$L{uT`Gb#U;{+JpO#R904o0mLm9iyHt0A(NoT<1rWjM4}Pt z+V#<2`cC#)oX*1cP8{z$rzlDozybhwC=@dH^mb2-jg8G!uU+?CTU*-?0HOdASfV$E zu_(dJ>n)E(qo4jXd~W#a8?V3F=l2I@0ce@Y1iW5vOp9yd<3EmneClNXfGo>V0I{4M zfZ=j^qgwncw6yMm#cKT>fI*z|B4kua&t_rZ@5tGc03rZV_$O=ttXV$}AVQpTwj^*l qn337gWtD9SaFTwJtjVg%6=aCXokI21)~9mK^!mx4G5j`|NYgS(rkOVuvAI4O}*sL@D5 zUT?|aXkli7aX_q`X+NwHimYrk&*ZqAx3 z1|BMmD;{?861m(FJkJ0iqO7cZU|;Pi1_5ZQ>aE8wSu*oyiTIugE}S_S`_jqqF38ff z9j2$JFlHMdtgWq+Ohh@F{LG}k&a>C6R#a0FAm({yEE@57U(d35{}DkDP^nZxtIf?F zB9%&U@9u3bX1*b+F(4Z0|J2@sL?VHzFf(&(FdpLZI9q?fsp)w=fNCfkmfyS$y$ksq zyD7pDoj#T4A6yV|!vVTWVS55qMMcP+JpO+Z6!JMl1Q9`1u+}m$ksb}u-zd^;ZvAMD zK7okqL8@P?G#d3CA%_72HRrm3R?E_;*C`gy58D)P*aX&YQ2Sm(M0)=9`Kw%>S{}Z_ z-Z7;aG)bp3q|+I)*~3`7fvRw0;aacRHyQ$Lis1v7=gySn zH0n71Btjr4xeIgQCMlI#aXhER{OgQ^dEs)t^YcBt_x%p{6I6JHhlf7`z5AADCnqN_AC@NyCw@QL z@+=O3WaIS<`iV2|rBt4-t`3AqA5}`Ru<#vC6OmLRHslDsn+G`8OVaO09srN_+3qOh zb1A6?_*>hfHMaMN*4D<7idI)6tpAu(CpYJ$0yKf8q;~JchrPD|dRFPyXZdXCQkyHZ z+rU?|lO1ypx7$NoTYFAJT6B6$Bw&5LLsYe#w{@Rc!bQk6J@<1Q$b*+>aX58q>~@X$ z%}#s|pI}4{#>bzsxVThOvC~Ml*zNYR`%0;TNd<7>{>;qGAyDY=_mKF zbM_ZBIXGVN=2EfS6#-HJj$p%rUuzp<=s;_*02$>V}$MzLaL|EsJnCjLO_y(=-W%)|q%c!L_D^^5AUQPCF!# zjR?)nExAK2`;rVJS_E}Fwks=cmERb9>?5AkDm52wwS3`}Em_`*H?t&0ud-?Fq&yeT z8g#2q9Cp7;^`WSh0#x`w2f2HN8$#1wqLimZ+Y;seMfpH%$*RV{Zd328U~p>ZK*Gq# z?JA%Kr~~Q&573Z_oj@Ge0ycmM@CVq;jIm&FN&@@?USWreIVMnR00000NkvXXu0mjf D-0Nc} diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Translate16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Translate16.gif deleted file mode 100644 index 5b9e46112df6f706919f44af8a22f42ea1e85c18..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 567 zcmV-70?7S|P)(R5*>5 zkxOe+Q51#0v(LG&+<0%Bkdg{UP$@X*q%%1u(Wid ze?h^=!2XA7?nIFIAX3{T+rc%4OZuP-7H6H!KI^Qrk6FAwzXy1n0GsPuW~iMp#$3Mj z_`t>+**ioBh1%0k9}0Un6fZVDju}kM*QrjXBuPRPMKl@>ILzQ6OtxCsL60ub1=3b) ztmjCB&dN$5L3&(*x#%sb`k${}=c^bQH5pjAcSiw4%)SG7c=IBc&Rd?XzTw>23uIYF zyWJ+sGCG|OaU2sx5kU~(2LaYvJO`)GOy|~L*Vg#fY##NRLm>cD%gfAeZv)^-k-mU$ za|RXyQ9@Bdr=uCXpP2!`zjlR3VTmsYZG;TrJ3>W;RE0!^GL{HSxm4yk;8ay#UcZ_f z04`0B&ut7rtpXFX;Hm2!3ag#oVb758T@(;KJOI2abSh&?K0ijK7)22 z&HBVY`c$iZCeobAsUC63kWN+M$qrIXW-yWhf-!cCc?=82VZGXDh(o9X45&;uaq%xI z^`Gqi*`*YDgrP?mSbX2&`+{mOzf|*60Nh<#P)-Eh{|j+xfjKw=zB>Q_002ovPDHLk FV1lon^AZ36 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Translate24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Translate24.gif deleted file mode 100644 index 38b36b48c3fb3c52a90e74df3e08fd536bbf6b27..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1210 zcmV;r1V#IaP)b zmCJ9`RTRfR_wk$GJbuGGTA{Q&(o){VBBn@`jX;PoF~p#is2g@_VvHdM6SpL8)xQ9C zNLXv)0x>2;c?n5P8Ys|o3bpBDX4=kgW`2)*UCdCyQsTywoZQv@oO8bCoO^|}mjA=V zyYC&}47`>|Bo0ZbUJt{dTPanQQqEXwABJIg+ZZzfi~{%D_td|$LLN@+n@DW&oKS_UWr zm8ZZ`N|o#A(Ldc?}rGCMFUz!vt$Pt0Y~6BSW+>M1iCcC5Vhn2w~@jPaGHR(KSNI7P$ZJP2y{p(0li? zxNASo>^LL$LbT)HIN&%iJKv-kG^y8W)P0}2-#Re?Qae&gjC6(!E`1TA^%2joL(!$8%$X5L;o9DVjmoMXuj}wiJp^YKydDMKL&M0DokTkXC zfwk2CQ@A$RKX(pu_AG^t4(hoaZnwuLnK^dco21JvkS!KTIFh-b!6Owh?pbb0!Ig&P zjDIT2dHe%;%>* zYbd2ImCNPd!XT^Yg7C3L`y4IU1c4zgLyIoicKFDu+ak5d$WYo3)s-7`06_Ns=`yl zYOOV%mx)>%q>;KC>GUF;t)Mo7>;#c|I+74%dtC}cN%99=l$UR1yqZ>VEO=Bo!rZvS ze5D?($<3;s^?A|RF^HE25lur>!UW?83s?{cgnSOTTnQ2%ogQmwWkzbgy;bvrY1h>o zyo@^tvR6u--m|+i+_$HY>hB#Cne;wlB4Qg6&4sIiYsT>L*x17#uKs?#0VLa=qBYfS zv7=ZV9qoPbmtTv6`Fv_fAhJT(Cc-uZw(cld7SH=kg%Fa~GoS$nNVMH)6;JpKkFB-l YZ&qs7TmPw4dH?_b07*qoM6N<$g8rgETL1t6 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Underline16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Underline16.gif deleted file mode 100644 index 0c487210023af031a2867c5418ac8f66a74dd964..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 673 zcmV;S0$%-zP)*hRD* zDilHN6y!03Aylvq8mY0^Xm*&-*;Q4?~%1?s{qC zoNW>*4FEW2MIu!b8t=@MX0>tvW9YtdseyO3_y7RofiQnRAL|D2s%9j$AAC2 zX*&E}0YIaxhCO~UT_{SjhQ>Q-Z=RO|B;_@ivs&m!O_&TWsL9}h0_QlPTLejYwKRVK z&;*{|x#AJCkqsy%SCo<~bCEdCyB$Ikc=k`g*D+Ra(wNs>cO0*S5t+{y`ttcg-%Kbb z^=ci4QS|yc#_InHaNyDH%jeja)imNiG9XD)Bxx#<%wjXO1E<5zpzyFP;B6ltv~%#PWKQjDpeY zx%<2q0E&iz%vM&~9d*KDu_E^?+Xmp(K0t6b>^W1%m*U%KzUUJcvp}U;!x6K9ZmmF- zRTHyc(^x-ND{|TF@IJuR>i3x{xK6@~cOO2>WFjfb9av?RO`dG<3I(ORTK&G*n+M_D zQ)L)(IGti~HHGA60z_n94)hoHHlJ=8H08F^+s5xaY<7o8ZmbOfxXE|-r>1Bmin*DO zP(%Zz%>b|*=r2I2!B}`6Ki9rN5jEj|6gzcmKph6)hn?ULm)G+yCUZW`00000NkvXX Hu0mjf71A&2 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Undo16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Undo16.gif deleted file mode 100644 index 40b970b26579599c54cee347da8fc88e120063fc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 649 zcmV;40(Sk0P)_Q zAIS2@V8*Jq4A#=OFHQ%- z98)?#fDZTYT#ZsY&h*>5ua-oNf86XF%KBeQ2F75lBFmE}cJ7ta&8OGmQevBCbH#m1H(QRmv;f!zgQ0t{t+hm4hk zh2s?7z40sasu8rd$F*%Mk%({d^Lvw7(SxC^@4T9`lBM`cMLH_e_1z79r#SCS*TrCG zKZelSuINEI`BC)WnwWb^o1Kt_rnAkuFz;S2#g@26)zzI(KVzc{}LoccNAO;7Hg4Jk*iawr?xJy!4#@(!81#T7X6X j;T1=LvF-uhmxjLpfVtQgd>IM200000NkvXXu0mjfbTc&a diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Undo24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Undo24.gif deleted file mode 100644 index 53561163ed617121aed7a660b354ece4a68f65e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 999 zcmV}7&XeH0n)zd-CM3{T1MG{ zANSsK4xjV;eb4WEfi1?3Yw@wv1O&D*=w=JwT<$%r=npSpn}co!4bkk>&}*;ase#v_ zBmICizilwv3~Goz$ZQ9Idq_<{Gz{F<4gA^QD3=Ngd|66@rq_3R7s&18xjtzZHG-(K!LyvvqBHxmF1fOt`>EMRr{ z&c=&jKsX#jIyw70w{YwAag4VGw`yEiYNA}up+BJkQUm~?>vdEsdFYiQ2qOUTAvYgJ zedVvaFOT8HO~DR4$R14{I1)uBlYypbNKekJub0J6M4~;SvnxlK?8m<)35Cqk>MLW7 z(3X8XdNTWK(F`0(PtHKowDtKzCqNFJ04c6{kCs+fmh07SVVM>rNr%DNt|v0c=*jHO z`Fiw?^yCb{;_iL)y;CdK^F{K0E?0u$>lCub5+2ETBIi*6^xY2@e|cDryqW&#XSb0U z0Cw!dOMM{hJylnY9lz?cffWw8@ycvT)uB0CMSk z=cwOLB280Xm|x`KYN>GzzzzU)8!7+@*3x>dhsdrfB)=alF`%B+61Du-UrozP1@Xy8 zU*LNH%41i-aNtr4l)8UR_M8NOBob7;@_FE5pi5tynyy$2v;5r0Um|Ij??4?X1ZmNj zxipq!8Ep8V5*XemMLSd;^eWb1wPw=OpNR>(WXq1G9j5)w9gT79sE7D`!lUbq+`rGc zWpM%l>z!dk4F-Am!JIMo&jZ}Pa21biDD3RG>i|dN4gE*jXiZw|?>vPoxclM&;6Lri VYLSa67rX!f002ovPDHLkV1f>q(TxBA diff --git a/org.adempiere.ui.swing/src/org/compiere/images/VPreference16.gif b/org.adempiere.ui.swing/src/org/compiere/images/VPreference16.gif deleted file mode 100644 index fbea772caec3b4f9120bc7ece1a7057f32bc2ebe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 757 zcmVbY*F7WpWA%Lvm$dbY)~9cWHEJAXI2&AV*0}P>|V+ZvX%SQ%OWYR5;6R zkj+a}VHm}K@B7|QXB=lno$+JP6e9z5r)UPXXd$_3(LyqU{)&Q%D9BZ9+O_Bd`wJ?9 zc5Niu^+n>4W~OGM_?6B$_rCXS5tiva%frL(Ip+utXz;?FnT0jcM!cTRzPx&IzhND` zSXdKn!>2k;L#|fnFrX4f>{K+L=Qb%$PLBfdfPs;*_e&e5$6zS5w21q6?-6JN2*7Y| zWR&709638?x(j0B`GYGb0puQFy<~bu&YvNj@R(ZMq_4jZCs~hEoui|>mld6)wY`>EpQ;>sw_CT>}ga522)FVXe&T4@=m#VmC0vR>)LA%C~6Br%@8- zmpAw}@s^rko0Y;bT-QS=NqMLIAK-6=e9GXM3P(E%{QO#^usTC_c^3D_cN$jbn46lS zA(x?4D#a&gO2hF&HMR)IXL^}__5xd!5S~P?F4BMEG(n|IAS?vtFd*eaW5y+_xTHOp z@k6{?8xcu%1A{9yLPj`JV5yh{Qh==>A2LYuDRKf^@K?;GeB#vXDtq3PFG-f?Q z9Z{1>(_SC5!B!b|D;lj0LJ6dhShj`G8cS(>M`4VlKJ8JPh^bHtKqJZJ^Z2gw$J~1) zpsp^9j$GdzRlmsPh(luGaFktJ~GLN1-WZzz|_{WZwymj-oE`FKW naXr^=YiYKx-MDT6`rzSj;egEtd1;)W diff --git a/org.adempiere.ui.swing/src/org/compiere/images/VPreference24.gif b/org.adempiere.ui.swing/src/org/compiere/images/VPreference24.gif deleted file mode 100644 index 7b5f0ba237781b4cf4341e19675dc3793bd458b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 953 zcmV;q14jIbP)7%Q7>1vn-SyhB zT@pDoisELYK-A&{P>5O@KowjNqHw6hrAjI!4*Uv^6%FDTQi|Zht)i*|RVBplDNqnq z6j33=p{WHWlnM-Ls1p)_9ouW~dUiO(cI?JM$tSH=v$Nkb@4Vl9qp^eNdwl8xV0??| zbLp8A$7%zEoyGXWqkDh5Bi`93D;{per|3$4`g2YG`t$X1pbplysq`E$2JqamM|t<{ zckraDrYnvd9p|grD*&`v`oz`Gj!%hgDjj?3$Rk8U77L3x4jeo{AaXl_=x*-3dp|2O zg57WP%+rS{mgO6ptT=gUvaYN-d~%kB&;={m687LIuOEI4T?iKcDKVSMV46B*PqCH9 zWA_XVd;R_Wh7ba!6o9()T~d&lAsXpKLnEEZlKwVHN2S2(p1oLB5KR}9ilt`on{Q1` zD&BO@b7Dam9qT)XxQy?f$#o>x!2EvQ4VjciF$a@H-dbXt2n zI5Z&64MNj%Vi0MLY$eN=Kb^MDHe;g zg~OD~WrPqr2UjW;%H=YnqYv`Mg$s1FN7xk&@%6=v+_f)(>$>>9zme##KU;;-2(BgP z3wb&^+5zx9ugTl(#wPH3Ax%1CF;E~?YhP8ZQm&*u5(L0B1pj*p8A1?hi=vcI(W$fq zOW#M+GzDn0mr{*gIuB?q!I}`5hJo~bbX~Os+XHa`?Z^2v>6sHx0)GKFfPc4CEQG)? z3^ZS&3%P0j_nQmP0;d7;rOYI7y$Z|&6+ksLNOyNPhOv3ASS&^$5U3xwZ!UlS5tsR- zW_K0l0v_Pk6)UCY&YV4cXk!tRSgaGzb6LwTad!H>4F`SyOJJ=E)T(c4z*ZN%4(tMU zpFB0Wko;lZ35UbxP-4J%_4sT1fxm%Opm-~!Wu00yj0spkpg~CmC^v3(r{G(^H*Qt! bq(S}z$qrClV2niT00000NkvXXu0mjfqeQNI diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Warn32.gif b/org.adempiere.ui.swing/src/org/compiere/images/Warn32.gif deleted file mode 100644 index a05e160c2070e197599c5fd98b45958af0da4910..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1377 zcmV-n1)lneP)6jv0-e|KhfXTN5%4RO;f>*i~TCP>z(RfwO(fCWQog*+6~q9~DAK}`&$ zR_M3%p%0~fkP3Fdmp)bS$>K*|5+YG!@Z%v-G{&YXnyA5KGjVt4_95AA%t~7mV=45& zpW&W+&;9@BoHKW3;D7sDle2NeU=0t!A z^MYk%O^(~Qk>lgInwk)*3PRv+X+b8Fi2i=^OG+9{D0%4ugre*(ip7lh#fxZ*7vo&N ze!?#V&gyC$t5#w4^f14))TyZI7cW(S36a;!%NxbDYsh30cXKmBQ4m5P#KckJZD|21 zv9Dhz6pg-TLgh;nplI5sh2`aX{K^%y>S`P-R}zoMX>D!g%$YNcjg6tjV(1$-@U*Xw zP$;Bm4#&Zla#ovAe!8kEd3E7Jc>(0LW5?vpn>S^9d%FZAAUirbWPg9Zym|Vxyr3xZ zQbB=it*DSDte$lSG+qBPTwJVLy}g-^7eZhdMrMuA=R*jAR#t{<(jZ zF=r#dgg3&m*rr5x_e8fhH)m?@^ZA|;kZwq$xf$VflIZCn9F0~3Z_ikO)8jc9Dku=+ zeSJ7&+6N27~yvZ^s@PAz<5h4dZij;=3Wso|~F?;N56-brTmaB2y`hLx)fd zBa0{!iLh?nI-=2N)|?)TF?#eUsRs}6mXrhr@82Ih4xN9S0TWbjZthpP4hPA>L0t9q zs09U?yH67g4-a$r@L`S|Il_}CPo61_5CSz2z`tu3wq@b7Ec`h+pO|3$lM=jNv~+1j zyt5PG_2S;SGm9LcyStmSXV22!-cDCnSJoOK1pbBw)L@XOw{9^%9G(X>|78hG(EY*S zFOj^wfYsB3r?C;erY4JA2tg)js!KOm z){)~d`rL0q6Lwd=_11TytqtjLklWUV;`e8fPsj88X&;FMzb#)*a$o?;%DCFw`~4Ov zcW0I05O@Ol`TM;iBiN&(xa;a>O)i8$(RFgRYysQG@#qn`fxwO*VSZKyet#P3|egZ>K3(G>LQefLiDZ#d3@|qsY zDL$mkjGysOi?`89%v+ z6o0~2z!o4UuPH@JTSysC!OvIK6dpuP@0~}M3_9>G{$ERP-Hjo06Kw=7#ldxy| jXC$Uzdc2&5|Azemil@Gh0_=Kr00000NkvXXu0mjflYoJh diff --git a/org.adempiere.ui.swing/src/org/compiere/images/WinSize16.gif b/org.adempiere.ui.swing/src/org/compiere/images/WinSize16.gif deleted file mode 100644 index c3a2b8d2e326c1c7151cff69bba47dd930e85997..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 772 zcmV+f1N;1mP)uNu@a`xcqJ5=-Wt8d~_hjsB#Vs_CZ zod~yHIJJ|z&n9twuq}m%qNBNyPv4gj5iC)3wj>!E9z)e=*9V{XUAj4BpEjX`Vk2XJF>1b~uXMnou-4cG3xrvGF&F-O?ak|dvVDV2OI5sU_7RsgnVH#&!U zJG)j#Ls$eft#;U&Y2x<7agOx1lgky@wKa_>g;)x0G{zXLdi3HurWcmn&FQ8!hnKy8 za$qP22Coc17IK_D)n0|bFaYh52G1x5$>et=Cy8UU^?<=@^PdU4(8atNcPvSBdB2*wC# z0R_tP#SRsf<#@Fq)m((C?Nr}tMO#(J1}Fgq!2Jzrb^O&Ty0J?D0000ZVZ7K z#4v&j|CF&Pp~hH+y09S8U=h*Q5-6e|x==D$1j(OHQqfu`lWCueci$wFzC@|`;PC$3 zd%ydg^L^(&_@6Fib{q=Un=m(iKvx5t02m$Yp#5RV9%$3?TKh z@_yU>{5xPX@#8NG^yMcQ>F;LX@D~8IiZ?pg1Hh)1jTEOZ@YUBp zF}$~v?2cC$d46Z?!ikgL(Y^i7*s*;>WA&~`1Qn`E`sXEn9e;-Qz9Xb=Y(fY#Fogm? z(7Bo8C#NtICaaA-(sdX6hQ>&&v{MiS1CoZ@a{1tmp{w9SL$663i482N~u&6+xCod`mM)Um_HwanlLAxdbpzo=p+wpSK1BW z=Z~MO_o9h(x`}(9e1}tS?q+`ew-7*3I5vrMq331GW%_GzX??~Q%axFwiA<)6&b?!N zd3YD4(s@kAfrmOUjG5W_+C0TI$Xbk}bel6N?%V$^pBElw?%V=}4xa_}G cfu$(^2E!fjHKHIz)&Kwi07*qoM6N<$f)^>IMgRZ+ diff --git a/org.adempiere.ui.swing/src/org/compiere/images/WorkFlow16.gif b/org.adempiere.ui.swing/src/org/compiere/images/WorkFlow16.gif deleted file mode 100644 index 92224cea7f2ecfaf0dff2dbcd4cdb49443ac1d1d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#8mpj)p|Mv;J5UoNm#2$kh{fsTm_r9X%xC28NK8mbQDDx|N2_q4|x%pfQGXQYHVz5ZT|1?A7-6! zbGhHVG#)O#gezCCmeqWEl4&0&-r?n80K^HU%T~>L#V8?tSJa0G2-@TKI2=5&V9^?> ze2GUqnKOKWCLZWmy5IqW+l+%Oi?u9O4?g_#boKAVn%LM}_Y{3WZkaP@eE%C87+5^$ z4%)L|@oLfRDuoxUtn16xXnsAo&C3nw3^uW(9Dc5^4!#Mi%M+F{J3Y9taWzkSU+mGj z6FxMy_s1uu3cqCqsjG|(T=U39vf$eh%Q;01u6tAG@F#qX0tOU=r>mdKI;Vst02$ed AumAu6 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/WorkFlow24.gif b/org.adempiere.ui.swing/src/org/compiere/images/WorkFlow24.gif deleted file mode 100644 index 7879b2f6f9638efc9edc1e021acdb02669a74009..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 714 zcmV;*0yX`KP)8$CqFhQ3x z01QpTGEKymLobR5>vejO0brRXCx?eIG_B?E{n{F3X{y7g&%|R(JF`kdn{UDnhjO#qU~eTf+T&4-^m-O9iQ-2Jb|J1LhN zeD3?ffa5rqns6b+&uq5;PBNK%wK-Pn2At0ieS~<%bG<30)Hf;RlIM936N$vre12%9 z<#s(hsthnPcKp~yrPRjT`GqOq6A-p-w_VBu-T_w{4<`b)bx2ngA3Aem5}51|QvUkv z>djs%9!;gp@%;XMXj*GcKh|xkRi}3=GMPS(j*X(?7$p@#2$D&I`PU!z25xF)bsf9n zkTMe-9y!=~R_sPmU1C=@aNU3)sG*d?t~dl?v^TI)3daf1bwRq%MAtPuKO~CkdjrQY wNTsmSDXets{+_^rAF#Z%%$7k&7_?5pKYT;)=ScJHO#lD@07*qoM6N<$f>;GU-2eap diff --git a/org.adempiere.ui.swing/src/org/compiere/images/WorkFlow_16.gif b/org.adempiere.ui.swing/src/org/compiere/images/WorkFlow_16.gif deleted file mode 100644 index 92224cea7f2ecfaf0dff2dbcd4cdb49443ac1d1d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#8mpj)p|Mv;J5UoNm#2$kh{fsTm_r9X%xC28NK8mbQDDx|N2_q4|x%pfQGXQYHVz5ZT|1?A7-6! zbGhHVG#)O#gezCCmeqWEl4&0&-r?n80K^HU%T~>L#V8?tSJa0G2-@TKI2=5&V9^?> ze2GUqnKOKWCLZWmy5IqW+l+%Oi?u9O4?g_#boKAVn%LM}_Y{3WZkaP@eE%C87+5^$ z4%)L|@oLfRDuoxUtn16xXnsAo&C3nw3^uW(9Dc5^4!#Mi%M+F{J3Y9taWzkSU+mGj z6FxMy_s1uu3cqCqsjG|(T=U39vf$eh%Q;01u6tAG@F#qX0tOU=r>mdKI;Vst02$ed AumAu6 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/WorkFlow_24.gif b/org.adempiere.ui.swing/src/org/compiere/images/WorkFlow_24.gif deleted file mode 100644 index 7879b2f6f9638efc9edc1e021acdb02669a74009..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 714 zcmV;*0yX`KP)8$CqFhQ3x z01QpTGEKymLobR5>vejO0brRXCx?eIG_B?E{n{F3X{y7g&%|R(JF`kdn{UDnhjO#qU~eTf+T&4-^m-O9iQ-2Jb|J1LhN zeD3?ffa5rqns6b+&uq5;PBNK%wK-Pn2At0ieS~<%bG<30)Hf;RlIM936N$vre12%9 z<#s(hsthnPcKp~yrPRjT`GqOq6A-p-w_VBu-T_w{4<`b)bx2ngA3Aem5}51|QvUkv z>djs%9!;gp@%;XMXj*GcKh|xkRi}3=GMPS(j*X(?7$p@#2$D&I`PU!z25xF)bsf9n zkTMe-9y!=~R_sPmU1C=@aNU3)sG*d?t~dl?v^TI)3daf1bwRq%MAtPuKO~CkdjrQY wNTsmSDXets{+_^rAF#Z%%$7k&7_?5pKYT;)=ScJHO#lD@07*qoM6N<$f>;GU-2eap diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Zoom16.gif b/org.adempiere.ui.swing/src/org/compiere/images/Zoom16.gif deleted file mode 100644 index d072d3cbe2dadb1494f77e950952123813613677..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 617 zcmV-v0+#)WP)4+SOttuFuo0rp8m zK~y-)osvy!6Hyq2pF7DUO`2wgN>U06wOwc$MHIn>xD*Oicj6|$z;CJaABeUjK|~aE zS$9RDeGK5zq#vnP18H_P9en3BbiKg914X(U4?fX zv=3%78D?M10+5(X0MN8+cL(3TuaZiqIeKc0ZN-aeE4XBZ)ck8EZr_Z=qW7OQ{wVDZ zG+iT=PIKtw7@rGX1_uI+90*bpKD5zs{F**C6zm9u?EJ zQ5_2JmL<2Flg761XDbP7v)0}Ku5Shi%_G^x}q%2kVgpPOH0wIvBfN{N(qOE7M? z3xuFtwW!u4n_D&9s)POg9;6U0U2p=nX__rgY-58pql(|7qW8J5Es5XbtmWcc6+03YVxryf3dbXat2*wyQorvicCWHaaM z^${Ko^E;cZ_ht1ff`3FT9+eG|{}KR{SUhS0lnsNw28{O8e>3MU00000NkvXXu0mjf D_c;L2 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/Zoom24.gif b/org.adempiere.ui.swing/src/org/compiere/images/Zoom24.gif deleted file mode 100644 index 4f078cb6eab83506f780a858b253ff7215e0c65d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1090 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 V{{#N}5x4dNfSt7ywhj|`<9~u|Kji=b diff --git a/org.adempiere.ui.swing/src/org/compiere/images/iD16.gif b/org.adempiere.ui.swing/src/org/compiere/images/iD16.gif deleted file mode 100644 index e626d5704a81d7f38b0f6612ec7f3812e80a3bef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 800 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 KMNUMnLSTZ(JO>p3 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/iDempiereHR.png b/org.adempiere.ui.swing/src/org/compiere/images/iDempiereHR.png deleted file mode 100644 index 76071a46dd82c93936de903692b9e091b5a31fc1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8345 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 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/mDocAction.png b/org.adempiere.ui.swing/src/org/compiere/images/mDocAction.png deleted file mode 100644 index 2420d2351ef3e9b7ed97dab566082cecb3294e17..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 606 zcmV-k0-^nhP)EfuU_49k?d%xC z3*g|>45~9&2A)3Iy&aGlMMU^{m7rR2kfbHFpFP0&JOz|+d9_^iy$BEyl*?r>GkQlu z{D=$|NrdMw9^y-X2I2rGC&!4QxTttl0TF?Su)nv1pek_70X`fK;ny0NPiJ`hW*s8;tGk z^}ACL5g2owcO1t^k_5i*UbnlrNlz=((u5&q*50Z?WZV~jAfjK|~o4M3;Uc?7`r`+YkY4A$Z}Zlr0t sp{g}zJ~zfpUDutoTCLD^-9>iqHw(zxF3*I7IRF3v07*qoM6N<$f&rNa9{>OV diff --git a/org.adempiere.ui.swing/src/org/compiere/images/mOpen.gif b/org.adempiere.ui.swing/src/org/compiere/images/mOpen.gif deleted file mode 100755 index 1e074cd024aeaa1f774c335ad66fcf8187d5e587..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 523 zcmV+m0`&cfP)cVPQ;zF0Y6Y-;<5;ZC2-aEN-Ul%u85)#z*FfcH~`@T9H@$2A2@QE^U{K zOU+5f<~ZY!b4>9sJdaqU|7ecRED(i4_ZM({dP3`~*KF>d7ly8JK diff --git a/org.adempiere.ui.swing/src/org/compiere/images/mProcess.png b/org.adempiere.ui.swing/src/org/compiere/images/mProcess.png deleted file mode 100644 index d90ab661cbb29366ea77d3e8fb95841f1ee876c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 588 zcmV-S0<-;zP)WFU8GbZ8({Xk{QrNlj4iWF>9@00FQ`L_t(I%f*wyN*hrW zhQC;`PLh_6(FAQJr7#kZfPx4E#iGza=`xl&PtX@Ar1Sx#d6AAGt=aAYaO?!s%x>`Mz@cV#gU@{dK(pP8 z#v3v*G%TN$PzxDqW;gi$^~4bFQGMcmZY?>x_c-+2*wv2(<2J_t+h+ zs5rlI{^p#SO2-|aiODDi-jZP}W|aE1)~BmOR3$EA(Vi@w>U%ZDa$9qM8}c0HKK>=@ z`d4d)YqwsmShMx=n<-}wTJ%-CXPi)?Z+d)E$Kx3$zTq0>%B>G-<`ESK<06 zKLv;!Rde(>`RU=L2g~Ovo%n1M@bQ?*+>S*Vvl$k=|9v$za@qmb9gNTaiaD`NnxMxo zp5*#q&TW}{<`>WDw{ULpSLj^#x@qe3m+d`GEQ*uw+Md|dvtPsTSdE!)vF)Ukp32Aj azp#b`#_#;I)BX+6mkge+elF{r5}E*#afeO- diff --git a/org.adempiere.ui.swing/src/org/compiere/images/mSetVariable.png b/org.adempiere.ui.swing/src/org/compiere/images/mSetVariable.png deleted file mode 100644 index f85b1c78bbb42354c5d020c4b0d75197e8ec3611..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 625 zcmV-%0*?KOP)N~kBCX;kSfS7%7$mg_Hl=jz>L3pJ z3!Gfein_Qsw3AgF6$?2!b+Cgt#G%-wZ4xfM=g?9WZLNY29z5QA-|zbj5B_HaFc`qa ze--E6jgIcT9~s#T;M{S0`nW-EXy~5RXk=22hMg-E?*ElR02i``ao3obATc#X7H&UQ zYVg$ftHt88Fqe~$YiqI@hEmVvoPk#E7fXMK5cABy|-6h_xHa&k>IIiUG8ePZzN}C(5{Q?x;T!5 z&Sc2U&*Qb*SD&X+*MDme0KJ7mP3`VtO;4kg!f_m2*F|fMQ>lqr!6C z39s3_Vpppe=`>nv1_lQ3eIKngI+em(T*PZOhwXH_{F6ZdI^Wk{`R)I!{9K^%h!h#+wcag2z3@5eC$eAaqta%=030(bV%h2hY28u`Ad8QJ7c2SM=Jeb00000 LNkvXXu0mjfrH~it diff --git a/org.adempiere.ui.swing/src/org/compiere/images/mUserChoice.png b/org.adempiere.ui.swing/src/org/compiere/images/mUserChoice.png deleted file mode 100644 index c890426e0528c068995e96c2a23f1a875a822677..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 648 zcmV;30(bq1P)&B9OEw=s_=1!D0y}n`X1!@lcJ3N!yDLhMD30-;cQr@IR}%fbr@g zE*_MjevR59h9Zf{ceLk7Tkkg$$rt$4E64f)`pLv2t@AbLcfV=+aD1&_t|zdugt#7% z78@heXq>(YeSqd_OE`CAz&K?-R-A3MX|BRHbCCDyYH0Y(+L3_T9qEFud9%&YS$Jv) zLN#EISulL=bnPy`dMFT%CD*z0U4C1SBb&`4lgZ%CRuqzG%i*Ds!hyiXvYH9{I@cQG z3)rz;lu9M!^Le~{T}JEtDs;7dW%HhTy(dtyfWg?<6V~~`TW4=$W@ZLL2o#G&tgNh{ zle9pbOUELSLdE(s*F7j&;6_m1O*JQSAXx(upA2O3EO?Kn(C?Nw@(SyM_uoAfvt060ZOV iI^?7M?*Dqmzx5LlT&3rvAZ?TY0000?qQ@-!qMM<5pp5dB+VK1wQhN zL|Y%-{z3NAZziGp4iSl|Yo~}Xo)%!bwy1x?+@05x%FJiqRn5sWjX5```ki_5B$Iut zZ6&LBcVAxpe5v20W4E?WGP$;EF>65Rw{`5=?)Cd^wtUlV=t!?lFJIc&vE`fZq+?Yz zC2d|F-+zBUTw=CRd-8+>+)7PMmv6Rwo_yMG`~7?I?W)Wl=QUlh^3idamTK|b;MfK| zVeSWeAI#Mj?$DawZ@x4laE0vx@%T!&mda-uA)#t+jLa*7WEg$cZ#U@pCAN91{XE z)7O>#8mpj)p|Mv;J5UoNm#2$kh{fsTm_r9X%xC28NK8mbQDDx|N2_q4|x%pfQGXQYHVz5ZT|1?A7-6! zbGhHVG#)O#gezCCmeqWEl4&0&-r?n80K^HU%T~>L#V8?tSJa0G2-@TKI2=5&V9^?> ze2GUqnKOKWCLZWmy5IqW+l+%Oi?u9O4?g_#boKAVn%LM}_Y{3WZkaP@eE%C87+5^$ z4%)L|@oLfRDuoxUtn16xXnsAo&C3nw3^uW(9Dc5^4!#Mi%M+F{J3Y9taWzkSU+mGj z6FxMy_s1uu3cqCqsjG|(T=U39vf$eh%Q;01u6tAG@F#qX0tOU=r>mdKI;Vst02$ed AumAu6 diff --git a/org.adempiere.ui.swing/src/org/compiere/images/mWorkbench.png b/org.adempiere.ui.swing/src/org/compiere/images/mWorkbench.png deleted file mode 100644 index 437522777b1c198d5b7880e7dace037b83f918fa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 765 zcmVe`7IhHDfAjzEZmCdSq}AHi5Xwgk5lQfacxa47gV9Tk2?^m~O5%Zo#-j(r z1rid@52}-Q_ubu@@$j~_;MF9Z|d?d z1KypQ;nQ_Y*aSWeT$+6TY>bIO`ztixLvxKR{=&$fBk9D`ZwKH~ztJXwxmhMaE>6C1 zhR622A$Wu9T_D3f!3;u77~A)H`s6dG6!^H0S)V}U?7+6MFudzEwD%isCFUurJ+!T; zyUR!nNIFjE@$E4k9CqOS4T2Do>D|wMAoc1`Xj`DoBHHA%O+ni%qium{O;g>X?cHT` z-_aE01V92{raQAohH2`X#MnifZ$ZGl!L7oyV5qZ;GQUP${!UC%fxd)f?HJ-#(RA<7 zO2n+dbp=6i4AlawmvFBzYjA4-5C0Ol(ybO)S-gr_!O+Mw?mbkOu{Nh|mbicaZ#vr} zZi>5YoIY7kVzQHJbpZ*Ha_I)$avoW;iR08grS3Uy%E4ERdkgZQ54P@ji6{17z^$ci zb4!{{b`E{z|23sFJ%IN-Swsj7H zKyURA+(p6rGtSNOHSp?lZ{4EIuOMLnkqikL64JFk0Wh*Hhxp<0UVtyBW;nj_3v-`m zKVtRak;#*cA9#jEB<5wG8q|kKzxu40~2=-^YQ~-cX;OHA7Wy#1^_3P B3=RMQ diff --git a/org.adempiere.ui.swing/src/org/compiere/images/wfBack24.gif b/org.adempiere.ui.swing/src/org/compiere/images/wfBack24.gif deleted file mode 100644 index 93be3d1ee6b90843d7df0f517733f63ce72f4611..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 955 zcmV;s14R6ZP)b zl}%_|RTze!@0@e*&7V^HBN&Y|1&xTHg2tGcEZQg$sloamid{(QrYma`p)R6`8xe$x zE=)JAVs%lCB0?>;8x67IczQ|E_9Y~NZ8{U=yn5|bNt zZ{FN-`>T5f542e0(zO_A*m+=BT65yYyKmi^zpwkzroe@3VKxTmpO<#Qo$9}PN9Ubg z_Xgiie@@TlL5!nPUT}-K{lP!##V{MR`u1A(tAcYQ;T_gAofzD<^P1~6-C!rCJ_VE{ zO?Y9~Tg^rcf*`V-pKddeGBNcDMl99@d@*?#BMu`5 zYb=66M96P>ym1t{;b7mot2ey7qkmV+`Nb)IK6?gh0-Om*H6=|GtZ^8z_|#xB$4MHa zD6$$jKjIFyZ|rzxApcm)!!tZo00$ zhq5n{niALwE`qSx617;GS}jp)^&B)CQmI@XtfQKK{hHtR*X)JiW5*8{*M}YSbUs87 z1lYjfLPHRlDtrlQago7TL4k#H%e?#y8Bg9ja)0mkw!Y3Mr7-(3 zYAQUqh^+o!nj9Hs){H z=}ylcLsNMD&@1I~F^*P_E-*KL76XJLlGGgAOs=NizD)j@|COP{pFB8!alR|pGZbnf z#AOW%WB!5iMHYZ^rc$=oSgzquXnvZ7!rRH-LgDnu&rXb&7mKAv<@GDAIZiV9I`7ewn;fJhF#0jl@vQT*g_QU!iIgs_I1~i>lhOu8{-W_eYbl%HYh8>o&{o zBxWuf-PgfmU=b*(s!IKhkt#g^qHK3{6G$e_R6k`ID61~NDss8UR75P*@7&g@Hcf4! d1W0rh$lr11Sh~C<&aD6d002ovPDHLkV1hiw#cluq diff --git a/org.adempiere.ui.swing/src/org/compiere/images/wfEnd24.gif b/org.adempiere.ui.swing/src/org/compiere/images/wfEnd24.gif deleted file mode 100644 index 32df45d41fb2d0722db6b50e08195f060bfbaf22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 940 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 diff --git a/org.adempiere.ui.swing/src/org/compiere/install/VTranslationDialog.java b/org.adempiere.ui.swing/src/org/compiere/install/VTranslationDialog.java deleted file mode 100644 index 7ea92cd2a5..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/install/VTranslationDialog.java +++ /dev/null @@ -1,256 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.install; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JFileChooser; -import javax.swing.JLabel; - -import org.compiere.apps.ADialog; -import org.compiere.apps.StatusBar; -import org.compiere.apps.form.FormFrame; -import org.compiere.apps.form.FormPanel; -import org.compiere.grid.ed.VCheckBox; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Ini; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; -import org.compiere.util.ValueNamePair; - -/** - * Translation Dialog Import + Export. - * - * @author Jorg Janke - * @version $Id: TranslationDialog.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $ - */ -public class VTranslationDialog extends TranslationController - implements FormPanel, ActionListener -{ - private CPanel panel = new CPanel(); - - - /** - * TranslationDialog Constructor. - * (Initiated via init()) - */ - public VTranslationDialog() - { - } // TranslationDialog - - /** FormFrame */ - private FormFrame m_frame; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VTranslationDialog.class); - // - private GridBagLayout mainLayout = new GridBagLayout(); - private JComboBox cbLanguage = new JComboBox(); - private JLabel lLanguage = new JLabel(); - private JLabel lTable = new JLabel(); - private JComboBox cbTable = new JComboBox(); - private JButton bExport = new JButton(); - private JButton bImport = new JButton(); - // - private StatusBar statusBar = new StatusBar(); - private JLabel lClient = new JLabel(); - private JComboBox cbClient = new JComboBox(); - private VCheckBox isOnlyCentralized = new VCheckBox(); - - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - panel.setLayout(mainLayout); - lClient.setText(Msg.translate(Env.getCtx(), "AD_Client_ID")); - lLanguage.setText(Msg.translate(Env.getCtx(), "AD_Language")); - lLanguage.setToolTipText(Msg.translate(Env.getCtx(), "IsSystemLanguage")); - lTable.setText(Msg.translate(Env.getCtx(), "AD_Table_ID")); - isOnlyCentralized.setText(Msg.getMsg(Env.getCtx(), "OnlyCentralizedData")); - // - bExport.setText(Msg.getMsg(Env.getCtx(), "Export")); - bExport.addActionListener(this); - bImport.setText(Msg.getMsg(Env.getCtx(), "Import")); - bImport.addActionListener(this); - // - panel.add(cbLanguage, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - panel.add(lLanguage, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - panel.add(lTable, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - panel.add(cbTable, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - panel.add(isOnlyCentralized, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - panel.add(bExport, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - panel.add(bImport, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - panel.add(lClient, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - panel.add(cbClient, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - } // jbInit - - /** - * Dynamic Init. - * - fill Language & Table - */ - private void dynInit() - { - // Fill Client - ArrayList clients = getClientList(); - for(KeyNamePair client: clients) - cbClient.addItem(client); - - // Fill Language - ArrayList languages = getLanguageList(); - for(ValueNamePair language: languages) - cbLanguage.addItem(language); - - // Fill Table - ArrayList tables = getTableList(); - for(ValueNamePair table: tables) - cbTable.addItem(table); - - // Info - setStatusBar(statusBar); - } // dynInit - - /** - * Initialize Panel - * @param WindowNo window - * @param frame frame - */ - public void init (int WindowNo, FormFrame frame) - { - log.info(""); - m_WindowNo = WindowNo; - m_frame = frame; - Env.setContext(Env.getCtx(), m_WindowNo, "IsSOTrx", "Y"); - try - { - jbInit(); - dynInit(); - frame.getContentPane().add(panel, BorderLayout.CENTER); - frame.getContentPane().add(statusBar, BorderLayout.SOUTH); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "", ex); - } - } // init - - /** - * Dispose - */ - public void dispose() - { - m_frame.dispose(); - } // dispose - - /************************************************************************** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - ValueNamePair AD_Language = (ValueNamePair)cbLanguage.getSelectedItem(); - if (AD_Language == null) - { - statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), "LanguageSetupError"), true); - return; - } - ValueNamePair AD_Table = (ValueNamePair)cbTable.getSelectedItem(); - if (AD_Table == null) - return; - boolean imp = (e.getSource() == bImport); - KeyNamePair AD_Client = (KeyNamePair)cbClient.getSelectedItem(); - int AD_Client_ID = -1; - if (AD_Client != null) - AD_Client_ID = AD_Client.getKey(); - - String startDir = Ini.getAdempiereHome() + File.separator + "data"; - JFileChooser chooser = new JFileChooser(startDir); - chooser.setMultiSelectionEnabled(false); - chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - int returnVal = imp ? chooser.showOpenDialog(panel) : chooser.showSaveDialog(panel); - if (returnVal != JFileChooser.APPROVE_OPTION) - return; - String directory = chooser.getSelectedFile().getAbsolutePath(); - // - statusBar.setStatusLine(directory); - panel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - Translation t = new Translation(Env.getCtx()); - String msg = t.validateLanguage(AD_Language.getValue()); - if (msg.length() > 0) - { - ADialog.error(m_WindowNo, panel, "LanguageSetupError", msg); - return; - } - - // All Tables - if (AD_Table.getValue().equals("")) - { - msg = null; - - for (int i = 1; i < cbTable.getItemCount(); i++) - { - AD_Table = (ValueNamePair)cbTable.getItemAt(i); - msg = imp - ? t.importTrl (directory, AD_Client_ID, AD_Language.getValue(), AD_Table.getValue()) - : t.exportTrl (directory, AD_Client_ID, AD_Language.getValue(), AD_Table.getValue(), isOnlyCentralized.isSelected()); - } - - if(msg == null || msg.length() == 0) - msg = (imp ? "Import" : "Export") + " Successful. [" + directory + "]"; - - statusBar.setStatusLine(directory); - } - else // single table - { - msg = null; - msg = imp - ? t.importTrl (directory, AD_Client_ID, AD_Language.getValue(), AD_Table.getValue()) - : t.exportTrl (directory, AD_Client_ID, AD_Language.getValue(), AD_Table.getValue(), isOnlyCentralized.isSelected()); - - if(msg == null || msg.length() == 0) - msg = (imp ? "Import" : "Export") + " Successful. [" + directory + "]"; - - statusBar.setStatusLine(msg); - } - // - panel.setCursor(Cursor.getDefaultCursor()); - } // actionPerformed - -} // Translation diff --git a/org.adempiere.ui.swing/src/org/compiere/install/package.html b/org.adempiere.ui.swing/src/org/compiere/install/package.html deleted file mode 100644 index f3bfb97c47..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/install/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - -

    Package org.compiere.install

    - -Language Pack Maintenance - -

    Related Documentation

    - -For overviews, tutorials, examples, guides, and tool documentation, please see: - - - - - - diff --git a/org.adempiere.ui.swing/src/org/compiere/license.html b/org.adempiere.ui.swing/src/org/compiere/license.html deleted file mode 100644 index a4e87c198d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/license.html +++ /dev/null @@ -1,81 +0,0 @@ - - -Adempiere Public License - - - -
    -

    ADEMPIERE PUBLIC LICENSE

    - Version 1.2 -

    Contact info@adempiere.org for licensing alternatives.

    -

    GNU General Public License

    -

    Version 2, June 1991

    -
    Copyright (C) 1989, 1991 Free Software Foundation, Inc.  
    -59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
    -
    -
    -Everyone is permitted to copy and distribute verbatim copies
    -of this license document, but changing it is not allowed.
    -  
    -
    -

    Preamble

    -

    The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.

    -

    When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.

    -

    To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.

    -

    For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.

    -

    We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.

    -

    Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.

    -

    Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.

    -

    The precise terms and conditions for copying, distribution and modification follow.

    -

    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

    -

    0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". -

    Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. -

    1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. -

    You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. -

    2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: -

    -

    -
      -
    • a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. -
    • - b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. -
    • - c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) -
    -
    -
    These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
    -

    Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. -

    In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. -

    3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: - - -

    -
      -
    • a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, -
    • b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, -
    • -
      c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
      -
    • -
    -
    -
    The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
    -

    If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. -

    4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. -

    5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. -

    6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. -

    7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. -

    If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. -

    It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. -

    This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. -

    8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. -

    9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. -

    Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. -

    10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. -

    NO WARRANTY

    -

    11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. -

    12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -

    -

    END OF TERMS AND CONDITION

    -

    - - diff --git a/org.adempiere.ui.swing/src/org/compiere/minigrid/CheckRenderer.java b/org.adempiere.ui.swing/src/org/compiere/minigrid/CheckRenderer.java deleted file mode 100644 index 0366fab85d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/minigrid/CheckRenderer.java +++ /dev/null @@ -1,101 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.minigrid; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Insets; - -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JTable; -import javax.swing.table.DefaultTableCellRenderer; - -import org.adempiere.plaf.AdempierePLAF; - -/** - * Check Box Renderer based on Boolean values - * - * @author Jorg Janke - * @version $Id: CheckRenderer.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public final class CheckRenderer extends DefaultTableCellRenderer -{ - /** - * - */ - private static final long serialVersionUID = -7687503957742100068L; - - /** - * Constructor - */ - public CheckRenderer() - { - super(); - m_check.setMargin(new Insets(0,0,0,0)); - m_check.setHorizontalAlignment(JLabel.CENTER); - m_check.setOpaque(true); - } // CheckRenderer - - private JCheckBox m_check = new JCheckBox(); - - /** - * Return centered, white Check Box - * @param table - * @param value - * @param isSelected - * @param hasFocus - * @param row - * @param col - * @return Component - */ - public Component getTableCellRendererComponent(JTable table, Object value, - boolean isSelected, boolean hasFocus, int row, int col) - { - // Background & Foreground - Color bg = AdempierePLAF.getFieldBackground_Normal(); - // Selected is white on blue in Windows - if (isSelected && !hasFocus) - bg = table.getSelectionBackground(); - // row not selected or field has focus - else - { - // Inactive Background - if (!table.isCellEditable(row, col)) - bg = AdempierePLAF.getFieldBackground_Inactive(); - } - // Set Color - m_check.setBackground(bg); - - // Value - setValue(value); - return m_check; - } // getTableCellRendererComponent - - /** - * Set Value - * @param value - */ - public void setValue(Object value) - { - if (value != null && ((Boolean)value).booleanValue()) - m_check.setSelected(true); - else - m_check.setSelected(false); - } // setValue - -} // CheckRenderer diff --git a/org.adempiere.ui.swing/src/org/compiere/minigrid/IDColumnEditor.java b/org.adempiere.ui.swing/src/org/compiere/minigrid/IDColumnEditor.java deleted file mode 100644 index 58090c2927..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/minigrid/IDColumnEditor.java +++ /dev/null @@ -1,137 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.minigrid; - -import java.awt.Component; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.EventObject; - -import javax.swing.AbstractCellEditor; -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JTable; -import javax.swing.event.ChangeEvent; -import javax.swing.table.TableCellEditor; - -import org.compiere.swing.CCheckBox; - -/** - * ID Column Editor (with Select Box). - * CheckBox change is only detected, if you move out of the cell. - * A ActionListener is added to the check box and the table forced - * to notice the change immediately. - * - * @author Jorg Janke - * @version $Id: IDColumnEditor.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class IDColumnEditor extends AbstractCellEditor - implements TableCellEditor, ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 7263316764540177503L; - - /** - * Constructor - */ - public IDColumnEditor() - { - m_check.setMargin(new Insets(0,0,0,0)); - m_check.setHorizontalAlignment(JLabel.CENTER); - m_check.addActionListener(this); - } // IDColumnEditor - - /** the selection */ - private JCheckBox m_check = new CCheckBox(); - /** temporary value */ - private IDColumn m_value = null; - - private JTable m_table; - - /** - * Return Selection Status as IDColumn - * @return value - */ - public Object getCellEditorValue() - { - // log.fine( "IDColumnEditor.getCellEditorValue - " + m_check.isSelected()); - if (m_value != null) - m_value.setSelected (m_check.isSelected()); - return m_value; - } // getCellEditorValue - - /** - * Get visual Component - * @param table - * @param value - * @param isSelected - * @param row - * @param column - * @return Component - */ - public Component getTableCellEditorComponent (JTable table, Object value, boolean isSelected, int row, int column) - { - // log.fine( "IDColumnEditor.getTableCellEditorComponent", value); - m_table = table; - // set value - if (value != null && value instanceof IDColumn) - m_value = (IDColumn)value; - else - { - m_value = null; - return null; - //throw new IllegalArgumentException("ICColumnEditor.getTableCellEditorComponent - value=" + value); - } - // set editor value - m_check.setSelected(m_value.isSelected()); - return m_check; - } // getTableCellEditorComponent - - /** - * Can we edit it - * @param anEvent - * @return true (cobstant) - */ - public boolean isCellEditable (EventObject anEvent) - { - return true; - } // isCellEditable - - /** - * Can the cell be selected - * @param anEvent - * @return true (constant) - */ - public boolean shouldSelectCell (EventObject anEvent) - { - return true; - } // shouldSelectCell - - /** - * Action Listener - * @param e - */ - public void actionPerformed (ActionEvent e) - { - if (m_table != null) - m_table.editingStopped(new ChangeEvent(this)); - } // actionPerformed - -} // IDColumnEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/minigrid/IDColumnRenderer.java b/org.adempiere.ui.swing/src/org/compiere/minigrid/IDColumnRenderer.java deleted file mode 100644 index ccc552648c..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/minigrid/IDColumnRenderer.java +++ /dev/null @@ -1,113 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.minigrid; - -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Insets; - -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JTable; -import javax.swing.table.DefaultTableCellRenderer; - -/** - * ID Column Renderer - * - * @author Jorg Janke - * @version $Id: IDColumnRenderer.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class IDColumnRenderer extends DefaultTableCellRenderer -{ - /** - * - */ - private static final long serialVersionUID = -7513837304119751313L; - - /** - * Constructor - * @param multiSelection determines layout - button for single, check for multi - */ - public IDColumnRenderer(boolean multiSelection) - { - super(); - m_multiSelection = multiSelection; - // Multi => Check - if (m_multiSelection) - { - m_check = new JCheckBox(); - m_check.setMargin(new Insets(0,0,0,0)); - m_check.setHorizontalAlignment(JLabel.CENTER); - } - else // Single => Button - { - m_button = new JButton(); - m_button.setMargin(new Insets(0,0,0,0)); - m_button.setSize(new Dimension(5,5)); - } - } // IDColumnRenderer - - /** Mult-Selection flag */ - private boolean m_multiSelection; - /** The Single-Selection renderer */ - private JButton m_button; - /* The Multi-Selection renderer */ - private JCheckBox m_check; - - /** - * Set Value (for multi-selection) - * @param value - */ - protected void setValue(Object value) - { - if (m_multiSelection) - { - boolean sel = false; - if (value == null) - ; - else if (value instanceof IDColumn) - sel = ((IDColumn)value).isSelected(); - else if (value instanceof Boolean) - sel = ((Boolean)value).booleanValue(); - else - sel = value.toString().equals("Y"); - // - m_check.setSelected(sel); - } - } // setValue - - /** - * Return rendering component - * @param table - * @param value - * @param isSelected - * @param hasFocus - * @param row - * @param column - * @return Component (CheckBox or Button) - */ - public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) - { - setValue(value); - if (m_multiSelection) - return m_check; - else - return m_button; - } // setTableCellRenderereComponent - -} // IDColumnRenderer diff --git a/org.adempiere.ui.swing/src/org/compiere/minigrid/MiniCellEditor.java b/org.adempiere.ui.swing/src/org/compiere/minigrid/MiniCellEditor.java deleted file mode 100644 index 4ea6d81408..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/minigrid/MiniCellEditor.java +++ /dev/null @@ -1,110 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.minigrid; - -import java.awt.Component; -import java.math.BigDecimal; -import java.sql.Timestamp; - -import javax.swing.AbstractCellEditor; -import javax.swing.JTable; -import javax.swing.table.TableCellEditor; - -import org.compiere.grid.ed.VDate; -import org.compiere.grid.ed.VEditor; -import org.compiere.grid.ed.VNumber; -import org.compiere.grid.ed.VString; -import org.compiere.util.DisplayType; - -/** - * MiniTable Cell Editor based on class - Timestamp, BigDecimal - * - * @author Jorg Janke - * @version $Id: MiniCellEditor.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class MiniCellEditor extends AbstractCellEditor implements TableCellEditor -{ - /** - * - */ - private static final long serialVersionUID = 4431508736596874253L; - - /** - * Default Constructor - * @param c Class - */ - public MiniCellEditor(Class c) - { - super(); - // Date - if (c == Timestamp.class) - m_editor = new VDate(); - else if (c == BigDecimal.class) - m_editor = new VNumber("Amount", false, false, true, DisplayType.Amount, "Amount"); - else if (c == Double.class) - m_editor = new VNumber("Number", false, false, true, DisplayType.Number, "Number"); - else if (c == Integer.class) - m_editor = new VNumber("Integer", false, false, true, DisplayType.Integer, "Integer"); - else - m_editor = new VString(); - - } // MiniCellEditor - - private VEditor m_editor = null; - - /** - * Sets an initial value for the editor. This will cause the editor to - * stopEditing and lose any partially edited value if the editor is editing - * when this method is called. - * Returns the component that should be added to the client's Component hierarchy. - * Once installed in the client's hierarchy this component - * will then be able to draw and receive user input. - * @param table - * @param value - * @param isSelected - * @param row - * @param column - * @return Component - */ - public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) - { - // ADebug.trace(ADebug.l5_DData, "VCellEditor.getTableCellEditorComponent - " + value == null ? "null" : value.toString()); - - // Set Value - m_editor.setValue(value); - - // Set UI - m_editor.setBorder(null); - // m_editor.setBorder(UIManager.getBorder("Table.focusCellHighlightBorder")); - m_editor.setFont(table.getFont()); - return (Component)m_editor; - } // getTableCellEditorComponent - - /** - * Returns the value contained in the editor - * @return value - */ - public Object getCellEditorValue() - { - // ADebug.trace(ADebug.l5_DData, "VCellEditor.getCellEditorValue - "); - - if (m_editor != null) - return m_editor.getValue(); - return null; - } // getCellEditorValue - -} // MiniCellEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/minigrid/MiniTable.java b/org.adempiere.ui.swing/src/org/compiere/minigrid/MiniTable.java deleted file mode 100644 index 4334ea0524..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/minigrid/MiniTable.java +++ /dev/null @@ -1,910 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.minigrid; - -import java.awt.Component; -import java.awt.Insets; -import java.math.BigDecimal; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Collection; -import java.util.logging.Level; - -import javax.swing.DefaultCellEditor; -import javax.swing.SwingConstants; -import javax.swing.table.DefaultTableCellRenderer; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableCellRenderer; -import javax.swing.table.TableColumn; -import javax.swing.table.TableModel; - -import org.compiere.apps.search.Info_Column; -import org.compiere.grid.ed.VCellRenderer; -import org.compiere.grid.ed.VHeaderRenderer; -import org.compiere.model.MRole; -import org.compiere.model.PO; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CTable; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Util; - -/** - * Mini Table. - * Default Read Only Table for Boolean, String, Number, Timestamp values - *

    - * After initializing the Table Model, you need to call setColumnClass, - * add columns via addColumn or in one go prepare the table. - * - * MiniTable mt = new MiniTable(); - * String sql = mt.prepareTable(..); // table defined - * // add where to the sql statement - * ResultSet rs = .. - * mt.loadTable(rs); - * rs.close(); - * - * @author Jorg Janke - * @version $Id: MiniTable.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *

  • BF [ 1891082 ] NPE on MiniTable when you hide some columns - *
  • FR [ 1974299 ] Add MiniTable.getSelectedKeys method - *
  • FR [ 2847295 ] MiniTable multiselection checkboxes not working - * https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2847295&group_id=176962 - * @author Teo Sarca, teo.sarca@gmail.com - *
  • BF [ 2876895 ] MiniTable.loadTable: NPE if column is null - * https://sourceforge.net/tracker/?func=detail&aid=2876895&group_id=176962&atid=879332 - */ -public class MiniTable extends CTable implements IMiniTable -{ - /** - * - */ - private static final long serialVersionUID = 281959800766140642L; - - /** - * Default Constructor - */ - public MiniTable() - { - super(); - // log.config( "MiniTable"); - setCellSelectionEnabled(false); - setRowSelectionAllowed(false); - // Default Editor - this.setCellEditor(new ROCellEditor()); - } // MiniTable - - /** List of R/W columns */ - private ArrayList m_readWriteColumn = new ArrayList(); - /** List of Column Width */ - private ArrayList m_minWidth = new ArrayList(); - - /** Color Column Index of Model */ - private int m_colorColumnIndex = -1; - /** Color Column compare data */ - private Object m_colorDataCompare = Env.ZERO; - - /** Multi Selection mode (default false) */ - private boolean m_multiSelection = false; - - /** Lauout set in prepareTable and used in loadTable */ - private ColumnInfo[] m_layout = null; - /** Logger */ - private static CLogger log = CLogger.getCLogger(MiniTable.class); - /** Is Total Show */ - private boolean showTotals = false; - private boolean autoResize = true; - - public boolean isAutoResize() { - return autoResize; - } - - public void setAutoResize(boolean autoResize) { - this.autoResize = autoResize; - } - - /** - * Gets the swing column of given index. No index checking - * is done. - * - * @param col - * @return - */ - public TableColumn getColumn(int col) { - return(getColumnModel().getColumn(col)); - } - - /** - * Return number of columns in the mini table - */ - public int getColumnCount() { - return(getColumnModel().getColumnCount()); - } - - /** - * Size Columns. - * Uses Mimimum Column Size - */ - public void autoSize() - { - if ( !autoResize ) - return; - - long start = System.currentTimeMillis(); - // - final int SLACK = 8; // making sure it fits in a column - final int MAXSIZE = 300; // max size of a column - // - TableModel model = this.getModel(); - int size = model.getColumnCount(); - // for all columns - for (int col = 0; col < size; col++) - { - // Column & minimum width - TableColumn tc = this.getColumnModel().getColumn(col); - int width = 0; - if (m_minWidth.size() > col) - width = ((Integer)m_minWidth.get(col)).intValue(); - // log.config( "Column=" + col + " " + column.getHeaderValue()); - - // Header - TableCellRenderer renderer = tc.getHeaderRenderer(); - if (renderer == null) - renderer = new DefaultTableCellRenderer(); - Component comp = renderer.getTableCellRendererComponent - (this, tc.getHeaderValue(), false, false, 0, 0); - // log.fine( "Hdr - preferred=" + comp.getPreferredSize().width + ", width=" + comp.getWidth()); - width = Math.max(width, comp.getPreferredSize().width + SLACK); - - // Cells - int maxRow = Math.min(30, getRowCount()); // first 30 rows - for (int row = 0; row < maxRow; row++) - { - renderer = getCellRenderer(row, col); - comp = renderer.getTableCellRendererComponent - (this, getValueAt(row, col), false, false, row, col); - if (comp != null) { - int rowWidth = comp.getPreferredSize().width + SLACK; - width = Math.max(width, rowWidth); - } - } - // Width not greater .. - width = Math.min(MAXSIZE, width); - tc.setPreferredWidth(width); - // log.fine( "width=" + width); - } // for all columns - if (log.isLoggable(Level.FINER)) log.finer("Cols=" + size + " - " + (System.currentTimeMillis()-start) + "ms"); - } // autoSize - - - /** - * Is Cell Editable - * @param row row - * @param column column - * @return true if editable - */ - public boolean isCellEditable(int row, int column) - { - // if the first column is a boolean and it is false, it is not editable - if (column != 0 - && getValueAt(row, 0) instanceof Boolean - && !((Boolean)getValueAt(row, 0)).booleanValue()) - return false; - - // is the column RW? - if (m_readWriteColumn.contains(Integer.valueOf(column))) - return true; - return false; - } // isCellEditable - - /** - * Set Column to ReadOnly - * @param column column - * @param readOnly read only - */ - public void setColumnReadOnly (int column, boolean readOnly) - { - // Column is ReadWrite - if (m_readWriteColumn.contains(Integer.valueOf(column))) - { - // Remove from list - if (readOnly) - { - int size = m_readWriteColumn.size(); - for (int i = 0; i < size; i++) - { - if (((Integer)m_readWriteColumn.get(i)).intValue() == column) - { - m_readWriteColumn.remove(i); - break; - } - } - } // ReadOnly - } - // current column is R/O - ReadWrite - add to list - else if (!readOnly) - m_readWriteColumn.add(Integer.valueOf(column)); - } // setColumnReadOnly - - - /************************************************************************** - * Prepare Table and return SQL - * - * @param layout array of column info - * @param from SQL FROM content - * @param where SQL WHERE content - * @param multiSelection multiple selections - * @param tableName table name - * @return SQL - */ - public String prepareTable(ColumnInfo[] layout, - String from, String where, boolean multiSelection, String tableName) - { - m_layout = layout; - m_multiSelection = multiSelection; - // - StringBuilder sql = new StringBuilder ("SELECT "); - // add columns & sql - for (int i = 0; i < layout.length; i++) - { - // create sql - if (i > 0) - sql.append(", "); - sql.append(layout[i].getColSQL()); - // adding ID column - if (layout[i].isKeyPairCol()) - sql.append(",").append(layout[i].getKeyPairColSQL()); - - // add to model - addColumn(layout[i].getColHeader()); - if (layout[i].isColorColumn()) - setColorColumn(i); - if (layout[i].getColClass() == IDColumn.class) - p_keyColumnIndex = i; - } - // set editors (two steps) - for (int i = 0; i < layout.length; i++) - setColumnClass(i, layout[i].getColClass(), layout[i].isReadOnly(), layout[i].getColHeader()); - - sql.append( " FROM ").append(from); - sql.append(" WHERE ").append(where); - - // Table Selection - setRowSelectionAllowed(true); - - // org.compiere.apps.form.VMatch.dynInit calls routine for initial init only - if (from.length() == 0) - return sql.toString(); - // - String finalSQL = MRole.getDefault().addAccessSQL(sql.toString(), - tableName, MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); - log.finest(finalSQL); - return finalSQL; - } // prepareTable - - /** - * Add Table Column. - * after adding a column, you need to set the column classes again - * (DefaultTableModel fires TableStructureChanged, which calls - * JTable.tableChanged .. createDefaultColumnsFromModel - * @param header header - */ - public void addColumn (String header) - { - if (getModel() instanceof DefaultTableModel) - { - DefaultTableModel model = (DefaultTableModel)getModel(); - model.addColumn(Util.cleanAmp(header)); - } - else - throw new IllegalArgumentException("Model must be instance of DefaultTableModel"); - } // addColumn - - /** - * Set Column Editor & Renderer to Class. - * (after all columns were added) - * @param index column index - * @param c class of column - determines renderere - * @param readOnly read only flag - */ - public void setColumnClass (int index, Class c, boolean readOnly) - { - setColumnClass(index, c, readOnly, null); - } // setColumnClass - - /** - * Set Column Editor & Renderer to Class - * (after all columns were added) - * Lauout of IDColumn depemds on multiSelection - * @param index column index - * @param c class of column - determines renderere/editors supported: - * IDColumn, Boolean, Double (Quantity), BigDecimal (Amount), Integer, Timestamp, String (default) - * @param readOnly read only flag - * @param header optional header value - */ - public void setColumnClass (int index, Class c, boolean readOnly, String header) - { - // log.config( "MiniTable.setColumnClass - " + index, c.getName() + ", r/o=" + readOnly); - TableColumn tc = getColumnModel().getColumn(index); - if (tc == null) - return; - // Set R/O - setColumnReadOnly(index, readOnly); - - // Header - if (header != null && header.length() > 0) - tc.setHeaderValue(Util.cleanAmp(header)); - - // ID Column & Selection - if (c == IDColumn.class) - { - tc.setCellRenderer(new IDColumnRenderer(m_multiSelection)); - if (m_multiSelection) - { - tc.setCellEditor(new IDColumnEditor()); - setColumnReadOnly(index, false); - } - else - { - tc.setCellEditor(new ROCellEditor()); - } - m_minWidth.add(Integer.valueOf(10)); - tc.setMaxWidth(20); - tc.setPreferredWidth(20); - tc.setResizable(false); - - tc.setHeaderRenderer(new VHeaderRenderer(DisplayType.Number)); - } - // Boolean - else if (c == Boolean.class) - { - tc.setCellRenderer(new CheckRenderer()); - if (readOnly) - tc.setCellEditor(new ROCellEditor()); - else - { - CCheckBox check = new CCheckBox(); - check.setMargin(new Insets(0,0,0,0)); - check.setHorizontalAlignment(SwingConstants.CENTER); - tc.setCellEditor(new DefaultCellEditor(check)); - } - m_minWidth.add(Integer.valueOf(30)); - - tc.setHeaderRenderer(new VHeaderRenderer(DisplayType.YesNo)); - } - // Date - else if (c == Timestamp.class) - { - tc.setCellRenderer(new VCellRenderer(DisplayType.Date)); - if (readOnly) - tc.setCellEditor(new ROCellEditor()); - else - tc.setCellEditor(new MiniCellEditor(c)); - m_minWidth.add(Integer.valueOf(30)); - - tc.setHeaderRenderer(new VHeaderRenderer(DisplayType.DateTime)); - } - // Amount - else if (c == BigDecimal.class) - { - tc.setCellRenderer(new VCellRenderer(DisplayType.Amount)); - if (readOnly) - { - tc.setCellEditor(new ROCellEditor()); - m_minWidth.add(Integer.valueOf(70)); - } - else - { - tc.setCellEditor(new MiniCellEditor(c)); - m_minWidth.add(Integer.valueOf(80)); - } - - tc.setHeaderRenderer(new VHeaderRenderer(DisplayType.Number)); - } - // Number - else if (c == Double.class) - { - tc.setCellRenderer(new VCellRenderer(DisplayType.Number)); - if (readOnly) - { - tc.setCellEditor(new ROCellEditor()); - m_minWidth.add(Integer.valueOf(70)); - } - else - { - tc.setCellEditor(new MiniCellEditor(c)); - m_minWidth.add(Integer.valueOf(80)); - } - - tc.setHeaderRenderer(new VHeaderRenderer(DisplayType.Number)); - } - // Integer - else if (c == Integer.class) - { - tc.setCellRenderer(new VCellRenderer(DisplayType.Integer)); - if (readOnly) - tc.setCellEditor(new ROCellEditor()); - else - tc.setCellEditor(new MiniCellEditor(c)); - m_minWidth.add(Integer.valueOf(30)); - - tc.setHeaderRenderer(new VHeaderRenderer(DisplayType.Number)); - } - // String - else - { - tc.setCellRenderer(new VCellRenderer(DisplayType.String)); - if (readOnly) - tc.setCellEditor(new ROCellEditor()); - else - tc.setCellEditor(new MiniCellEditor(String.class)); - m_minWidth.add(Integer.valueOf(30)); - - tc.setHeaderRenderer(new VHeaderRenderer(DisplayType.String)); - } - // log.fine( "Renderer=" + tc.getCellRenderer().toString() + ", Editor=" + tc.getCellEditor().toString()); - } // setColumnClass - - /** - * Clear Table Content - * @param no number of rows - */ - public void setRowCount (int no) - { - if (getModel() instanceof DefaultTableModel) - { - DefaultTableModel model = (DefaultTableModel)getModel(); - model.setRowCount(no); - // log.config( "MiniTable.setRowCount", "rows=" + getRowCount() + ", cols=" + getColumnCount()); - } - else - throw new IllegalArgumentException("Model must be instance of DefaultTableModel"); - } // setRowCount - - - /************************************************************************** - * Load Table from ResultSet - The ResultSet is not closed - * - * @param rs ResultSet with the column layout defined in prepareTable - */ - public void loadTable(ResultSet rs) - { - if (m_layout == null) - throw new UnsupportedOperationException("Layout not defined"); - - // Clear Table - setRowCount(0); - // - try - { - while (rs.next()) - { - int row = getRowCount(); - setRowCount(row+1); - int colOffset = 1; // columns start with 1 - for (int col = 0; col < m_layout.length; col++) - { - Object data = null; - Class c = m_layout[col].getColClass(); - int colIndex = col + colOffset; - if (c == IDColumn.class) - data = new IDColumn(rs.getInt(colIndex)); - else if (c == Boolean.class) - data = Boolean.valueOf("Y".equals(rs.getString(colIndex))); - else if (c == Timestamp.class) - data = rs.getTimestamp(colIndex); - else if (c == BigDecimal.class) - data = rs.getBigDecimal(colIndex); - else if (c == Double.class) - data = rs.getDouble(colIndex); - else if (c == Integer.class) - data = rs.getInt(colIndex); - else if (c == KeyNamePair.class) - { - String display = rs.getString(colIndex); - int key = rs.getInt(colIndex+1); - data = new KeyNamePair(key, display); - colOffset++; - } - else - { - String s = rs.getString(colIndex); - if (s != null) - data = s.trim(); // problems with NCHAR - } - // store - setValueAt(data, row, col); - // log.fine( "r=" + row + ", c=" + col + " " + m_layout[col].getColHeader(), - // "data=" + data.toString() + " " + data.getClass().getName() + " * " + m_table.getCellRenderer(row, col)); - } - - - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, "", e); - } - if(getShowTotals()) - addTotals(m_layout); - autoSize(); - if (log.isLoggable(Level.CONFIG)) log.config("Row(rs)=" + getRowCount()); - - - } // loadTable - - /** - * Load Table from Object Array - * @param pos array of POs - */ - public void loadTable(PO[] pos) - { - if (m_layout == null) - throw new UnsupportedOperationException("Layout not defined"); - - // Clear Table - setRowCount(0); - // - for (int i = 0; i < pos.length; i++) - { - PO myPO = pos[i]; - int row = getRowCount(); - setRowCount(row+1); - - for (int col = 0; col < m_layout.length; col++) - { - String columnName = m_layout[col].getColSQL(); - Object data = myPO.get_Value(columnName); - if (data != null) - { - Class c = m_layout[col].getColClass(); - if (c == IDColumn.class) - data = new IDColumn(((Integer)data).intValue()); - else if (c == Double.class) - data = Double.valueOf(((BigDecimal)data).doubleValue()); - } - // store - setValueAt(data, row, col); - } - } - if(getShowTotals()) - addTotals(m_layout); - autoSize(); - if (log.isLoggable(Level.CONFIG)) log.config("Row(array)=" + getRowCount()); - } // loadTable - - - /** - * Get the key of currently selected row based on layout defined in prepareTable - * @return ID if key - */ - public Integer getSelectedRowKey() - { - if (m_layout == null) - throw new UnsupportedOperationException("Layout not defined"); - - int row = getSelectedRow(); - if (row != -1 && p_keyColumnIndex != -1) - { - Object data = getModel().getValueAt(row, p_keyColumnIndex); - if (data instanceof IDColumn) - data = ((IDColumn)data).getRecord_ID(); - if (data instanceof Integer) - return (Integer)data; - } - return null; - } // getSelectedRowKey - - /** - * @return collection of selected IDs - */ - public Collection getSelectedKeys() - { - if (m_layout == null) - { - throw new UnsupportedOperationException("Layout not defined"); - } - if (p_keyColumnIndex < 0) - { - throw new UnsupportedOperationException("Key Column is not defined"); - } - // - ArrayList list = new ArrayList(); - for (int row = 0; row < getRowCount(); row++) - { - Object data = getModel().getValueAt(row, p_keyColumnIndex); - if (data instanceof IDColumn) - { - IDColumn record = (IDColumn)data; - if (record.isSelected()) - { - list.add(record.getRecord_ID()); - } - } - } - return list; - } - - /************************************************************************** - * Get Layout - * @return Array of ColumnInfo - */ - public ColumnInfo[] getLayoutInfo() - { - return m_layout; - } // getLayout - - /** - * Set Single Selection - * @param multiSelection multiple selections - */ - public void setMultiSelection (boolean multiSelection) - { - m_multiSelection = multiSelection; - } // setMultiSelection - - /** - * Single Selection Table - * @return true if multiple rows can be selected - */ - public boolean isMultiSelection() - { - return m_multiSelection; - } // isMultiSelection - - /** - * Set the Column to determine the color of the row (based on model index) - * @param modelIndex model index - */ - public void setColorColumn (int modelIndex) - { - m_colorColumnIndex = modelIndex; - } // setColorColumn - - /** - * Set ColorColumn comparison criteria - * @param dataCompare data - */ - public void setColorCompare (Object dataCompare) - { - m_colorDataCompare = dataCompare; - } // - - /** - * Get ColorCode for Row. - *
    -	 *	If numerical value in compare column is
    -	 *		negative = -1,
    -	 *      positive = 1,
    -	 *      otherwise = 0
    -	 *  If Timestamp
    -	 *  
    - * @param row row - * @return color code - */ - public int getColorCode (int row) - { - if (m_colorColumnIndex == -1) - return 0; - - Object data = getModel().getValueAt(row, m_colorColumnIndex); - int cmp = 0; - - // We need to have a Number - if (data == null) - return 0; - try - { - if (data instanceof Timestamp) - { - if (m_colorDataCompare == null || !(m_colorDataCompare instanceof Timestamp)) - m_colorDataCompare = new Timestamp(System.currentTimeMillis()); - cmp = ((Timestamp)m_colorDataCompare).compareTo((Timestamp)data); - } - else - { - if (m_colorDataCompare == null || !(m_colorDataCompare instanceof BigDecimal)) - m_colorDataCompare = Env.ZERO; - if (!(data instanceof BigDecimal)) - data = new BigDecimal(data.toString()); - cmp = ((BigDecimal)m_colorDataCompare).compareTo((BigDecimal)data); - } - } - catch (Exception e) - { - return 0; - } - if (cmp > 0) - return -1; - if (cmp < 0) - return 1; - return 0; - } // getColorCode - - - /** - * Set if Totals is Show - * @param boolean Show - */ - public void setShowTotals(boolean show) - { - showTotals= show; - } - /** - * get if Totals is Show - * @param boolean Show - */ - public boolean getShowTotals() - { - return showTotals; - } - - /** - * Adding a new row with the totals - */ - public void addTotals(ColumnInfo[] layout) - { - if (getRowCount() == 0 || layout.length == 0) - return; - - Object[] total = new Object[layout.length]; - - for (int row = 0 ; row < getRowCount(); row ++) - { - - for (int col = 0; col < layout.length; col++) - { - Object data = getModel().getValueAt(row, col); - Class c = layout[col].getColClass(); - if (c == BigDecimal.class) - { - BigDecimal subtotal = Env.ZERO; - if(total[col]!= null) - subtotal = (BigDecimal)(total[col]); - - BigDecimal amt = (BigDecimal) data; - if(subtotal == null) - subtotal = Env.ZERO; - if(amt == null ) - amt = Env.ZERO; - total[col] = subtotal.add(amt); - } - else if (c == Double.class) - { - Double subtotal = Double.valueOf(0); - if(total[col] != null) - subtotal = (Double)(total[col]); - - Double amt = (Double) data; - if(subtotal == null) - subtotal = Double.valueOf(0); - if(amt == null ) - amt = Double.valueOf(0); - total[col] = subtotal + amt; - - } - } - } - - //adding total row - - int row = getRowCount() + 1; - setRowCount(row); - for (int col = 0; col < layout.length; col++) - { - Class c = layout[col].getColClass(); - if (c == BigDecimal.class) - { - setValueAt(total[col] , row - 1, col); - } - else if (c == Double.class) - { - setValueAt(total[col] , row -1 , col); - } - else - { - if(col == 0 ) - { - setValueAt(" ÎŁ " , row -1 , col); - } - else - setValueAt(null , row - 1, col ); - } - - } - } - - /** - * Adding a new row with the totals - */ - public void addTotals(Info_Column[] layout) - { - if (getRowCount() == 0 || layout.length == 0) - return; - - Object[] total = new Object[layout.length]; - - for (int row = 0 ; row < getRowCount(); row ++) - { - - for (int col = 0; col < layout.length; col++) - { - Object data = getModel().getValueAt(row, col); - Class c = layout[col].getColClass(); - if (c == BigDecimal.class) - { - BigDecimal subtotal = Env.ZERO; - if(total[col]!= null) - subtotal = (BigDecimal)(total[col]); - - BigDecimal amt = (BigDecimal) data; - if(subtotal == null) - subtotal = Env.ZERO; - if(amt == null ) - amt = Env.ZERO; - total[col] = subtotal.add(amt); - } - else if (c == Double.class) - { - Double subtotal = Double.valueOf(0); - if(total[col] != null) - subtotal = (Double)(total[col]); - - Double amt = (Double) data; - if(subtotal == null) - subtotal = Double.valueOf(0); - if(amt == null ) - amt = Double.valueOf(0); - total[col] = subtotal + amt; - - } - } - } - - //adding total row - - int row = getRowCount() + 1; - setRowCount(row); - for (int col = 0; col < layout.length; col++) - { - Class c = layout[col].getColClass(); - if (c == BigDecimal.class) - { - setValueAt(total[col] , row - 1, col); - } - else if (c == Double.class) - { - setValueAt(total[col] , row -1 , col); - } - else - { - if(col == 1 ) - { - setValueAt(" ÎŁ " , row -1 , col ); - } - else - setValueAt(null , row - 1, col ); - } - - } - } -} // MiniTable diff --git a/org.adempiere.ui.swing/src/org/compiere/minigrid/ROCellEditor.java b/org.adempiere.ui.swing/src/org/compiere/minigrid/ROCellEditor.java deleted file mode 100644 index e8af206a52..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/minigrid/ROCellEditor.java +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.minigrid; - -import java.util.EventObject; - -import javax.swing.DefaultCellEditor; -import javax.swing.JTextField; - -/** - * Read Only Cell Renderer - * - * @author Jorg Janke - * @version $Id: ROCellEditor.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public final class ROCellEditor extends DefaultCellEditor -{ - /** - * - */ - private static final long serialVersionUID = 1957123963696065686L; - - /** - * Constructor - */ - public ROCellEditor() - { - super(new JTextField()); - } // ROCellEditor - - /** - * Indicate RO - * @param anEvent - * @return false - */ - public boolean isCellEditable(EventObject anEvent) - { - return false; - } // isCellEditable -} // ROCellEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/minigrid/package.html b/org.adempiere.ui.swing/src/org/compiere/minigrid/package.html deleted file mode 100644 index 04e562d3e5..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/minigrid/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - -

    Package org.compiere.minigrid

    - -Custom JTable for use in custom application form. - -

    Related Documentation

    - -For overviews, tutorials, examples, guides, and tool documentation, please see: - - - - - - diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/Adempiere200x100.gif b/org.adempiere.ui.swing/src/org/compiere/plaf/Adempiere200x100.gif deleted file mode 100644 index f3e3c9368219408ec01943c3936b8e5e93855372..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3372 zcmV+{4b$?8P)qeIPYl)(m8dZX zmk5Q5C~8E5ao-b%#2OBTz<67VcS#^L`U?K1c@Fws)@Q}Cq zxtw+-CGAdAQbCk)Uk5G#js#jV+I|UK3tZ%_{&%Q?GVWerK%KI^1&jx-_E!J5&OS;? z8lpM=k20jc5Tm4A9u)!51$qm49-s&&gsK1gNlyMsaqk$cO*@(69RL4rSVrd3Y#%&2qrat8W z=mtzx#%r&u8C5`bDpm(CI3t&1x zmJXvu8Mh~}U*Ot2V5qnH;Y9g$%D8=i+kiC_*9Ix$cJo$0k#Wyi-sJp$QXU?G-9T2h$836ewQ;3<@X*0N&~uz!1VK$aplFMI##ewqF$?dC1Gq6{n{IdzXKYXe|sGVTmyV_x|m;C65Is|DJwhdkE?$e7GU z#^kZQF)7gZYRGtR49xRZ-(H}NirQ?5?4$kzycfyyQChne62ZcVqAzziPX(F^wl9RY zdbTp|I$%WN(hrq!-MrNcLhY1s-I2}w2w?mtz=O-6kDZ`UH1GHwWP9x}s*o_V1% zZU!*QTm5vbT@$kU{R&8Pn|`T`n+{wMnL9;gY6cEPR^A;`NM;q8uTUe2FsdNno_My2>J| zH}269Orcsqx&zw*&n7EJ{`x7%ER)68fMbB+$~fb#{zIN1QH)>`uy0P)E<~Xm2q2ntCNZt?|Ty@S##4G`UX+Lt&k-? zZ8Zzg1e^(cM;SLX?PXHN?TR=}LMC$>U4gO6xNU%AywzzIK_<$$Er17rZ`9cIcwlQ~ z+<-K5GO_~hq6X(rWb!@$Y+Iu|Lx881as9m2b0BP90o;TH?DBs8Sfc=StV*o;Yf z#s5*p^#L5UDMy@BlyT>TE-2&H1n!}B<*2YLwJArOLBI`>8IzQ2GbDgpi*m#{3W+<_ zOthN*h1!*)!XCh+$TUp$-2_}uZOYLd2}akd92LF|OpEq8sS46r3C%JUTa+lmJ`q?g zrTtsTY;+6o4C#BQF_FESw{F;T?$ z7>Q}z0lb(Y!$@V^9)+Y`p38yFQ?AWJ#>4>+0`pVq4F*mOlpjudTx~HjR*xpi&qJI8 zAwEM^mPyE%q&W-v5KR~>(;fuG8flG^kbAcL% ze;*#Wz5wXwt-dp9V|%M#N0i`&K)Zg?*_aB$2(P%Oc&pD&o>}o$f9S0qPI`V?D{!c{ zdR%f}5qXvdBb)go8?wB~ab%#*B4CKO`m&^l&s+T>vXM^CyZ}2Z+i8g8T;fd&;#qy8*u}P_HfcQA+vCuykV@+5QrQQjDae!F z>U%Oe1eV(T?M}3TJ1KDKooE#Rc>zPS+4{hb>%8@*DSub^b6yAD>MxaXw^BWkb^+Vjv#WYbbpog^CTGw$c_&QEB89WT`Au^9cQSY>IT#hJ5?gOfmUGJj)ed!l=v9MFRd85tesfe2|G)vAwHor^pR==r?dzzI?ksfiHJ!&63{D3 z$PL{B%t$-Cu8bQBJQVHg+M3Yk4{)oJFC_`dvj^~O6r-u4BTTGe%DBFWa#nuUKsIQ3 zUa`f%@Z`6r#JB|c%A%wjaTj2wGHxQWbti`{NX1MJotMH24)| z+|9sKNI-QHx16Vzn9G>gSYk zQ>Z>C)C0Iz8TT-9B622@N7x_na5e!Gm2m@;D@jL~SiPvv+weJXh_`xLS_N%}q$WCM_Ov zTr??7sO6po_yw}J3cX`{k)CbbAK9;-A1~}QCRPs513P6YM}_DV+_*aKu_`b{8P^^e z${nR3MVSd47$t<(gtz)1NHo8mJ;nHxoVU7(vJeg=J?|@vk;=H`(tA3)g1iHq4D|6< zzg)DDxB4_B7pT?`?WH=}6rnRK$m77S-s+;KNUQKxPe#tJd|YGG*D3B+u0@{5kd>m4 zM=r*@$cfISbjCp8`$z!rAmE$c>hblQgZ5TmjC^tSV+E?uL`<)tjUET>B+MXRu|7h~ zk-pyQ4;sB;lzFi|k}H)r$$X4t%YNTm{aT~uPD_=R-<0000JComponent when the specified - * component is being painted. - * - * By default this method will fill the specified component with - * its background color (if its opaque property is - * true) and then immediately call paint. - * - * @param g the Graphics context in which to paint - * @param c the component being painted - * - * @see #paint - * @see javax.swing.JComponent#paintComponent - */ - public void update(Graphics g, JComponent c) - { - // System.out.println(c.getClass() + " ** " + ((JButton)c).getText() + " ** " + c.isOpaque()); - if (c.isOpaque()) - CompiereUtils.fillRectange((Graphics2D)g, c, CompiereLookAndFeel.ROUND); - paint (g, c); - } // update - - /** - * Paint 3D boxes - * @param g - * @param c - */ - public void paint (Graphics g, JComponent c) - { - super.paint( g, c); - AbstractButton b = (AbstractButton) c; - ButtonModel model = b.getModel(); - boolean in = model.isPressed() || model.isSelected(); - // - if (b.isBorderPainted()) - CompiereUtils.paint3Deffect((Graphics2D)g, c, CompiereLookAndFeel.ROUND, !in); - } // paint - - /** - * Don't get selected Color - use default (otherwise the pressed button is gray) - * @param g - * @param b - */ - protected void paintButtonPressed(Graphics g, AbstractButton b) - { - // if (b.isContentAreaFilled()) - // { - // Dimension size = b.getSize(); - // g.setColor(getSelectColor()); - // g.fillRect(0, 0, size.width, size.height); - // } - } // paintButtonPressed - - /** - * Is Tool Bar Button - * @param c - * @return true if toolbar - */ - boolean isToolBarButton(JComponent c) - { - return (c.getParent() instanceof JToolBar); - } // isToolBarButton - - - /** - * Create Button Listener - * @param b button - * @return listener - */ - protected BasicButtonListener createButtonListener (AbstractButton b) - { - return new CompiereButtonListener(b); - } // createButtonListener - -} // AdempiereButtonUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereCheckBoxMenuItemUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereCheckBoxMenuItemUI.java deleted file mode 100644 index 2c2cad52c6..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereCheckBoxMenuItemUI.java +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicCheckBoxMenuItemUI; - -/** - * Menu Check Box UI - * - * @author Jorg Janke - * @version $Id: AdempiereCheckBoxMenuItemUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereCheckBoxMenuItemUI extends BasicCheckBoxMenuItemUI -{ - /** - * Create own instance - * @param c compoment - * @return AdempiereMenuBarUI - */ - public static ComponentUI createUI(JComponent c) - { - return new CompiereMenuItemUI(); - } // createUI - - /** - * Install UI - * @param c - */ - public void installUI (JComponent c) - { - super.installUI(c); - c.setOpaque(false); // use MenuBarUI background - } // installUI - -} // AdempiereCheckBoxMenuItemUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereCheckBoxUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereCheckBoxUI.java deleted file mode 100644 index 6439b7319e..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereCheckBoxUI.java +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import javax.swing.AbstractButton; -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicButtonListener; -import javax.swing.plaf.metal.MetalCheckBoxUI; - -/** - * Check Box UI - * - * @author Jorg Janke - * @version $Id: AdempiereCheckBoxUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereCheckBoxUI extends MetalCheckBoxUI -{ - /** - * Create UI - * @param b - * @return ComponentUI - */ - public static ComponentUI createUI (JComponent b) - { - return s_checkBoxUI; - } // createUI - - /** UI shared */ - private static CompiereCheckBoxUI s_checkBoxUI = new CompiereCheckBoxUI(); - - - /************************************************************************** - * Install Defaults - * @param b - */ - public void installDefaults (AbstractButton b) - { - super.installDefaults(b); - b.setOpaque(false); - } // installDefaults - - /** - * Create Button Listener - * @param b button - * @return listener - */ - protected BasicButtonListener createButtonListener (AbstractButton b) - { - return new CompiereButtonListener(b); - } // createButtonListener - -} // AdempiereCheckBoxUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereColor.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereColor.java deleted file mode 100644 index 2285f07734..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereColor.java +++ /dev/null @@ -1,1308 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.AlphaComposite; -import java.awt.BasicStroke; -import java.awt.Color; -import java.awt.Container; -import java.awt.GradientPaint; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.TexturePaint; -import java.awt.Window; -import java.awt.image.BufferedImage; -import java.io.Serializable; -import java.math.BigDecimal; -import java.net.URL; -import java.util.ResourceBundle; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.swing.JComponent; -import javax.swing.JDialog; -import javax.swing.JFrame; -import javax.swing.JPanel; -import javax.swing.JWindow; -import javax.swing.SwingConstants; -import javax.swing.UIManager; -import javax.swing.plaf.ColorUIResource; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.model.MColor; -import org.compiere.swing.ColorBlind; -import org.compiere.swing.ThemeUtils; -import org.compiere.util.KeyNamePair; -import org.compiere.util.ValueNamePair; - -/** - * Adempiere Background Color - * - * @author Jorg Janke - * @version $Id: AdempiereColor.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereColor implements Serializable -{ - /** - * - */ - private static final long serialVersionUID = 756220720952973781L; - /** Background type Flat */ - public static final String TYPE_FLAT = "F"; - /** Background type Gradient */ - public static final String TYPE_GRADIENT = "G"; - /** Background type Lines */ - public static final String TYPE_LINES = "L"; - /** Background type Texture */ - public static final String TYPE_TEXTURE = "T"; - - /** Names */ - private static ResourceBundle s_res = ResourceBundle.getBundle("org.compiere.plaf.PlafRes"); - - /** Type Values */ - public static final String[] TYPE_VALUES = new String[] { - TYPE_FLAT, TYPE_GRADIENT, TYPE_LINES, TYPE_TEXTURE - }; - /** Type Names */ - public static final String[] TYPE_NAMES = new String[] { - s_res.getString("BackColType_Flat"), - s_res.getString("BackColType_Gradient"), - s_res.getString("BackColType_Lines"), - s_res.getString("BackColType_Texture") - }; - /** Types */ - public static final ValueNamePair[] TYPES = new ValueNamePair[] { - new ValueNamePair(TYPE_VALUES[0], TYPE_NAMES[0]), - new ValueNamePair(TYPE_VALUES[1], TYPE_NAMES[1]), - new ValueNamePair(TYPE_VALUES[2], TYPE_NAMES[2]), - new ValueNamePair(TYPE_VALUES[3], TYPE_NAMES[3]) - }; - - /** Gradient Starting Values */ - public static final int[] GRADIENT_SP_VALUES = new int[] { - SwingConstants.NORTH, SwingConstants.NORTH_EAST, - SwingConstants.EAST, SwingConstants.SOUTH_EAST, - SwingConstants.SOUTH, SwingConstants.SOUTH_WEST, - SwingConstants.WEST, SwingConstants.NORTH_WEST - }; - /** Gradient Starting Names */ - public static final String[] GRADIENT_SP_NAMES = new String[] { - "North", "North-East", - "East", "South-East", - "South", "South-West", - "West", "North-West" - }; - /** Gradient Starting Point */ - public static final KeyNamePair[] GRADIENT_SP = new KeyNamePair[] { - new KeyNamePair(GRADIENT_SP_VALUES[0], GRADIENT_SP_NAMES[0]), - new KeyNamePair(GRADIENT_SP_VALUES[1], GRADIENT_SP_NAMES[1]), - new KeyNamePair(GRADIENT_SP_VALUES[2], GRADIENT_SP_NAMES[2]), - new KeyNamePair(GRADIENT_SP_VALUES[3], GRADIENT_SP_NAMES[3]), - new KeyNamePair(GRADIENT_SP_VALUES[4], GRADIENT_SP_NAMES[4]), - new KeyNamePair(GRADIENT_SP_VALUES[5], GRADIENT_SP_NAMES[5]), - new KeyNamePair(GRADIENT_SP_VALUES[6], GRADIENT_SP_NAMES[6]), - new KeyNamePair(GRADIENT_SP_VALUES[7], GRADIENT_SP_NAMES[7]) - }; - /** Exception text */ - private static final String EXCEPTION_TEXT = "Arguments cannot be NULL"; - - - /************************************************************************** - * Set Background of Component to default color - * @param c component - */ - public static void setBackground (JComponent c) - { - setBackground (c, new CompiereColor(AdempierePLAF.getFormBackground())); - } // setBackground - - /** - * Set Background of Component - * @param c Component - * @param cc Color - */ - public static void setBackground (JComponent c, CompiereColor cc) - { - c.putClientProperty(CompiereLookAndFeel.BACKGROUND, cc); - } // setBackground - - /** - * Get Background Color of component - * @param c JComponent - * @return Color - */ - public static CompiereColor getBackground (JComponent c) - { - CompiereColor bg = null; - try - { - bg = (CompiereColor)c.getClientProperty(CompiereLookAndFeel.BACKGROUND); - } - catch (Exception e) - { - log.severe("ClientProperty: " + e.getMessage()); - } - return bg; - } // getBackground - - /** - * Set Background of Window Content Pane to default color - * @param win window - */ - public static void setBackground (Window win) - { - setBackground (win, new CompiereColor(AdempierePLAF.getFormBackground())); - } // setBackground - - /** - * Set Background of Window Content Pane - * @param win window - * @param cc adempiere color - */ - public static void setBackground (Window win, CompiereColor cc) - { - if (win instanceof JDialog) - { - ((JPanel)((JDialog)win).getContentPane()).putClientProperty(CompiereLookAndFeel.BACKGROUND, cc); - // ((JPanel)((JDialog)win).getContentPane()).setName("contentPane"); - } - else if (win instanceof JFrame) - { - ((JPanel)((JFrame)win).getContentPane()).putClientProperty(CompiereLookAndFeel.BACKGROUND, cc); - // ((JPanel)((JFrame)win).getContentPane()).setName("contentPane"); - } - else if (win instanceof JWindow) - { - ((JPanel)((JWindow)win).getContentPane()).putClientProperty(CompiereLookAndFeel.BACKGROUND, cc); - // ((JPanel)((JWindow)win).getContentPane()).setName("contentPane"); - } - } // setBackground - - /** - * Get Default Background - * @return Background - * @see CompierePanelUI#getDefaultBackground - */ - public static CompiereColor getDefaultBackground() - { - return new CompiereColor(AdempierePLAF.getFormBackground()); - } // getDefaultBackground - - /** - * Parse attributes and return AdempiereColor - * @param attributes attributes - * @return AdempiereColor - */ - public static CompiereColor parse (String attributes) - { - CompiereColor cc = new CompiereColor (); - try - { - if (attributes != null && attributes.length() > 0) - cc.parseAttributres (attributes); - } - catch (Exception e) - { - log.severe("(" + attributes + ") - " + e.toString()); - } - return cc; - } // parse - - /************************************************************************** - * Get CompiereColor. - * @return CompiereColor - */ - public static CompiereColor getCompiereColor(MColor color) - { - if (color == null || color.get_ID() == 0) - return null; - - // Color Type - String ColorType = (String)color.getColorType(); - if (ColorType == null) - { - log.log(Level.SEVERE, "MColor.getAdempiereColor - No ColorType"); - return null; - } - CompiereColor cc = null; - // - if (ColorType.equals(CompiereColor.TYPE_FLAT)) - { - cc = new CompiereColor(color.getColor(true), true); - } - else if (ColorType.equals(CompiereColor.TYPE_GRADIENT)) - { - int RepeatDistance = color.getRepeatDistance(); - String StartPoint = color.getStartPoint(); - int startPoint = StartPoint == null ? 0 : Integer.parseInt(StartPoint); - cc = new CompiereColor(color.getColor(true), color.getColor(false), startPoint, RepeatDistance); - } - else if (ColorType.equals(CompiereColor.TYPE_LINES)) - { - int LineWidth = color.getLineWidth(); - int LineDistance = color.getLineDistance(); - cc = new CompiereColor(color.getColor(false), color.getColor(true), LineWidth, LineDistance); - } - else if (ColorType.equals(CompiereColor.TYPE_TEXTURE)) - { - int AD_Image_ID = color.getAD_Image_ID(); - String url = color.getURL(AD_Image_ID); - if (url == null) - return null; - BigDecimal ImageAlpha = color.getImageAlpha(); - float compositeAlpha = ImageAlpha == null ? 0.7f : ImageAlpha.floatValue(); - cc = new CompiereColor(url, color.getColor(true), compositeAlpha); - } - return cc; - } // getAdempiereColor - - /************************************************************************* - * Create Gradient Background Color (Window System Color - White) - */ - public CompiereColor() - { - this (TYPE_GRADIENT); - } // AdempiereColor - - /** - * Create Default Background Colors of Type - * @param type Background type (see constants TYPE_*) - */ - public CompiereColor (String type) - { - if (type == null) - throw new java.lang.IllegalArgumentException (EXCEPTION_TEXT); - if (type.equals(TYPE_FLAT) || type.equals(TYPE_GRADIENT) - || type.equals(TYPE_TEXTURE) || type.equals(TYPE_LINES)) - { - m_type = type; - } - else - throw new java.lang.IllegalArgumentException ("Invalid Type"); - } // AdempiereColor - - /** - * Create Flat Background Color - * @param bg background - */ - public CompiereColor (Color bg) - { - this (bg, true); - } // AdempiereColor - - /** - * Create Background Color - * @param bg Color - * @param flat if true create Flat color otherwise Gradient color with white lower color - */ - public CompiereColor (Color bg, boolean flat) - { - if (bg == null) - throw new java.lang.IllegalArgumentException (EXCEPTION_TEXT); - m_type = flat ? TYPE_FLAT : TYPE_GRADIENT; - m_primaryColor = bg; - } // AdempiereColor - - /** - * Set Background to Gradient colors - * @param upperColor upper Color - * @param lowerColor lower Color - * @param startPoint Starting point - e.g. SOUTH_WEST see SwingConstants, default NORTH_WEST - * @param repeatDistance X/Y Distance to repeat gradient in points - 0 no repeats - */ - public CompiereColor (Color upperColor, Color lowerColor, int startPoint, int repeatDistance) - { - if (upperColor == null || lowerColor == null) - throw new java.lang.IllegalArgumentException (EXCEPTION_TEXT); - m_type = TYPE_GRADIENT; - m_primaryColor = upperColor; - m_secondaryColor = lowerColor; - m_startPoint = startPoint; - m_repeatDistance = repeatDistance; - } // AdempiereColor - - /** - * Set Background to Gradient colors. - * Starting in the north, repeat after 100 pt - * @param upperColor upper color - * @param lowerColor lower color - */ - public CompiereColor (Color upperColor, Color lowerColor) - { - this (upperColor, lowerColor, SwingConstants.NORTH_WEST, 100); - } // AdempiereColor - - /** - * Set Background to Texture - * - * @param textureURL URL to a *.gif or *.jpg graphic file - * @param taint Color to taint the texture (use white for not tainting it) - * @param compositeAlpha Value from 0(no) to 1(full) tainting - */ - public CompiereColor (URL textureURL, Color taint, float compositeAlpha) - { - if (textureURL == null || taint == null) - throw new java.lang.IllegalArgumentException (EXCEPTION_TEXT); - m_type = TYPE_TEXTURE; - m_textureURL = textureURL; - m_primaryColor = taint; - m_compositeAlpha = compositeAlpha; - } // AdempiereColor - - /** - * Set Background to Texture - * - * @param textureURL URL to a *.gif or *.jpg graphic file - * @param taint Color to taint the texture (use white for not tainting it) - * @param compositeAlpha Tainting value from 0 (no - FullGraph) to 1 (full - NoGraph) - */ - public CompiereColor (String textureURL, Color taint, float compositeAlpha) - { - if (textureURL == null || taint == null) - throw new java.lang.IllegalArgumentException (EXCEPTION_TEXT); - m_type = TYPE_TEXTURE; - setTextureURL(textureURL); - m_primaryColor = taint; - m_compositeAlpha = compositeAlpha; - } // AdempiereColor - - /** - * Set Background to Lines - * - * @param lineColor line color - * @param backColor background color - * @param lineWidth Stroke width in point - * @param lineDistance Distance between lines in points - */ - public CompiereColor (Color lineColor, Color backColor, float lineWidth, int lineDistance) - { - if (lineColor == null || backColor == null) - throw new java.lang.IllegalArgumentException (EXCEPTION_TEXT); - m_type = TYPE_LINES; - m_primaryColor = backColor; - m_secondaryColor = lineColor; - m_lineWidth = lineWidth; - m_lineDistance = lineDistance; - } // AdempiereColor - - /** - * Copy Color - * @param cc color - */ - public CompiereColor (CompiereColor cc) - { - if (cc == null) - return; - setColor(cc); - } // AdempiereColor - - /*************************************************************************/ - - /** Type - Default: Gradient */ - private String m_type = TYPE_GRADIENT; - - /** Primary Color - Default Panel back */ - private Color m_primaryColor = UIManager.getColor("Panel.background"); - /** Secondary Color - Default: gray-white */ - private Color m_secondaryColor = new Color (245, 245, 245); - - /** Texture Graph URL */ - private URL m_textureURL = null; - /** Texture Graph */ - private BufferedImage m_image = null; - /** Texture Alpha - Default: 0.7 */ - private float m_compositeAlpha = 0.7f; - - /** Line Width - Default: 1 */ - private float m_lineWidth = 1.0f; - /** Line Distance - Default: 5 */ - private int m_lineDistance = 5; - - /** Gradient Starting point - Default: NORTH_WEST */ - private int m_startPoint = SwingConstants.NORTH_WEST; - /** Gradient repeat distance in points - Default: 100 */ - private int m_repeatDistance = 100; - - /** Background */ - private ColorBackground m_back = null; - - /** Diry marker for repaining Background */ - private boolean m_dirty = true; - /** Logger */ - private static Logger log = Logger.getLogger(CompiereColor.class.getName()); - - /************************************************************************** - * Get BackgroundType (Flat, Gradient, Lines, Texture) - * @return Background Type (see TYPE_* constants) - */ - public String getType() - { - return m_type; - } // getType - - /** - * Flat Background Type (default) - * @return true if Flat background - */ - public boolean isFlat() - { - return TYPE_FLAT.equals(getType()); - } // isFlat - - /** - * Gradient Background Type - * @return true if Gradient background - */ - public boolean isGradient() - { - return TYPE_GRADIENT.equals(getType()); - } // isGradient - - /** - * Line Background Type - * @return true if Line background - */ - public boolean isLine() - { - return TYPE_LINES.equals(getType()); - } // isLine - - /** - * Texture Background Type - * @return true if Texture background - */ - public boolean isTexture() - { - return TYPE_TEXTURE.equals(getType()); - } // isTexture - - - /************************ - * Get Flat Color - * @return Primary Color - */ - public Color getFlatColor() - { - return m_primaryColor; - } // getFlatColor - - /** - * Set Flat Color - * @param color flat color - */ - public void setFlatColor(Color color) - { - if (!isFlat() || color == null) - return; - m_primaryColor = color; - m_dirty = true; - } // getFlatColor - - - /************************ - * Gradient Upper Color - * @return Color or null - */ - public Color getGradientUpperColor() - { - if (!isGradient()) - return null; - return m_primaryColor; - } // getGradientUpperColor - - /** - * Gradient Upper Color - * @param color upper color - */ - public void setGradientUpperColor(Color color) - { - if (!isGradient() || color == null) - return; - m_primaryColor = color; - m_dirty = true; - } // getGradientUpperColor - - /** - * Gradient Lower Color - * @return Color or null - */ - public Color getGradientLowerColor() - { - if (!isGradient()) - return null; - return m_secondaryColor; - } // getGradientLowerColor - - /** - * Gradient Lower Color - * @param color lower color - */ - public void setGradientLowerColor(Color color) - { - if (!isGradient() || color == null) - return; - m_secondaryColor = color; - m_dirty = true; - } // setGradientLowerColor - - /** - * Gradient Starting Point - * @return starting point - e.g. NORTH - or 0 - * @see SwingConstants - */ - public int getGradientStartPoint () - { - if (!isGradient()) - return 0; - return m_startPoint; - } // getGradientStartPoint - - /** - * Gradient Starting Point - * @param startPoint starting point - e.g. NORTH - * @see SwingConstants - */ - public void setGradientStartPoint (int startPoint) - { - if (!isGradient()) - return; - m_startPoint = startPoint; - m_dirty = true; - } // setGradientStartPoint - - /** - * Gradient Repeat Distance in point - * @return Repeat Distance - or 0 - */ - public int getGradientRepeatDistance () - { - if (!isGradient()) - return 0; - return m_repeatDistance; - } // getGradientRepeatDistance - - /** - * Gradient Repeat Distance. - * Zero stands for no repeats - * @param repeatDistance repeat gradient after point x+repeat / y+repeat (depending on direction) - */ - public void setGradientRepeatDistance (int repeatDistance) - { - if (!isGradient()) - return; - m_repeatDistance = repeatDistance; - m_dirty = true; - } // setGradientRepeatDistance - - /** - * Gradient Repeat Distance. - * Zero stands for no repeats - * @param repeatDistanceString repeat gradient after point x+repeat / y+repeat (depending on direction) - */ - public void setGradientRepeatDistance (String repeatDistanceString) - { - if (!isGradient()) - return; - try - { - setGradientRepeatDistance(Integer.parseInt(repeatDistanceString)); - } - catch (Exception e) - { - log.severe("Parsing=" - + repeatDistanceString + " - " + e.getMessage()); - } - } // setGradientRepeatDistance - - - /************************ - * Texture Url - * @return URL (if not found, org.compiere.plaf.background.jpg is used) - */ - public URL getTextureURL() - { - if (!isTexture()) - return null; - if (m_textureURL == null) - m_textureURL = CompiereColor.class.getResource("iDempiere00x100.gif"); - return m_textureURL; - } // getTextureURL - - /** - * Get Texture Image based on Texture URL - * @return Image - */ - public BufferedImage getTextureImage() - { - if (m_image == null) - { - URL url = getTextureURL(); - m_image = CompiereUtils.loadBufferedImage(url, BufferedImage.TYPE_INT_ARGB_PRE); - } - return m_image; - } // getTextureImage - - /** - * Texture Url - * @param url URL to graphic file (jpg) - */ - public void setTextureURL(URL url) - { - if (!isTexture() || url == null) - return; - m_textureURL = url; - m_image = null; - m_dirty = true; - } // setTextureURL - - /** - * Texture Url - * @param urlString URL to graphic file (jpg) - */ - public void setTextureURL(String urlString) - { - if (!isTexture() || urlString == null) - return; - try - { - setTextureURL (new URL(urlString)); - } - catch (Exception e) - { - log.severe("Parsing URL=" - + urlString + " - " + e.getMessage()); - } - } // setTextureURL - - /** - * Texture Taint Color - * @return Color or null - */ - public Color getTextureTaintColor() - { - if (!isTexture()) - return null; - return m_primaryColor; - } // getTextureTaintColor - - /** - * Texture Taint Color - * @param color taint color - */ - public void setTextureTaintColor(Color color) - { - if (!isTexture() || color == null) - return; - m_primaryColor = color; - m_dirty = true; - } // setTextureTaintColor - - /** - * Texture Composite Alpha - * @return Composite Ampha or 0f - */ - public float getTextureCompositeAlpha() - { - if (!isTexture()) - return 0f; - return m_compositeAlpha; - } // getTextureCompositeAlpha - - /** - * Texture Composite Alpha - * @param alpha alpha value - */ - public void setTextureCompositeAlpha(float alpha) - { - if (!isTexture()) - return; - m_compositeAlpha = alpha; - m_dirty = true; - } // setTextureCompositeAlpha - - /** - * Texture Composite Alpha - * @param alphaString String to be parsed - */ - public void setTextureCompositeAlpha(String alphaString) - { - if (!isTexture() || alphaString == null) - return; - try - { - setTextureCompositeAlpha(Float.parseFloat(alphaString)); - } - catch (Exception e) - { - log.severe("Parsing=" - + alphaString + " - " + e.getMessage()); - } - } // setTextureCompositeAlpha - - - /************************ - * Line Color - * @return Color or null - */ - public Color getLineColor() - { - if (!isLine()) - return null; - return m_secondaryColor; - } // getLineColor - - /** - * Line Color - * @param color line color - */ - public void setLineColor(Color color) - { - if (!isLine() || color == null) - return; - m_secondaryColor = color; - m_dirty = true; - } // setLineColor - - /** - * Line Background Color - * @return Color or null - */ - public Color getLineBackColor() - { - if (!isLine()) - return null; - return m_primaryColor; - } // getLineBackColor - - /** - * Line Background Color - * @param color background color - */ - public void setLineBackColor(Color color) - { - if (!isLine() || color == null) - return; - m_primaryColor = color; - m_dirty = true; - } // setLineBackColor - - /** - * Background Line Width - * @return width or 0f - */ - public float getLineWidth() - { - if (!isLine()) - return 0f; - return m_lineWidth; - } // getLineWidth - - /** - * Background Line Width - * @param width line width - */ - public void setLineWidth(float width) - { - if (!isLine()) - return; - m_lineWidth = width; - m_dirty = true; - } // setLineWidth - - /** - * Background Line Width - * @param widthString line width - */ - public void setLineWidth(String widthString) - { - if (!isLine() || widthString == null) - return; - try - { - setLineWidth(Float.parseFloat(widthString)); - } - catch (Exception e) - { - log.severe("Parsing=" - + widthString + " - " + e.getMessage()); - } - } // setLineWidth - - /** - * Background Line distance in pt - * @return distance or 0 - */ - public int getLineDistance() - { - if (!isLine()) - return 0; - return m_lineDistance; - } // getLineDistance - - /** - * Background Line distance in pt - * @param distance line distance - */ - public void setLineDistance(int distance) - { - if (!isLine()) - return; - m_lineDistance = distance; - m_dirty = true; - } // setLineDistance - - /** - * Background Line distance in pt - * @param distanceString line distance - */ - public void setLineDistance(String distanceString) - { - if (!isLine()) - return; - try - { - setLineDistance(Integer.parseInt(distanceString)); - } - catch (Exception e) - { - log.severe("Parsing=" - + distanceString + " - " + e.getMessage()); - } - } // setLineDistance - - /** - * Set Prinary Color - * @param color primary color - */ - protected void setPrimaryColor (Color color) - { - if (color != null) - m_primaryColor = color; - } // setPrimaryColor - - /** - * Set AdempiereColor from AdempiereColor - * @param cc AdempiereColor - */ - public void setColor (CompiereColor cc) - { - if (cc == null) - return; - m_type = cc.getType(); - // - if (cc.isFlat()) - m_primaryColor = cc.getFlatColor(); - else if (cc.isGradient()) - { - m_primaryColor = cc.getGradientUpperColor(); - m_secondaryColor = cc.getGradientLowerColor(); - m_startPoint = cc.getGradientStartPoint(); - m_repeatDistance = cc.getGradientRepeatDistance(); - } - else if (cc.isTexture()) - { - setTextureURL(cc.getTextureURL()); - m_primaryColor = cc.getTextureTaintColor(); - m_compositeAlpha = cc.getTextureCompositeAlpha(); - } - else if (cc.isLine()) - { - m_primaryColor = cc.getLineBackColor(); - m_secondaryColor = cc.getLineColor(); - m_lineWidth = cc.getLineWidth(); - m_lineDistance = cc.getLineDistance(); - } - else - log.severe("Invalid Color"); - // - m_dirty = true; - } // setColor - - - /************************************************************************** - * Fill with AdempiereColor Background - * @param g the Graphics context in which to paint - * @param c the component being painted - */ - public void paint (Graphics g, JComponent c) - { - getColorBackground(c).paint (g, c); - } // paint - - /** - * Fill with Adempiere Background - * @param g graphics - * @param c component - * @param x x pos - * @param y y pos - * @param w with - * @param h height - */ - public void paintRect (Graphics g, JComponent c, int x, int y, int w, int h) - { - getColorBackground(c).paintRect (g,c, x,y, w,h); - } // paintRect - - /** - * Get Background - * @param c Componenr - * @return Background - */ - private ColorBackground getColorBackground (JComponent c) - { - if (m_back == null) - { - Rectangle bounds = c.getBounds(); - Container container = c.getParent(); - while (container != null) - { - bounds = container.getBounds(bounds); - container = container.getParent(); - } - m_back = new ColorBackground (bounds); - } - return m_back; - } // getBackground - - - /************************************************************************** - * String representation - * @return string representation - */ - public String toString() - { - StringBuilder sb = new StringBuilder ("AdempiereColor["); - if (isFlat()) - sb.append("Flat") - .append(" ").append(ThemeUtils.getColorAsString(getFlatColor())); - else if (isGradient()) - sb.append("Gradient") - .append(" Upper=").append(ThemeUtils.getColorAsString(getGradientUpperColor())) - .append(",Lower=").append(ThemeUtils.getColorAsString(getGradientLowerColor())) - .append(",Start=").append(getGradientStartPoint()) - .append(",RDistance=").append(getGradientRepeatDistance()); - else if (isLine()) - sb.append("Line") - .append(" Color=").append(ThemeUtils.getColorAsString(getLineColor())) - .append(",BackColor=").append(ThemeUtils.getColorAsString(getLineBackColor())) - .append(",Width=").append(getLineWidth()) - .append(",Distance=").append(getLineDistance()); - else if (isTexture()) - sb.append("Texture") - .append(" GraphURL=").append(getTextureURL()) - .append(",Taint=").append(ThemeUtils.getColorAsString(getTextureTaintColor())) - .append(",Alpha=").append(getTextureCompositeAlpha()); - sb.append("]"); - return sb.toString(); - } // toString - - /** - * Parse String Representation and set Attributes - * @param str parse string - */ - private void parseAttributres (String str) - { - if (str.indexOf("[Flat ") != -1) - { - m_type = TYPE_FLAT; - m_primaryColor = ThemeUtils.parseColor(str, - new ColorUIResource(m_primaryColor)); - } - else if (str.indexOf("[Gradient ") != -1) - { - m_type = TYPE_GRADIENT; - m_primaryColor = ThemeUtils.parseColor(str.substring(str.indexOf(" Upper=")+7, str.indexOf(",Lower=")), - new ColorUIResource(m_primaryColor)); - m_secondaryColor = ThemeUtils.parseColor(str.substring(str.indexOf(",Lower=")+7, str.indexOf(",Start=")), - new ColorUIResource(m_secondaryColor)); - m_startPoint = Integer.parseInt(str.substring(str.indexOf(",Start=")+7, str.indexOf(",RDistance="))); - setGradientRepeatDistance(str.substring(str.indexOf(",RDistance=")+11, str.lastIndexOf(']'))); - } - else if (str.indexOf("[Line ") != -1) - { - m_type = TYPE_LINES; - m_primaryColor = ThemeUtils.parseColor(str.substring(str.indexOf(" Color=")+7, str.indexOf(",BackColor=")), - new ColorUIResource(m_primaryColor)); - m_secondaryColor = ThemeUtils.parseColor(str.substring(str.indexOf(",BackColor=")+11, str.indexOf(",Width=")), - new ColorUIResource(m_secondaryColor)); - setLineWidth(str.substring(str.indexOf(",Width=")+7, str.indexOf(",Distance="))); - setLineDistance(str.substring(str.indexOf(",Distance=")+10, str.lastIndexOf(']'))); - } - else if (str.indexOf("[Texture ") != -1) - { - m_type = TYPE_TEXTURE; - setTextureURL (str.substring(str.indexOf(" GraphURL=")+10, str.indexOf(",Taint="))); - m_primaryColor = ThemeUtils.parseColor(str.substring(str.indexOf(",Taint=")+7, str.indexOf(",Alpha=")), - new ColorUIResource(m_primaryColor)); - setTextureCompositeAlpha (str.substring(str.indexOf(",Alpha=")+7, str.lastIndexOf(']'))); - } - } // parseString - - /** - * Does the background needs to be redone - * @return true if there were changes - */ - boolean isDirty() - { - return m_dirty; - } // isDirty - - /** - * Set Dirty - * @param dirty if true, the background will be re-painted - */ - void setDirty (boolean dirty) - { - m_dirty = dirty; - } // setDirty - - -/****************************************************************************** - * Background contains a Buffered Image with the background. - * The initial size is determined by the constructor. - * It is resized if required when painting. - *
    - * The Buffered image is a 8-bit RGBA color components packed into integer pixels. - * The image has a DirectColorModel with alpha. The color data in this image - * is considered to be premultiplied with alpha - */ -public class ColorBackground -{ - /** - * Create Color Background - * @param bounds Rectangle to fit in - */ - public ColorBackground (Rectangle bounds) - { - createColorBackground (bounds); - fillColorBackground (); - } // Background - - private int m_height = 200; - private int m_width = 200; - private BufferedImage m_backImage; - private int m_colorBlind = ColorBlind.getColorType(); - - /** - * Create Color Background - * @param bounds Rectangle to fit in - */ - private void createColorBackground (Rectangle bounds) - { - m_height = Math.max(bounds.y + bounds.height, m_height); - m_width = Math.max(bounds.x + bounds.width, m_width); - m_backImage = new BufferedImage (m_width, m_height, BufferedImage.TYPE_INT_ARGB_PRE); - } // create Background - - - /** - * Fill Background with Color - */ - public void fillColorBackground () - { - Graphics2D g2D = m_backImage.createGraphics(); - - if (isGradient()) - { - Point start = null; - Point end = null; - int r = 1; // repeats - switch (m_startPoint) - { - case SwingConstants.NORTH_WEST: - start = new Point (0, 0); - if (m_repeatDistance > 0) - end = new Point (m_repeatDistance, m_repeatDistance); - // end = new Point (Math.min(m_repeatDistance, m_width), Math.min(m_repeatDistance, height)); - else - end = new Point (m_width/r, m_height/r); - break; - case SwingConstants.WEST: - start = new Point (0, m_height/2); - if (m_repeatDistance > 0) - end = new Point (m_repeatDistance, m_height/2); - // end = new Point (Math.min(m_repeatDistance, m_width), m_height/2); - else - end = new Point (m_width/r, m_height/2); - break; - case SwingConstants.SOUTH_WEST: - start = new Point (0, m_height); - if (m_repeatDistance > 0) - end = new Point (m_repeatDistance, m_height-m_repeatDistance); - // end = new Point (Math.min(m_width, m_repeatDistance), Math.max(0, m_height-m_repeatDistance)); - else - end = new Point (m_width/r, m_height-(m_height/r)); - break; - case SwingConstants.SOUTH: - start = new Point (0, m_height); - if (m_repeatDistance > 0) - end = new Point (0, m_height-m_repeatDistance); - // end = new Point (0, Math.max(0, m_height-m_repeatDistance)); - else - end = new Point (0, m_height-(m_height/r)); - break; - case SwingConstants.SOUTH_EAST: - start = new Point (m_width, m_height); - if (m_repeatDistance > 0) - end = new Point (m_width-m_repeatDistance, m_height-m_repeatDistance); - // end = new Point (Math.min(0, m_width-m_repeatDistance), Math.max(0, m_height-m_repeatDistance)); - else - end = new Point (m_width-(m_width/r), m_height-(m_height/r)); - break; - case SwingConstants.EAST: - start = new Point (m_width, m_height/2); - if (m_repeatDistance > 0) - end = new Point (m_width-m_repeatDistance, m_height/2); - // end = new Point (Math.min(0, m_width-m_repeatDistance), m_height/2); - else - end = new Point (m_width-(m_width/r), m_height/2); - break; - case SwingConstants.NORTH_EAST: - start = new Point (m_width, 0); - if (m_repeatDistance > 0) - end = new Point (m_width-m_repeatDistance, m_repeatDistance); - // end = new Point (Math.min(0, m_width-m_repeatDistance), Math.min(m_height, m_repeatDistance)); - else - end = new Point (m_width-(m_width/r), m_height/r); - break; - default: - case SwingConstants.NORTH: - start = new Point (0, 0); - if (m_repeatDistance > 0) - end = new Point (0, m_repeatDistance); - // end = new Point (0, Math.min(m_height, m_repeatDistance)); - else - end = new Point (0, m_height/r); - } - GradientPaint paint = new GradientPaint( - start, - ColorBlind.getDichromatColor(getGradientUpperColor()), - end, - ColorBlind.getDichromatColor(getGradientLowerColor()), - true); // cyclic - g2D.setPaint(paint); - g2D.fillRect(0, 0, m_width, m_height); - } - else if (isTexture()) - { - BufferedImage image = getTextureImage(); - if (image == null) - { - g2D.setPaint(ColorBlind.getDichromatColor(getFlatColor())); - g2D.fillRect(0, 0, m_width, m_height); - } - else - { - Rectangle anchor = new Rectangle (0,0, image.getWidth(), image.getHeight()); - TexturePaint texture = new TexturePaint (image, anchor); - g2D.setPaint(texture); - g2D.fillRect(0, 0, m_width, m_height); - g2D.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, getTextureCompositeAlpha())); - g2D.setPaint(ColorBlind.getDichromatColor(getTextureTaintColor())); - g2D.fillRect(0, 0, m_width, m_height); - } - } - else if (isLine()) - { - // Background - g2D.setPaint(ColorBlind.getDichromatColor(getLineBackColor())); - g2D.fillRect(0, 0, m_width, m_height); - // Lines - g2D.setPaint(ColorBlind.getDichromatColor(getLineColor())); - g2D.setStroke(new BasicStroke(getLineWidth())); - for (int y = 0; y < m_height; y += getLineDistance()) - g2D.drawLine(0, y, m_width, y); - } - else // flat - { - g2D.setPaint(ColorBlind.getDichromatColor(getFlatColor())); - g2D.fillRect(0, 0, m_width, m_height); - } - setDirty (false); - } // fillBackground - - /** - * Paint/copy background to component - * @param g graphics - * @param c component - */ - public void paint (Graphics g, JComponent c) - { - Rectangle bounds = c.getBounds(); - check (bounds); - // - int h = c.getHeight(); - int w = c.getWidth(); - // Copy Background - g.drawImage (m_backImage, - 0, 0, // destination start point - w, h, // destination end point - bounds.x, bounds.y, // source start - bounds.x+w, bounds.y+h, // source end - c); - } // paint - - /** - * Paint/copy background to component rectangle - * @param g graphics - * @param c compnent - * @param x x pos - * @param y y pos - * @param w width - * @param h height - */ - public void paintRect (Graphics g, JComponent c, int x, int y, int w, int h) - { - Rectangle bounds = c.getBounds(); - check (bounds); - // Copy Background - g.drawImage (m_backImage, - x, y, // destination start point - x+w, h+y, // destination end point - x, y, // source start - x+w, y+h, // source end - c); - } // paint - - /** - * Check size of background and repaint if required - * @param bounds Bounds of component - */ - private void check (Rectangle bounds) - { - // Re-Create, if Color Type changed - if (ColorBlind.getColorType() != m_colorBlind) - { - m_colorBlind = ColorBlind.getColorType(); - setDirty(true); - } - // we need to create new background - if ((m_height < (bounds.y + bounds.height)) - || (m_width < (bounds.x + bounds.width))) - { - createColorBackground (bounds); - fillColorBackground(); - } - else if (isDirty()) - fillColorBackground(); - } // check - -} // ColorBackground - -} // AdempiereColor diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereComboBoxUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereComboBoxUI.java deleted file mode 100644 index 21f5c83d38..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereComboBoxUI.java +++ /dev/null @@ -1,114 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.event.MouseListener; - -import javax.swing.Icon; -import javax.swing.JButton; -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.ComboPopup; -import javax.swing.plaf.metal.MetalComboBoxButton; -import javax.swing.plaf.metal.MetalComboBoxUI; - - -/** - * Adempiere ComboBox UI. - * The ComboBox is opaque - with opaque arrow button and textfield background - * - * @author Jorg Janke - * @version $Id: AdempiereComboBoxUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereComboBoxUI extends MetalComboBoxUI -{ - /** - * Create UI - * @param c - * @return new instance of AdempiereComboBoxUI - */ - public static ComponentUI createUI(JComponent c) - { - return new CompiereComboBoxUI(); - } // CreateUI - - /*************************************************************************/ - - static int s_no = 0; - /** - * Install UI - Set ComboBox opaque. - * Bug in Metal: arrowButton gets Mouse Events, so add the JComboBox - * MouseListeners to the arrowButton - * @see org.compiere.swing.CComboBox#addMouseListener(MouseListener) - * @param c componrnt - */ - public void installUI (JComponent c) - { - MouseListener[] ml = c.getMouseListeners(); - super.installUI(c); - c.setOpaque(false); - // - for (int i = 0; i < ml.length; i++) - { - // System.out.println("adding " + c.getClass().getName()); - arrowButton.addMouseListener(ml[i]); - } - - } // installUI - - /*************************************************************************/ - - /** - * Create opaque button - * @return opaque button - */ - protected JButton createArrowButton() - { - JButton button = super.createArrowButton(); - button.setContentAreaFilled(false); - button.setOpaque(false); - return button; - } // createArrowButton - - public JButton getArrowButton() - { - return arrowButton; - } - - /** - * Set Icon of arrow button - * @param defaultIcon - */ - public void setIcon(Icon defaultIcon) - { - ((MetalComboBoxButton)arrowButton).setComboIcon(defaultIcon); - } // setIcon - - /*************************************************************************/ - - /** - * Create Popup - * @return AdempiereComboPopup - */ - protected ComboPopup createPopup() - { - CompiereComboPopup newPopup = new CompiereComboPopup( comboBox ); - newPopup.getAccessibleContext().setAccessibleParent(comboBox); - return newPopup; - } // createPopup - -} // AdempiereComboBoxUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereComboPopup.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereComboPopup.java deleted file mode 100644 index e30a6816bd..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereComboPopup.java +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import javax.swing.JComboBox; -import javax.swing.plaf.basic.BasicComboPopup; - -import org.compiere.swing.CComboBox; -import org.compiere.swing.CField; - -/** - * Adempiere Combo Popup - allows to prevent the display of the popup - * - * @author Jorg Janke - * @version $Id: AdempiereComboPopup.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereComboPopup extends BasicComboPopup -{ - /** - * - */ - private static final long serialVersionUID = 2031710222285745816L; - - /** - * Constructor - * @param combo - */ - public CompiereComboPopup(JComboBox combo) - { - super(combo); - } // AdempiereComboPopup - - /** - * Conditionally show the Popup. - * If the combo is a CComboBox/CField, the return value of the - * method displayPopup determines if the popup is actually displayed - * @see CComboBox#displayPopup() - * @see CField#displayPopup() - */ - public void show() - { - // Check ComboBox if popup should be displayed - if (comboBox instanceof CComboBox && !((CComboBox)comboBox).displayPopup()) - return; - // Check Field if popup should be displayed - if (comboBox instanceof CField && !((CField)comboBox).displayPopup()) - return; - super.show(); - } // show - - - /** - * Inform CComboBox and CField that Popup was hidden - * @see CComboBox.hidingPopup - * @see CField.hidingPopup - * - public void hide() - { - super.hide(); - // Inform ComboBox that popup was hidden - if (comboBox instanceof CComboBox) - (CComboBox)comboBox).hidingPopup(); - else if (comboBox instanceof CComboBox) - (CComboBox)comboBox).hidingPopup(); - } // hided - /**/ -} // AdempiereComboPopup diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereLabelUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereLabelUI.java deleted file mode 100644 index 64b859b4c3..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereLabelUI.java +++ /dev/null @@ -1,164 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.Component; -import java.awt.Container; -import java.awt.FocusTraversalPolicy; -import java.awt.event.ActionEvent; - -import javax.swing.ActionMap; -import javax.swing.InputMap; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.KeyStroke; -import javax.swing.SwingUtilities; -import javax.swing.plaf.ComponentInputMapUIResource; -import javax.swing.plaf.metal.MetalLabelUI; - -import org.jdesktop.swingx.UIAction; - -/** - * Adempiere Label UI - * - * @author Jorg Janke - * @version $Id: AdempiereLabelUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereLabelUI extends MetalLabelUI -{ - /** Singleton */ - protected static CompiereLabelUI adempiereLabelUI = new CompiereLabelUI(); - - /** - * Create UI - * @param c component - * @return singleton - */ - public static CompiereLabelUI createUI(JComponent c) - { - return adempiereLabelUI; - } // createUI - - /** - * Install Keyboard Actions - * @param l label - */ - protected void installKeyboardActions (JLabel l) - { - // super.installKeyboardActions(l); - int dka = l.getDisplayedMnemonic(); - if (dka != 0) - { - Component lf = l.getLabelFor(); - if (lf != null) - { - ActionMap actionMap = l.getActionMap(); - actionMap.put(PRESS, ACTION_PRESS); - InputMap inputMap = SwingUtilities.getUIInputMap (l, JComponent.WHEN_IN_FOCUSED_WINDOW); - if (inputMap == null) - { - inputMap = new ComponentInputMapUIResource (l); - SwingUtilities.replaceUIInputMap (l, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); - } - inputMap.clear (); - inputMap.put (KeyStroke.getKeyStroke (dka, - ActionEvent.SHIFT_MASK+ActionEvent.CTRL_MASK, false), PRESS); - } - } - } // installKeyboardActions - - - /** Action Name */ - private static final String PRESS = "press"; - /** Press Action */ - private static PressAction ACTION_PRESS = new PressAction(); - - /** - * Adempiere Label UI Actions - */ - private static class PressAction extends UIAction - { - - PressAction () - { - super (PRESS); - } - - public void actionPerformed (ActionEvent e) - { - JLabel label = (JLabel)e.getSource (); - String key = getName (); - if (key.equals(PRESS)) - { - doPress (label); - } - } // actionPerformed - - /** - * Do Press - Focus the Field - * @param label label - */ - private void doPress (JLabel label) - { - Component labelFor = label.getLabelFor (); - if (labelFor != null && labelFor.isEnabled ()) - { - Component owner = label.getLabelFor (); - if (owner instanceof Container - && ((Container)owner).isFocusCycleRoot ()) - { - owner.requestFocus (); - } - else - { - if (owner instanceof Container) - { - Container container = (Container)owner; - if (container.isFocusCycleRoot()) - { - FocusTraversalPolicy policy = container.getFocusTraversalPolicy(); - Component comp = policy.getDefaultComponent(container); - if (comp != null) - { - comp.requestFocus(); - return; - } - } - Container rootAncestor = container.getFocusCycleRootAncestor(); - if (rootAncestor != null) - { - FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy(); - Component comp = policy.getComponentAfter(rootAncestor, container); - if (comp != null && SwingUtilities.isDescendingFrom(comp, container)) - { - comp.requestFocus(); - return; - } - } - } - if (owner.isFocusable()) - { - owner.requestFocus(); - return; - } - // No Forcus - } - } - } // doPress - } // PressAction - -} // AdempiereLabelUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereLookAndFeel.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereLookAndFeel.java deleted file mode 100644 index fd9a225ac3..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereLookAndFeel.java +++ /dev/null @@ -1,252 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.Color; -import java.awt.Component; - -import javax.swing.UIDefaults; -import javax.swing.plaf.metal.MetalLookAndFeel; -import javax.swing.plaf.metal.MetalTheme; - -/** - * Compiere Look & Feel. - * We wanted a nice UI not the battleship gray based stuff. - * I guess a matter of taste. - * - * : - * UIManager.setLookAndFeel(new com.adempiere.plaf.AdempiereLookAndFeel()); - * // or UIManager.setLookAndFeel("com.adempiere.plaf.AdempiereLookAndFeel"); - * - * - * @author Jorg Janke - * @version $Id: AdempiereLookAndFeel.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereLookAndFeel extends MetalLookAndFeel -{ - /** - * - */ - private static final long serialVersionUID = -5141712405407428104L; - - /** - * Constructor - */ - public CompiereLookAndFeel() - { - super(); - // System.setProperty("awt.visualbell", "true"); - } // AdempiereLookAndFeel - - /** The name */ - public static final String NAME = "Compiere"; - - /** The Theme */ - private static CompiereTheme s_compiereTheme = new CompiereThemeBlueMetal(); - private static MetalTheme s_theme = s_compiereTheme; - - /** Paint Round Corners */ - protected static boolean ROUND = false; - - /** Key of Client Property to paint in CompiereColor */ - public static final String BACKGROUND = "CompiereBackground"; - /** Key of Client Property for Rectangle Items - if exists, the standard background is used */ - public static final String BACKGROUND_FILL = "CompiereBackgroundFill"; - /** Key of Client Property for CPanel */ - public static final String TABLEVEL = "TabLevel"; - - /** Version tag */ - public static final String VERSION = "R1.4.0"; - - /** - * The Name - * @return Name - */ - public String getName() - { - return NAME; - } // getName - - /** - * The ID - * @return Name - */ - public String getID() - { - return NAME; - } // getID - - /** - * The Description - * @return description - */ - public String getDescription() - { - return "Compiere Look & Feel - (c) 2001-2005 Jorg Janke"; - } // getDescription - - - /************************************************************************** - * Get/Create Defaults - * @return UI Defaults - */ - public UIDefaults getDefaults() - { - // Theme already created/set - MetalLookAndFeel.setCurrentTheme(s_theme); - UIDefaults defaults = super.getDefaults(); // calls init..Defaults - return defaults; - } // getDefaults - - /** - * Creates the mapping from UI class IDs to ComponentUI classes, - * putting the ID-ComponentUI pairs in the passed-in defaults table. - * Each JComponent class specifies its own UI class ID string. - * - * @param table UI Defaults - */ - protected void initClassDefaults(UIDefaults table) - { - super.initClassDefaults( table); - // Overwrite - putDefault (table, "PanelUI"); - putDefault (table, "ButtonUI"); - putDefault (table, "ToggleButtonUI"); - putDefault (table, "TabbedPaneUI"); - putDefault (table, "TableHeaderUI"); - putDefault (table, "RadioButtonUI"); - putDefault (table, "CheckBoxUI"); - putDefault (table, "ComboBoxUI"); - putDefault (table, "MenuUI"); - putDefault (table, "MenuBarUI"); - putDefault (table, "MenuItemUI"); - putDefault (table, "CheckBoxMenuItemUI"); - putDefault (table, "ToolBarUI"); - putDefault (table, "RootPaneUI"); - putDefault (table, "ViewportUI"); - putDefault (table, "SplitPaneUI"); - putDefault (table, "ScrollPaneUI"); - putDefault (table, "LabelUI"); - putDefault (table, "ToolTipUI"); - putDefault (table, "TextAreaUI"); - - } // initClassDefaults - - /** - * Put "uiKey - ClassName" pair in UIDefaults - * @param table - * @param uiKey - */ - private void putDefault (UIDefaults table, String uiKey) - { - try - { - String className = "org.compiere.plaf.Compiere" + uiKey; - table.put(uiKey, className); - } - catch (Exception ex) - { - ex.printStackTrace(); - } - } // putDefault - - /** - * For overwriting Component defaults - * @param table - */ - protected void initSystemColorDefaults (UIDefaults table) - { - super.initSystemColorDefaults( table); - } // initSystemColorDefaults - - /** - * For overwriting Component defaults - * @param table - */ - protected void initComponentDefaults (UIDefaults table) - { - super.initComponentDefaults( table); - - // ComboBox defaults - Color c = table.getColor("TextField.background"); - table.put("ComboBox.background", c); - table.put("ComboBox.listBackground", c); - } // initComponentDefaults - - - /************************************************************************** - * Create Default Themes - */ - protected void createDefaultTheme() - { - setCurrentTheme(s_theme); - } // createDefaultTheme - - /** - * Set Current Theme - * @param theme metal theme - */ - public static void setCurrentTheme (MetalTheme theme) - { - if (theme != null) - s_theme = theme; - MetalLookAndFeel.setCurrentTheme(s_theme); - } // setCurrentTheme - - /** - * Get Current Theme - * @return Metal Theme - */ - public static MetalTheme getCurrentTheme() - { - return s_theme; - } // getCurrentTheme - - /** - * Get Compiere Theme - * @return Metal Theme - */ - public static CompiereTheme getCompiereTheme() - { - return s_compiereTheme; - } // getCurrentTheme - - /** - * Error Feedback. - *

    - * Invoked when the user attempts an invalid operation, - * such as pasting into an uneditable JTextField - * that has focus. - *

    - *

    - * If the user has enabled visual error indication on - * the desktop, this method will flash the caption bar - * of the active window. The user can also set the - * property awt.visualbell=true to achieve the same - * results. - *

    - * @param component Component the error occured in, may be - * null indicating the error condition is - * not directly associated with a - * Component. - */ - public void provideErrorFeedback (Component component) - { - super.provideErrorFeedback (component); - } // provideErrorFeedback - -} // AdempiereLookAndFeel diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereMenuBarUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereMenuBarUI.java deleted file mode 100644 index 7233fb8723..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereMenuBarUI.java +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.Graphics; - -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.metal.MetalMenuBarUI; - -/** - * Adempiere Menu Bar UI. - * Main Menu background - * - * @author Jorg Janke - * @version $Id: AdempiereMenuBarUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereMenuBarUI extends MetalMenuBarUI -{ - /** - * Create own instance - * @param x - * @return AdempiereMenuBarUI - */ - public static ComponentUI createUI (JComponent x) - { - return new CompiereMenuBarUI(); - } // createUI - - /** - * Install UI - * @param c - */ - public void installUI (JComponent c) - { - super.installUI(c); - c.setOpaque(true); - } // installUI - - /** - * Update UI - * @param g graphics - * @param c component - */ - public void update (Graphics g, JComponent c) - { - if (c.isOpaque()) - { - // Get AdempiereColor - CompiereColor bg = CompiereColor.getDefaultBackground(); - bg.paint (g, c); - } - else - { - g.setColor(c.getBackground()); - g.fillRect(0,0, c.getWidth(), c.getHeight()); - } - paint(g,c); - } // update - -} // AdempiereMenuBarUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereMenuItemUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereMenuItemUI.java deleted file mode 100644 index 5dba81309f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereMenuItemUI.java +++ /dev/null @@ -1,92 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.Color; -import java.awt.Graphics; - -import javax.swing.ButtonModel; -import javax.swing.JComponent; -import javax.swing.JMenuItem; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicMenuItemUI; - -/** - * Menu Item UI - * - * @author Jorg Janke - * @version $Id: AdempiereMenuItemUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereMenuItemUI extends BasicMenuItemUI -{ - /** - * Create own instance - * @param c compoment - * @return AdempiereMenuBarUI - */ - public static ComponentUI createUI(JComponent c) - { - return new CompiereMenuItemUI(); - } // createUI - - /** - * Install UI - * @param c - */ - public void installUI (JComponent c) - { - super.installUI(c); - c.setOpaque(false); // use MenuBarUI background - } // installUI - - /** - * Update UI - * @param g graphics - * @param c component - */ - public void update (Graphics g, JComponent c) - { - if (c.isOpaque()) - { - CompiereColor bg = CompiereColor.getDefaultBackground(); - bg.paint (g, c); - // - // g.setColor(c.getBackground()); - // g.fillRect(0,0, c.getWidth(), c.getHeight()); - } - paint(g,c); - } // update - - /** - * Paint Background - * @param g graphics - * @param menuItem menu - * @param bgColor bg color - */ - protected void paintBackground (Graphics g, JMenuItem menuItem, Color bgColor) - { - ButtonModel model = menuItem.getModel(); - if (model.isArmed()) - super.paintBackground (g, menuItem, bgColor); - else - { - CompiereColor bg = CompiereColor.getDefaultBackground(); - bg.paint (g, menuItem); - } - } // paintBackground - -} // AdempiereMenuItemUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereMenuUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereMenuUI.java deleted file mode 100644 index e74d517f80..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereMenuUI.java +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicMenuUI; - -/** - * Adempiere Menu UI. - * The main menu. - * - * @author Jorg Janke - * @version $Id: AdempiereMenuUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereMenuUI extends BasicMenuUI -{ - /** - * Create own instance - * @param x - * @return AdempiereMenuBarUI - */ - public static ComponentUI createUI(JComponent x) - { - return new CompiereMenuUI(); - } // createUI - - /** - * Install UI - * @param c - */ - public void installUI (JComponent c) - { - super.installUI(c); - c.setOpaque(false); // use MenuBarUI background - } // installUI - -} // AdempiereMenuUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompierePanelUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompierePanelUI.java deleted file mode 100644 index ae6e3b296a..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompierePanelUI.java +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.Graphics; - -import javax.swing.JComponent; -import javax.swing.JPanel; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicPanelUI; - -/** - * Panel UI. - * The default properties can be set via - *
    - *  AdempierePanelUI.setDefaultBackground (new AdempiereColor());
    - *  
    - * The individual Panel can set the background type by setting the - * parameter via - *
    - *  putClientProperty(AdempierePanelUI.BACKGROUND, new AdempiereColor());
    - *  
    - * @see org.compiere.swing.CPanel - * - * @author Jorg Janke - * @version $Id: AdempierePanelUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompierePanelUI extends BasicPanelUI -{ - /** - * Static Create UI - * @param c JComponent - * @return Adempiere Panel UI - */ - public static ComponentUI createUI (JComponent c) - { - // return new AdempierePanelUI(); - return s_panelUI; - } // createUI - - /** UI */ - private static CompierePanelUI s_panelUI = new CompierePanelUI(); - - - /************************************************************************** - * Install Defaults - * @param p Panel - */ - protected void installDefaults (JPanel p) - { - super.installDefaults(p); - /** If enabled, all windows are with Adempiere Background, - * but Sun dialogs (print ..) are "patchy" as they are opaque ** - // System.out.println ("BG=" + p.getClientProperty(AdempierePLAF.BACKGROUND)); - if (s_setDefault || p.getClientProperty(AdempierePLAF.BACKGROUND) == null) - p.putClientProperty (AdempierePLAF.BACKGROUND, s_default); - /** **/ - } // installDefaults - - - /************************************************************************** - * Update. - * This method is invoked by JComponent when the specified - * component is being painted. - * - * By default this method will fill the specified component with - * its background color (if its opaque property is - * true) and then immediately call paint. - * - * @param g the Graphics context in which to paint - * @param c the component being painted - * - * @see javax.swing.JComponent#paintComponent - */ - public void update (Graphics g, JComponent c) - { - // AdempiereUtils.printParents (c); - if (c.isOpaque()) - updateIt (g, c); - paint (g, c); // does nothing - } // update - - /** - * Print background based on AdempiereColor or flat background if not found - * @param g - * @param c - */ - static void updateIt (Graphics g, JComponent c) - { - // System.out.print("Panel " + c.getName()); - // System.out.print(" Bounds=" + c.getBounds().toString()); - // System.out.print(" - Background: "); - - // Get AdempiereColor - CompiereColor bg = null; - try - { - bg = (CompiereColor)c.getClientProperty(CompiereLookAndFeel.BACKGROUND); - } - catch (Exception e) - { - System.err.println("AdempierePanelUI - ClientProperty: " + e.getMessage()); - } - // paint adempiere background - if (bg != null) - { - // System.out.print(bg); - bg.paint (g, c); - } - else - { - // System.out.print(c.getBackground()); - g.setColor(c.getBackground()); - g.fillRect(0,0, c.getWidth(), c.getHeight()); - } - // System.out.println(); - } // updateIt - - /*************************************************************************/ - - -} // AdempierePanel diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereRadioButtonUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereRadioButtonUI.java deleted file mode 100644 index 0973feb52f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereRadioButtonUI.java +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import javax.swing.AbstractButton; -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.metal.MetalRadioButtonUI; - -/** - * Adempiere Radio Button UI - * - * @author Jorg Janke - * @version $Id: AdempiereRadioButtonUI.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $ - */ -public class CompiereRadioButtonUI extends MetalRadioButtonUI -{ - /** - * Create UI - * @param c component - * @return ComponentUI - */ - public static ComponentUI createUI (JComponent c) - { - return s_radioButtonUI; - } // createUI - - /** UI */ - private static final CompiereRadioButtonUI s_radioButtonUI = new CompiereRadioButtonUI(); - - - /************************************************************************** - * Install Defaults - * @param b Button - */ - public void installDefaults (AbstractButton b) - { - super.installDefaults(b); - b.setOpaque(false); - } // installDefaults - -} // AdempiereRadioButtonUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereRootPaneUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereRootPaneUI.java deleted file mode 100644 index 10b17f07fa..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereRootPaneUI.java +++ /dev/null @@ -1,33 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import javax.swing.plaf.metal.MetalRootPaneUI; - -/** - * Root Pane UI - * - * @author Jorg Janke - * @version $Id: AdempiereRootPaneUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereRootPaneUI extends MetalRootPaneUI -{ -/** - * MetalTitlePane does the Layout & Painting of the Window including System MenuBar - * The titlePane is private in MetalRootPaneUI - */ -} // AdempiereRootPaneUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereScrollPaneUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereScrollPaneUI.java deleted file mode 100644 index d42c505a13..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereScrollPaneUI.java +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import javax.swing.JComponent; -import javax.swing.JScrollPane; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.metal.MetalScrollPaneUI; - -/** - * Adempiere Scroll Pane UI - * - * @author Jorg Janke - * @version $Id: AdempiereScrollPaneUI.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $ - */ -public class CompiereScrollPaneUI extends MetalScrollPaneUI -{ - /** - * Create UI (not shared) - * @param x - * @return UI - */ - public static ComponentUI createUI(JComponent x) - { - return new CompiereScrollPaneUI(); - } // createUI - - /** - * Install UI - * @param c - */ - public void installUI (JComponent c) - { - super.installUI(c); - c.setOpaque(false); - // was ignored as set in constructor after updateUI - Sun bug: 138828 - ((JScrollPane)c).getViewport().setOpaque(false); - } // installUI - -} // AdempiereScrollPaneUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereSplitPaneDivider.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereSplitPaneDivider.java deleted file mode 100644 index d451ade5cd..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereSplitPaneDivider.java +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.Graphics; - -import javax.swing.plaf.basic.BasicSplitPaneDivider; -import javax.swing.plaf.basic.BasicSplitPaneUI; - -/** - * Split Pane Divider - * - * @author Jorg Janke - * @version $Id: AdempiereSplitPaneDivider.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -class CompiereSplitPaneDivider extends BasicSplitPaneDivider -{ - /** - * - */ - private static final long serialVersionUID = 8912837390203690804L; - - /** - * Constructor - * @param ui - */ - public CompiereSplitPaneDivider (BasicSplitPaneUI ui) - { - super (ui); - // BasicBorders$SplitPaneDividerBorder - ignored set after constructor - setBorder(null); - } // AdempiereSplitPaneDivider - - /** - * Paints the divider. - * If the border is painted, it creates a light gray bar on top/button. - * Still, a light gray 1 pt shaddow border is painted on top/button - * @param g - */ - public void paint (Graphics g) - { - // BasicBorders$SplitPaneDividerBorder - setBorder(null); - super.paint(g); - } // paint - -} // AdempiereSplitPaneDivider diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereSplitPaneUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereSplitPaneUI.java deleted file mode 100644 index b4ac64e70e..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereSplitPaneUI.java +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicSplitPaneDivider; -import javax.swing.plaf.basic.BasicSplitPaneUI; - -/** - * Adempiere Split Pane UI. - * When moving, the divider is painted in darkGray. - * - * @author Jorg Janke - * @version $Id: AdempiereSplitPaneUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereSplitPaneUI extends BasicSplitPaneUI -{ - /** - * Creates a new MetalSplitPaneUI instance - * @param x - * @return ComponentUI - */ - public static ComponentUI createUI (JComponent x) - { - return new CompiereSplitPaneUI(); - } // createUI - - /** - * Creates the default divider. - * @return SplitPaneDivider - */ - public BasicSplitPaneDivider createDefaultDivider() - { - return new CompiereSplitPaneDivider (this); - } - - /** - * Installs the UI. - * @param c - */ - public void installUI (JComponent c) - { - super.installUI(c); - c.setOpaque(false); - // BasicBorders$SplitPaneBorder paints gray border - // resulting in a 2pt border for the left/right components - // but results in 1pt gray line on top/button of divider. - // Still, a 1 pt shaddow light gay line is painted - c.setBorder(null); - } // installUI - - - -} // AdempiereSplitPaneUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTabbedPaneUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTabbedPaneUI.java deleted file mode 100644 index 09a9f75378..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTabbedPaneUI.java +++ /dev/null @@ -1,1068 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.FontMetrics; -import java.awt.GradientPaint; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Insets; -import java.awt.LayoutManager; -import java.awt.Polygon; -import java.awt.Rectangle; -import java.awt.Shape; - -import javax.swing.Icon; -import javax.swing.JComponent; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicGraphicsUtils; -import javax.swing.plaf.metal.MetalTabbedPaneUI; - -/** - * Same implementation detail as in AdempierePanelUI. - * Additional handling of dwawing tabs. - * @see CompierePanelUI - * - * @author Jorg Janke - * @version $Id: AdempiereTabbedPaneUI.java,v 1.3 2006/07/30 00:52:23 jjanke Exp $ - */ -public class CompiereTabbedPaneUI extends MetalTabbedPaneUI -{ - /** - * Static Create UI - * @param c Component - * @return Adempiere TabbedPaneUI - */ - public static ComponentUI createUI(JComponent c) - { - return new CompiereTabbedPaneUI(); - } // createUI - - /** - * Install Defaults - */ - protected void installDefaults() - { - super.installDefaults(); - tabPane.setOpaque(false); - } // installDefaults - - - /************************************************************************* - * Update - - * This method is invoked by JComponent when the specified - * component is being painted. - * - * By default this method will fill the specified component with - * its background color (if its opaque property is - * true) and then immediately call paint. - * - * @param g the Graphics context in which to paint - * @param c the component being painted - * - * @see #paint - * @see javax.swing.JComponent#paintComponent - */ - public void update (Graphics g, JComponent c) - { - /** - System.out.println (c.getClass().getName() + " ** " + c.isOpaque()); - Container container = c.getParent(); - while (container != null) - { - System.out.println (" - " + container.getClass() + " ** " + container.isOpaque() ); - container = container.getParent(); - } - */ - - // System.out.println("Tab: Bounds=" + c.getBounds() + " - " + c.getClass().getName()); - - if (c.isOpaque()) - CompierePanelUI.updateIt (g, c); // tabAreaBackground - paint (g, c); - } // update - - /** - * Paint it - * @param g graphics - * @param c component - */ - public void paint( Graphics g, JComponent c ) - { - int tabPlacement = tabPane.getTabPlacement(); - Insets insets = c.getInsets(); - Dimension size = c.getSize(); - - if ( tabPane.isOpaque() ) - { - g.setColor(c.getBackground()); - /** @todo Printing of area behind Tabs */ - switch (tabPlacement) - { - case LEFT: - g.fillRect( insets.left, insets.top, - calculateTabAreaWidth( tabPlacement, runCount, maxTabWidth ), - size.height - insets.bottom - insets.top ); - break; - case BOTTOM: - int totalTabHeight = calculateTabAreaHeight( tabPlacement, runCount, maxTabHeight ); - g.fillRect( insets.left, size.height - insets.bottom - totalTabHeight, - size.width - insets.left - insets.right, - totalTabHeight ); - break; - case RIGHT: - int totalTabWidth = calculateTabAreaWidth( tabPlacement, runCount, maxTabWidth ); - g.fillRect( size.width - insets.right - totalTabWidth, - insets.top, totalTabWidth, - size.height - insets.top - insets.bottom ); - break; - // - case TOP: - default: - g.fillRect( insets.left, insets.top, - size.width - insets.right - insets.left, - calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight) ); - paintHighlightBelowTab(); - } - } - else - super.paint( g, c ); - } // paint - - - /************************************************************************** - * Paint the actual Tab Background. - * Called from Basic.PaintTab (<- Basic.paintTabArea <- Basic.paint) - *

    - * Based on MetalTabbedPaneUI.paintTabBackground: - * Differences: - * - Color based on primary Background of Tab - * - Selected Tab is painted - *

    -	 *          selected    not sel
    -	 *  top     //////////  //////////  (lighter)
    -	 *                      ++++++++++  (flat/darker)
    -	 *
    -	 *  bottom              //////////  (flat/lighter)
    -	 *          ++++++++++  ++++++++++  (darker)
    -	 *
    -	 *  sides               //////////  (flat/ligher)
    -	 *                      ++++++++++  (flat/darker)
    -	 *  
    - * @param g graphics - * @param tabPlacement tab placement - * @param tabIndex tab index - * @param x x - * @param y y - * @param w width - * @param h height - * @param isSelected selected - */ - protected void paintTabBackground (Graphics g, int tabPlacement, - int tabIndex, int x, int y, int w, int h, boolean isSelected) - { - Graphics2D g2D = (Graphics2D)g; - - - // Get Background color of Tab - Component comp = tabPane.getComponentAt(tabIndex); - // System.out.println("Tab " + tabIndex + " Comp=" + comp.getName() + " " + comp.getClass().getName() + " x=" + x + ", y=" + y + ", w=" +w + ", h=" + h); - g2D.setPaint(comp.getBackground()); - CompiereColor bg = CompiereColor.getDefaultBackground(); - if (comp instanceof JPanel) - { - JPanel jp = (JPanel)comp; - try - { - bg = (CompiereColor)jp.getClientProperty(CompiereLookAndFeel.BACKGROUND); - } - catch (Exception e) - { - System.err.println("AdempiereTabbedPaneUI - ClientProperty: " + e.getMessage()); - } - } - - if (bg == null) // No Background - { - if (CompiereUtils.isLeftToRight(tabPane)) - { - switch (tabPlacement) - { - case LEFT: - g2D.fillRect( x + 5, y + 1, w - 5, h - 1); - g2D.fillRect( x + 2, y + 4, 3, h - 4 ); - break; - case BOTTOM: - g2D.fillRect( x + 2, y, w - 2, h - 4 ); - g2D.fillRect( x + 5, y + (h - 1) - 3, w - 5, 3 ); - break; - case RIGHT: - g2D.fillRect( x + 1, y + 1, w - 5, h - 1); - g2D.fillRect( x + (w - 1) - 3, y + 5, 3, h - 5 ); - break; - case TOP: - default: - g2D.fillRect( x + 4, y + 2, (w - 1) - 3, (h - 1) - 1 ); - g2D.fillRect( x + 2, y + 5, 2, h - 5 ); - } - } - else - { - switch (tabPlacement) - { - case LEFT: - g2D.fillRect( x + 5, y + 1, w - 5, h - 1); - g2D.fillRect( x + 2, y + 4, 3, h - 4 ); - break; - case BOTTOM: - g2D.fillRect( x, y, w - 5, h - 1 ); - g2D.fillRect( x + (w - 1) - 4, y, 4, h - 5); - g2D.fillRect( x + (w - 1) - 4, y + (h - 1) - 4, 2, 2); - break; - case RIGHT: - g2D.fillRect( x + 1, y + 1, w - 5, h - 1); - g2D.fillRect( x + (w - 1) - 3, y + 5, 3, h - 5 ); - break; - case TOP: - default: - g2D.fillRect( x, y + 2, (w - 1) - 3, (h - 1) - 1 ); - g2D.fillRect( x + (w - 1) - 3, y + 4, 3, h - 4 ); - } - } - } - else // we have a background - { - if (CompiereUtils.isLeftToRight(tabPane)) - { - switch (tabPlacement) - { - case LEFT: - bg.paintRect (g2D, tabPane, x + 5, y + 1, w - 5, h - 1); - bg.paintRect (g2D, tabPane, x + 2, y + 4, 3, h - 4 ); - break; - case BOTTOM: - bg.paintRect (g2D, tabPane, x + 2, y, w - 2, h - 4 ); - bg.paintRect (g2D, tabPane, x + 5, y + (h - 1) - 3, w - 5, 3 ); - break; - case RIGHT: - // bg.paintRect (g2D, tabPane, x + 1, y + 1, w - 5, h - 1); - bg.paintRect (g2D, tabPane, x, y + 2, w - 4, h - 2); // changed - bg.paintRect (g2D, tabPane, x + (w - 1) - 3, y + 5, 3, h - 5 ); - break; - case TOP: - default: - bg.paintRect (g2D, tabPane, x + 4, y + 2, (w - 1) - 3, (h - 1) - 1 ); - bg.paintRect (g2D, tabPane, x + 2, y + 5, 2, h - 5 ); - } - } - else - { - switch (tabPlacement) - { - case LEFT: - bg.paintRect (g2D, tabPane, x + 5, y + 1, w - 5, h - 1); - bg.paintRect (g2D, tabPane, x + 2, y + 4, 3, h - 4 ); - break; - case BOTTOM: - bg.paintRect (g2D, tabPane, x, y, w - 5, h - 1 ); - bg.paintRect (g2D, tabPane, x + (w - 1) - 4, y, 4, h - 5); - bg.paintRect (g2D, tabPane, x + (w - 1) - 4, y + (h - 1) - 4, 2, 2); - break; - case RIGHT: - bg.paintRect (g2D, tabPane, x + 1, y + 1, w - 5, h - 1); - bg.paintRect (g2D, tabPane, x + (w - 1) - 3, y + 5, 3, h - 5 ); - break; - case TOP: - default: - bg.paintRect (g2D, tabPane, x, y + 2, (w - 1) - 3, (h - 1) - 1 ); - bg.paintRect (g2D, tabPane, x + (w - 1) - 3, y + 4, 3, h - 4 ); - } - } - } - - // Upper Part - not when selected and R/L/B - if (!(isSelected && (tabPlacement == RIGHT || tabPlacement == LEFT || tabPlacement == BOTTOM))) - { - Shape top = new Rectangle (x, y, w, h/2); // upper half - if (tabPlacement == TOP || tabPlacement == LEFT) - top = new Polygon ( // top left triangle - new int[] {x+6, x+w, x+w, x, x }, - new int[] {y, y, y+(h/2), y+(h/2), y+6 }, 5); - else if (tabPlacement == RIGHT) - top = new Polygon ( // top right triangle - new int[] {x, x+w-6, x+w, x+w, x }, - new int[] {y, y, y+6, y+(h/2), y+(h/2) }, 5); - // lighter - GradientPaint paint = new GradientPaint ( - x, y, CompiereUtils.COL_1TOP, - x, y+(h/2), CompiereUtils.COL_1END); - g2D.setPaint(paint); - g2D.fill(top); - } - - // Lower part - not when selected and T/R/L - if (!(isSelected && (tabPlacement == TOP || tabPlacement == RIGHT || tabPlacement == LEFT))) - { - Shape end = new Rectangle (x, y+(h/2), w, h/2); // lower half - if (tabPlacement == BOTTOM) - end = new Polygon ( // bottom left triangle - new int[] {x, x+w, x+w, x+6, x }, - new int[] {y+(h/2), y+(h/2), y+h, y+h, y+h-6 }, 5); - // darker - GradientPaint paint = new GradientPaint ( - x, y+(h/2), CompiereUtils.COL_2TOP, - x, y+h, CompiereUtils.COL_2END); - g2D.setPaint(paint); - g2D.fill(end); - } - - } // paintTabBackground - - - /************************************************************************** - * Paint Content Border (overwriting BasicTabbedPanelUI) - * Uses Color from actual Tab (not from TabbedPane) - * @param g graphics - * @param tabPlacement tab placement - * @param selectedIndex index - */ - protected void paintContentBorder (Graphics g, int tabPlacement, int selectedIndex) - { - // System.out.println("TabContentBorder " ); - int width = tabPane.getWidth(); - int height = tabPane.getHeight(); - Insets insets = tabPane.getInsets(); - - int x = insets.left; - int y = insets.top; - int w = width - insets.right - insets.left; - int h = height - insets.top - insets.bottom; - - switch (tabPlacement) - { - case LEFT: - x += calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); - w -= (x - insets.left); - break; - case RIGHT: - w -= calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); - break; - case BOTTOM: - h -= calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); - break; - case TOP: - default: - y += calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); - h -= (y - insets.top); - } - - // Fill region behind content area - basically a border - Component comp = null; - if (selectedIndex != -1) - comp = tabPane.getComponentAt(selectedIndex); - if (comp != null && comp instanceof JComponent) - { - JComponent jc = (JComponent)comp; - CompiereColor bg = null; - try - { - if (jc != null) - bg = (CompiereColor)jc.getClientProperty(CompiereLookAndFeel.BACKGROUND); - } - catch (Exception e) - { - System.err.println("AdempiereTabbedPaneUI - ClientProperty: " + e.getMessage()); - } - if (bg == null) - { - bg = new CompiereColor(jc.getBackground()); - jc.putClientProperty(CompiereLookAndFeel.BACKGROUND, bg); - } - bg.paintRect(g, jc, x,y, w,h); - } - // Not a JComponent - paint flat - else if (comp != null) - { - g.setColor(comp.getBackground()); - g.fillRect(x,y, w,h); - } - - paintContentBorderTopEdge(g, tabPlacement, selectedIndex, x, y, w, h); - paintContentBorderLeftEdge(g, tabPlacement, selectedIndex, x, y, w, h); - paintContentBorderBottomEdge(g, tabPlacement, selectedIndex, x, y, w, h); - paintContentBorderRightEdge(g, tabPlacement, selectedIndex, x, y, w, h); - } // paintContentBorder - - /** - * Paint left content border edge - * @param g graphics - * @param tabPlacement tab placement - * @param selectedIndex index - * @param x x - * @param y y - * @param w width - * @param h height - */ - protected void paintContentBorderLeftEdge (Graphics g, int tabPlacement, - int selectedIndex, int x, int y, int w, int h) - { - Rectangle selRect = selectedIndex < 0 ? null : getTabBounds(selectedIndex, calcRect); - g.setColor(selectHighlight); - - // Draw unbroken line if tabs are not on LEFT, OR - // selected tab is not in run adjacent to content, OR - // selected tab is not visible (SCROLL_TAB_LAYOUT) - if (tabPlacement != LEFT || selectedIndex < 0 - || (selRect.x + selRect.width + 1 < x) - || (selRect.y < y || selRect.y > y + h)) - { - g.drawLine(x, y, x, y+h-2); - } - else - { - // Break line to show visual connection to selected tab - g.drawLine(x, y, x, selRect.y + 1); - if (selRect.y + selRect.height < y + h - 2) - g.drawLine(x, selRect.y + selRect.height + 1, x, y+h-2); // bug - } - } - - /** - * Paint bottom content area edge - * @param g graphics - * @param tabPlacement tab placement - * @param selectedIndex index - * @param x x - * @param y y - * @param w width - * @param h height - */ - protected void paintContentBorderBottomEdge (Graphics g, int tabPlacement, - int selectedIndex, int x, int y, int w, int h) - { - boolean leftToRight = CompiereUtils.isLeftToRight(tabPane); - int bottom = y + h - 1; - int right = x + w - 1; - Rectangle selRect = selectedIndex < 0 ? null : getTabBounds(selectedIndex, calcRect); - g.setColor(shadow); - - // Draw unbroken line if tabs are not on BOTTOM, OR - // selected tab is not in run adjacent to content, OR - // selected tab is not visible (SCROLL_TAB_LAYOUT) - if (tabPlacement != BOTTOM - || selectedIndex < 0 -// || (selRect.y - 1 > h) // bug!! - || (selRect.x < x || selRect.x > x + w)) - { - g.setColor(darkShadow); - g.drawLine(x, y+h-1, x+w-1, y+h-1); - } - else - { - // Break line to show visual connection to selected tab - boolean lastInRun = isLastInRun(selectedIndex); - g.setColor(darkShadow); - if ( leftToRight || lastInRun ) - g.drawLine(x, bottom, selRect.x, bottom); - else - g.drawLine(x, bottom, selRect.x - 1, bottom); - - if (selRect.x + selRect.width < x + w - 2) - { - if ( leftToRight && !lastInRun ) - g.drawLine(selRect.x + selRect.width, bottom, right, bottom); - else - g.drawLine(selRect.x + selRect.width - 1, bottom, right, bottom); - } - } - } // paintContentBorderBottomEdge - - /** - * Paint right Contenr border edge - * @param g graphics - * @param tabPlacement tab placement - * @param selectedIndex index - * @param x x - * @param y y - * @param w width - * @param h height - */ - protected void paintContentBorderRightEdge (Graphics g, int tabPlacement, - int selectedIndex, int x, int y, int w, int h) - { - Rectangle selRect = selectedIndex < 0 ? null : getTabBounds(selectedIndex, calcRect); - g.setColor(shadow); - - // Draw unbroken line if tabs are not on RIGHT, OR - // selected tab is not in run adjacent to content, OR - // selected tab is not visible (SCROLL_TAB_LAYOUT) - if (tabPlacement != RIGHT - || selectedIndex < 0 -// || (selRect.x - 1 > w) // bug !! - || (selRect.y < y || selRect.y > y + h) - ) - { - g.setColor(darkShadow); - g.drawLine(x+w-1, y, x+w-1, y+h-1); - } - else - { - // Break line to show visual connection to selected tab - g.setColor(darkShadow); - g.drawLine(x+w-1, y, x+w-1, selRect.y); - if (selRect.y + selRect.height < y + h - 2) - { - g.setColor(darkShadow); - g.drawLine(x+w-1, selRect.y + selRect.height, x+w-1, y+h-2); - } - } - } // paintContentBorderRightEdge - - /** - * Is Last Run - * @param tabIndex index - * @return true if last tab run - */ - private boolean isLastInRun (int tabIndex) - { - int run = getRunForTab( tabPane.getTabCount(), tabIndex ); - int lastIndex = lastTabInRun( tabPane.getTabCount(), run ); - return tabIndex == lastIndex; - } // isLastRun - - - /************************************************************************** - * Fill Tab gap triangle (no) - * @param currentRun current run - * @param tabIndex tab index - * @param x x - * @param y y - * @return false - */ - protected boolean shouldFillGap (int currentRun, int tabIndex, int x, int y) - { - return false; - } // shouldFillGap - - /** - * Paint Top Tab Border - * @param tabIndex index - * @param g graphics - * @param x x - * @param y y - * @param w width - * @param h height - * @param btm bottom - * @param rght right - * @param isSelected selected - */ - protected void paintTopTabBorder ( int tabIndex, Graphics g, - int x, int y, int w, int h, int btm, int rght, boolean isSelected ) - { - int currentRun = getRunForTab( tabPane.getTabCount(), tabIndex ); - int lastIndex = lastTabInRun( tabPane.getTabCount(), currentRun ); - int firstIndex = tabRuns[ currentRun ]; - boolean leftToRight = CompiereUtils.isLeftToRight(tabPane); - int bottom = h - 1; - int right = w - 1; - - // ** Paint Gap ** - if ( shouldFillGap( currentRun, tabIndex, x, y ) ) - { - g.translate( x, y ); - if ( leftToRight ) - { - g.setColor( getColorForGap( currentRun, x, y + 1 ) ); - g.fillRect( 1, 0, 5, 3 ); - g.fillRect( 1, 3, 2, 2 ); - } - else - { - g.setColor( getColorForGap( currentRun, x + w - 1, y + 1 ) ); - g.fillRect( right - 5, 0, 5, 3 ); - g.fillRect( right - 2, 3, 2, 2 ); - } - g.translate( -x, -y ); - } - - g.translate( x, y ); - // ** Paint Border ** - g.setColor( darkShadow ); - if (leftToRight) - { - // Paint slant - g.drawLine( 1, 5, 6, 0 ); - // Paint top - g.drawLine( 6, 0, right, 0 ); - // Paint right - if ( tabIndex==lastIndex ) // last tab in run - g.drawLine( right, 1, right, bottom ); - // Paint left - if ( tabIndex != tabRuns[ runCount - 1 ] ) // not the first tab in the last run - g.drawLine( 0, 0, 0, bottom ); - else // the first tab in the last run - g.drawLine( 0, 6, 0, bottom ); - } - else - { - // Paint slant - g.drawLine( right - 1, 5, right - 6, 0 ); - // Paint top - g.drawLine( right - 6, 0, 0, 0 ); - // Paint right - if ( tabIndex != tabRuns[ runCount - 1 ] ) // not the first tab in the last run - g.drawLine( right, 0, right, bottom ); - else // the first tab in the last run - g.drawLine( right, 6, right, bottom ); - // Paint left - if ( tabIndex==lastIndex ) // last tab in run - g.drawLine( 0, 1, 0, bottom ); - } - - // Paint button - if (!isSelected) - g.drawLine(0, bottom, right, bottom); // added - - // ** Paint Highlight ** - g.setColor( isSelected ? selectHighlight : highlight ); - if ( leftToRight ) - { - // Paint slant - g.drawLine( 1, 6, 6, 1 ); - // Paint top - if (tabIndex == lastIndex) - g.drawLine( 6, 1, right-1, 1 ); - else - g.drawLine( 6, 1, right, 1 ); // bug !! - // Paint left - g.drawLine( 1, 6, 1, bottom ); - - // paint highlight in the gap on tab behind this one - // on the left end (where they all line up) - if ( tabIndex==firstIndex && tabIndex!=tabRuns[runCount - 1] ) - { - // first tab in run but not first tab in last run - if (tabPane.getSelectedIndex()==tabRuns[currentRun+1]) - { - // tab in front of selected tab - g.setColor( selectHighlight ); - } - else - { - // tab in front of normal tab - g.setColor( highlight ); - } - g.drawLine( 1, 0, 1, 4 ); - } - } - else - { - // Paint slant - g.drawLine( right - 1, 6, right - 6, 1 ); - // Paint top - g.drawLine( right - 6, 1, 1, 1 ); - - // Paint left - if ( tabIndex==lastIndex ) // last tab in run - g.drawLine( 1, 1, 1, bottom ); - else - g.drawLine( 0, 1, 0, bottom ); - } - g.translate( -x, -y ); - } // paintTopTabBorder - - /** - * Paint Border of Left Tab. - * Does not fill triangle - * - * @param tabIndex index - * @param g graphics - * @param x x - * @param y y - * @param w width - * @param h height - * @param btm bottom - * @param rght right - * @param isSelected selected - */ - protected void paintLeftTabBorder (int tabIndex, Graphics g, - int x, int y, int w, int h, int btm, int rght, boolean isSelected) - { - int tabCount = tabPane.getTabCount(); - int currentRun = getRunForTab( tabCount, tabIndex ); - @SuppressWarnings("unused") - int lastIndex = lastTabInRun( tabCount, currentRun ); - @SuppressWarnings("unused") - int firstIndex = tabRuns[ currentRun ]; - - g.translate( x, y ); - - int bottom = h - 1; - int right = w - 1; - - // ** Paint Highlight ** - g.setColor( isSelected ? selectHighlight : highlight ); - // Paint slant - g.drawLine( 1, 6, 6, 1 ); - // Paint top - g.drawLine( 6, 1, right, 1 ); - // Paint left - g.drawLine( 1, 6, 1, bottom ); - // Paint right - if (!isSelected) - g.drawLine(right-1, 0, right-1, bottom ); - - // ** Paint Border ** - g.setColor( darkShadow ); - // Paint slant - g.drawLine( 1, 5, 6, 0 ); - // Paint top - g.drawLine( 6, 0, right, 0 ); - // Paint left - g.drawLine( 0, 6, 0, bottom ); - // Paint bottom - g.drawLine( 0, bottom, right, bottom ); - // Paint right - if (!isSelected) - g.drawLine(right, 0, right, bottom ); - // - g.translate( -x, -y ); - } // paintLeftTabBorder - - - /** - * Paint Border of Right Tab. - * Does not fill triangle - * - * @param tabIndex index - * @param g graphics - * @param x x - * @param y y - * @param w width - * @param h height - * @param btm bottom - * @param rght right - * @param isSelected selected - */ - protected void paintRightTabBorder (int tabIndex, Graphics g, - int x, int y, int w, int h, int btm, int rght, boolean isSelected) - { - int tabCount = tabPane.getTabCount(); - int currentRun = getRunForTab( tabCount, tabIndex ); - @SuppressWarnings("unused") - int lastIndex = lastTabInRun( tabCount, currentRun ); - @SuppressWarnings("unused") - int firstIndex = tabRuns[ currentRun ]; - - g.translate( x, y ); - - int bottom = h - 1; - int right = w - 1; - - // ** Paint Highlight ** - g.setColor( isSelected ? selectHighlight : highlight ); - // Paint slant - g.drawLine (right-6, 1, right-1, 6 ); - // Paint top - g.drawLine (0, 1, right - 6, 1 ); - // Paint right - g.drawLine (right-1, 6, right-1, bottom-1); - // Paint left - if (!isSelected) - g.drawLine (0, 1, 0, bottom-1); - - // ** Paint Border ** - g.setColor( darkShadow ); - // Paint slant - g.drawLine (right - 6, 0, right, 6 ); - // Paint top - g.drawLine (0, 0, right - 6, 0 ); - // Paint right - g.drawLine (right, 6, right, bottom ); - // Paint bottom - g.drawLine( 0, bottom, right, bottom ); - - g.translate( -x, -y ); - } // paintRightTabBorder - - - /************************************************************************** - * Calculate Tab Width. - * We may have to overwrite to adjust width for TabHirarchyLevel - * @param tabPlacement tab placement - * @param tabIndex tab index - * @param metrics metcics - * @return tab width - */ - protected int calculateTabWidth (int tabPlacement, int tabIndex, FontMetrics metrics) - { - boolean calculate = !(tabPlacement == TOP || tabPlacement == BOTTOM); - // HTML - if (getTextViewForTab(tabIndex) != null) - calculate = false; - // No spaces in title - String title = tabPane.getTitleAt(tabIndex); - int pos = title.indexOf(' '); - if (calculate && pos == -1) - calculate = false; - if (!calculate) - return super.calculateTabWidth (tabPlacement, tabIndex, metrics); - // - Icon icon = getIconForTab(tabIndex); - Insets tabInsetsLocal = getTabInsets(tabPlacement, tabIndex); - int width = tabInsetsLocal.left + tabInsetsLocal.right + 3; - - if (icon != null) - width += icon.getIconWidth() + textIconGap; - - String firstLine = title.substring(0, pos); - String secondLine = title.substring(pos+1); - width += Math.max(SwingUtilities.computeStringWidth (metrics, firstLine), - SwingUtilities.computeStringWidth (metrics, secondLine)); - return width; - } // calculateTabWidth - - /** - * Calculate TabHeight - * @param tabPlacement tab placement - * @param tabIndex tab index - * @param fontHeight font height - * @return tab height - */ - protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight) - { - boolean calculate = !(tabPlacement == TOP || tabPlacement == BOTTOM); - // HTML - if (getTextViewForTab(tabIndex) != null) - calculate = false; - // No spaces in title - String title = tabPane.getTitleAt(tabIndex); - int pos = title.indexOf(' '); - if (calculate && pos == -1) - calculate = false; - if (!calculate) - return super.calculateTabHeight (tabPlacement, tabIndex, fontHeight); - // - int height = fontHeight * 2; - Icon icon = getIconForTab(tabIndex); - Insets tabInsetsLocal = getTabInsets(tabPlacement, tabIndex); - if (icon != null) - height = Math.max(height, icon.getIconHeight()); - height += tabInsetsLocal.top + tabInsetsLocal.bottom + 2; - return height; - } - - /** - * Layout Label - * @param tabPlacement tab placement - * @param metrics fint metrics - * @param tabIndex tab index - * @param title title - * @param icon icon - * @param tabRect tab bounds - * @param iconRect icon bounds - * @param textRect text bounds - * @param isSelected selected - */ - protected void layoutLabel(int tabPlacement, - FontMetrics metrics, int tabIndex, String title, Icon icon, - Rectangle tabRect, Rectangle iconRect, Rectangle textRect, boolean isSelected) - { - boolean calculate = !(tabPlacement == TOP || tabPlacement == BOTTOM); - // HTML - if (getTextViewForTab(tabIndex) != null) - calculate = false; - if (!calculate) - { - super.layoutLabel (tabPlacement, metrics, tabIndex, title, icon, - tabRect, iconRect, textRect, isSelected); - // System.out.println("1.tabRect=" + tabRect + " - textRect=" + textRect + " - " + title); - return; - } - // - textRect.x = textRect.y = iconRect.x = iconRect.y = 0; - SwingUtilities.layoutCompoundLabel(tabPane, - metrics, title, icon, - SwingUtilities.TOP, // vert - SwingUtilities.LEFT, // horiz - SwingUtilities.CENTER, // vert Text - SwingUtilities.TRAILING, // horiz Text - tabRect, - iconRect, - textRect, - textIconGap); - tabPane.putClientProperty("html", null); - int xNudge = getTabLabelShiftX(tabPlacement, tabIndex, isSelected); - int yNudge = getTabLabelShiftY(tabPlacement, tabIndex, isSelected); - // positioned top left - add gap - Insets tabInsetsLocal = getTabInsets(tabPlacement, tabIndex); - xNudge += tabInsetsLocal.left; - yNudge += tabInsetsLocal.top + 1; - iconRect.x += xNudge; - iconRect.y += yNudge; - textRect.x += xNudge; - textRect.y += yNudge; - // System.out.println("2.tabRect=" + tabRect + " - textRect=" + textRect + " - " + title); - } - - /** - * Paint Tab - * @param g graphics - * @param tabPlacement tab placement - * @param font font - * @param metrics font metrics - * @param tabIndex tab index - * @param title title - * @param textRect text bounds - * @param isSelected selected - */ - protected void paintText (Graphics g, int tabPlacement, - Font font, FontMetrics metrics, int tabIndex, - String title, Rectangle textRect, boolean isSelected) - { - boolean calculate = !(tabPlacement == TOP || tabPlacement == BOTTOM); - // HTML - if (getTextViewForTab(tabIndex) != null) - calculate = false; - if (!calculate) - { - super.paintText (g, tabPlacement, font, metrics, tabIndex, - title, textRect, isSelected); - return; - } - - // System.out.println("3.textRect " + textRect + " - " + title); - String firstLine = title; - String secondLine = null; - int pos = title.indexOf(' '); - if (pos != -1) - { - firstLine = title.substring(0, pos); - secondLine = title.substring(pos+1); - } - - g.setFont(font); - int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); - if (tabPane.isEnabled() && tabPane.isEnabledAt(tabIndex)) - { - Color c = tabPane.getForegroundAt(tabIndex); - if (!isSelected) - { - if (c.equals(Color.black)) - c = Color.darkGray; - else - c = c.brighter(); - } - g.setColor(c); - // first line - BasicGraphicsUtils.drawStringUnderlineCharAt - (g, firstLine, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); - // secondLine - if (secondLine != null) - BasicGraphicsUtils.drawStringUnderlineCharAt - (g, secondLine, mnemIndex-firstLine.length(), - textRect.x, textRect.y + metrics.getAscent() + metrics.getHeight()); - } - else - { // tab disabled - g.setColor(tabPane.getBackgroundAt(tabIndex).brighter()); - BasicGraphicsUtils.drawStringUnderlineCharAt - (g, firstLine, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); - // secondLine - if (secondLine != null) - BasicGraphicsUtils.drawStringUnderlineCharAt - (g, secondLine, mnemIndex-firstLine.length(), - textRect.x, textRect.y + metrics.getAscent() + metrics.getHeight()); - // - g.setColor(tabPane.getBackgroundAt(tabIndex).darker()); - BasicGraphicsUtils.drawStringUnderlineCharAt - (g, firstLine, mnemIndex, textRect.x -1, textRect.y + metrics.getAscent() -1); - // secondLine - if (secondLine != null) - BasicGraphicsUtils.drawStringUnderlineCharAt - (g, secondLine, mnemIndex-firstLine.length(), - textRect.x -1, textRect.y + metrics.getAscent() + metrics.getHeight() -1); - } - } // paintText - - - /************************************************************************** - * Create Layout Manager to size & position tabs - * @return Layout Manager - */ - protected LayoutManager createLayoutManager() - { - return new TabbedPaneLayout(); - } // createLayoutManager - - /** - * Layout Manager to overwrite TabRect size - */ - public class TabbedPaneLayout extends MetalTabbedPaneUI.TabbedPaneLayout - { - /** - * Calculate Tab Rectangle Size - * @param tabPlacement tab placement - * @param tabCount no of tabs - */ - protected void calculateTabRects(int tabPlacement, int tabCount) - { - super.calculateTabRects(tabPlacement, tabCount); - if (tabPlacement == TOP || tabPlacement == BOTTOM) - return; - // System.out.println("calculateTabRects " + tabCount); - int tabHeight = calculateMaxTabHeight(tabPlacement); - for (int i = 0; i < rects.length; i++) - { - int level = 0; - Component comp = tabPane.getComponentAt(i); - if (comp instanceof JComponent) - { - JComponent jc = (JComponent)comp; - try - { - Integer ll = (Integer)jc.getClientProperty(CompiereLookAndFeel.TABLEVEL); - if (ll != null) - level = ll.intValue(); - } - catch (Exception e) - { - System.err.println("AdempiereTabbedPaneUI - ClientProperty: " + e.getMessage()); - } - } - if (level != 0) - { - if (tabPlacement == LEFT) - rects[i].x += level * 5; - rects[i].width -= level * 5; - } - // Height - rects[i].height = tabHeight; - if (i > 0) - rects[i].y = rects[i-1].y + tabHeight; // rects[i-1].height; - } // for all rects - } // calculate TabRects - - } // TabbedPaneLayout - -} // AdempiereTabbedPaneUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTableHeaderUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTableHeaderUI.java deleted file mode 100644 index d6c7097bb9..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTableHeaderUI.java +++ /dev/null @@ -1,95 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.Graphics; -import java.awt.Graphics2D; - -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicTableHeaderUI; - -/** - * Table Header UI - * 3D effect - * - * @author Jorg Janke - * @version $Id: AdempiereTableHeaderUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereTableHeaderUI extends BasicTableHeaderUI -{ - /** - * Static Create UI - * @param c Component - * @return Adempiere TableHeader UI - */ - public static ComponentUI createUI(JComponent c) - { - return new CompiereTableHeaderUI(); - } // createUI - - - /** - * Install UI - set not Opaque - * @param c - */ - public void installUI(JComponent c) - { - super.installUI(c); - // TableHeader is in JViewpoiunt, which is Opaque - // When UI created, TableHeader not added to viewpoint - //c.setOpaque(true); - //c.putClientProperty(AdempierePLAF.BACKGROUND_FILL, "Y"); - } // installUI - - - /************************************************************************** - * Update - - * This method is invoked by JComponent when the specified - * component is being painted. - * - * By default this method will fill the specified component with - * its background color (if its opaque property is - * true) and then immediately call paint. - * - * @param g the Graphics context in which to paint - * @param c the component being painted - * - * @see #paint - * @see javax.swing.JComponent#paintComponent - */ - public void update(Graphics g, JComponent c) - { - // AdempiereUtils.printParents (c); // Parent is JViewpoint - if (c.isOpaque()) // flat - CompiereUtils.fillRectange((Graphics2D)g, c, CompiereLookAndFeel.ROUND); - // - paint (g, c); - } // update - - /** - * Paint 3D box - * @param g - * @param c - */ - public void paint(Graphics g, JComponent c) - { - super.paint( g, c); - CompiereUtils.paint3Deffect((Graphics2D)g, c, CompiereLookAndFeel.ROUND, true); - } // paint - -} // AdempiereTableHeader diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTextAreaUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTextAreaUI.java deleted file mode 100644 index e3649cd9d8..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTextAreaUI.java +++ /dev/null @@ -1,119 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.AWTKeyStroke; -import java.awt.KeyboardFocusManager; -import java.awt.event.ActionEvent; -import java.awt.event.KeyEvent; -import java.beans.PropertyChangeEvent; -import java.util.HashSet; -import java.util.Set; - -import javax.swing.Action; -import javax.swing.JComponent; -import javax.swing.KeyStroke; -import javax.swing.LookAndFeel; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicTextAreaUI; -import javax.swing.text.DefaultEditorKit; -import javax.swing.text.EditorKit; -import javax.swing.text.JTextComponent; -import javax.swing.text.Keymap; - - -public class CompiereTextAreaUI extends BasicTextAreaUI -{ - /** - * Creates a UI for a JTextArea. - * Tab is the normal focus traversal key - to enter Tab enter Ctrl-Tab - * - * @param ta a text area - * @return the UI - */ - public static ComponentUI createUI(JComponent ta) - { - return new CompiereTextAreaUI(ta); - } - - /** - * Constructor - * @param ta text area - */ - public CompiereTextAreaUI (JComponent ta) - { - if (ta instanceof JTextComponent) - m_editor = (JTextComponent)ta; - } // AdempiereTextAreaUI - - /** The Editor */ - private JTextComponent m_editor = null; - /** Tab Stroke */ - private static KeyStroke s_stroke = KeyStroke.getKeyStroke (KeyEvent.VK_TAB, ActionEvent.CTRL_MASK); - /** Tab Action */ - private static Action s_action = new DefaultEditorKit.InsertTabAction(); - - /** - * Create Keymap - * @return key Map - */ - protected Keymap createKeymap () - { - Keymap map = super.createKeymap (); - map.addActionForKeyStroke(s_stroke, s_action); - return map; - } // createKeyMap - - /** - * Property Change - * @param evt event - */ - protected void propertyChange (PropertyChangeEvent evt) - { - String name = evt.getPropertyName(); - if ("editable".equals(name)) - updateFocusTraversalKeysX(); - else - super.propertyChange (evt); - } // propertyChange - - /** - * UpdateFocusTraversalKeysX - */ - void updateFocusTraversalKeysX () - { - if (m_editor == null) - return; - // - EditorKit editorKit = getEditorKit (m_editor); - if (editorKit != null && editorKit instanceof DefaultEditorKit) - { - Set storedForwardTraversalKeys = m_editor.getFocusTraversalKeys (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS); - Set storedBackwardTraversalKeys = m_editor.getFocusTraversalKeys (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS); - Set forwardTraversalKeys = new HashSet(storedForwardTraversalKeys); - Set backwardTraversalKeys = new HashSet(storedBackwardTraversalKeys); - // - forwardTraversalKeys.add (KeyStroke.getKeyStroke (KeyEvent.VK_TAB, 0)); - forwardTraversalKeys.remove(s_stroke); - backwardTraversalKeys.add (KeyStroke.getKeyStroke (KeyEvent.VK_TAB, ActionEvent.SHIFT_MASK)); - // - LookAndFeel.installProperty (m_editor, "focusTraversalKeysForward", forwardTraversalKeys); - LookAndFeel.installProperty (m_editor, "focusTraversalKeysBackward", backwardTraversalKeys); - } - } // updateFocusTraversalKeysX - -} // AdempiereTextAreaUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTheme.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTheme.java deleted file mode 100644 index 246d9fe451..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTheme.java +++ /dev/null @@ -1,343 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.Font; -import java.util.logging.Logger; - -import javax.swing.UIDefaults; -import javax.swing.plaf.ColorUIResource; -import javax.swing.plaf.FontUIResource; -import javax.swing.plaf.metal.MetalTheme; - -import org.compiere.swing.ColorBlind; -import org.compiere.swing.ExtendedTheme; - -/** - * Compiere User definable Theme (if used in Metal L&F). - * In other Environments, it provides UI extensions (e.g. Error Color) - * - * @author Jorg Janke - * @version $Id: AdempiereTheme.java,v 1.4 2006/07/30 00:52:23 jjanke Exp $ - */ -public class CompiereTheme extends MetalTheme -{ - /** - * Constructor - nop - */ - public CompiereTheme() - { - } // AdempiereTheme - - /** - * Return Theme Name - * @return Theme Name - */ - public String getName() - { - return s_name; - } // getName - - /** - * String Representation - * @return info - */ - public String toString () - { - return s_name; - } // toString - - /** - * Set Default Colors - */ - protected void setDefault() - { - } // setDefault - - /** Static Initializer */ - static - { - s_theme = new CompiereThemeBlueMetal(); - } - - /** Theme Name */ - protected static String s_name = "Compiere Theme"; - /** Logger */ - protected static Logger log = Logger.getLogger(CompiereTheme.class.getName()); - /** Active Theme */ - protected static CompiereTheme s_theme = null; - - /** Blue 51,51,102 */ - protected static ColorUIResource primary0 = new ColorUIResource(51, 51, 102); - /** Blue 102, 102, 153 */ - protected static ColorUIResource primary1; - /** Blue 153, 153, 204 */ - protected static ColorUIResource primary2; - /** Blue 204, 204, 255 */ - protected static ColorUIResource primary3; - - /** Black */ - protected final ColorUIResource secondary0 = new ColorUIResource(0, 0, 0); - /** Gray 102, 102, 102 */ - protected static ColorUIResource secondary1; - /** Gray 153, 153, 153 */ - protected static ColorUIResource secondary2; - /** BlueGray 214, 224, 234 - background */ - protected static ColorUIResource secondary3; - /** White */ - protected final ColorUIResource secondary4 = new ColorUIResource(255, 255, 255); - - /** Black */ - protected static ColorUIResource black; - /** White */ - protected static ColorUIResource white; - - /** Background for mandatory fields */ - protected static ColorUIResource mandatory; - /** Background for fields in error */ - protected static ColorUIResource error; - /** Background for inactive fields */ - protected static ColorUIResource inactive; - /** Background for info fields */ - protected static ColorUIResource info; - - /** Foreground Text OK */ - protected static ColorUIResource txt_ok; - /** Foreground Text Error */ - protected static ColorUIResource txt_error; - - /** Control font */ - protected static FontUIResource controlFont; - /** System font */ - protected static FontUIResource systemFont; - /** User font */ - protected static FontUIResource userFont; - /** Small font */ - protected static FontUIResource smallFont; - /** Window Title font */ - protected static FontUIResource windowFont; - /** Menu font */ - protected static FontUIResource menuFont; - - /** Default Font */ - public static final String FONT_DEFAULT = "Dialog"; - /** Default Font Size */ - public static final int FONT_SIZE = 12; - - - /************************************************************************** - * Get Primary 1 (blue in default Metal Theme) - * @return color - */ - public ColorUIResource getPrimary1() - { - return ColorBlind.getDichromatColorUIResource(primary1); - } - public ColorUIResource getPrimary2() - { - return ColorBlind.getDichromatColorUIResource(primary2); - } - public ColorUIResource getPrimary3() - { - return ColorBlind.getDichromatColorUIResource(primary3); - } - - /** - * Get Seconary 1 (gray in default Metal Theme) - * @return color - */ - public ColorUIResource getSecondary0() - { - return ColorBlind.getDichromatColorUIResource(secondary0); - } - public ColorUIResource getSecondary1() - { - return ColorBlind.getDichromatColorUIResource(secondary1); - } - public ColorUIResource getSecondary2() - { - return ColorBlind.getDichromatColorUIResource(secondary2); - } - public ColorUIResource getSecondary3() - { - return ColorBlind.getDichromatColorUIResource(secondary3); - } - public ColorUIResource getSecondary4() - { - return ColorBlind.getDichromatColorUIResource(secondary4); - } - - public ColorUIResource getBlack() - { - return ColorBlind.getDichromatColorUIResource(black); - } - public ColorUIResource getWhite() - { - return ColorBlind.getDichromatColorUIResource(white); - } - - /** - * Control Font (plain) - * @return font - */ - protected static FontUIResource _getControlTextFont() - { - if (controlFont == null) - { - try - { - controlFont = new FontUIResource(Font.getFont("swing.plaf.metal.controlFont", - new Font(FONT_DEFAULT, Font.PLAIN, FONT_SIZE))); - } - catch (Exception e) - { - controlFont = new FontUIResource(FONT_DEFAULT, Font.PLAIN, FONT_SIZE); - } - } - return controlFont; - } - public FontUIResource getControlTextFont() {return _getControlTextFont();} - - /** - * System Font - * @return font - */ - protected static FontUIResource _getSystemTextFont() - { - if (systemFont == null) - { - try - { - systemFont = new FontUIResource(Font.getFont("swing.plaf.metal.systemFont", - new Font(FONT_DEFAULT, Font.PLAIN, FONT_SIZE))); - } - catch (Exception e) - { - systemFont = new FontUIResource(FONT_DEFAULT, Font.PLAIN, FONT_SIZE); - } - } - return systemFont; - } - public FontUIResource getSystemTextFont() {return _getSystemTextFont();} - - /** - * User Font - * @return font - */ - protected static FontUIResource _getUserTextFont() - { - if (userFont == null) - { - try - { - userFont = new FontUIResource(Font.getFont("swing.plaf.metal.userFont", - new Font(FONT_DEFAULT, Font.PLAIN, FONT_SIZE))); - } - catch (Exception e) - { - userFont = new FontUIResource(FONT_DEFAULT, Font.PLAIN, FONT_SIZE); - } - } - return userFont; - } - public FontUIResource getUserTextFont() {return _getUserTextFont();} - - /** - * Menu - * @return font - */ - protected static FontUIResource _getMenuTextFont() - { - if (menuFont == null) - { - try - { - menuFont = new FontUIResource(Font.getFont("swing.plaf.metal.menuFont", - new Font(FONT_DEFAULT, Font.PLAIN, FONT_SIZE))); - } - catch (Exception e) - { - menuFont = new FontUIResource(FONT_DEFAULT, Font.PLAIN, FONT_SIZE); - } - } - return menuFont; - } - public FontUIResource getMenuTextFont() {return _getMenuTextFont();} - - /** - * Window Title - * @return font - */ - protected static FontUIResource _getWindowTitleFont() - { - if (windowFont == null) - { - try - { - windowFont = new FontUIResource(Font.getFont("swing.plaf.metal.windowFont", - new Font(FONT_DEFAULT, Font.BOLD, FONT_SIZE+2))); - } - catch (Exception e) - { - windowFont = new FontUIResource(FONT_DEFAULT, Font.BOLD, FONT_SIZE+2); - } - } - return windowFont; - } - public FontUIResource getWindowTitleFont() {return _getWindowTitleFont();} - - /** - * Sub Text - * @return font - */ - protected static FontUIResource _getSubTextFont() - { - if (smallFont == null) - { - try - { - smallFont = new FontUIResource(Font.getFont("swing.plaf.metal.smallFont", - new Font(FONT_DEFAULT, Font.PLAIN, FONT_SIZE-2))); - } - catch (Exception e) - { - smallFont = new FontUIResource(FONT_DEFAULT, Font.PLAIN, FONT_SIZE-2); - } - } - return smallFont; - } - public FontUIResource getSubTextFont() {return _getSubTextFont();} - - @Override - public void addCustomEntriesToTable(UIDefaults table) { - super.addCustomEntriesToTable(table); - Object[] defaults = - { - ExtendedTheme.ERROR_BG_KEY, - error, - ExtendedTheme.ERROR_FG_KEY, - txt_error, - ExtendedTheme.INACTIVE_BG_KEY, - inactive, - ExtendedTheme.INFO_BG_KEY, - info, - ExtendedTheme.MANDATORY_BG_KEY, - mandatory - }; - table.putDefaults(defaults); - } -} // AdempiereTheme diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereThemeBlueMetal.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereThemeBlueMetal.java deleted file mode 100644 index 5652ba899d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereThemeBlueMetal.java +++ /dev/null @@ -1,101 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.Color; - -import javax.swing.plaf.ColorUIResource; - -/** - * Adempiere default Blue Metal Color Theme - * - * @author Jorg Janke, Adam Michau - * @version $Id: AdempiereThemeBlueMetal.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereThemeBlueMetal extends CompiereTheme -{ - /** - * Adempiere default Theme Blue Metal - */ - public CompiereThemeBlueMetal() - { - setDefault(); - s_theme = this; - s_name = NAME; - } // AdempiereThemeBlueMetal - - /** Name */ - public static final String NAME = "Compiere Theme"; - - /** - * Set Defaults - */ - protected void setDefault() - { - /** Blue 102, 102, 153 */ - primary1 = new ColorUIResource(102, 102, 153); - /** Blue 153, 153, 204 */ - primary2 = new ColorUIResource(153, 153, 204); - /** Blue 204, 204, 255 */ - primary3 = new ColorUIResource(204, 204, 255); - /** Gray 102, 102, 102 */ - secondary1 = new ColorUIResource(102, 102, 102); - /** Gray 153, 153, 153 */ - secondary2 = new ColorUIResource(153, 153, 153); - /** BlueGray 214, 224, 234 - background */ - secondary3 = new ColorUIResource(205, 215, 231); - - /** Black */ - black = new ColorUIResource(Color.black); - /** White */ - white = new ColorUIResource(Color.white); - - /** Background for mandatory fields */ - mandatory = new ColorUIResource(224, 224, 255); // blue-isch - /** Background for fields in error */ - error = new ColorUIResource(255, 204, 204); // red-isch - /** Background for inactive fields */ - inactive = new ColorUIResource(234, 234, 234); // light gray - /** Background for info fields */ - info = new ColorUIResource(253, 237, 207); // light yellow - - /** Foreground Text OK */ - txt_ok = new ColorUIResource(51, 51, 102); // dark blue - /** Foreground Text Error */ - txt_error = new ColorUIResource(204, 0, 0); // dark red - - /** Control font */ - controlFont = null; - _getControlTextFont(); - /** System font */ - systemFont = null; - _getSystemTextFont(); - /** User font */ - userFont = null; - _getUserTextFont(); - /** Small font */ - smallFont = null; - _getSubTextFont(); - /** Window Title font */ - windowFont = null; - _getWindowTitleFont(); - /** Menu font */ - menuFont = null; - _getMenuTextFont(); - } // setDefault - -} // AdempiereThemeBlueMetal diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereThemeEditor.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereThemeEditor.java deleted file mode 100644 index 104ee2440a..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereThemeEditor.java +++ /dev/null @@ -1,431 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.BorderLayout; -import java.awt.FlowLayout; -import java.awt.GridLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ResourceBundle; - -import javax.swing.JColorChooser; -import javax.swing.JDialog; -import javax.swing.UIManager; -import javax.swing.border.TitledBorder; -import javax.swing.plaf.ColorUIResource; -import javax.swing.plaf.FontUIResource; -import javax.swing.plaf.metal.MetalLookAndFeel; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.swing.CButton; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.swing.FontChooser; - -/** - * Java Theme Editor. - * Edit the attributes and save them in Ini.properties. - * Does not set background of AdempiereColorUI. - * - * @author Jorg Janke - * @version $Id: AdempiereThemeEditor.java,v 1.3 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereThemeEditor extends CDialog - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = 6865599987532875192L; - - /** - * Constructor - * @param owner Frame owner - */ - public CompiereThemeEditor (JDialog owner) - { - super(owner, s_res.getString("AdempiereThemeEditor"), true); - try - { - jbInit(); - loadTheme(); - dynInit(); - AdempierePLAF.showCenterScreen(this); - } - catch(Exception e) - { - System.err.println("AdempiereThemeEditor"); - e.printStackTrace(); - } - } // AdempiereThemeEditor - - static ResourceBundle s_res = ResourceBundle.getBundle("org.compiere.plaf.PlafRes"); - - private CButton primary1 = new CButton(); - private CButton primary2 = new CButton(); - private CButton primary3 = new CButton(); - private CButton secondary1 = new CButton(); - private CButton secondary2 = new CButton(); - private CButton secondary3 = new CButton(); - private CButton controlFont = new CButton(); - private CButton systemFont = new CButton(); - private CButton userFont = new CButton(); - private CButton smallFont = new CButton(); - private CButton mandatory = new CButton(); - private CButton error = new CButton(); - private CButton windowFont = new CButton(); - private CButton menuFont = new CButton(); - private CButton white = new CButton(); - private CButton black = new CButton(); - private CPanel confirmPanel = new CPanel(); - - private CButton inactive = new CButton(); - private CButton txt_ok = new CButton(); - private CButton txt_error = new CButton(); - private CButton bCancel = AdempierePLAF.getCancelButton(); - private CButton bOK = AdempierePLAF.getOKButton(); - private FlowLayout confirmLayout = new FlowLayout(); - private CPanel centerPanel = new CPanel(); - private CPanel metalColorPanel = new CPanel(); - private BorderLayout centerLayout = new BorderLayout(); - private CPanel adempiereColorPanel = new CPanel(); - private TitledBorder metalColorBorder; - private TitledBorder adempiereColorBorder; - private GridLayout metalColorLayout = new GridLayout(); - private GridLayout adempiereColorLayout = new GridLayout(); - private CPanel fontPanel = new CPanel(); - private GridLayout fontLayout = new GridLayout(); - private TitledBorder fontBorder; - private CButton info = new CButton(); - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - metalColorBorder = new TitledBorder(s_res.getString("MetalColors")); - adempiereColorBorder = new TitledBorder(s_res.getString("AdempiereColors")); - fontBorder = new TitledBorder(s_res.getString("AdempiereFonts")); - fontPanel.setBorder(fontBorder); - fontPanel.setOpaque(false); - - this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - // - primary1.setToolTipText(s_res.getString("Primary1Info")); - primary1.setText(s_res.getString("Primary1")); - primary1.addActionListener(this); - primary2.setToolTipText(s_res.getString("Primary2Info")); - primary2.setText(s_res.getString("Primary2")); - primary2.addActionListener(this); - primary3.setToolTipText(s_res.getString("Primary3Info")); - primary3.setText(s_res.getString("Primary3")); - primary3.addActionListener(this); - secondary1.setToolTipText(s_res.getString("Secondary1Info")); - secondary1.setText(s_res.getString("Secondary1")); - secondary1.addActionListener(this); - secondary2.setToolTipText(s_res.getString("Secondary2Info")); - secondary2.setText(s_res.getString("Secondary2")); - secondary2.addActionListener(this); - secondary3.setToolTipText(s_res.getString("Secondary3Info")); - secondary3.setText(s_res.getString("Secondary3")); - secondary3.addActionListener(this); - controlFont.setToolTipText(s_res.getString("ControlFontInfo")); - controlFont.setText(s_res.getString("ControlFont")); - controlFont.addActionListener(this); - systemFont.setToolTipText(s_res.getString("SystemFontInfo")); - systemFont.setText(s_res.getString("SystemFont")); - systemFont.addActionListener(this); - userFont.setToolTipText(s_res.getString("UserFontInfo")); - userFont.setText(s_res.getString("UserFont")); - userFont.addActionListener(this); - smallFont.setText(s_res.getString("SmallFont")); - smallFont.addActionListener(this); - mandatory.setToolTipText(s_res.getString("MandatoryInfo")); - mandatory.setText(s_res.getString("Mandatory")); - mandatory.addActionListener(this); - error.setToolTipText(s_res.getString("ErrorInfo")); - error.setText(s_res.getString("Error")); - error.addActionListener(this); - info.setToolTipText(s_res.getString("InfoInfo")); - info.setText(s_res.getString("Info")); - info.addActionListener(this); - windowFont.setText(s_res.getString("WindowTitleFont")); - windowFont.addActionListener(this); - menuFont.setText(s_res.getString("MenuFont")); - menuFont.addActionListener(this); - white.setToolTipText(s_res.getString("WhiteInfo")); - white.setText(s_res.getString("White")); - white.addActionListener(this); - black.setToolTipText(s_res.getString("BlackInfo")); - black.setText(s_res.getString("Black")); - black.addActionListener(this); - inactive.setToolTipText(s_res.getString("InactiveInfo")); - inactive.setText(s_res.getString("Inactive")); - inactive.addActionListener(this); - txt_ok.setToolTipText(s_res.getString("TextOKInfo")); - txt_ok.setText(s_res.getString("TextOK")); - txt_ok.addActionListener(this); - txt_error.setToolTipText(s_res.getString("TextIssueInfo")); - txt_error.setText(s_res.getString("TextIssue")); - txt_error.addActionListener(this); - // - confirmPanel.setLayout(confirmLayout); - confirmLayout.setAlignment(FlowLayout.RIGHT); - centerPanel.setLayout(centerLayout); - metalColorPanel.setBorder(metalColorBorder); - metalColorPanel.setOpaque(false); - metalColorPanel.setLayout(metalColorLayout); - adempiereColorPanel.setLayout(adempiereColorLayout); - adempiereColorPanel.setBorder(adempiereColorBorder); - adempiereColorPanel.setOpaque(false); - metalColorLayout.setColumns(3); - metalColorLayout.setHgap(5); - metalColorLayout.setRows(3); - metalColorLayout.setVgap(5); - adempiereColorLayout.setColumns(4); - adempiereColorLayout.setHgap(5); - adempiereColorLayout.setRows(2); - adempiereColorLayout.setVgap(5); - fontPanel.setLayout(fontLayout); - fontLayout.setColumns(3); - fontLayout.setHgap(5); - fontLayout.setRows(2); - fontLayout.setVgap(5); - centerLayout.setVgap(5); - fontBorder.setTitle(s_res.getString("Fonts")); - confirmPanel.setOpaque(false); - this.getContentPane().add(confirmPanel, BorderLayout.SOUTH); - confirmPanel.add(bCancel, null); - confirmPanel.add(bOK, null); - this.getContentPane().add(centerPanel, BorderLayout.CENTER); - centerPanel.add(metalColorPanel, BorderLayout.NORTH); - metalColorPanel.add(primary1, null); - metalColorPanel.add(primary2, null); - metalColorPanel.add(primary3, null); - metalColorPanel.add(secondary1, null); - metalColorPanel.add(secondary2, null); - metalColorPanel.add(secondary3, null); - metalColorPanel.add(white, null); - metalColorPanel.add(black, null); - centerPanel.add(adempiereColorPanel, BorderLayout.CENTER); - adempiereColorPanel.add(txt_error, null); - centerPanel.add(fontPanel, BorderLayout.SOUTH); - fontPanel.add(controlFont, null); - fontPanel.add(systemFont, null); - fontPanel.add(menuFont, null); - fontPanel.add(userFont, null); - fontPanel.add(windowFont, null); - fontPanel.add(smallFont, null); - adempiereColorPanel.add(error, null); - adempiereColorPanel.add(inactive, null); - adempiereColorPanel.add(txt_ok, null); - adempiereColorPanel.add(mandatory, null); - adempiereColorPanel.add(info, null); - bCancel.addActionListener(this); - bOK.addActionListener(this); - } // jbInit - - /** - * Load Theme from current Setting (if MetalLookAndFeel) - */ - private void loadTheme() - { - if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) - { - // AdempiereTheme.setTheme(); - } - else // Not a Metal Theme - { - primary1.setEnabled(false); - primary2.setEnabled(false); - primary3.setEnabled(false); - secondary1.setEnabled(false); - secondary2.setEnabled(false); - secondary3.setEnabled(false); - } - } // loadTheme - - /** - * Dynamic Init - */ - private void dynInit() - { - // Colors - primary1.setBackground(CompiereTheme.primary1); - primary2.setBackground(CompiereTheme.primary2); - primary3.setBackground(CompiereTheme.primary3); - secondary1.setBackground(CompiereTheme.secondary1); - secondary2.setBackground(CompiereTheme.secondary2); - secondary3.setBackground(CompiereTheme.secondary3); - // - white.setBackground(CompiereTheme.white); - black.setBackground(CompiereTheme.secondary3); - black.setForeground(CompiereTheme.black); - // - error.setBackground(CompiereTheme.error); - mandatory.setBackground(CompiereTheme.mandatory); - inactive.setBackground(CompiereTheme.inactive); - info.setBackground(CompiereTheme.info); - // - txt_ok.setBackground(CompiereTheme.white); - txt_ok.setForeground(CompiereTheme.txt_ok); - txt_error.setBackground(CompiereTheme.white); // AdempierePLAF.getFieldBackground_Normal() - txt_error.setForeground(CompiereTheme.txt_error); - - // Fonts - controlFont.setFont(CompiereTheme.controlFont); - systemFont.setFont(CompiereTheme.systemFont); - userFont.setFont(CompiereTheme.userFont); - smallFont.setFont(CompiereTheme.smallFont); - menuFont.setFont(CompiereTheme.menuFont); - windowFont.setFont(CompiereTheme.windowFont); - } // dynInit - - /** - * Action Listener - * @param e - */ - public void actionPerformed(ActionEvent e) - { - // Confirm - if (e.getSource() == bOK) - { - //CompiereTheme.saveEx(); - dispose(); - return; - } - // Cancel - else if (e.getSource() == bCancel) - { - dispose(); - return; - } - - try { // to capture errors when Cancel in JColorChooser - - if (e.getSource() == primary1) - { - CompiereTheme.primary1 = new ColorUIResource(JColorChooser.showDialog - (this, s_res.getString("Primary1"), CompiereTheme.primary1)); - } - else if (e.getSource() == primary2) - { - CompiereTheme.primary2 = new ColorUIResource(JColorChooser.showDialog - (this, s_res.getString("Primary2"), CompiereTheme.primary2)); - } - else if (e.getSource() == primary3) - { - CompiereTheme.primary3 = new ColorUIResource(JColorChooser.showDialog - (this, s_res.getString("Primary3"), CompiereTheme.primary3)); - } - else if (e.getSource() == secondary1) - { - CompiereTheme.secondary1 = new ColorUIResource(JColorChooser.showDialog - (this, s_res.getString("Secondary1"), CompiereTheme.secondary1)); - } - else if (e.getSource() == secondary2) - { - CompiereTheme.secondary2 = new ColorUIResource(JColorChooser.showDialog - (this, s_res.getString("Secondary2"), CompiereTheme.secondary2)); - } - else if (e.getSource() == secondary3) - { - CompiereTheme.secondary3 = new ColorUIResource(JColorChooser.showDialog - (this, s_res.getString("Secondary3"), CompiereTheme.secondary3)); - } - - else if (e.getSource() == error) - { - CompiereTheme.error = new ColorUIResource(JColorChooser.showDialog - (this, s_res.getString("Error"), CompiereTheme.error)); - } - else if (e.getSource() == mandatory) - { - CompiereTheme.mandatory = new ColorUIResource(JColorChooser.showDialog - (this, s_res.getString("Mandatory"), CompiereTheme.mandatory)); - } - else if (e.getSource() == inactive) - { - CompiereTheme.inactive = new ColorUIResource(JColorChooser.showDialog - (this, s_res.getString("Inactive"), CompiereTheme.inactive)); - } - else if (e.getSource() == info) - { - CompiereTheme.info = new ColorUIResource(JColorChooser.showDialog - (this, s_res.getString("Info"), CompiereTheme.info)); - } - - else if (e.getSource() == black) - { - CompiereTheme.black = new ColorUIResource(JColorChooser.showDialog - (this, s_res.getString("Black"), CompiereTheme.black)); - } - else if (e.getSource() == white) - { - CompiereTheme.white = new ColorUIResource(JColorChooser.showDialog - (this, s_res.getString("White"), CompiereTheme.white)); - } - else if (e.getSource() == txt_ok) - { - CompiereTheme.txt_ok = new ColorUIResource(JColorChooser.showDialog - (this, s_res.getString("TextOK"), CompiereTheme.txt_ok)); - } - else if (e.getSource() == txt_error) - { - CompiereTheme.txt_error = new ColorUIResource(JColorChooser.showDialog - (this, s_res.getString("TextIssue"), CompiereTheme.txt_error)); - } - - else if (e.getSource() == controlFont) - { - CompiereTheme.controlFont = new FontUIResource(FontChooser.showDialog - (this, s_res.getString("ControlFont"), CompiereTheme.controlFont)); - } - else if (e.getSource() == systemFont) - { - CompiereTheme.systemFont = new FontUIResource(FontChooser.showDialog - (this, s_res.getString("SystemFont"), CompiereTheme.systemFont)); - } - else if (e.getSource() == userFont) - { - CompiereTheme.userFont = new FontUIResource(FontChooser.showDialog - (this, s_res.getString("UserFont"), CompiereTheme.userFont)); - } - else if (e.getSource() == smallFont) - { - CompiereTheme.smallFont = new FontUIResource(FontChooser.showDialog - (this, s_res.getString("SmallFont"), CompiereTheme.smallFont)); - } - else if (e.getSource() == menuFont) - { - CompiereTheme.menuFont = new FontUIResource(FontChooser.showDialog - (this, s_res.getString("MenuFont"), CompiereTheme.menuFont)); - } - else if (e.getSource() == windowFont) - { - CompiereTheme.windowFont = new FontUIResource(FontChooser.showDialog - (this, s_res.getString("WindowTitleFont"), CompiereTheme.windowFont)); - } - - } catch (Exception ee) {} // to capture errors when Cancel in JColorChooser - - dynInit(); - } // actionPerformed - -} // AdempiereThemeEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereThemeIce.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereThemeIce.java deleted file mode 100644 index 134bab80aa..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereThemeIce.java +++ /dev/null @@ -1,101 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.Color; - -import javax.swing.plaf.ColorUIResource; - -/** - * Adempiere Theme Ice - * - * @author Jorg Janke, Adam Michau - * @version $Id: AdempiereThemeIce.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereThemeIce extends CompiereTheme -{ - /** - * Adempiere Theme: Ice - */ - public CompiereThemeIce () - { - setDefault(); - s_theme = this; - s_name = NAME; - } // AdempiereThemeBlueMetal - - /** Name */ - public static final String NAME = "Compiere Ice"; - - /** - * Set Defaults - */ - protected void setDefault() - { - /** Blue 102, 102, 153 */ - primary1 = new ColorUIResource(210, 226, 239); - /** Blue 153, 153, 204 */ - primary2 = new ColorUIResource(233, 240, 248); - /** Blue 204, 204, 255 */ - primary3 = new ColorUIResource(167, 198, 227); - /** Gray 102, 102, 102 */ - secondary1 = new ColorUIResource(102, 102, 102); - /** Gray 153, 153, 153 */ - secondary2 = new ColorUIResource(153, 153, 153); - /** BlueGray 214, 224, 234 - background */ - secondary3 = new ColorUIResource(210, 226, 239); - - /** Black */ - black = new ColorUIResource(Color.black); - /** White */ - white = new ColorUIResource(Color.white); - - /** Background for mandatory fields */ - mandatory = new ColorUIResource(224, 224, 255); // blue-isch - /** Background for fields in error */ - error = new ColorUIResource(255, 204, 204); // red-isch - /** Background for inactive fields */ - inactive = new ColorUIResource(234, 234, 234); // light gray - /** Background for info fields */ - info = new ColorUIResource(253, 237, 207); // light yellow - - /** Foreground Text OK */ - txt_ok = new ColorUIResource(51, 51, 102); // dark blue - /** Foreground Text Error */ - txt_error = new ColorUIResource(204, 0, 0); // dark red - - /** Control font */ - controlFont = null; - _getControlTextFont(); - /** System font */ - systemFont = null; - _getSystemTextFont(); - /** User font */ - userFont = null; - _getUserTextFont(); - /** Small font */ - smallFont = null; - _getSubTextFont(); - /** Window Title font */ - windowFont = null; - _getWindowTitleFont(); - /** Menu font */ - menuFont = null; - _getMenuTextFont(); - } // setDefault - -} // AdempiereThemeIce diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereToggleButtonUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereToggleButtonUI.java deleted file mode 100644 index 1a53cac058..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereToggleButtonUI.java +++ /dev/null @@ -1,113 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.Graphics; -import java.awt.Graphics2D; - -import javax.swing.AbstractButton; -import javax.swing.ButtonModel; -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.metal.MetalToggleButtonUI; - -/** - * Adempiere Toggle Button UI - * - * @author Jorg Janke - * @version $Id: AdempiereToggleButtonUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereToggleButtonUI extends MetalToggleButtonUI -{ - /** - * Static Create UI - * @param c Component - * @return Adempiere ToggleButton UI - */ - public static ComponentUI createUI (JComponent c) - { - return s_toggleButtonUI; - } // createUI - - /** UI shared */ - private static CompiereToggleButtonUI s_toggleButtonUI = new CompiereToggleButtonUI(); - - - /************************************************************************** - * Install Defaults - * @param b - */ - public void installDefaults(AbstractButton b) - { - super.installDefaults(b); - b.setOpaque(false); - } // installDefaults - - /** - * Update - - * This method is invoked by JComponent when the specified - * component is being painted. - * - * By default this method will fill the specified component with - * its background color (if its opaque property is - * true) and then immediately call paint. - * - * @param g the Graphics context in which to paint - * @param c the component being painted - * - * @see #paint - * @see javax.swing.JComponent#paintComponent - */ - public void update(Graphics g, JComponent c) - { - if (c.isOpaque()) // flat background - // AdempiereColor.getDefaultBackground().paint(g, c); - CompiereUtils.fillRectange((Graphics2D)g, c, CompiereLookAndFeel.ROUND); - paint (g, c); - } // update - - /** - * Paint 3D Box - * @param g Graphics - * @param c Component - */ - public void paint(Graphics g, JComponent c) - { - super.paint(g, c); - AbstractButton b = (AbstractButton) c; - ButtonModel model = b.getModel(); - boolean in = model.isPressed() || model.isSelected(); - // - CompiereUtils.paint3Deffect((Graphics2D)g, c, CompiereLookAndFeel.ROUND, !in); - } // paint - - /** - * Don't get selected Color - use default (otherwise the pressed button is gray) - * @param g - * @param b - */ - protected void paintButtonPressed(Graphics g, AbstractButton b) - { - // if (b.isContentAreaFilled()) - // { - // Dimension size = b.getSize(); - // g.setColor(getSelectColor()); - // g.fillRect(0, 0, size.width, size.height); - // } - } // paintButtonPressed - -} // AdempiereToggleButton diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereToolBarUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereToolBarUI.java deleted file mode 100644 index cfe262aa5c..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereToolBarUI.java +++ /dev/null @@ -1,60 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.metal.MetalToolBarUI; - -/** - * Adempiere Tool Bar - * - * @author Jorg Janke - * @version $Id: AdempiereToolBarUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereToolBarUI extends MetalToolBarUI -{ - /** - * Create UI (own instance) - * @param c - * @return AdempiereToolBarUI - */ - public static ComponentUI createUI (JComponent c) - { - return new CompiereToolBarUI(); - } // createUI - - - /** - * Install UI - not Opaque - * @param c - */ - public void installUI( JComponent c ) - { - super.installUI (c); - c.setOpaque(false); - } // installUI - - /** - * JToolbar error : I just instanciate and display a toolbar - * in the AWT dispatcher thread. When the toolbar is repaint - * with a SwingUtilities.updateTreeView, buttons are larger - * than usual. Note that I have several toolbars - * == paint is done by Metal, so error is there == - */ - -} // AdempiereToolBarUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereToolTipUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereToolTipUI.java deleted file mode 100644 index a8bb4d214a..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereToolTipUI.java +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.event.KeyEvent; - -import javax.swing.JComponent; -import javax.swing.JMenuItem; -import javax.swing.JTabbedPane; -import javax.swing.JToolTip; -import javax.swing.KeyStroke; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.metal.MetalToolTipUI; - -/** - * Tool Tip - * - * @author Jorg Janke - * @version $Id: AdempiereToolTipUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CompiereToolTipUI extends MetalToolTipUI -{ - - public static ComponentUI createUI(JComponent c) - { - return sharedInstance; - } - - static CompiereToolTipUI sharedInstance = new CompiereToolTipUI(); - - private JToolTip tip; - - public Dimension getPreferredSize(JComponent c) - { - tip = (JToolTip)c; - return super.getPreferredSize(c); - } - public void paint(Graphics g, JComponent c) - { - tip = (JToolTip)c; - super.paint(g, c); - } - - /** - * Get Accelerator String - * @return string - */ - public String getAcceleratorString () - { - String str = super.getAcceleratorString(); - - if (tip == null || isAcceleratorHidden ()) - return str; - JComponent comp = tip.getComponent (); - if (comp == null || comp instanceof JTabbedPane || comp instanceof JMenuItem) - return str; - - KeyStroke[] keys = comp.getRegisteredKeyStrokes (); - StringBuilder controlKeyStr = new StringBuilder(); - for (int i = 0; i < keys.length; i++) - { - int mod = keys[i].getModifiers (); - int condition = comp.getConditionForKeyStroke (keys[i]); - if (condition == JComponent.WHEN_IN_FOCUSED_WINDOW) - { - String prefix = KeyEvent.getModifiersExText (mod); - if (prefix.length() > 1) - { - if (controlKeyStr.length() > 0) - controlKeyStr.append(" "); - controlKeyStr.append(prefix).append("-") - .append(KeyEvent.getKeyText(keys[i].getKeyCode())); - break; // just first - } - } - } - return controlKeyStr.toString(); - } // getAcceleratorString - -} // AdempierelToolTipUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereUtils.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereUtils.java deleted file mode 100644 index 5390386f97..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereUtils.java +++ /dev/null @@ -1,482 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.GradientPaint; -import java.awt.Graphics2D; -import java.awt.Image; -import java.awt.MediaTracker; -import java.awt.Paint; -import java.awt.Rectangle; -import java.awt.Toolkit; -import java.awt.geom.RectangularShape; -import java.awt.geom.RoundRectangle2D; -import java.awt.image.BufferedImage; -import java.io.File; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.imageio.ImageIO; -import javax.swing.JComponent; - - -/** - * UI utilities - * - * @author Jorg Janke - * @version $Id: AdempiereUtils.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $ - */ -public class CompiereUtils -{ - - /** Logger */ - private static Logger log = Logger.getLogger(CompiereUtils.class.getName()); - - /** - * Fill Background with Color. - * (Ususlly called from update methods) - * - * @param g2D Graphics - * @param c Component - * @param round paint round corners - */ - public static void fillRectange(Graphics2D g2D, JComponent c, boolean round) - { - // Paint in AdempiereColor? - CompiereColor cc = null; - boolean stdCC = c.getClientProperty(CompiereLookAndFeel.BACKGROUND_FILL) != null; - try - { - cc = (CompiereColor)c.getClientProperty(CompiereLookAndFeel.BACKGROUND); - } - catch (Exception e) - { - stdCC = true; - } - if (stdCC) - cc = CompiereColor.getDefaultBackground(); - - // Paint AdempiereColor - if (cc != null) - { - // bounds is often not within Panel bouunds - cc.paint(g2D, c); - } - // Paint Flat Color - else - { - Paint paint = c.getBackground(); - g2D.setPaint(paint); - // - RectangularShape rec = null; - if (round) - rec = new RoundRectangle2D.Float(0, 0, c.getWidth(),c.getHeight(), 15,15); - else - rec = new Rectangle(0,0, c.getWidth(),c.getHeight()); - g2D.fill(rec); - } - } // fill Rectangle - - /** Top Top Color - white 128 the higher the ligher */ - static public final Color COL_1TOP = new Color(255, 255, 255, 128); - /** End Top Color - white 0 */ - static public final Color COL_1END = new Color(255, 255, 255, 0); - /** Top End Color - black 0 */ - static public final Color COL_2TOP = new Color(0, 0, 0, 0); - /** End End Color - black 64 the higher the darker */ - static public final Color COL_2END = new Color(0, 0, 0, 64); - - /** - * Paint 3D effect in (lighten in upper half, darken in lowerhalf) - * (called from paint methods) - * - * @param g2D Graphics - * @param r Ractangle - * @param round paint round corners - * @param out paint sticking out (not pressed) - */ - public static void paint3Deffect (Graphics2D g2D, Rectangle r, boolean round, boolean out) - { - // paint upper gradient - GradientPaint topPaint = null; - if (out) - topPaint = new GradientPaint(r.x, r.y, COL_1TOP, r.x, r.y+r.height/2, COL_1END); - else - topPaint = new GradientPaint(r.x, r.y, COL_2END, r.x, r.y+r.height/2, COL_2TOP); - g2D.setPaint(topPaint); - // - RectangularShape topRec = null; - if (round) - topRec = new RoundRectangle2D.Float(r.x,r.y, r.width,r.height/2, 15,15); - else - topRec = new Rectangle(r.x,r.y, r.width,r.height/2); - g2D.fill(topRec); - - // paint lower gradient - GradientPaint endPaint = null; // upper left corner to lower left - if (out) - endPaint = new GradientPaint(r.x, r.y+r.height/2, COL_2TOP, r.x, r.y+r.height, COL_2END); - else - endPaint = new GradientPaint(r.x, r.y+r.height/2, COL_1END, r.x, r.y+r.height, COL_1TOP); - g2D.setPaint(endPaint); - // - RectangularShape endRec = null; - if (round) - endRec = new RoundRectangle2D.Float(r.x, r.y+r.height/2, r.width, r.height/2, 15,15); - else - endRec = new Rectangle(r.x, r.y+r.height/2, r.width, r.height/2); - g2D.fill(endRec); - } // paint3Deffect - - /** - * Paint 3D effect in (lighten in upper half, darken in lowerhalf) - * (called from paint methods) - * - * @param g2D Graphics - * @param c Component - * @param round paint round corners - * @param out paint sticking out (not pressed) - */ - public static void paint3Deffect (Graphics2D g2D, JComponent c, boolean round, boolean out) - { - // paint upper gradient - GradientPaint topPaint = null; - if (out) - topPaint = new GradientPaint(0,0, COL_1TOP, 0,c.getHeight()/2, COL_1END); - else - topPaint = new GradientPaint(0,0, COL_2END, 0,c.getHeight()/2, COL_2TOP); - g2D.setPaint(topPaint); - // - RectangularShape topRec = null; - if (round) - topRec = new RoundRectangle2D.Float(0, 0, c.getWidth(),c.getHeight()/2, 15,15); - else - topRec = new Rectangle(0,0, c.getWidth(),c.getHeight()/2); - g2D.fill(topRec); - - // paint lower gradient - GradientPaint endPaint = null; - if (out) - endPaint = new GradientPaint(0, c.getHeight()/2, COL_2TOP, 0,c.getHeight(), COL_2END); - else - endPaint = new GradientPaint(0, c.getHeight()/2, COL_1END, 0,c.getHeight(), COL_1TOP); - g2D.setPaint(endPaint); - // - RectangularShape endRec = null; - if (round) - endRec = new RoundRectangle2D.Float(0, c.getHeight()/2, c.getWidth(),c.getHeight()/2, 15,15); - else - endRec = new Rectangle(0, c.getHeight()/2, c.getWidth(), c.getHeight()/2); - g2D.fill(endRec); - } // paint3Deffect - - - /************************************************************************* - * Helper to simplify creation of translucent colors - * @param c Color - * @param alpha alpha - * @return Translucent Color - */ - static public Color getTranslucentColor(Color c, int alpha) - { - return new Color(c.getRed(), c.getGreen(), c.getBlue(), alpha); - } // getTranslucentColor - - - /** - * Set Not Buffered. Recursive for all contained components - * @param c - */ - static public void setNotBuffered (Component c) - { - if (c instanceof JComponent) - ((JComponent)c).setDoubleBuffered(false); - if (c instanceof Container) - { - Component[] cc = ((Container)c).getComponents(); - for (int i = 0; i < cc.length; i++) - setNotBuffered(cc[i]); - } - } // setNotBuffered - - - /*************************************************************************/ - - /** Component for media tracker */ - protected final static Component s_component = new Component() { - - /** - * - */ - private static final long serialVersionUID = 2185807624882290223L;}; - /** Media tracker */ - protected final static MediaTracker s_tracker = new MediaTracker(s_component); - - /** - * load the image located at path. - * - * @param path location of image file in local file system - * - otherwise relative to class - * @return loaded image at path or url - * @see java.io.File#toURI() - * @see java.net.URI#toURL() - */ - public static synchronized Image loadImage(String path) - { - Image image = null; - if (path != null) - { - try - { - File file = new File(path); - URL url = file.toURI().toURL(); - image = loadImage(url); - } - catch (MalformedURLException e) - { - log.severe("Path= " + path + " - " + e.getMessage()); - } - } - return image; - } // loadImage - - /** - * Load the image located at URL. - * - * @param url URL where the image file is located. - * @return loaded image at path or url - * @see java.io.File#toURI() - */ - public static synchronized Image loadImage(URL url) - { - Image image = null; - image = Toolkit.getDefaultToolkit().getImage(url); - if (image != null) - { - s_tracker.addImage(image, 0); - try - { - s_tracker.waitForAll(); - } - catch (InterruptedException e) - { - log.severe("Url= " + url + " - " + e.getMessage()); - s_tracker.removeImage(image); - image = null; - } - finally - { - if (image != null) - s_tracker.removeImage(image); - if (s_tracker.isErrorAny()) - { - log.severe("Tracker: " + s_tracker.getErrorsAny()[0]); - image = null; - } - - if (image != null) - { - if (image.getWidth(null) < 0 || image.getHeight(null) < 0) - { - log.severe("Image=0"); - image = null; - } - } - } - } - return image; - } // loadImage - - /** - * Load an image from a given file into a BufferedImage. - * The image is returned in the format defined by the imageType parameter. - * Note that this is special cased for JPEG images where loading is performed - * outside the standard media tracker, for efficiency reasons. - * - * @param file File where the image file is located. - * @param imageType one of the image type defined in the BufferedImage class. - * @return loaded image at path or url - * @see java.awt.image.BufferedImage - */ - public static synchronized BufferedImage loadBufferedImage(File file, int imageType) - { - BufferedImage image = null; - try - { - URL url = file.toURI().toURL(); - image = loadBufferedImage(url, imageType); - } - catch (MalformedURLException e) - { - log.severe("File: " + file + " - " + e.getMessage()); - } - return image; - } // loadBufferedImage - - /** - * Load an image from a given path into a BufferedImage. - * The image is returned in the format defined by the imageType parameter. - * Note that this is special cased for JPEG images where loading is performed - * outside the standard media tracker, for efficiency reasons. - * - * @param path Name of file where the image file is located. - * @param imageType one of the image type defined in the BufferedImage class. - * @return loaded image at path or url - * @see java.awt.image.BufferedImage - * @see java.io.File#toURI() - * @see java.net.URI#toURL() - */ - public static synchronized BufferedImage loadBufferedImage(String path, int imageType) - { - File file = new File(path); - BufferedImage image = null; - try - { - URL url = file.toURI().toURL(); - image = loadBufferedImage(url, imageType); - } - catch (MalformedURLException e) - { - log.severe("Path: " + path + " - " + e.getMessage()); - } - return image; - } // loadBufferedImage - - /** - * Loads an image from a given URL into a BufferedImage. - * The image is returned in the format defined by the imageType parameter. - * Note that this is special cased for JPEG images where loading is performed - * outside the standard media tracker, for efficiency reasons. - * - * @param url URL where the image file is located. - * @param imageType one of the image type defined in the BufferedImage class. - * @return loaded image at path or url - * @see java.awt.image.BufferedImage - */ - public static synchronized BufferedImage loadBufferedImage(URL url, int imageType) - { - BufferedImage image = null; - // Special handling for JPEG images to avoid extra processing if possible. - if (url == null || !url.toString().toLowerCase().endsWith(".jpg")) - { - Image tmpImage = loadImage(url); - if (tmpImage != null) - { - image = new BufferedImage(tmpImage.getWidth(null), tmpImage.getHeight(null), imageType); - Graphics2D g = image.createGraphics(); - g.drawImage(tmpImage, 0, 0, null); - g.dispose(); - } - } - else - { - BufferedImage tmpImage = loadBufferedJPEGImage(url); - if (tmpImage != null) - { - if (tmpImage.getType() != imageType) - { - log.config("Incompatible JPEG image type: creating new buffer image"); - image = new BufferedImage(tmpImage.getWidth(null), tmpImage.getHeight(null), imageType); - Graphics2D g = image.createGraphics(); - g.drawImage(tmpImage, 0, 0, null); - g.dispose(); - } - else - image = tmpImage; - } - } - return image; - } // loadBufferedImage - - /** - * Load a JPEG image from a given location. - * - * @param url URL where the image file is located. - * @return loaded image at path or url - */ - public static synchronized BufferedImage loadBufferedJPEGImage (URL url) - { - BufferedImage image = null; - if (url != null) - { - try - { - image = ImageIO.read(url); - } - catch (Exception e) - { - log.severe("URL: " + url + " - " + e.getMessage()); - image = null; - } - if (image != null) - { - if (log.isLoggable(Level.CONFIG)) log.config("Image type : " + image.getType()); - if (image.getWidth() <= 0 || image.getHeight() <= 0) - { - log.severe("URL: " + url + " =0"); - image = null; - } - } - } - return image; - } - - - /************************************************************************* - * Convenience function for determining ComponentOrientation. - * Copied from MetalUtils - * @param c Component - * @return true, if left to right - */ - public static boolean isLeftToRight (Component c) - { - return c.getComponentOrientation().isLeftToRight(); - } // isLeftToRight - - /** Debug SequenceNo */ - private static int s_no = 0; - - /** - * Print Oarent of Component - * @param c component - */ - static void printParents (JComponent c) - { - if (c.getName() == null) - c.setName("C" + String.valueOf(s_no++)); - System.out.print(c.getName()); - System.out.print(" - " + c.getClass().getName()); - System.out.println (" ** " + c.isOpaque() + " bg=" + (c.getClientProperty(CompiereLookAndFeel.BACKGROUND) != null)); - // - Container container = c.getParent(); - while (container != null) - { - System.out.print (" - " + container.getName() + " " + container.getClass().getName() - + " ** " + container.isOpaque()); - if (container instanceof JComponent) - System.out.print (" bg=" + (((JComponent)container).getClientProperty(CompiereLookAndFeel.BACKGROUND) != null)); - System.out.println (); - container = container.getParent(); - } - } // printParents - -} // AdempiereTuils diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereViewportUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereViewportUI.java deleted file mode 100644 index 98585084b0..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereViewportUI.java +++ /dev/null @@ -1,58 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.ViewportUI; -import javax.swing.plaf.basic.BasicViewportUI; - -/** - * Adempiere View Point - * - * @author Jorg Janke - * @version $Id: AdempiereViewportUI.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $ - */ -public class CompiereViewportUI extends BasicViewportUI -{ - /** Shared UI object */ - private static ViewportUI viewportUI; - - /** - * Create UI - * @param c - * @return AdempiereViewpointUI - */ - public static ComponentUI createUI (JComponent c) - { - if (viewportUI == null) - viewportUI = new CompiereViewportUI(); - return viewportUI; - } // createUI - - /** - * Install UI - * @param c - */ - public void installUI(JComponent c) - { - super.installUI(c); - // will be ignored as set in constructor after updateUI - Sun bug: 4677611 - c.setOpaque(false); - } // installUI - -} // AdempiereViewpointUI diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/ContrastTheme.java b/org.adempiere.ui.swing/src/org/compiere/plaf/ContrastTheme.java deleted file mode 100644 index 8a95b91166..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/ContrastTheme.java +++ /dev/null @@ -1,180 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -/* - * @(#)ContrastTheme.java 1.10 04/07/26 - */ -import javax.swing.UIDefaults; -import javax.swing.border.Border; -import javax.swing.border.CompoundBorder; -import javax.swing.border.LineBorder; -import javax.swing.plaf.BorderUIResource; -import javax.swing.plaf.ColorUIResource; -import javax.swing.plaf.basic.BasicBorders; -import javax.swing.plaf.metal.DefaultMetalTheme; - -/** - * This class describes a higher-contrast Metal Theme. - * - * @version 1.10 07/26/04 - * @author Michael C. Albers, Jorg Janke - */ -public class ContrastTheme extends DefaultMetalTheme -{ - - public String getName () - { - return "Contrast"; - } - - private final ColorUIResource primary1 - = new ColorUIResource (0, 0, 0); - - private final ColorUIResource primary2 - = new ColorUIResource (204, 204, 204); - - private final ColorUIResource primary3 - = new ColorUIResource (255, 255, 255); - - private final ColorUIResource primaryHighlight - = new ColorUIResource (102, 102, 102); - - private final ColorUIResource secondary2 - = new ColorUIResource (204, 204, 204); - - private final ColorUIResource secondary3 - = new ColorUIResource (255, 255, 255); - - //private final ColorUIResource controlHighlight = new ColorUIResource (102, 102, 102); - - protected ColorUIResource getPrimary1 () - { - return primary1; - } - - protected ColorUIResource getPrimary2 () - { - return primary2; - } - - protected ColorUIResource getPrimary3 () - { - return primary3; - } - - public ColorUIResource getPrimaryControlHighlight () - { - return primaryHighlight; - } - - protected ColorUIResource getSecondary2 () - { - return secondary2; - } - - protected ColorUIResource getSecondary3 () - { - return secondary3; - } - - public ColorUIResource getControlHighlight () - { - return super.getSecondary3 (); - } - - public ColorUIResource getFocusColor () - { - return getBlack (); - } - - public ColorUIResource getTextHighlightColor () - { - return getBlack (); - } - - public ColorUIResource getHighlightedTextColor () - { - return getWhite (); - } - - public ColorUIResource getMenuSelectedBackground () - { - return getBlack (); - } - - public ColorUIResource getMenuSelectedForeground () - { - return getWhite (); - } - - public ColorUIResource getAcceleratorForeground () - { - return getBlack (); - } - - public ColorUIResource getAcceleratorSelectedForeground () - { - return getWhite (); - } - - public void addCustomEntriesToTable (UIDefaults table) - { - Border blackLineBorder = new BorderUIResource - (new LineBorder(getBlack ())); - @SuppressWarnings("unused") - Border whiteLineBorder = new BorderUIResource( - new LineBorder(getWhite())); - // - Object textBorder = new BorderUIResource (new CompoundBorder - (blackLineBorder, new BasicBorders.MarginBorder())); - - // Enhancements - Object[] defaults = new Object[] - { - "ToolTip.border", blackLineBorder, - "TitledBorder.border", blackLineBorder, - "TextField.border", textBorder, - "PasswordField.border", textBorder, - "TextArea.border", textBorder, - "TextPane.border", textBorder, - "EditorPane.border", textBorder, - // - "ComboBox.background", getWindowBackground (), - "ComboBox.foreground", getUserTextColor (), - "ComboBox.selectionBackground", getTextHighlightColor (), - "ComboBox.selectionForeground", getHighlightedTextColor (), - "ProgressBar.foreground", getUserTextColor (), - "ProgressBar.background", getWindowBackground (), - "ProgressBar.selectionForeground", getWindowBackground (), - "ProgressBar.selectionBackground", getUserTextColor (), - "OptionPane.errorDialog.border.background", getPrimary1 (), - "OptionPane.errorDialog.titlePane.foreground", getPrimary3 (), - "OptionPane.errorDialog.titlePane.background", getPrimary1 (), - "OptionPane.errorDialog.titlePane.shadow", getPrimary2 (), - "OptionPane.questionDialog.border.background", getPrimary1 (), - "OptionPane.questionDialog.titlePane.foreground", getPrimary3 (), - "OptionPane.questionDialog.titlePane.background", getPrimary1 (), - "OptionPane.questionDialog.titlePane.shadow", getPrimary2 (), - "OptionPane.warningDialog.border.background", getPrimary1 (), - "OptionPane.warningDialog.titlePane.foreground", getPrimary3 (), - "OptionPane.warningDialog.titlePane.background", getPrimary1 (), - "OptionPane.warningDialog.titlePane.shadow", getPrimary2 (), - }; - table.putDefaults (defaults); - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/EmeraldTheme.java b/org.adempiere.ui.swing/src/org/compiere/plaf/EmeraldTheme.java deleted file mode 100644 index c5fdd7ee2c..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/EmeraldTheme.java +++ /dev/null @@ -1,58 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -/* - * @(#)EmeraldTheme.java 1.9 04/07/26 - */ - -import javax.swing.plaf.ColorUIResource; -import javax.swing.plaf.metal.DefaultMetalTheme; - -/** - * This class describes a theme using glowing green colors. - * - * @version 1.9 07/26/04 - * @author Jeff Dinkins - */ -public class EmeraldTheme extends DefaultMetalTheme { - - public String getName() - { - return "Emerald"; - } - - private final ColorUIResource primary1 = new ColorUIResource(51, 142, 71); - private final ColorUIResource primary2 = new ColorUIResource(102, 193, 122); - private final ColorUIResource primary3 = new ColorUIResource(153, 244, 173); - - protected ColorUIResource getPrimary1 () - { - return primary1; - } - - protected ColorUIResource getPrimary2 () - { - return primary2; - } - - protected ColorUIResource getPrimary3 () - { - return primary3; - } - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes.java deleted file mode 100644 index 3e37a3a5b5..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes.java +++ /dev/null @@ -1,133 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Jorg Janke - * @version $Id: PlafRes.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Background Color Type" }, - { "BackColType_Flat", "Flat" }, - { "BackColType_Gradient", "Gradient" }, - { "BackColType_Lines", "Lines" }, - { "BackColType_Texture", "Texture" }, - // - { "LookAndFeelEditor", "Look & Feel Editor" }, - { "LookAndFeel", "Look & Feel" }, - { "Theme", "Theme" }, - { "EditAdempiereTheme", "Edit Adempiere Theme" }, - { "SetDefault", "Default Background" }, - { "SetDefaultColor", "Background Color" }, - { "ColorBlind", "Color Deficiency" }, - { "Example", "Example" }, - { "Reset", "Reset" }, - { "OK", "OK" }, - { "Cancel", "Cancel" }, - // - { "AdempiereThemeEditor", "Adempiere Theme Editor" }, - { "MetalColors", "Metal Colors" }, - { "AdempiereColors", "Adempiere Colors" }, - { "AdempiereFonts", "Adempiere Fonts" }, - { "Primary1Info", "Shadow, Separator" }, - { "Primary1", "Primary 1" }, - { "Primary2Info", "Focus Line, Selected Menu" }, - { "Primary2", "Primary 2" }, - { "Primary3Info", "Table Selected Row, Selected Text, ToolTip Background" }, - { "Primary3", "Primary 3" }, - { "Secondary1Info", "Border Lines" }, - { "Secondary1", "Secondary 1" }, - { "Secondary2Info", "Inactive Tabs, Pressed Fields, Inactive Border + Text" }, - { "Secondary2", "Secondary 2" }, - { "Secondary3Info", "Background" }, - { "Secondary3", "Secondary 3" }, - // - { "ControlFontInfo", "Control Font" }, - { "ControlFont", "Label Font" }, - { "SystemFontInfo", "Tool Tip, Tree nodes" }, - { "SystemFont", "System Font" }, - { "UserFontInfo", "User Entered Data" }, - { "UserFont", "Field Font" }, -// { "SmallFontInfo", "Reports" }, - { "SmallFont", "Small Font" }, - { "WindowTitleFont", "Title Font" }, - { "MenuFont", "Menu Font" }, - // - { "MandatoryInfo", "Mandatory Field Background" }, - { "Mandatory", "Mandatory" }, - { "ErrorInfo", "Error Field Background" }, - { "Error", "Error" }, - { "InfoInfo", "Info Field Background" }, - { "Info", "Info" }, - { "WhiteInfo", "Lines" }, - { "White", "White" }, - { "BlackInfo", "Lines, Text" }, - { "Black", "Black" }, - { "InactiveInfo", "Inactive Field Background" }, - { "Inactive", "Inactive" }, - { "TextOKInfo", "OK Text Foreground" }, - { "TextOK", "Text - OK" }, - { "TextIssueInfo", "Error Text Foreground" }, - { "TextIssue", "Text - Error" }, - // - { "FontChooser", "Font Chooser" }, - { "Fonts", "Fonts" }, - { "Plain", "Plain" }, - { "Italic", "Italic" }, - { "Bold", "Bold" }, - { "BoldItalic", "Bold & Italic" }, - { "Name", "Name" }, - { "Size", "Size" }, - { "Style", "Style" }, - { "TestString", "This is just a Test! The quick brown Fox is doing something. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "Font" }, - // - { "AdempiereColorEditor", "Adempiere Color Editor" }, - { "AdempiereType", "Color Type" }, - { "GradientUpperColor", "Gradient Upper Color" }, - { "GradientLowerColor", "Gradient Lower Color" }, - { "GradientStart", "Gradient Start" }, - { "GradientDistance", "Gradient Distance" }, - { "TextureURL", "Texture URL" }, - { "TextureAlpha", "Texture Alpha" }, - { "TextureTaintColor", "Texture Taint Color" }, - { "LineColor", "Line Color" }, - { "LineBackColor", "Background Color" }, - { "LineWidth", "Line Width" }, - { "LineDistance", "Line Distance" }, - { "FlatColor", "Flat Color" }, - { "UITheme", "User Interface Theme" }, - { "Preview", "Preview" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ar.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ar.java deleted file mode 100644 index 4893131d68..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ar.java +++ /dev/null @@ -1,132 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * @author Nizar Khalifa Sallem - OXIA Tunisia - * @version $Id: PlafRes_ar.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_ar extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "\u0646\u0648\u0639 \u0644\u0648\u0646 \u0627\u0644\u062e\u0644\u0641\u064a\u0651\u064e\u0629" }, - { "BackColType_Flat", "\u0645\u0633\u0637\u0651\u064e\u062d" }, - { "BackColType_Gradient", "\u062a\u062f\u0631\u0651\u064f\u062c" }, - { "BackColType_Lines", "\u0623\u0633\u0637\u0631" }, - { "BackColType_Texture", "\u0646\u0633\u064a\u062c" }, - // - { "LookAndFeelEditor", "\u0645\u0639\u0650\u062f \u0623\u0646\u0638\u0631 \u0648 \u0623\u062d\u0633" }, - { "LookAndFeel", "\u0623\u0646\u0638\u0631 \u0648 \u0623\u062d\u0633" }, - { "Theme", "\u0633\u0645\u0629" }, - { "EditAdempiereTheme", "\u0623\u0639\u062f \u0633\u0645\u0629 \u0643\u0645\u0628\u064a\u0631" }, - { "SetDefault", "\u0627\u0644\u062e\u0644\u0641\u064a\u0651\u064e\u0629 \u0627\u0644\u0627\u0650\u0641\u062a\u0631\u0627\u0636\u064a\u0651\u064e\u0629" }, - { "SetDefaultColor", "\u0644\u0648\u0646 \u0627\u0644\u062e\u0644\u0641\u064a\u0651\u064e\u0629" }, - { "ColorBlind", "\u0639\u0645\u0649 \u0627\u0644\u0623\u0644\u0648\u0627\u0646" }, - { "Example", "\u0645\u062b\u0627\u0644" }, - { "Reset", "\u0625\u0639\u0627\u062f\u0629 \u0636\u0628\u0637" }, - { "OK", "\u0646\u0639\u0645" }, - { "Cancel", "\u0625\u0644\u063a\u0627\u0621" }, - // - { "AdempiereThemeEditor", "\u0645\u0639\u062f \u0633\u0645\u0629 \u0643\u0645\u0628\u064a\u0631" }, - { "MetalColors", "\u0623\u0644\u0648\u0627\u0646 \u0645\u0639\u062f\u0646\u064a\u0651\u064e\u0629" }, - { "AdempiereColors", "\u0623\u0644\u0648\u0627\u0646 \u0643\u0645\u0628\u064a\u0631" }, - { "AdempiereFonts", "\u062e\u0637\u0648\u0637 \u0643\u0645\u0628\u064a\u0631" }, - { "Primary1Info", "\u0638\u0644\u060c \u0641\u0627\u0635\u0644" }, - { "Primary1", "\u0623\u0648\u0651\u064e\u0644\u064a 1" }, - { "Primary2Info", "\u0633\u0637\u0631 \u0645\u0631\u0643\u0651\u064e\u0632 \u0639\u0644\u064a\u0647\u060c \u0642\u0627\u0626\u0645\u0629 \u0645\u062e\u062a\u0627\u0631\u0629" }, - { "Primary2", "\u0623\u0648\u0651\u064e\u0644\u064a 2" }, - { "Primary3Info", "\u0633\u0637\u0631 \u0645\u062e\u062a\u0627\u0631 \u0645\u0646 \u062c\u062f\u0648\u0644\u060c \u0646\u0635 \u0645\u062e\u062a\u0627\u0631\u060c \u062e\u0644\u0641\u064a\u0651\u064e\u0629 \u0646\u0635 \u0639\u0631\u0636\u064a" }, - { "Primary3", "\u0623\u0648\u0651\u064e\u0644\u064a 3" }, - { "Secondary1Info", "\u0623\u0633\u0637\u0631 \u062d\u062f" }, - { "Secondary1", "\u062b\u0627\u0646\u0648\u064a 1" }, - { "Secondary2Info", "\u062c\u062f\u0648\u0644\u0627\u062a \u062e\u0627\u0645\u0644\u0629\u060c \u062e\u0627\u0646\u0627\u062a \u0645\u0636\u063a\u0648\u0637\u0629\u060c \u062d\u062f \u062e\u0627\u0645\u0644 +\u0646\u0635" }, - { "Secondary2", "\u062b\u0627\u0646\u0648\u064a 2" }, - { "Secondary3Info", "\u062e\u0644\u0641\u064a\u0651\u064e\u0629" }, - { "Secondary3", "\u062b\u0627\u0646\u0648\u064a 3" }, - // - { "ControlFontInfo", "\u062e\u0637 \u0645\u0631\u0627\u0642\u0628\u0629" }, - { "ControlFont", "\u062e\u0637 \u062c\u0630\u0627\u0630\u0629" }, - { "SystemFontInfo", "\u0646\u0635 \u0639\u0631\u0636\u064a\u060c \u0639\u0642\u062f \u0634\u062c\u0631\u0629" }, - { "SystemFont", "\u062e\u0637 \u0627\u0644\u0646\u0638\u0627\u0645" }, - { "UserFontInfo", "\u0628\u064a\u0627\u0646\u0627\u062a \u0645\u062f\u062e\u0644\u0629 \u0645\u0646 \u0627\u0644\u0645\u0633\u062a\u0639\u0645\u0644" }, - { "UserFont", "\u062e\u0637 \u062d\u0642\u0644" }, -// { "SmallFontInfo", "\u062a\u0642\u0627\u0631\u064a\u0631" }, - { "SmallFont", "\u062e\u0637 \u0635\u063a\u064a\u0631" }, - { "WindowTitleFont", "\u062e\u0637 \u0639\u0646\u0648\u0627\u0646" }, - { "MenuFont", "\u062e\u0637 \u0642\u0627\u0626\u0645\u0629" }, - // - { "MandatoryInfo", "\u062e\u0644\u0641\u064a\u0651\u064e\u0629 \u062d\u0642\u0644 \u0625\u062c\u0628\u0627\u0631\u064a" }, - { "Mandatory", "\u0625\u062c\u0628\u0627\u0631\u064a" }, - { "ErrorInfo", "\u062e\u0644\u0641\u064a\u0651\u064e\u0629 \u062d\u0642\u0644 \u062e\u0627\u0637\u0626"}, - { "Error", "\u062e\u0637\u0623" }, - { "InfoInfo", "\u062e\u0644\u0641\u064a\u0651\u064e\u0629 \u062d\u0642\u0644 \u0628\u064a\u0627\u0646\u0627\u062a" }, - { "Info", "\u0628\u064a\u0627\u0646\u0627\u062a" }, - { "WhiteInfo", "\u0623\u0633\u0637\u0631" }, - { "White", "\u0623\u0628\u064a\u0636" }, - { "BlackInfo", "\u0623\u0633\u0637\u0631\u060c \u0646\u0635" }, - { "Black", "\u0623\u0633\u0648\u062f" }, - { "InactiveInfo", "\u062e\u0644\u0641\u064a\u0651\u064e\u0629 \u062d\u0642\u0644 \u062e\u0627\u0645\u0644" }, - { "Inactive", "\u062e\u0627\u0645\u0644" }, - { "TextOKInfo", "\u0623\u0645\u0627\u0645\u064a\u0651\u064e\u0629 \u0646\u0635 \u0635\u062d\u064a\u062d" }, - { "TextOK", "\u0646\u0635 - \u0635\u062d\u064a\u062d" }, - { "TextIssueInfo", "\u0623\u0645\u0627\u0645\u064a\u0651\u064e\u0629 \u0646\u0635 \u062e\u0627\u0637\u0626" }, - { "TextIssue", "\u0646\u0635 - \u062e\u0637\u0623" }, - // - { "FontChooser", "\u0645\u062e\u062a\u0627\u0631 \u0627\u0644\u062e\u0637" }, - { "Fonts", "\u062e\u0637\u0648\u0637" }, - { "Plain", "\u0645\u0644\u0622\u0646" }, - { "Italic", "\u0645\u0627\u0626\u0644" }, - { "Bold", "\u0633\u0645\u064a\u0643" }, - { "BoldItalic", "\u0633\u0645\u064a\u0643 \u0648 \u0645\u0627\u0626\u0644" }, - { "Name", "\u0627\u0650\u0633\u0645" }, - { "Size", "\u062d\u062c\u0645" }, - { "Style", "\u0645\u0638\u0647\u0631" }, - { "TestString", "\u0647\u0630\u0627 \u0627\u0650\u062e\u062a\u0628\u0627\u0631 \u0641\u0642\u0637\u060c \u0627\u0644\u062b\u0639\u0644\u0628 \u0627\u0644\u0628\u0646\u064a \u0627\u0644\u0633\u0631\u064a\u0639 \u0623\u0643\u0644 \u0634\u064a\u0626\u0627 \u0645\u0627. 12,3456789" }, - { "FontString", "\u062e\u0637" }, - // - { "AdempiereColorEditor", "\u0645\u0639\u062f \u0623\u0644\u0648\u0627\u0646 \u0643\u0645\u0628\u064a\u0631" }, - { "AdempiereType", "\u0646\u0648\u0639 \u0627\u0644\u0644\u0651\u064e\u0648\u0646" }, - { "GradientUpperColor", "\u0644\u0648\u0646 \u0627\u0644\u062a\u062f\u0631\u0651\u064f\u062c \u0627\u0644\u0639\u0644\u0648\u064a" }, - { "GradientLowerColor", "\u0644\u0648\u0646 \u0627\u0644\u062a\u062f\u0631\u0651\u064f\u062c \u0627\u0644\u0633\u0651\u064f\u0641\u0644\u064a" }, - { "GradientStart", "\u0628\u062f\u0627\u064a\u0629 \u0627\u0644\u062a\u062f\u0631\u0651\u064f\u062c" }, - { "GradientDistance", "\u062a\u0628\u0627\u0639\u062f \u0627\u0644\u062a\u062f\u0631\u0651\u064f\u062c" }, - { "TextureURL", "\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0646\u0633\u064a\u062c" }, - { "TextureAlpha", "\u0634\u0641\u0627\u0641\u064a\u0651\u064e\u0629 \u0627\u0644\u0646\u0633\u064a\u062c" }, - { "TextureTaintColor", "\u0644\u0648\u0646 \u0635\u0628\u063a\u0629 \u0627\u0644\u0646\u0633\u064a\u062c" }, - { "LineColor", "\u0644\u0648\u0646 \u0627\u0644\u0633\u0651\u064e\u0637\u0631" }, - { "LineBackColor", "\u0644\u0648\u0646 \u0627\u0644\u062e\u0644\u0641\u064a\u0651\u064e\u0629" }, - { "LineWidth", "\u0639\u0631\u0636 \u0627\u0644\u0633\u0637\u0631" }, - { "LineDistance", "\u062a\u0628\u0627\u0639\u062f \u0627\u0644\u0633\u0637\u0631" }, - { "FlatColor", "\u0644\u0648\u0646 \u0645\u0633\u0637\u0651\u064e\u062d" } - }; - - /** - * Get Contents - * @return contents - * @uml.property name="contents" - */ - public Object[][] getContents() - { - return contents; - } -} // Res_ar_TN - diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_bg.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_bg.java deleted file mode 100644 index 016867804b..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_bg.java +++ /dev/null @@ -1,131 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Plamen Niikolov - * @version $Id: PlafRes_bg.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_bg extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "\u0422\u0438\u043f \u043d\u0430 \u0446\u0432\u0435\u0442\u0430 \u043d\u0430 \u0444\u043e\u043d\u0430" }, - { "BackColType_Flat", "\u0420\u0430\u0432\u0435\u043d(\u041f\u043b\u044a\u0442\u0435\u043d)" }, - { "BackColType_Gradient", "\u041f\u0440\u0435\u043b\u0438\u0432\u0430\u0449" }, - { "BackColType_Lines", "\u041b\u0438\u043d\u0438\u0438" }, - { "BackColType_Texture", "\u041a\u043e\u043d\u0441\u0438\u0441\u0442\u0435\u043d\u0446\u0438\u044f" }, - // - { "LookAndFeelEditor", "\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043d\u0430 \u0432\u0438\u0434 \u043f\u043e\u0442\u0440\u0435\u0431.\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441" }, - { "LookAndFeel", "\u0412\u0438\u0434 \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431.\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441" }, - { "Theme", "\u0422\u0435\u043c\u0430" }, - { "EditAdempiereTheme", "\u0420\u0435\u0434\u0430\u043a\u0446\u0438\u044f \u043d\u0430 \u0442\u0435\u043c\u0430" }, - { "SetDefault", "\u041f\u043e\u0434\u0440\u0430\u0437\u0431" }, - { "SetDefaultColor", "\u0426\u0432\u044f\u0442 \u043d\u0430 \u0444\u043e\u043d\u0430" }, - { "ColorBlind", "\u0414\u043e\u043f\u044a\u043b\u0432\u0430\u0449 \u0446\u0432\u044f\u0442" }, - { "Example", "\u041f\u0440\u0438\u043c\u0435\u0440" }, - { "Reset", "\u041d\u0430\u0447\u0430\u043b\u043d\u043e \u0441\u044a\u0441\u0442\u043e\u044f\u043d\u0438\u0435" }, - { "OK", "\u0414\u0430" }, - { "Cancel", "\u041e\u0442\u043a\u0430\u0437" }, - // - { "AdempiereThemeEditor", "\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043d\u0430 \u0442\u0435\u043c\u0438" }, - { "MetalColors", "\u041c\u0435\u0442\u0430\u043b\u043d\u0438 \u0446\u0432\u0435\u0442\u043e\u0432\u0435" }, - { "AdempiereColors", "\u0426\u0432\u0435\u0442\u043e\u0432\u0435" }, - { "AdempiereFonts", "\u0428\u0440\u0438\u0444\u0442\u043e\u0432\u0435" }, - { "Primary1Info", "\u0421\u044f\u043d\u043a\u0430, \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b" }, - { "Primary1", "\u041e\u0441\u043d\u043e\u0432\u0435\u043d 1" }, - { "Primary2Info", "\u0424\u043e\u043a\u0443\u0441 \u043b\u0438\u043d\u0438\u044f, \u0421\u0435\u043b\u0435\u043a\u0442\u0438\u0440\u0430\u043d\u043e \u043c\u0435\u043d\u044e" }, - { "Primary2", "\u041e\u0441\u043d\u043e\u0432\u0435\u043d 2" }, - { "Primary3Info", "\u0421\u0435\u043b\u0435\u043a\u0442\u0438\u0440\u0430\u043d \u0440\u0435\u0434 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u0421\u0435\u043b\u0435\u043a\u0442\u0438\u0440\u0430\u043d \u0442\u0435\u043a\u0441\u0442,\u0424\u043e\u043d \u043d\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u0430 \u043f\u043e\u043c\u043e\u0449" }, - { "Primary3", "\u041e\u0441\u043d\u043e\u0432\u0435\u043d 3" }, - { "Secondary1Info", "\u041b\u0438\u043d\u0438\u044f \u043d\u0430 \u0440\u0430\u043c\u043a\u0430\u0442\u0430" }, - { "Secondary1", "\u0421\u043f\u043e\u043c\u0430\u0433\u0430\u0442\u0435\u043b\u0435\u043d 1" }, - { "Secondary2Info", "\u041d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u0438 \u043f\u0430\u043d\u0435\u043b\u0438, \u041d\u0430\u0442\u0438\u0441\u043d\u0430\u0442\u0438 \u043f\u043e\u043b\u0435\u0442\u0430, \u041d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u0438 \u0440\u0430\u043c\u043a\u0438 \u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0435" }, - { "Secondary2", "\u0421\u043f\u043e\u043c\u0430\u0433\u0430\u0442\u0435\u043b\u0435\u043d 2" }, - { "Secondary3Info", "\u0424\u043e\u043d" }, - { "Secondary3", "\u0421\u043f\u043e\u043c\u0430\u0433\u0430\u0442\u0435\u043b\u0435\u043d 3" }, - // - { "ControlFontInfo", "\u041a\u043e\u043d\u0442\u0440\u043e\u043b \u043d\u0430 \u0448\u0440\u0438\u0444\u0442\u043e\u0432\u0435\u0442\u0435" }, - { "ControlFont", "\u0428\u0440\u0438\u0444\u0442 \u043d\u0430 \u0435\u0442\u0438\u043a\u0435\u0442\u0438\u0442\u0435" }, - { "SystemFontInfo", "\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u0430 \u043f\u043e\u043c\u043e\u0449, \u0434\u044a\u0440\u0432\u043e\u0432\u0438\u0434\u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430" }, - { "SystemFont", "\u0421\u0438\u0441\u0442\u0435\u043c\u0435\u043d \u0448\u0440\u0438\u0444\u0442" }, - { "UserFontInfo", "\u0414\u0430\u043d\u043d\u0438 \u0432\u044a\u0432\u0435\u0434\u0435\u043d\u0438 \u043e\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044f" }, - { "UserFont", "\u0428\u0440\u0438\u0444\u0442 \u043d\u0430 \u043f\u043e\u043b\u0435" }, -// { "SmallFontInfo", "Reports" }, - { "SmallFont", "\u041c\u0430\u043b\u044a\u043a \u0448\u0440\u0438\u0444\u0442" }, - { "WindowTitleFont", "\u0428\u0440\u0438\u0444\u0442 \u043d\u0430 \u0437\u0430\u0433\u043b\u0430\u0432\u0438\u0435\u0442\u043e" }, - { "MenuFont", "\u0428\u0440\u0438\u0444\u0442 \u043d\u0430 \u043c\u0435\u043d\u044e\u0442\u043e" }, - // - { "MandatoryInfo", "\u0424\u043e\u043d \u043d\u0430 \u0437\u0430\u0434\u044a\u043b\u0436\u0438\u0442\u0435\u043b\u043d\u043e\u0442\u043e \u043f\u043e\u043b\u0435" }, - { "Mandatory", "\u0417\u0430\u0434\u044a\u043b\u0436\u0438\u0442\u0435\u043b\u0435\u043d" }, - { "ErrorInfo", "\u0424\u043e\u043d \u043d\u0430 \u043f\u043e\u043b\u0435 \u0437\u0430 \u0433\u0440\u0435\u0448\u043a\u0430" }, - { "Error", "\u0413\u0440\u0435\u0448\u043a\u0430" }, - { "InfoInfo", "\u0424\u043e\u043d \u043d\u0430 \u043f\u043e\u043b\u0435\u0442\u043e \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f" }, - { "Info", "\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f" }, - { "WhiteInfo", "\u041b\u0438\u043d\u0438\u0438" }, - { "White", "\u0411\u044f\u043b" }, - { "BlackInfo", "\u041b\u0438\u043d\u0438\u0438, \u0442\u0435\u043a\u0441\u0442" }, - { "Black", "\u0427\u0435\u0440\u0435\u043d" }, - { "InactiveInfo", "\u0424\u043e\u043d \u043d\u0430 \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043b\u0435" }, - { "Inactive", "\u041d\u0435\u0430\u043a\u0442\u0438\u0432\u0435\u043d" }, - { "TextOKInfo", "\u0426\u0432\u044f\u0442 \u043d\u0430 \u0448\u0440\u0438\u0444\u0442\u0430 \u043f\u0440\u0438 \u041e\u041a" }, - { "TextOK", "\u0412\u0430\u043b\u0438\u0434\u0435\u043d \u0442\u0435\u043a\u0441\u0442" }, - { "TextIssueInfo", "\u0426\u0432\u044f\u0442 \u043d \u0430\u0448\u0440\u0438\u0444\u0442\u0430 \u043f\u0440\u0438 \u0433\u0440\u0435\u0448\u043a\u0430" }, - { "TextIssue", "\u0413\u0440\u0435\u0448\u0435\u043d \u0442\u0435\u043a\u0441\u0442" }, - // - { "FontChooser", "\u0418\u0437\u0431\u043e\u0440 \u043d\u0430 \u0448\u0440\u0438\u0444\u0442" }, - { "Fonts", "\u0428\u0440\u0438\u0444\u0442\u043e\u0432\u0435" }, - { "Plain", "\u041e\u0431\u0438\u043a\u043d\u043e\u0432\u0435\u043d" }, - { "Italic", "\u041d\u0430\u043a\u043b\u043e\u043d\u0435\u043d" }, - { "Bold", "\u0423\u0434\u0435\u0431\u0435\u043b\u0435\u043d" }, - { "BoldItalic", "\u0423\u0434\u0435\u0431\u0435\u043b\u0435\u043d \u0438 \u043d\u0430\u043a\u043b\u043e\u043d\u0435\u043d" }, - { "Name", "\u0418\u043c\u0435" }, - { "Size", "\u0420\u0430\u0437\u043c\u0435\u0440" }, - { "Style", "\u0421\u0442\u0438\u043b" }, - { "TestString", "\u0422\u043e\u0432\u0430 \u0435 \u0441\u0430\u043c\u043e \u0442\u0435\u0441\u0442! \u0411\u044a\u0440\u0437\u0430\u0442\u0430 \u043a\u0430\u0444\u044f\u0432\u0430 \u043b\u0438\u0441\u0438\u0446\u0430 \u043f\u0440\u0430\u0432\u0438 \u043d\u0435\u0449\u043e. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "\u0428\u0440\u0438\u0444\u0442" }, - // - { "AdempiereColorEditor", "\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043d\u0430 \u0446\u0432\u0435\u0442\u043e\u0432\u0435" }, - { "AdempiereType", "\u0422\u0438\u043f \u043d\u0430 \u0446\u0432\u0435\u0442\u043e\u0432\u0435\u0442\u0435" }, - { "GradientUpperColor", "\u041f\u0440\u0435\u043b\u0438\u0432\u0430\u043d\u0435 \u0433\u043e\u0440\u0435\u043d \u0446\u0432\u044f\u0442" }, - { "GradientLowerColor", "\u041f\u0440\u0435\u043b\u0438\u0432\u0430\u043d\u0435 \u0434\u043e\u043b\u0435\u043d \u0446\u0432\u044f\u0442" }, - { "GradientStart", "\u041d\u0430\u0447\u0430\u043b\u043e \u043d\u0430 \u043f\u0440\u0435\u043b\u0438\u0432\u043a\u0430" }, - { "GradientDistance", "\u0414\u044a\u043b\u0436\u0438\u043d\u0430 \u043d\u0430 \u043f\u0440\u0435\u043b\u0438\u0432\u043a\u0430" }, - { "TextureURL", "\u041c\u0435\u0441\u0442\u043e\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u0441\u043d\u0441\u0438\u0441\u0442\u0435\u043d\u0446\u0438\u044f\u0442\u0430" }, - { "TextureAlpha", "\u0422\u0435\u043a\u0441\u0442\u0443\u0440\u0430 \u0410\u043b\u0444\u0430" }, - { "TextureTaintColor", "\u0422\u0435\u043a\u0441\u0442\u0443\u0440\u0430 \u0446\u0432\u044f\u0442 - \u043f\u0435\u0442\u043d\u043e, \u0441\u043b\u0435\u0434\u0430" }, - { "LineColor", "\u0426\u0432\u044f\u0442 \u043d\u0430 \u043b\u0438\u043d\u0438\u044f" }, - { "LineBackColor", "\u0426\u0432\u044f\u0442 \u043d\u0430 \u0444\u043e\u043d\u0430" }, - { "LineWidth", "\u0414\u0435\u0431\u0435\u043b\u0438\u043d\u0430 \u043d\u0430 \u043b\u0438\u043d\u0438\u044f" }, - { "LineDistance", "\u0414\u044a\u043b\u0436\u0438\u043d\u0430 \u043d\u0430 \u043b\u0438\u043d\u0438\u044f" }, - { "FlatColor", "\u0420\u0430\u0432\u0435\u043d(\u041f\u043b\u044a\u0442\u0435\u043d) \u0446\u0432\u044f\u0442" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ca.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ca.java deleted file mode 100644 index 988c0391ca..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ca.java +++ /dev/null @@ -1,134 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Jaume Teixi - * @author Jordi Luna - * @version $Id: PlafRes_ca.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $ - */ -public class PlafRes_ca extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Tipus Color de Fons" }, - { "BackColType_Flat", "Pla" }, - { "BackColType_Gradient", "Pendent" }, - { "BackColType_Lines", "L\u00ednies" }, - { "BackColType_Texture", "Textura" }, - // - { "LookAndFeelEditor", "Editor Look & Feel" }, - { "LookAndFeel", "Look & Feel" }, - { "Theme", "Tema" }, - { "EditAdempiereTheme", "Editar Tema Adempiere" }, - { "SetDefault", "Fons Per Defecte" }, - { "SetDefaultColor", "Color de Fons" }, - { "ColorBlind", "Defici\u00e9ncia de Color" }, - { "Example", "Exemple" }, - { "Reset", "Reiniciar" }, - { "OK", "Acceptar" }, - { "Cancel", "Cancel.lar" }, - // - { "AdempiereThemeEditor", "Editor Tema Adempiere" }, - { "MetalColors", "Colors Met\u00e0l.lics" }, - { "AdempiereColors", "Colors Adempiere" }, - { "AdempiereFonts", "Fonts Adempiere" }, - { "Primary1Info", "Ombra, Separador" }, - { "Primary1", "Primari 1" }, - { "Primary2Info", "L\u00ednia Enfocada, Men\u00fa Seleccionat" }, - { "Primary2", "Primari 2" }, - { "Primary3Info", "Taula Fila Seleccionada, Texte Seleccionat, Indicador de Fons" }, - { "Primary3", "Primari 3" }, - { "Secondary1Info", "L\u00ednies Marc" }, - { "Secondary1", "Secondari 1" }, - { "Secondary2Info", "Pestanyes Inactives, Camps Premuts, Texte + Marc Inactius" }, - { "Secondary2", "Secondari 2" }, - { "Secondary3Info", "Fons" }, - { "Secondary3", "Secondari 3" }, - // - { "ControlFontInfo", "Font de Control" }, - { "ControlFont", "Font d'Etiqueta" }, - { "SystemFontInfo", "Indicador, Arbres Node" }, - { "SystemFont", "Font de Sistema" }, - { "UserFontInfo", "Dades Entrades Per l'Usuari" }, - { "UserFont", "Font de Camp" }, -// { "SmallFontInfo", "Informes" }, - { "SmallFont", "Font Petita" }, - { "WindowTitleFont", "Font de T\u00edtol" }, - { "MenuFont", "Font del Men\u00fa" }, - // - { "MandatoryInfo", "Camp de Fons Obligatori" }, - { "Mandatory", "Obligatori" }, - { "ErrorInfo", "Error al Camp de Fons" }, - { "Error", "Error" }, - { "InfoInfo", "Informaci\u00f3 Camp de Fons" }, - { "Info", "Informaci\u00f3" }, - { "WhiteInfo", "L\u00ednies" }, - { "White", "Blanc" }, - { "BlackInfo", "L\u00ednies, Text" }, - { "Black", "Negre" }, - { "InactiveInfo", "Camp de Fons Inactiu" }, - { "Inactive", "Inactiu" }, - { "TextOKInfo", "Texte Superior OK" }, - { "TextOK", "Texte - OK" }, - { "TextIssueInfo", "Error al Texte Superior" }, - { "TextIssue", "Texte - Error" }, - // - { "FontChooser", "Seleccionador de Font" }, - { "Fonts", "Fonts" }, - { "Plain", "Plana" }, - { "Italic", "It\u00e0lica" }, - { "Bold", "Negreta" }, - { "BoldItalic", "Negreta & It\u00e0lica" }, - { "Name", "Nom" }, - { "Size", "Tamany" }, - { "Style", "Estil" }, - { "TestString", "Aix\u00f2 \u00e9s nom\u00e9s una Prova! La Guineu marr\u00f3 r\u00e0pida est\u00e0 fent quelcom. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "Font" }, - // - { "AdempiereColorEditor", "Editor Color Adempiere" }, - { "AdempiereType", "Tipus Color" }, - { "GradientUpperColor", "Color Superior Degradat" }, - { "GradientLowerColor", "Color Inferior Degradat" }, - { "GradientStart", "Inici Degradat" }, - { "GradientDistance", "Dist\u00e0ncia Degradat" }, - { "TextureURL", "Textura URL" }, - { "TextureAlpha", "Textura Alfa" }, - { "TextureTaintColor", "Textura Color Empanyat" }, - { "LineColor", "Color de L\u00ednia" }, - { "LineBackColor", "Color de Fons" }, - { "LineWidth", "Amplada L\u00ednia" }, - { "LineDistance", "Dist\u00e0ncia L\u00ednia" }, - { "FlatColor", "Color Pl\u00e0" }, - { "UITheme", "Tema Interface d'Usuari" }, - { "Preview", "Pre-visualitzar" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_da.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_da.java deleted file mode 100644 index 02248ba3a6..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_da.java +++ /dev/null @@ -1,131 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Jorg Janke - * @version $Id: PlafRes_da.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $ - */ -public class PlafRes_da extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Baggrund: Farvetype" }, - { "BackColType_Flat", "Fast" }, - { "BackColType_Gradient", "FarveforlĂžb" }, - { "BackColType_Lines", "Linjer" }, - { "BackColType_Texture", "Struktur" }, - // - { "LookAndFeelEditor", "RedigĂ©r & udseende" }, - { "LookAndFeel", "Udseende" }, - { "Theme", "Tema" }, - { "EditAdempiereTheme", "RedigĂ©r Adempiere tema" }, - { "SetDefault", "Baggrund: Standard" }, - { "SetDefaultColor", "Baggrundsfarve" }, - { "ColorBlind", "Farvereduktion" }, - { "Example", "Eksempel" }, - { "Reset", "Gendan" }, - { "OK", "OK" }, - { "Cancel", "AnnullĂ©r" }, - // - { "AdempiereThemeEditor", "Adempiere-tema: RedigĂ©r" }, - { "MetalColors", "Metal-farver" }, - { "AdempiereColors", "Adempiere-farver" }, - { "AdempiereFonts", "Adempiere-skrifttyper" }, - { "Primary1Info", "Skygge, Separator" }, - { "Primary1", "PrimĂŠr 1" }, - { "Primary2Info", "Markeret element, Markeret menu" }, - { "Primary2", "PrimĂŠr 2" }, - { "Primary3Info", "Markeret rĂŠkke i tabel, Markeret tekst, VĂŠrktĂžjstip - baggr." }, - { "Primary3", "Primïżœr 3" }, - { "Secondary1Info", "Rammelinjer" }, - { "Secondary1", "SekundĂŠr 1" }, - { "Secondary2Info", "Ikke-aktive faner, Markerede felter, Ikke-aktiv ramme + tekst" }, - { "Secondary2", "SekundĂŠr 2" }, - { "Secondary3Info", "Baggrund" }, - { "Secondary3", "SekundĂŠr 3" }, - // - { "ControlFontInfo", "Skrifttype: Knapper" }, - { "ControlFont", "Skrifttype: Etiket" }, - { "SystemFontInfo", "VĂŠrktĂžjstip, Strukturknuder" }, - { "SystemFont", "Skrifttype: System" }, - { "UserFontInfo", "Anvend" }, - { "UserFont", "Skrifttype: Felt" }, -// { "SmallFontInfo", "Rapporter" }, - { "SmallFont", "Lille" }, - { "WindowTitleFont", "Skrifttype: Titellinje" }, - { "MenuFont", "Skrifttype: Menu" }, - // - { "MandatoryInfo", "Tvungen feltbaggrund" }, - { "Mandatory", "Tvungen" }, - { "ErrorInfo", "Fejl: Feltbaggrund" }, - { "Error", "Fejl" }, - { "InfoInfo", "Info: Feltbaggrund" }, - { "Info", "Info" }, - { "WhiteInfo", "Linjer" }, - { "White", "Hvid" }, - { "BlackInfo", "Linjer, Tekst" }, - { "Black", "Sort" }, - { "InactiveInfo", "Inaktiv feltbaggrund" }, - { "Inactive", "Inaktiv" }, - { "TextOKInfo", "OK: Tekstforgrund" }, - { "TextOK", "Tekst: OK" }, - { "TextIssueInfo", "Fejl: Tekstforgrund" }, - { "TextIssue", "Tekst: Fejl" }, - // - { "FontChooser", "Skriftype" }, - { "Fonts", "Skrifttyper" }, - { "Plain", "Normal" }, - { "Italic", "Kursiv" }, - { "Bold", "Fed" }, - { "BoldItalic", "Fed & kursiv" }, - { "Name", "Navn" }, - { "Size", "StĂžrrelse" }, - { "Style", "Type" }, - { "TestString", "Dette er en prĂžve! 12.3456,78 BogstavLEn = l1 BogstavONul = O0" }, - { "FontString", "Skrifttype" }, - // - { "AdempiereColorEditor", "Adempiere-farveeditor" }, - { "AdempiereType", "Farvetype" }, - { "GradientUpperColor", "FarveforlĂžb: Farve 1" }, - { "GradientLowerColor", "FarveforlĂžb: Farve 2" }, - { "GradientStart", "FarveforlĂžb: Start" }, - { "GradientDistance", "FarveforlĂžb: Afstand" }, - { "TextureURL", "Struktur: URL" }, - { "TextureAlpha", "Struktur: Alpha" }, - { "TextureTaintColor", "Struktur: Pletvis" }, - { "LineColor", "Linjefarve" }, - { "LineBackColor", "Baggrundsfarve" }, - { "LineWidth", "Linjebredde" }, - { "LineDistance", "Linjeafstand" }, - { "FlatColor", "Fast farve" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_de.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_de.java deleted file mode 100644 index 61196f2723..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_de.java +++ /dev/null @@ -1,130 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel (German) - * - * @author Jorg Janke - * @version $Id: PlafRes_de.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $ - */ -public class PlafRes_de extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Hintergrund Farbtyp" }, - { "BackColType_Flat", "Flach" }, - { "BackColType_Gradient", "Gradient" }, - { "BackColType_Lines", "Linie" }, - { "BackColType_Texture", "Textur" }, - // - { "LookAndFeelEditor", "BenutzeroberflĂ€chen Editor" }, - { "LookAndFeel", "OberflĂ€che" }, - { "Theme", "Thema" }, - { "EditAdempiereTheme", "Adempiere Thema bearbeiten" }, - { "SetDefault", "Standard Hintergrund" }, - { "SetDefaultColor", "Hintergrund Farbe" }, - { "ColorBlind", "Farbblindheit" }, - { "Example", "Beispiel" }, - { "Reset", "ZurĂŒcksetzen" }, - { "OK", "Ja" }, - { "Cancel", "Abbruch" }, - // - { "AdempiereThemeEditor", "Adempiere Thema Editor" }, - { "MetalColors", "Metal Farben" }, - { "AdempiereColors", "Adempiere Farben" }, - { "AdempiereFonts", "Adempiere Schriften" }, - { "Primary1Info", "Schatten, Separator" }, - { "Primary1", "PrimĂ€r 1" }, - { "Primary2Info", "Fokuslinien, Aktives Menïżœ" }, - { "Primary2", "PrimĂ€r 2" }, - { "Primary3Info", "Tabelle Selected Row, Selected Text, Tool Tip Hintergrund" }, - { "Primary3", "PrimĂ€r 3" }, - { "Secondary1Info", "Rahmen Lines" }, - { "Secondary1", "SekundĂ€r 1" }, - { "Secondary2Info", "Inaktive Tabs, Pressed Felder, Inaktive Rahmen + Text" }, - { "Secondary2", "SekundĂ€r 2" }, - { "Secondary3Info", "Hintergrund" }, - { "Secundary3", "SekundĂ€r 3" }, - // - { "ControlFontInfo", "Labels" }, - { "ControlFont", "Standard Schrift" }, - { "SystemFontInfo", "Tool Tip" }, - { "SystemFont", "System Schrift" }, - { "UserFontInfo", "Entered Data" }, - { "UserFont", "Nutzer Schrift" }, - { "SmallFont", "Kleine Schrift" }, - { "WindowTitleFont", "Titel Schrift" }, - { "MenuFont", "MenĂŒ Schrift" }, - // - { "MandatoryInfo", "Erforderliches Feld Hintergrund" }, - { "Mandatory", "Erforderlich" }, - { "ErrorInfo", "Fehler Feld Hintergrund" }, - { "Error", "Fehler" }, - { "InfoInfo", "Info Feld Hintergrund" }, - { "Info", "Info" }, - { "WhiteInfo", "Linien" }, - { "White", "Weiß" }, - { "BlackInfo", "Linien, Text" }, - { "Black", "Schwarz" }, - { "InactiveInfo", "Inaktiv Feld Hintergrund" }, - { "Inactive", "Inaktiv" }, - { "TextOKInfo", "OK Text Fordergrund" }, - { "TextOK", "Text - OK" }, - { "TextIssueInfo", "Fehler Text Fordergrund" }, - { "TextIssue", "Text - Fehler" }, - // - { "FontChooser", "Schrift Auswahl" }, - { "Fonts", "Schriften" }, - { "Plain", "Normal" }, - { "Italic", "Italic" }, - { "Bold", "Fett" }, - { "BoldItalic", "Fett & Italic" }, - { "Name", "Name" }, - { "Size", "GrĂ¶ĂŸe" }, - { "Style", "Stil" }, - { "TestString", "Dies ist nur ein Test! The quick brown Fox is doing something. 12,3456.78 BuchstabeLEins = l1 BuchstabeONull = O0" }, - { "FontString", "Schrift" }, - // - { "AdempiereColorEditor", "Adempiere Farben Auswahl" }, - { "AdempiereType", "Farbtyp" }, - { "GradientUpperColor", "Gradient obere Farbe" }, - { "GradientLowerColor", "Gradient untere Farbe" }, - { "GradientStart", "Gradient Start" }, - { "GradientDistance", "Gradient Distanz" }, - { "TextureURL", "Textur URL" }, - { "TextureAlpha", "Textur Alpha" }, - { "TextureTaintColor", "Textur Tönung Farbe" }, - { "LineColor", "Linie Farbe" }, - { "LineBackColor", "Hintergrund Farbe" }, - { "LineWidth", "Linie Breite" }, - { "LineDistance", "Linie Distanz" }, - { "FlatColor", "Flache Farbe" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res_de diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_el.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_el.java deleted file mode 100644 index 8b56bcbfdb..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_el.java +++ /dev/null @@ -1,133 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Kyriakos Ioannidis - kioa@openway.gr - * @version $Id: PlafRes.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_el extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Background Color Type" }, - { "BackColType_Flat", "Flat" }, - { "BackColType_Gradient", "Gradient" }, - { "BackColType_Lines", "Lines" }, - { "BackColType_Texture", "Texture" }, - // - { "LookAndFeelEditor", "Look & Feel Editor" }, - { "LookAndFeel", "Look & Feel" }, - { "Theme", "Theme" }, - { "EditAdempiereTheme", "Edit Adempiere Theme" }, - { "SetDefault", "Default Background" }, - { "SetDefaultColor", "Background Color" }, - { "ColorBlind", "Color Deficiency" }, - { "Example", "Example" }, - { "Reset", "Reset" }, - { "OK", "OK" }, - { "Cancel", "Cancel" }, - // - { "AdempiereThemeEditor", "Adempiere Theme Editor" }, - { "MetalColors", "Metal Colors" }, - { "AdempiereColors", "Adempiere Colors" }, - { "AdempiereFonts", "Adempiere Fonts" }, - { "Primary1Info", "Shadow, Separator" }, - { "Primary1", "Primary 1" }, - { "Primary2Info", "Focus Line, Selected Menu" }, - { "Primary2", "Primary 2" }, - { "Primary3Info", "Table Selected Row, Selected Text, ToolTip Background" }, - { "Primary3", "Primary 3" }, - { "Secondary1Info", "Border Lines" }, - { "Secondary1", "Secondary 1" }, - { "Secondary2Info", "Inactive Tabs, Pressed Fields, Inactive Border + Text" }, - { "Secondary2", "Secondary 2" }, - { "Secondary3Info", "Background" }, - { "Secondary3", "Secondary 3" }, - // - { "ControlFontInfo", "Control Font" }, - { "ControlFont", "Label Font" }, - { "SystemFontInfo", "Tool Tip, Tree nodes" }, - { "SystemFont", "System Font" }, - { "UserFontInfo", "User Entered Data" }, - { "UserFont", "Field Font" }, -// { "SmallFontInfo", "Reports" }, - { "SmallFont", "Small Font" }, - { "WindowTitleFont", "Title Font" }, - { "MenuFont", "Menu Font" }, - // - { "MandatoryInfo", "Mandatory Field Background" }, - { "Mandatory", "Mandatory" }, - { "ErrorInfo", "Error Field Background" }, - { "Error", "Error" }, - { "InfoInfo", "Info Field Background" }, - { "Info", "Info" }, - { "WhiteInfo", "Lines" }, - { "White", "White" }, - { "BlackInfo", "Lines, Text" }, - { "Black", "Black" }, - { "InactiveInfo", "Inactive Field Background" }, - { "Inactive", "Inactive" }, - { "TextOKInfo", "OK Text Foreground" }, - { "TextOK", "Text - OK" }, - { "TextIssueInfo", "Error Text Foreground" }, - { "TextIssue", "Text - Error" }, - // - { "FontChooser", "Font Chooser" }, - { "Fonts", "Fonts" }, - { "Plain", "Plain" }, - { "Italic", "Italic" }, - { "Bold", "Bold" }, - { "BoldItalic", "Bold & Italic" }, - { "Name", "Name" }, - { "Size", "Size" }, - { "Style", "Style" }, - { "TestString", "This is just a Test! The quick brown Fox is doing something. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "Font" }, - // - { "AdempiereColorEditor", "Adempiere Color Editor" }, - { "AdempiereType", "Color Type" }, - { "GradientUpperColor", "Gradient Upper Color" }, - { "GradientLowerColor", "Gradient Lower Color" }, - { "GradientStart", "Gradient Start" }, - { "GradientDistance", "Gradient Distance" }, - { "TextureURL", "Texture URL" }, - { "TextureAlpha", "Texture Alpha" }, - { "TextureTaintColor", "Texture Taint Color" }, - { "LineColor", "Line Color" }, - { "LineBackColor", "Background Color" }, - { "LineWidth", "Line Width" }, - { "LineDistance", "Line Distance" }, - { "FlatColor", "Flat Color" }, - { "UITheme", "User Interface Theme" }, - { "Preview", "Preview" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_es.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_es.java deleted file mode 100644 index 06fb669c1e..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_es.java +++ /dev/null @@ -1,133 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Jordi Luna - * @version $Id: PlafRes_es.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $ - */ -public class PlafRes_es extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Tipo Color de Fondo" }, - { "BackColType_Flat", "Plano" }, - { "BackColType_Gradient", "Pendiente" }, - { "BackColType_Lines", "L\u00edneas" }, - { "BackColType_Texture", "Textura" }, - // - { "LookAndFeelEditor", "Editor Look & Feel" }, - { "LookAndFeel", "Look & Feel" }, - { "Theme", "Tema" }, - { "EditAdempiereTheme", "Editar Tema Adempiere" }, - { "SetDefault", "Fondo Por Defecto" }, - { "SetDefaultColor", "Color de Fondo" }, - { "ColorBlind", "Defici\u00e9ncia de Color" }, - { "Example", "Ejemplo" }, - { "Reset", "Reiniciar" }, - { "OK", "Aceptar" }, - { "Cancel", "Cancelar" }, - // - { "AdempiereThemeEditor", "Editor Tema Adempiere" }, - { "MetalColors", "Colores Met\u00e1licos" }, - { "AdempiereColors", "Colores Adempiere" }, - { "AdempiereFonts", "Fuentes Adempiere" }, - { "Primary1Info", "Sombra, Separador" }, - { "Primary1", "Primario 1" }, - { "Primary2Info", "L\u00ednea Enfocada, Men\u00fa Seleccionado" }, - { "Primary2", "Primario 2" }, - { "Primary3Info", "Fila de Tabla Seleccionada, Texto Seleccionado, Indicador de Fondo" }, - { "Primary3", "Primario 3" }, - { "Secondary1Info", "L\u00edneas Marco" }, - { "Secondary1", "Secundario 1" }, - { "Secondary2Info", "Pesta\u00f1as Inactivas, Campos Pulsados, Texto + Marco Inactivos" }, - { "Secondary2", "Secundario 2" }, - { "Secondary3Info", "Fondo" }, - { "Secondary3", "Secundario 3" }, - // - { "ControlFontInfo", "Fuente de Control" }, - { "ControlFont", "Fuente de Etiqueta" }, - { "SystemFontInfo", "Indicador, \u00c1rbol Nodo" }, - { "SystemFont", "Fuente del Sistema" }, - { "UserFontInfo", "Datos Entrados Por el Usuario" }, - { "UserFont", "Fuente de Campo" }, -// { "SmallFontInfo", "Informes" }, - { "SmallFont", "Fuente Peque\u00f1a" }, - { "WindowTitleFont", "Fuente de T\u00edtulo" }, - { "MenuFont", "Fuente del Men\u00fa" }, - // - { "MandatoryInfo", "Campo de fondo Obligatorio" }, - { "Mandatory", "Obligatorio" }, - { "ErrorInfo", "Error en el Campo de Fondo" }, - { "Error", "Error" }, - { "InfoInfo", "Informaci\u00f3n Campo de Fondo" }, - { "Info", "Informaci\u00f3n" }, - { "WhiteInfo", "L\u00edneas" }, - { "White", "Blanco" }, - { "BlackInfo", "L\u00edneas, Texto" }, - { "Black", "Negro" }, - { "InactiveInfo", "Campo de Fondo Inactivo" }, - { "Inactive", "Inactivo" }, - { "TextOKInfo", "Texto Superior OK" }, - { "TextOK", "Texto - OK" }, - { "TextIssueInfo", "Error en el Texto Superior" }, - { "TextIssue", "Texto - Error" }, - // - { "FontChooser", "Seleccionador de Fuente" }, - { "Fonts", "Fuentes" }, - { "Plain", "Plana" }, - { "Italic", "It\u00e1lica" }, - { "Bold", "Negrita" }, - { "BoldItalic", "Negrita & It\u00e1lica" }, - { "Name", "Nombre" }, - { "Size", "Tama\u00f1o" }, - { "Style", "Estilo" }, - { "TestString", "Esto es solo una prueba! El r\u00e1pido zorro marr\u00f3n est\u00e1 haciendo alguna cosa. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "Fuente" }, - // - { "AdempiereColorEditor", "Editor Color Adempiere" }, - { "AdempiereType", "Tipo Color" }, - { "GradientUpperColor", "Color Superior Degradado" }, - { "GradientLowerColor", "Color Inferior Degradado" }, - { "GradientStart", "Inicio Degradado" }, - { "GradientDistance", "Distancia Degradado" }, - { "TextureURL", "Textura URL" }, - { "TextureAlpha", "Textura Alfa" }, - { "TextureTaintColor", "Textura Color Empa\u00f1ado" }, - { "LineColor", "Color de L\u00ednea" }, - { "LineBackColor", "Color de Fondo" }, - { "LineWidth", "Anchura L\u00ednea" }, - { "LineDistance", "Distancia L\u00ednea" }, - { "FlatColor", "Color Plano" }, - { "UITheme", "Tema Interface de Usuario" }, - { "Preview", "Pre-visualizar" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_fa.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_fa.java deleted file mode 100644 index c0b7183d7c..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_fa.java +++ /dev/null @@ -1,131 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Jorg Janke - * @version $Id: PlafRes_fa.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_fa extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "\u0646\u0648\u0639 \u0631\u0646\u06af \u0632\u0645\u064a\u0646\u0647" }, - { "BackColType_Flat", "\u0645\u0633\u0637\u062d" }, - { "BackColType_Gradient", "\u0634\u064a\u0628 \u062f\u0627\u0631" }, - { "BackColType_Lines", "\u062e\u0637\u0648\u0637" }, - { "BackColType_Texture", "\u0634\u0627\u0644\u0648\u062f\u0647" }, - // - { "LookAndFeelEditor", "\u0648\u064a\u0631\u0627\u0633\u062a\u0627\u0631 \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 \u0638\u0627\u0647\u0631 \u0648 \u0639\u0645\u0644" }, - { "LookAndFeel", "\u0638\u0627\u0647\u0631 \u0648 \u0639\u0645\u0644" }, - { "Theme", "\u062a\u0645" }, - { "EditAdempiereTheme", "\u0648\u064a\u0631\u0627\u064a\u0634 \u062a\u0645 \u06a9\u0627\u0645\u067e\u064a\u0631\u0647" }, - { "SetDefault", "\u0632\u0645\u064a\u0646\u0647 \u067e\u064a\u0634 \u0641\u0631\u0636" }, - { "SetDefaultColor", "\u0631\u0646\u06af \u0632\u0645\u064a\u0646\u0647" }, - { "ColorBlind", "\u0646\u0642\u0635 \u0631\u0646\u06af" }, - { "Example", "\u0645\u062b\u0627\u0644" }, - { "Reset", "\u0628\u0627\u0632\u0646\u0634\u0627\u0646\u062f\u0646" }, - { "OK", "\u062a\u0635\u0648\u064a\u0628" }, - { "Cancel", "\u0644\u063a\u0648" }, - // - { "AdempiereThemeEditor", "\u0648\u064a\u0631\u0627\u064a\u0633\u062a\u0627\u0631 \u062a\u0645 \u06a9\u0627\u0645\u067e\u064a\u0631\u0647" }, - { "MetalColors", "\u0631\u0646\u06af\u0647\u0627\u06cc \u0645\u062a\u0627\u0644" }, - { "AdempiereColors", "\u0631\u0646\u06af\u0647\u0627\u06cc \u06a9\u0627\u0645\u067e\u064a\u0631\u0647" }, - { "AdempiereFonts", "\u0641\u0648\u0646\u062a \u06a9\u0627\u0645\u067e\u064a\u0631\u0647" }, - { "Primary1Info", "\u0633\u0627\u064a\u0647\u060c \u062c\u062f\u0627\u06a9\u0646\u0646\u062f\u0647" }, - { "Primary1", "\u0627\u0648\u0644\u064a\u0647 1" }, - { "Primary2Info", "\u062e\u0637 \u0645\u0648\u0631\u062f \u062a\u0627\u06a9\u064a\u062f\u060c \u0645\u0646\u0648\u06cc \u0627\u0646\u062a\u062e\u0627\u0628 \u0634\u062f\u0647" }, - { "Primary2", "\u0627\u0648\u0644\u064a\u0647 2" }, - { "Primary3Info", "\u0631\u062f\u064a\u0641 \u062c\u062f\u0648\u0644 \u0627\u0646\u062a\u062e\u0627\u0628 \u0634\u062f\u0647\u060c \u0645\u062a\u0646 \u0627\u0646\u062a\u062e\u0627\u0628 \u0634\u062f\u0647\u060c \u0632\u0645\u064a\u0646\u0647 \u062a\u0648\u0644\u062a\u064a\u067e" }, - { "Primary3", "\u0627\u0648\u0644\u064a\u0647 3" }, - { "Secondary1Info", "\u062e\u0637\u0648\u0637 \u0645\u0631\u0632\u06cc" }, - { "Secondary1", "\u062b\u0627\u0646\u0648\u064a\u0647 1" }, - { "Secondary2Info", "\u062c\u062f\u0627\u0648\u0644 \u0639\u064a\u0631\u0641\u0639\u0627\u0644\u060c \u0641\u064a\u0644\u062f\u0647\u0627\u06cc \u0641\u0634\u0627\u0631 \u062f\u0627\u062f\u0647 \u0634\u062f\u0647\u060c \u0645\u0631\u0632 \u063a\u064a\u0631\u0641\u0639\u0627\u0644 \u0648 \u0645\u062a\u0646" }, - { "Secondary2", "\u062b\u0627\u0646\u0648\u064a\u0647 2" }, - { "Secondary3Info", "\u0632\u0645\u064a\u0646\u0647" }, - { "Secondary3", "\u062b\u0627\u0646\u0648\u064a\u0647 3" }, - // - { "ControlFontInfo", "\u0641\u0648\u0646\u062a \u06a9\u0646\u062a\u0631\u0644" }, - { "ControlFont", "\u0641\u0648\u0646\u062a \u0628\u0631\u0686\u0633\u0628" }, - { "SystemFontInfo", "\u062a\u0648\u0644\u062a\u064a\u067e\u060c \u0646\u062f\u0647\u0627\u06cc \u062f\u0631\u062e\u062a" }, - { "SystemFont", "\u0641\u0648\u0646\u062a \u0633\u064a\u0633\u062a\u0645" }, - { "UserFontInfo", "\u062f\u0627\u062f\u0647 \u0647\u0627\u06cc \u0648\u0627\u0631\u062f \u0634\u062f\u0647 \u0628\u0648\u0633\u064a\u0644\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u0646\u062f\u0647" }, - { "UserFont", "\u0641\u0648\u0646\u062a \u0641\u064a\u0644\u062f" }, -// { "SmallFontInfo", "\u06af\u0632\u0627\u0631\u0634\u0627\u062a" }, - { "SmallFont", "\u0641\u0648\u0646\u062a \u06a9\u0648\u0686\u06a9" }, - { "WindowTitleFont", "\u0641\u0648\u0646\u062a \u0639\u0646\u0648\u0627\u0646" }, - { "MenuFont", "\u0641\u0648\u0646\u062a \u0645\u0646\u0648" }, - // - { "MandatoryInfo", "\u0632\u0645\u064a\u0646\u0647 \u0641\u064a\u0644\u062f \u0627\u0644\u0632\u0627\u0645\u06cc" }, - { "Mandatory", "\u0627\u0644\u0632\u0627\u0645\u06cc" }, - { "ErrorInfo", "\u0632\u0645\u064a\u0646\u0647 \u0641\u064a\u0644\u062f \u062e\u0637\u0627" }, - { "Error", "\u062e\u0637\u0627" }, - { "InfoInfo", "\u0632\u0645\u064a\u0646\u0647 \u0641\u064a\u0644\u062f \u0627\u0637\u0644\u0627\u0639\u0627\u062a\u06cc" }, - { "Info", "\u0627\u0637\u0644\u0627\u0639\u0627\u062a\u06cc" }, - { "WhiteInfo", "\u062e\u0637\u0648\u0637" }, - { "White", "\u0633\u0641\u064a\u062f" }, - { "BlackInfo", "\u062e\u0637\u0648\u0637\u060c \u0645\u062a\u0646" }, - { "Black", "\u0633\u064a\u0627\u0647" }, - { "InactiveInfo", "\u0632\u0645\u064a\u0646\u0647 \u0641\u064a\u0644\u062f \u063a\u064a\u0631\u0641\u0639\u0627\u0644" }, - { "Inactive", "\u063a\u064a\u0631\u0641\u0639\u0627\u0644" }, - { "TextOKInfo", "\u0631\u0646\u06af \u0645\u062a\u0646 \u062a\u0635\u0648\u064a\u0628" }, - { "TextOK", "\u0645\u062a\u0646 - \u062a\u0635\u0648\u064a\u0628" }, - { "TextIssueInfo", "\u0631\u0646\u06af \u0645\u062a\u0646 \u062e\u0637\u0627" }, - { "TextIssue", "\u0645\u062a\u0646 - \u062e\u0637\u0627" }, - // - { "FontChooser", "\u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u0646\u062f\u0647 \u0641\u0648\u0646\u062a" }, - { "Fonts", "\u0641\u0648\u0646\u062a\u0647\u0627" }, - { "Plain", "\u0633\u0627\u062f\u0647" }, - { "Italic", "\u062d\u0631\u0648\u0641 \u06a9\u062c" }, - { "Bold", "\u0633\u064a\u0627\u0647" }, - { "BoldItalic", "\u0633\u064a\u0627\u0647 \u0648 \u06a9\u062c" }, - { "Name", "\u0646\u0627\u0645" }, - { "Size", "\u0627\u0646\u062f\u0627\u0632\u0647" }, - { "Style", "\u0633\u0628\u06a9" }, - { "TestString", "\u0627\u064a\u0646 \u064a\u06a9 \u062a\u0633\u062a \u0627\u0633\u062a! \u0631\u0648\u0628\u0627\u0647 \u0642\u0647\u0648\u0647 \u0627\u06cc \u062f\u0631 \u062d\u0627\u0644 \u0627\u0646\u062c\u0627\u0645 \u06a9\u0627\u0631\u06cc \u0627\u0633\u062a." }, - { "FontString", "\u0641\u0648\u0646\u062a" }, - // - { "AdempiereColorEditor", "\u0648\u064a\u0631\u0627\u0633\u062a\u0627\u0631 \u0631\u0646\u06af \u06a9\u0627\u0645\u067e\u064a\u0631\u0647" }, - { "AdempiereType", "\u0646\u0648\u0639 \u0631\u0646\u06af" }, - { "GradientUpperColor", "\u0631\u0646\u06af \u0628\u0627\u0644\u0627\u06cc \u0634\u064a\u0628" }, - { "GradientLowerColor", "\u0631\u0646\u06af \u067e\u0627\u064a\u064a\u0646 \u0634\u064a\u0628" }, - { "GradientStart", "\u0634\u0631\u0648\u0639 \u0634\u064a\u0628" }, - { "GradientDistance", "\u0645\u0633\u0627\u0641\u062a \u0634\u064a\u0628" }, - { "TextureURL", "\u064a\u0648 \u0622\u0631 \u0622\u0644 \u0628\u0627\u0641\u062a" }, - { "TextureAlpha", "\u0628\u0627\u0641\u062a \u0622\u0644\u0641\u0627" }, - { "TextureTaintColor", "\u0631\u0646\u06af \u0628\u0627\u0641\u062a \u0644\u06a9\u0647 \u062f\u0627\u0631" }, - { "LineColor", "\u0631\u0646\u06af \u062e\u0637" }, - { "LineBackColor", "\u0631\u0646\u06af \u0632\u0645\u064a\u0646\u0647" }, - { "LineWidth", "\u067e\u0647\u0646\u0627\u06cc \u062e\u0637" }, - { "LineDistance", "\u0641\u0627\u0635\u0644\u0647 \u062e\u0637" }, - { "FlatColor", "\u0631\u0646\u06af \u0645\u0633\u0637\u062d" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_fr.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_fr.java deleted file mode 100644 index 5a48651888..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_fr.java +++ /dev/null @@ -1,124 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel (French) - * - * @author Jean-Luc SCHEIDEGGER - * @version $Id: PlafRes_fr.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $ - */ -public class PlafRes_fr extends ListResourceBundle -{ - /** Translation Content */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Type de Couleur de Fond" }, - { "BackColType_Flat", "Flat" }, - { "BackColType_Gradient", "Gradient" }, - { "BackColType_Lines", "Lignes" }, - { "BackColType_Texture", "Texture" }, - { "LookAndFeelEditor", "Look & Feel Editor" }, - { "LookAndFeel", "Look & Feel" }, - { "Theme", "Th\350me" }, - { "EditAdempiereTheme", "Editer Th\350me Adempiere" }, - { "SetDefault", "Couleur de Fond par D\351faut" }, - { "SetDefaultColor", "Couleur de Fond" }, - { "ColorBlind", "Couleur Deficiency" }, - { "Example", "Exemple" }, - { "Reset", "Remettre" }, - { "OK", "OK" }, - { "Cancel", "Annuler" }, - { "AdempiereThemeEditor", "Editeur de Th\350me Adempiere" }, - { "MetalColors", "Couleurs M\351tal" }, - { "AdempiereColors", "Couleurs Adempiere" }, - { "AdempiereFonts", "Polices Adempiere" }, - { "Primary1Info", "Label Text" }, - { "Primary1", "Primary 1" }, - { "Primary2Info", "Focus Line, Selected CheckBox" }, - { "Primary2", "Primary 2" }, - { "Primary3Info", "Table Selected Row, Selected Text, ToolTip Background" }, - { "Primary3", "Primary 3" }, - { "Secondary1Info", "Border Lines" }, - { "Secondary1", "Secondary 1" }, - { "Secondary2Info", "Inactive Tabs, Pressed Fields, Inactive Border + Text" }, - { "Secondary2", "Secondary 2" }, - { "Secondary3Info", "Background" }, - { "Secondary3", "Secondary 3" }, - { "ControlFontInfo", "Control Font" }, - { "ControlFont", "Label Font" }, - { "SystemFontInfo", "Tool Tip, Tree nodes" }, - { "SystemFont", "System Font" }, - { "UserFontInfo", "User Entered Data" }, - { "UserFont", "Field Font" }, - { "SmallFont", "Small Font" }, - { "WindowTitleFont", "Title Font" }, - { "MenuFont", "Menu Font" }, - { "MandatoryInfo", "Mandatory Field Background" }, - { "Mandatory", "Mandatory" }, - { "ErrorInfo", "Error Field Background" }, - { "Error", "Error" }, - { "InfoInfo", "Info Field Background" }, - { "Info", "Info" }, - { "WhiteInfo", "Lines" }, - { "White", "White" }, - { "BlackInfo", "Lines, Text" }, - { "Black", "Black" }, - { "InactiveInfo", "Inactive Field Background" }, - { "Inactive", "Inactive" }, - { "TextOKInfo", "OK Text Foreground" }, - { "TextOK", "Text - OK" }, - { "TextIssueInfo", "Error Text Foreground" }, - { "TextIssue", "Text - Error" }, - { "FontChooser", "Font Chooser" }, - { "Fonts", "Fonts" }, - { "Plain", "Plain" }, - { "Italic", "Italic" }, - { "Bold", "Bold" }, - { "BoldItalic", "Bold & Italic" }, - { "Name", "Name" }, - { "Size", "Size" }, - { "Style", "Style" }, - { "TestString", "This is just a Test! The quick brown Fox is doing something. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "Font" }, - { "AdempiereColorEditor", "Adempiere Couleur Editor" }, - { "AdempiereType", "Couleur Type" }, - { "GradientUpperColor", "Gradient Upper Couleur" }, - { "GradientLowerColor", "Gradient Lower Couleur" }, - { "GradientStart", "Gradient Start" }, - { "GradientDistance", "Gradient Distance" }, - { "TextureURL", "Texture URL" }, - { "TextureAlpha", "Texture Alpha" }, - { "TextureTaintColor", "Texture Taint Couleur" }, - { "LineColor", "Line Couleur" }, - { "LineBackColor", "Background Couleur" }, - { "LineWidth", "Line Width" }, - { "LineDistance", "Line Distance" }, - { "FlatColor", "Flat Couleur" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } // fetContents -} // PlafRes_fr diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_hr.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_hr.java deleted file mode 100644 index 63744e1124..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_hr.java +++ /dev/null @@ -1,132 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Marko Bubalo - * @version $Id: PlafRes_hr.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_hr extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Tip pozadine" }, - { "BackColType_Flat", "Flat" }, - { "BackColType_Gradient", "Gradient" }, - { "BackColType_Lines", "Liije" }, - { "BackColType_Texture", "Teksture" }, - // - { "LookAndFeelEditor", "Uredivaïżœ izgleda" }, - { "LookAndFeel", "Izgled" }, - { "Theme", "Tema" }, - { "EditAdempiereTheme", "Ureïżœivanje Adempiere teme" }, - { "SetDefault", "Uobiïżœajena pozadina" }, - { "SetDefaultColor", "Boja pozadine" }, - { "ColorBlind", "Color Deficiency" }, - { "Example", "Primjer" }, - { "Reset", "Poniïżœtiti" }, - { "OK", "U redu" }, - { "Cancel", "Otkazati" }, - // - { "AdempiereThemeEditor", "Ureïżœivanje Adempiere teme" }, - { "MetalColors", "Metal Colors" }, - { "AdempiereColors", "Adempiere Colors" }, - { "AdempiereFonts", "Adempiere Fonts" }, - { "Primary1Info", "Shadow, Separator" }, - { "Primary1", "Primary 1" }, - { "Primary2Info", "Focus Line, Selected Menu" }, - { "Primary2", "Primary 2" }, - { "Primary3Info", "Table Selected Row, Selected Text, ToolTip Background" }, - { "Primary3", "Primary 3" }, - { "Secondary1Info", "Border Lines" }, - { "Secondary1", "Secondary 1" }, - { "Secondary2Info", "Inactive Tabs, Pressed Fields, Inactive Border + Text" }, - { "Secondary2", "Secondary 2" }, - { "Secondary3Info", "Background" }, - { "Secondary3", "Secondary 3" }, - // - { "ControlFontInfo", "Control Font" }, - { "ControlFont", "Label Font" }, - { "SystemFontInfo", "Tool Tip, Tree nodes" }, - { "SystemFont", "System Font" }, - { "UserFontInfo", "User Entered Data" }, - { "UserFont", "Field Font" }, -// { "SmallFontInfo", "Reports" }, - { "SmallFont", "Small Font" }, - { "WindowTitleFont", "Title Font" }, - { "MenuFont", "Menu Font" }, - // - { "MandatoryInfo", "Mandatory Field Background" }, - { "Mandatory", "Mandatory" }, - { "ErrorInfo", "Error Field Background" }, - { "Error", "Error" }, - { "InfoInfo", "Info Field Background" }, - { "Info", "Info" }, - { "WhiteInfo", "Lines" }, - { "White", "White" }, - { "BlackInfo", "Lines, Text" }, - { "Black", "Black" }, - { "InactiveInfo", "Inactive Field Background" }, - { "Inactive", "Inactive" }, - { "TextOKInfo", "OK Text Foreground" }, - { "TextOK", "Text - OK" }, - { "TextIssueInfo", "Error Text Foreground" }, - { "TextIssue", "Text - Error" }, - // - { "FontChooser", "Font Chooser" }, - { "Fonts", "Fonts" }, - { "Plain", "Plain" }, - { "Italic", "Italic" }, - { "Bold", "Bold" }, - { "BoldItalic", "Bold & Italic" }, - { "Name", "Name" }, - { "Size", "Size" }, - { "Style", "Style" }, - { "TestString", "This is just a Test! The quick brown Fox is doing something. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "Font" }, - // - { "AdempiereColorEditor", "Adempiere Color Editor" }, - { "AdempiereType", "Color Type" }, - { "GradientUpperColor", "Gradient Upper Color" }, - { "GradientLowerColor", "Gradient Lower Color" }, - { "GradientStart", "Gradient Start" }, - { "GradientDistance", "Gradient Distance" }, - { "TextureURL", "Texture URL" }, - { "TextureAlpha", "Texture Alpha" }, - { "TextureTaintColor", "Texture Taint Color" }, - { "LineColor", "Line Color" }, - { "LineBackColor", "Background Color" }, - { "LineWidth", "Line Width" }, - { "LineDistance", "Line Distance" }, - { "FlatColor", "Flat Color" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res - diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_hu.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_hu.java deleted file mode 100644 index 66524f6d95..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_hu.java +++ /dev/null @@ -1,133 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Jorg Janke - * @version $Id: PlafRes.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_hu extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "HĂĄttĂ©rszĂ­n tĂ­pus" }, - { "BackColType_Flat", "Sima" }, - { "BackColType_Gradient", "Gradiens" }, - { "BackColType_Lines", "Vonalas" }, - { "BackColType_Texture", "TextĂșrĂĄzott" }, - // - { "LookAndFeelEditor", "Look & Feel Editor" }, - { "LookAndFeel", "Look & Feel" }, - { "Theme", "Theme" }, - { "EditAdempiereTheme", "Edit Adempiere Theme" }, - { "SetDefault", "Default Background" }, - { "SetDefaultColor", "Background Color" }, - { "ColorBlind", "Color Deficiency" }, - { "Example", "Example" }, - { "Reset", "Reset" }, - { "OK", "OK" }, - { "Cancel", "Cancel" }, - // - { "AdempiereThemeEditor", "Adempiere Theme Editor" }, - { "MetalColors", "Metal Colors" }, - { "AdempiereColors", "Adempiere Colors" }, - { "AdempiereFonts", "Adempiere Fonts" }, - { "Primary1Info", "Shadow, Separator" }, - { "Primary1", "Primary 1" }, - { "Primary2Info", "Focus Line, Selected Menu" }, - { "Primary2", "Primary 2" }, - { "Primary3Info", "Table Selected Row, Selected Text, ToolTip Background" }, - { "Primary3", "Primary 3" }, - { "Secondary1Info", "Border Lines" }, - { "Secondary1", "Secondary 1" }, - { "Secondary2Info", "Inactive Tabs, Pressed Fields, Inactive Border + Text" }, - { "Secondary2", "Secondary 2" }, - { "Secondary3Info", "Background" }, - { "Secondary3", "Secondary 3" }, - // - { "ControlFontInfo", "Control Font" }, - { "ControlFont", "Label Font" }, - { "SystemFontInfo", "Tool Tip, Tree nodes" }, - { "SystemFont", "System Font" }, - { "UserFontInfo", "User Entered Data" }, - { "UserFont", "Field Font" }, -// { "SmallFontInfo", "Reports" }, - { "SmallFont", "Small Font" }, - { "WindowTitleFont", "Title Font" }, - { "MenuFont", "Menu Font" }, - // - { "MandatoryInfo", "Mandatory Field Background" }, - { "Mandatory", "Mandatory" }, - { "ErrorInfo", "Error Field Background" }, - { "Error", "Error" }, - { "InfoInfo", "Info Field Background" }, - { "Info", "Info" }, - { "WhiteInfo", "Lines" }, - { "White", "White" }, - { "BlackInfo", "Lines, Text" }, - { "Black", "Black" }, - { "InactiveInfo", "Inactive Field Background" }, - { "Inactive", "Inactive" }, - { "TextOKInfo", "OK Text Foreground" }, - { "TextOK", "Text - OK" }, - { "TextIssueInfo", "Error Text Foreground" }, - { "TextIssue", "Text - Error" }, - // - { "FontChooser", "Font Chooser" }, - { "Fonts", "Fonts" }, - { "Plain", "Plain" }, - { "Italic", "Italic" }, - { "Bold", "Bold" }, - { "BoldItalic", "Bold & Italic" }, - { "Name", "Name" }, - { "Size", "Size" }, - { "Style", "Style" }, - { "TestString", "This is just a Test! The quick brown Fox is doing something. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "Font" }, - // - { "AdempiereColorEditor", "Adempiere Color Editor" }, - { "AdempiereType", "Color Type" }, - { "GradientUpperColor", "Gradient Upper Color" }, - { "GradientLowerColor", "Gradient Lower Color" }, - { "GradientStart", "Gradient Start" }, - { "GradientDistance", "Gradient Distance" }, - { "TextureURL", "Texture URL" }, - { "TextureAlpha", "Texture Alpha" }, - { "TextureTaintColor", "Texture Taint Color" }, - { "LineColor", "Line Color" }, - { "LineBackColor", "Background Color" }, - { "LineWidth", "Line Width" }, - { "LineDistance", "Line Distance" }, - { "FlatColor", "Flat Color" }, - { "UITheme", "User Interface Theme" }, - { "Preview", "Preview" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_in.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_in.java deleted file mode 100644 index 8134c78201..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_in.java +++ /dev/null @@ -1,131 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Halim Englen - * @version $Id: PlafRes_in.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_in extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Tipe Warna Latar Belakang" }, - { "BackColType_Flat", "Rata" }, - { "BackColType_Gradient", "Gradien" }, - { "BackColType_Lines", "Garis" }, - { "BackColType_Texture", "Textur" }, - // - { "LookAndFeelEditor", "Editor Look & Feel" }, - { "LookAndFeel", "Look & Feel" }, - { "Theme", "Tema" }, - { "EditAdempiereTheme", "Ubah Tema Adempiere" }, - { "SetDefault", "Latar Belakang Asal" }, - { "SetDefaultColor", "Warna Latar Belakang" }, - { "ColorBlind", "Defisiensi Warna" }, - { "Example", "Contoh" }, - { "Reset", "Reset" }, - { "OK", "OK" }, - { "Cancel", "Batal" }, - // - { "AdempiereThemeEditor", "Adempiere Tema Editor" }, - { "MetalColors", "Warna Metal" }, - { "AdempiereColors", "Warna Adempiere" }, - { "AdempiereFonts", "Adempiere Fonts" }, - { "Primary1Info", "Bayangan, Pemisah" }, - { "Primary1", "Utama 1" }, - { "Primary2Info", "Baris Fokus, Menu yang Dipilih" }, - { "Primary2", "Utama 2" }, - { "Primary3Info", "Table Selected Row, Selected Text, ToolTip Background" }, - { "Primary3", "Utama 3" }, - { "Secondary1Info", "Border Lines" }, - { "Secondary1", "Sekunder 1" }, - { "Secondary2Info", "Inactive Tabs, Pressed Fields, Inactive Border + Text" }, - { "Secondary2", "Sekunder 2" }, - { "Secondary3Info", "Background" }, - { "Secondary3", "Sekunder 3" }, - // - { "ControlFontInfo", "Control Font" }, - { "ControlFont", "Label Font" }, - { "SystemFontInfo", "Tool Tip, Tree nodes" }, - { "SystemFont", "System Font" }, - { "UserFontInfo", "User Entered Data" }, - { "UserFont", "Field Font" }, -// { "SmallFontInfo", "Reports" }, - { "SmallFont", "Small Font" }, - { "WindowTitleFont", "Title Font" }, - { "MenuFont", "Menu Font" }, - // - { "MandatoryInfo", "Mandatory Field Background" }, - { "Mandatory", "Mandatory" }, - { "ErrorInfo", "Error Field Background" }, - { "Error", "Error" }, - { "InfoInfo", "Info Field Background" }, - { "Info", "Info" }, - { "WhiteInfo", "Lines" }, - { "White", "Putih" }, - { "BlackInfo", "Lines, Text" }, - { "Black", "Hitam" }, - { "InactiveInfo", "Inactive Field Background" }, - { "Inactive", "Inactive" }, - { "TextOKInfo", "OK Text Foreground" }, - { "TextOK", "Text - OK" }, - { "TextIssueInfo", "Error Text Foreground" }, - { "TextIssue", "Text - Error" }, - // - { "FontChooser", "Font Chooser" }, - { "Fonts", "Fonts" }, - { "Plain", "Plain" }, - { "Italic", "Italic" }, - { "Bold", "Bold" }, - { "BoldItalic", "Bold & Italic" }, - { "Name", "Nama" }, - { "Size", "Ukuran" }, - { "Style", "Gaya" }, - { "TestString", "This is just a Test! The quick brown Fox is doing something. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "Font" }, - // - { "AdempiereColorEditor", "Editor Warna Adempiere" }, - { "AdempiereType", "Tipe Warna" }, - { "GradientUpperColor", "Warna Atas Gradien" }, - { "GradientLowerColor", "Warna Bawah Gradien" }, - { "GradientStart", "Mulai Gradien" }, - { "GradientDistance", "Jarak Gradien" }, - { "TextureURL", "Textur URL" }, - { "TextureAlpha", "Textur Alpha" }, - { "TextureTaintColor", "Textur Warna Taint" }, - { "LineColor", "Warna Baris" }, - { "LineBackColor", "Warna Latar Belakang" }, - { "LineWidth", "Lebar Baris" }, - { "LineDistance", "Jarak Baris" }, - { "FlatColor", "Warna Flat" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_it.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_it.java deleted file mode 100644 index bffb116159..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_it.java +++ /dev/null @@ -1,213 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Gabriele Vivinetto - gabriele.mailing@rvmgroup.it - * @version $Id: PlafRes_it.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_it extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - //{ "BackColType", "Background Color Type" }, - { "BackColType", "Tipo Colore di Sfondo" }, - //{ "BackColType_Flat", "Flat" }, - { "BackColType_Flat", "Piatto" }, - //{ "BackColType_Gradient", "Gradient" }, - { "BackColType_Gradient", "Gradiente" }, - //{ "BackColType_Lines", "Lines" }, - { "BackColType_Lines", "Linee" }, - //{ "BackColType_Texture", "Texture" }, //Need to be checked. How to translate "Texture" ? - { "BackColType_Texture", "Texture" }, - // - //{ "LookAndFeelEditor", "Look & Feel Editor" }, //Need to be checked - { "LookAndFeelEditor", "Editor aspetto" }, - //{ "LookAndFeel", "Look & Feel" }, - { "LookAndFeel", "Aspetto" }, - //{ "Theme", "Theme" }, - { "Theme", "Tema" }, - //{ "EditAdempiereTheme", "Edit Adempiere Theme" }, //Need to be checked - { "EditAdempiereTheme", "Modifica Tema di Adempiere" }, - //{ "SetDefault", "Default Background" }, - { "SetDefault", "Sfondo di Default" }, - //{ "SetDefaultColor", "Background Color" }, - { "SetDefaultColor", "Colore di Sfondo" }, - //{ "ColorBlind", "Color Deficiency" }, //Need to be checked - { "ColorBlind", "Mancanza di Colore" }, - //{ "Example", "Example" }, - { "Example", "Esempio" }, - //{ "Reset", "Reset" }, //Need to be checked - { "Reset", "Resetta" }, - //{ "OK", "OK" }, - { "OK", "OK" }, - //{ "Cancel", "Cancel" }, - { "Cancel", "Cancella" }, - // - //{ "AdempiereThemeEditor", "Adempiere Theme Editor" }, //Need to be checked - { "AdempiereThemeEditor", "Editor di Tema Adempiere" }, - //{ "MetalColors", "Metal Colors" }, - { "MetalColors", "Colori Metallici" }, - //{ "AdempiereColors", "Adempiere Colors" }, - { "AdempiereColors", "Colori di Adempiere" }, - //{ "AdempiereFonts", "Adempiere Fonts" }, //Need to be checked. Mantain the word "Font" ? - { "AdempiereFonts", "Caratteri di Adempiere" }, - //{ "Primary1Info", "Shadow, Separator" }, //Need to be checked - { "Primary1Info", "Ombra, Separatore" }, - //{ "Primary1", "Primary 1" }, - { "Primary1", "Primario 1" }, - //{ "Primary2Info", "Focus Line, Selected Menu" }, //Need to be checked - { "Primary2Info", "Linea di Selezione, Menu Selezionato" }, - //{ "Primary2", "Primary 2" }, - { "Primary2", "Primario 2" }, - //{ "Primary3Info", "Table Selected Row, Selected Text, ToolTip Background" }, //Need to be checked - { "Primary3Info", "Riga di Tabella Selezionata, Testo Selezionato, Sfondo ToolTip " }, - //{ "Primary3", "Primary 3" }, - { "Primary3", "Primario 3" }, - //{ "Secondary1Info", "Border Lines" }, - { "Secondary1Info", "Linee di Bordo" }, - //{ "Secondary1", "Secondary 1" }, - { "Secondary1", "Secondario 1" }, - //{ "Secondary2Info", "Inactive Tabs, Pressed Fields, Inactive Border + Text" }, //Need to be checked - { "Secondary2Info", "Tab inattive, Campi selezionati, Bordo + Testo inattivo" }, - //{ "Secondary2", "Secondary 2" }, - { "Secondary2", "Secondario 2" }, - //{ "Secondary3Info", "Background" }, - { "Secondary3Info", "Sfondo" }, - //{ "Secondary3", "Secondary 3" }, - { "Secondary3", "Secondario 3" }, - // - //{ "ControlFontInfo", "Control Font" }, //Need to be checked - { "ControlFontInfo", "Font di Controllo" }, - //{ "ControlFont", "Label Font" }, //Need to be checked - { "ControlFont", "Font di Etichetta" }, - //{ "SystemFontInfo", "Tool Tip, Tree nodes" }, //Need to be checked - { "SystemFontInfo", "Tool Tip, Nodi ad Albero" }, - //{ "SystemFont", "System Font" }, //Need to be checked - { "SystemFont", "Carattere di Sistema" }, - //{ "UserFontInfo", "User Entered Data" }, - { "UserFontInfo", "Dati immessi dall'utente" }, - //{ "UserFont", "Field Font" }, //Need to be checked - { "UserFont", "Carattere del Campo" }, -// { "SmallFontInfo", "Reports" }, - //{ "SmallFont", "Small Font" }, //Need to be checked - { "SmallFont", "Carattere piccolo" }, - //{ "WindowTitleFont", "Title Font" }, //Need to be checked - { "WindowTitleFont", "Carattere Titolo" }, - //{ "MenuFont", "Menu Font" }, //Need to be checked - { "MenuFont", "Carattere Menu" }, - // - //{ "MandatoryInfo", "Mandatory Field Background" }, - { "MandatoryInfo", "Sfondo Campo Obbligatorio" }, - //{ "Mandatory", "Mandatory" }, - { "Mandatory", "Obbligatorio" }, - //{ "ErrorInfo", "Error Field Background" }, - { "ErrorInfo", "Sfondo Campo di Errore" }, - //{ "Error", "Error" }, - { "Error", "Errore" }, - //{ "InfoInfo", "Info Field Background" }, //Need to be checked. Is it better "Informativo" ? What with the following ? - { "InfoInfo", "Sfondo Campo Informazione" }, - //{ "Info", "Info" }, - { "Info", "Informazione" }, - //{ "WhiteInfo", "Lines" }, - { "WhiteInfo", "Linee" }, - //{ "White", "White" }, - { "White", "Bianco" }, - //{ "BlackInfo", "Lines, Text" }, - { "BlackInfo", "Linee, Testo" }, - //{ "Black", "Black" }, - { "Black", "Nero" }, - //{ "InactiveInfo", "Inactive Field Background" }, - { "InactiveInfo", "Sfondo Campo Inattivo" }, - //{ "Inactive", "Inactive" }, - { "Inactive", "Inattivo" }, - //{ "TextOKInfo", "OK Text Foreground" }, //Need to be checked. How to translate Foreground ? - { "TextOKInfo", "Colore Testo OK" }, - //{ "TextOK", "Text - OK" }, //Need to be checked - { "TextOK", "Testo - OK" }, - //{ "TextIssueInfo", "Error Text Foreground" }, //Need to be checked - { "TextIssueInfo", "Colore Testo di Errore" }, - //{ "TextIssue", "Text - Error" }, - { "TextIssue", "Testo - Error" }, - // - //{ "FontChooser", "Font Chooser" }, //Need to be checked - { "FontChooser", "Selezionatore Carattere" }, - //{ "Fonts", "Fonts" }, //Need to be checked - { "Fonts", "Caratteri" }, - //{ "Plain", "Plain" }, //Need to be checked - { "Plain", "Normale" }, - //{ "Italic", "Italic" }, - { "Italic", "Corsivo" }, - //{ "Bold", "Bold" }, - { "Bold", "Grassetto" }, - //{ "BoldItalic", "Bold & Italic" }, - { "BoldItalic", "Grassetto & Corsivo" }, - //{ "Name", "Name" }, - { "Name", "Nome" }, - //{ "Size", "Size" }, - { "Size", "Dimensione" }, - //{ "Style", "Style" }, - { "Style", "Stile" }, - //{ "TestString", "This is just a Test! The quick brown Fox is doing something. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "TestString", "Questo ïżœ solo un Test! La veloce volpe marrone stïżœ facendo qualcosa. 12,3456.78 LetteraLUno = l1 LetteraOZero = O0" }, - //{ "FontString", "Font" }, - { "FontString", "Carattere" }, //Need to be checked - // - //{ "AdempiereColorEditor", "Adempiere Color Editor" }, //Need to be checked - { "AdempiereColorEditor", "Editor di Colori Adempiere" }, - //{ "AdempiereType", "Color Type" }, - { "AdempiereType", "Tipo Colore" }, - //{ "GradientUpperColor", "Gradient Upper Color" }, - { "GradientUpperColor", "Colore Gradiente Superiore" }, - //{ "GradientLowerColor", "Gradient Lower Color" }, - { "GradientLowerColor", "Colore Gradiente Inferiore" }, - //{ "GradientStart", "Gradient Start" }, - { "GradientStart", "Inizio Gradiente" }, - //{ "GradientDistance", "Gradient Distance" }, - { "GradientDistance", "Distanza Gradiente" }, - //{ "TextureURL", "Texture URL" }, //Need to be checked. How to translate "Texture" ? - { "TextureURL", "URL Texture" }, - //{ "TextureAlpha", "Texture Alpha" }, //Need to be checked. How to translate ? - { "TextureAlpha", "Texture Alpha" }, - //{ "TextureTaintColor", "Texture Taint Color" }, //Need to be checked. How to translate ? - { "TextureTaintColor", "Texture Taint Color" }, - //{ "LineColor", "Line Color" }, - { "LineColor", "Colore Linea" }, - //{ "LineBackColor", "Background Color" }, - { "LineBackColor", "Colore Sfondo" }, - //{ "LineWidth", "Line Width" }, - { "LineWidth", "Spessore Linea" }, - //{ "LineDistance", "Line Distance" }, - { "LineDistance", "Distanza Linea" }, - //{ "FlatColor", "Flat Color" } - { "FlatColor", "Colore Piatto" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ja.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ja.java deleted file mode 100644 index 47e9ea45f8..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ja.java +++ /dev/null @@ -1,131 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Stefan Christians - * @version $Id: PlafRes_ja.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_ja extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "\u80cc\u666f\u306e\u30b9\u30bf\u30a4\u30eb" }, - { "BackColType_Flat", "\u5358\u8272" }, - { "BackColType_Gradient", "\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3" }, - { "BackColType_Lines", "\u30e9\u30a4\u30f3" }, - { "BackColType_Texture", "\u30c6\u30ad\u30b9\u30c1\u30e3\u30fc" }, - // - { "LookAndFeelEditor", "\u5916\u89b3\u4fee\u6b63" }, - { "LookAndFeel", "\u5916\u89b3" }, - { "Theme", "\u30c6\u30fc\u30de" }, - { "EditAdempiereTheme", "\u30a2\u30c7\u30f3\u30d4\u30a8\u30fc\u30ec\u306e\u30c6\u30fc\u30de\u4fee\u6b63" }, - { "SetDefault", "\u30c7\u30d5\u30a9\u30eb\u30c8\u3092\u8a2d\u5b9a" }, - { "SetDefaultColor", "\u30c7\u30d5\u30a9\u30eb\u30c8\u8272\u3092\u8a2d\u5b9a" }, - { "ColorBlind", "\u80cc\u666f\u8272" }, - { "Example", "\u4f8b" }, - { "Reset", "\u30ea\u30bb\u30c3\u30c8" }, - { "OK", "OK" }, - { "Cancel", "\u30ad\u30e3\u30f3\u30bb\u30eb" }, - // - { "AdempiereThemeEditor", "\u30a2\u30c7\u30f3\u30d4\u30a8\u30fc\u30ec\u30c6\u30fc\u30de\u4fee\u6b63" }, - { "MetalColors", "\u30e1\u30bf\u30eb\u8abf" }, - { "AdempiereColors", "\u30a2\u30c7\u30f3\u30d4\u30a8\u30fc\u30ec\u306e\u8272" }, - { "AdempiereFonts", "\u30a2\u30c7\u30f3\u30d4\u30a8\u30fc\u30ec\u306e\u30d5\u30a9\u30f3\u30c8" }, - { "Primary1Info", "\u5f71\u3001\u30bb\u30d1\u30ec\u30fc\u30bf" }, - { "Primary1", "\u4e00\u756a\u76ee\u306e1" }, - { "Primary2Info", "\u30d5\u30a9\u30fc\u30ab\u30b9\u304c\u6709\u308b\u30e9\u30a4\u30f3\u3001\u9078\u629e\u3057\u305f\u30e1\u30cb\u30e5\u30fc" }, - { "Primary2", "\u4e00\u756a\u76ee\u306e2" }, - { "Primary3Info", "\u9078\u629e\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u884c\u3001\u9078\u629e\u3057\u305f\u30c6\u30ad\u30b9\u30c8\u3001\u30c4\u30fc\u30eb\u30fb\u30c1\u30c3\u30d7\u306e\u80cc\u666f" }, - { "Primary3", "\u4e00\u756a\u76ee\u306e3" }, - { "Secondary1Info", "\u5883\u754c\u7dda" }, - { "Secondary1", "\u4e8c\u756a\u76ee\u306e1" }, - { "Secondary2Info", "\u4e0d\u6d3b\u6027\u30bf\u30d6\u3001\u62bc\u4e0b\u3057\u305f\u30d5\u30a3\u30fc\u30eb\u30c9\u3001\u4e0d\u6d3b\u6027\u5883\u754c\u3068\u30c6\u30ad\u30b9\u30c8" }, - { "Secondary2", "\u4e8c\u756a\u76ee\u306e2" }, - { "Secondary3Info", "\u80cc\u666f" }, - { "Secondary3", "\u4e8c\u756a\u76ee\u306e3" }, - // - { "ControlFontInfo", "\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306e\u30d5\u30a9\u30f3\u30c8" }, - { "ControlFont", "\u30e9\u30d9\u30eb\u306e\u30d5\u30a9\u30f3\u30c8" }, - { "SystemFontInfo", "\u30c4\u30fc\u30eb\u30fb\u30c1\u30c3\u30d7\u3001\u30c4\u30ea\u30fc" }, - { "SystemFont", "\u30b7\u30b9\u30c6\u30e0\u30d5\u30a9\u30f3\u30c8" }, - { "UserFontInfo", "\u30e6\u30fc\u30b6\u304c\u5165\u529b\u3057\u305f\u30c7\u30fc\u30bf" }, - { "UserFont", "\u30d5\u30a3\u30fc\u30eb\u30c9\u30d5\u30a9\u30f3\u30c8" }, -// { "SmallFontInfo", "\u30ec\u30dd\u30fc\u30c8" }, - { "SmallFont", "\u5c0f\u30d5\u30a9\u30f3\u30c8" }, - { "WindowTitleFont", "\u30bf\u30a4\u30c8\u30eb\u30d5\u30a9\u30f3\u30c8" }, - { "MenuFont", "\u30e1\u30cb\u30e5\u30fc\u30d5\u30a9\u30f3\u30c8" }, - // - { "MandatoryInfo", "\u5fc5\u9808\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u80cc\u666f" }, - { "Mandatory", "\u5fc5\u9808" }, - { "ErrorInfo", "\u30a8\u30e9\u30fc\u30fb\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u80cc\u666f" }, - { "Error", "\u30a8\u30e9\u30fc" }, - { "InfoInfo", "\u60c5\u5831\u30fb\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u80cc\u666f" }, - { "Info", "\u60c5\u5831" }, - { "WhiteInfo", "\u30e9\u30a4\u30f3" }, - { "White", "\u767d" }, - { "BlackInfo", "\u30e9\u30a4\u30f3\u3068\u30c6\u30ad\u30b9\u30c8" }, - { "Black", "\u9ed2" }, - { "InactiveInfo", "\u4e0d\u6d3b\u6027\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u80cc\u666f" }, - { "Inactive", "\u4e0d\u6d3b\u6027" }, - { "TextOKInfo", "OK\u30fb\u30c6\u30ad\u30b9\u30c8\u306e\u524d\u666f" }, - { "TextOK", "\u30c6\u30ad\u30b9\u30c8 - OK" }, - { "TextIssueInfo", "\u30a8\u30e9\u30fc\u30fb\u30c6\u30ad\u30b9\u30c8\u306e\u524d\u666f" }, - { "TextIssue", "\u30c6\u30ad\u30b9\u30c8 - \u30a8\u30e9\u30fc" }, - // - { "FontChooser", "\u30d5\u30a9\u30f3\u30c8\u306e\u9078\u629e" }, - { "Fonts", "\u30d5\u30a9\u30f3\u30c8" }, - { "Plain", "\u666e\u901a" }, - { "Italic", "\u659c\u4f53" }, - { "Bold", "\u592a\u5b57" }, - { "BoldItalic", "\u592a\u5b57\u3068\u659c\u4f53" }, - { "Name", "\u30d5\u30a1\u30df\u30ea" }, - { "Size", "\u30b5\u30a4\u30ba" }, - { "Style", "\u30b9\u30bf\u30a4\u30eb" }, - { "TestString", "This is just a Test! The quick brown Fox is doing something. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "\u30d5\u30a9\u30f3\u30c8" }, - // - { "AdempiereColorEditor", "\u30a2\u30c7\u30f3\u30d4\u30a8\u30fc\u30ec\u8272\u4fee\u6b63" }, - { "AdempiereType", "\u8272\u578b" }, - { "GradientUpperColor", "\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3\u306e\u4e0a\u306e\u8272" }, - { "GradientLowerColor", "\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3\u306e\u4e0b\u306e\u8272" }, - { "GradientStart", "\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3\u306e" }, - { "GradientDistance", "\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3\u306e\u8ddd\u96e2" }, - { "TextureURL", "\u30c6\u30ad\u30b9\u30c1\u30e3\u30fc\u306eURL" }, - { "TextureAlpha", "\u30c6\u30ad\u30b9\u30c1\u30e3\u30fc\u306e\u03b1\u5024" }, - { "TextureTaintColor", "\u30c6\u30ad\u30b9\u30c1\u30e3\u30fc\u306e\u6c5a\u308c\u8272" }, - { "LineColor", "\u30e9\u30a4\u30f3\u306e\u8272" }, - { "LineBackColor", "\u30e9\u30a4\u30f3\u306e\u80cc\u666f\u8272" }, - { "LineWidth", "\u30e9\u30a4\u30f3\u306e\u5e45" }, - { "LineDistance", "\u30e9\u30a4\u30f3\u306e\u8ddd\u96e2" }, - { "FlatColor", "\u5358\u8272" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ms.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ms.java deleted file mode 100644 index 846667791e..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ms.java +++ /dev/null @@ -1,131 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Robin Hoo, Redhuan D. Oon (OPEN FIX SDN BHD - 2003) - * @version $Id: PlafRes_ms.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $ - */ -public class PlafRes_ms extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Jenis Warna Latar Belakang" }, - { "BackColType_Flat", "Leper" }, - { "BackColType_Gradient", "Gradient" }, - { "BackColType_Lines", "Garisan" }, - { "BackColType_Texture", "Texture" }, - // - { "LookAndFeelEditor", "Bentuk Paparan Editor" }, - { "LookAndFeel", "Bentuk Paparan" }, - { "Theme", "Tema" }, - { "EditAdempiereTheme", "Edit Tema Adempiere" }, - { "SetDefault", "Default LatarBelakang" }, - { "SetDefaultColor", "Warna LatarBelankang" }, - { "ColorBlind", "Kecacatan Warna" }, - { "Example", "Contoh" }, - { "Reset", "Reset" }, - { "OK", "OK" }, - { "Cancel", "Batal" }, - // - { "AdempiereThemeEditor", "Tema Adempiere Editor" }, - { "MetalColors", "Warna Metal" }, - { "AdempiereColors", "Warna Adempiere" }, - { "AdempiereFonts", "Adempiere Fonts" }, - { "Primary1Info", "Bayang, Pemisah" }, - { "Primary1", "Primary 1" }, - { "Primary2Info", "Garisan Fokus, Menu Terpilih" }, - { "Primary2", "Primary 2" }, - { "Primary3Info", "Table Selected Row, Selected Text, ToolTip Background" }, - { "Primary3", "Primary 3" }, - { "Secondary1Info", "Garis Sempadan" }, - { "Secondary1", "Menengah 1" }, - { "Secondary2Info", "Tab Tak Aktif, Medan Tertekan, Sempadan Tak Aktif + Teks" }, - { "Secondary2", "Menengah 2" }, - { "Secondary3Info", "LatarBelakang" }, - { "Secondary3", "Menengah 3" }, - // - { "ControlFontInfo", "Fon Kawalan" }, - { "ControlFont", "Fon Label" }, - { "SystemFontInfo", "Tool Tip, Tree nodes" }, - { "SystemFont", "Fon Sistem" }, - { "UserFontInfo", "User Entered Data" }, - { "UserFont", "Fon Medan" }, -// { "SmallFontInfo", "Reports" }, - { "SmallFont", "Fon Kecil" }, - { "WindowTitleFont", "Fon Tajuk" }, - { "MenuFont", "Fon Menu" }, - // - { "MandatoryInfo", "Medan LatarBelakang Wajib" }, - { "Mandatory", "Wajib" }, - { "ErrorInfo", "Error Field LatarBelakang" }, - { "Error", "Error" }, - { "InfoInfo", "Info Field Background" }, - { "Info", "Info" }, - { "WhiteInfo", "Garisan" }, - { "White", "Putih" }, - { "BlackInfo", "Garisan, Teks" }, - { "Black", "Hitam" }, - { "InactiveInfo", "Inactive Field Background" }, - { "Inactive", "Tak Aktif" }, - { "TextOKInfo", "OK Text Foreground" }, - { "TextOK", "Teks - OK" }, - { "TextIssueInfo", "Error Text Foreground" }, - { "TextIssue", "Teks - Error" }, - // - { "FontChooser", "Pemilih Fon" }, - { "Fonts", "Fon" }, - { "Plain", "Biasa" }, - { "Italic", "Italic" }, - { "Bold", "Bold" }, - { "BoldItalic", "Bold & Italic" }, - { "Name", "Nama" }, - { "Size", "Saiz" }, - { "Style", "Stail" }, - { "TestString", "Ini cuma ujian! The quick brown Fox is doing something. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "Fon" }, - // - { "AdempiereColorEditor", "Adempiere Color Editor" }, - { "AdempiereType", "Jenis Warna" }, - { "GradientUpperColor", "Gradient Upper Color" }, - { "GradientLowerColor", "Gradient Lower Color" }, - { "GradientStart", "Gradient Start" }, - { "GradientDistance", "Gradient Distance" }, - { "TextureURL", "Texture URL" }, - { "TextureAlpha", "Texture Alpha" }, - { "TextureTaintColor", "Texture Taint Color" }, - { "LineColor", "Warna Garisan" }, - { "LineBackColor", "Warna LatarBelakang" }, - { "LineWidth", "Lebar Garisan" }, - { "LineDistance", "Jarak Garisan" }, - { "FlatColor", "Warna Leper" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_nl.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_nl.java deleted file mode 100644 index bf70ef7646..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_nl.java +++ /dev/null @@ -1,132 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Eldir Tomassen - * @version $Id: PlafRes_nl.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $ - */ -public class PlafRes_nl extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Achtergrond Kleur Type" }, - { "BackColType_Flat", "Egaal" }, - { "BackColType_Gradient", "Verloop" }, - { "BackColType_Lines", "Lijnen" }, - { "BackColType_Texture", "Reliïżœf" }, - // - { "LookAndFeelEditor", "Look & Feel Editor" }, - { "LookAndFeel", "Look & Feel" }, - { "Theme", "Thema" }, - { "EditAdempiereTheme", "Adempiere Theme Bewerken" }, - { "SetDefault", "Standaard Achtergrond" }, - { "SetDefaultColor", "Achtergrond Kleur" }, - { "ColorBlind", "Kleur Verloop" }, - { "Example", "Voorbeeld" }, - { "Reset", "Ongedaan maken" }, - { "OK", "OK" }, - { "Cancel", "Annuleren" }, - // - { "AdempiereThemeEditor", "Adempiere Thema Editor" }, - { "MetalColors", "Metaal Kleuren" }, - { "AdempiereColors", "Adempiere Kleuren" }, - { "AdempiereFonts", "Adempiere Lettertypen" }, - { "Primary1Info", "Shaduw, Schijdingsteken" }, - { "Primary1", "Primair 1" }, - { "Primary2Info", "Schijdingslijn, Geselecteerd Menu" }, - { "Primary2", "Primair 2" }, - { "Primary3Info", "Tabel Geselecteerde Rij, Geselecteerde Tekst, ToolTip Achtergrond" }, - { "Primary3", "Primair 3" }, - { "Secondary1Info", "Begrenzing Lijnen" }, - { "Secondary1", "Secundair 2" }, - { "Secondary2Info", "Inactieve Tabs, Geselecteerde Velden, Inactieve Begrenzing + Tekst" }, - { "Secondary2", "Secundait 2" }, - { "Secondary3Info", "Achtergrond" }, - { "Secondary3", "Secondair 3" }, - // - { "ControlFontInfo", "Beheer Lettertype" }, - { "ControlFont", "Label Lettertype" }, - { "SystemFontInfo", "Tool Tip, Boom Iconen" }, - { "SystemFont", "Systeem Letterype" }, - { "UserFontInfo", "Door Gebruiker ingevoerde gegevens" }, - { "UserFont", "Veld Lettertype" }, -// { "SmallFontInfo", "Reports" }, - { "SmallFont", "Klein Lettertype" }, - { "WindowTitleFont", "Titel Lettertype" }, - { "MenuFont", "Menu Lettertype" }, - // - { "MandatoryInfo", "Verplicht Veld Achtergrond" }, - { "Mandatory", "Verplicht" }, - { "ErrorInfo", "Foutief Veld Achtergrond" }, - { "Error", "Foutief" }, - { "InfoInfo", "Informatie Veld Achtergrond" }, - { "Info", "Informatie" }, - { "WhiteInfo", "Lijnen" }, - { "White", "Wit" }, - { "BlackInfo", "Lijnen, Tekst" }, - { "Black", "Zwart" }, - { "InactiveInfo", "Inactief Veld Achtergrond" }, - { "Inactive", "Inactief" }, - { "TextOKInfo", "OK Tekst Voorgrond" }, - { "TextOK", "Tekst - OK" }, - { "TextIssueInfo", "Foutief Tekst Voorgrond" }, - { "TextIssue", "Tekst - Foutief" }, - // - { "FontChooser", "Lettertype Selecteren" }, - { "Fonts", "Lettertypen" }, - { "Plain", "Normaal" }, - { "Italic", "Schuin" }, - { "Bold", "Vet" }, - { "BoldItalic", "Vet & Schuin" }, - { "Name", "Naam" }, - { "Size", "Formaat" }, - { "Style", "Stijl" }, - { "TestString", "Dit is een test! De thema brwoser is bezig. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "Lettertype" }, - // - { "AdempiereColorEditor", "Adempiere Kleur Editor" }, - { "AdempiereType", "Kleur Type" }, - { "GradientUpperColor", "Verloop Bovenste Kleur" }, - { "GradientLowerColor", "Verloop Onderste Kleur" }, - { "GradientStart", "Verloop Start" }, - { "GradientDistance", "Verloop Afstand" }, - { "TextureURL", "Textuur URL" }, - { "TextureAlpha", "Textuur Alpha" }, - { "TextureTaintColor", "Textuur Taint Kleur" }, - { "LineColor", "Lijn Kleur" }, - { "LineBackColor", "Achtergrond Kleur" }, - { "LineWidth", "Lijn Breedte" }, - { "LineDistance", "Lijn Reikwijdte" }, - { "FlatColor", "Egale Kleur" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res - diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_no.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_no.java deleted file mode 100644 index 0429c2f04b..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_no.java +++ /dev/null @@ -1,131 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Norwegian Translation Texts for Look & Feel - * - * @author Olaf Slazak Lïżœken - * @version $Id: PlafRes_no.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_no extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Bakgrunns Farge Type" }, - { "BackColType_Flat", "Flat" }, - { "BackColType_Gradient", "Gradient" }, - { "BackColType_Lines", "Linjer" }, - { "BackColType_Texture", "Texture" }, - // - { "LookAndFeelEditor", "Utseende Egenskaper" }, - { "LookAndFeel", "Utseende" }, - { "Theme", "Sjanger" }, - { "EditAdempiereTheme", "Rediger Adempiere Sjanger" }, - { "SetDefault", "Standard Bakgrunn" }, - { "SetDefaultColor", "Bakgrunn Farge" }, - { "ColorBlind", "Farge Deficiency" }, - { "Example", "Eksempel" }, - { "Reset", "Angre" }, - { "OK", "OK" }, - { "Cancel", "Avbryt" }, - // - { "AdempiereThemeEditor", "Rediger Adempiere Sjanger" }, - { "MetalColors", "Metal Farger" }, - { "AdempiereColors", "Adempiere Farger" }, - { "AdempiereFonts", "Adempiere Fonter" }, - { "Primary1Info", "Sygger, Separator" }, - { "Primary1", "Primary 1" }, - { "Primary2Info", "Fokus Linje, Valgte " }, - { "Primary2", "Primary 2" }, - { "Primary3Info", "Table Selected Row, Selected Text, ToolTip Background" }, - { "Primary3", "Primary 3" }, - { "Secondary1Info", "Border Lines" }, - { "Secondary1", "Secondary 1" }, - { "Secondary2Info", "Inactive Tabs, Pressed Fields, Inactive Border + Text" }, - { "Secondary2", "Secondary 2" }, - { "Secondary3Info", "Background" }, - { "Secondary3", "Secondary 3" }, - // - { "ControlFontInfo", "Kontrol Font" }, - { "ControlFont", "Label Font" }, - { "SystemFontInfo", "Systemets Font Info" }, - { "SystemFont", "Systemets Fonter" }, - { "UserFontInfo", "Bruker Innlagt Data" }, - { "UserFont", "Felt Fonter" }, -// { "SmallFontInfo", "Reports" }, - { "SmallFont", "Smïżœ Fonter" }, - { "WindowTitleFont", "Titell Fonter" }, - { "MenuFont", "Meny Fonter" }, - // - { "MandatoryInfo", "Mandatory Field Background" }, - { "Mandatory", "Mandatory" }, - { "ErrorInfo", "Error Field Background" }, - { "Error", "Error" }, - { "InfoInfo", "Info Field Background" }, - { "Info", "Info" }, - { "WhiteInfo", "Lines" }, - { "White", "White" }, - { "BlackInfo", "Lines, Text" }, - { "Black", "Black" }, - { "InactiveInfo", "Inactive Field Background" }, - { "Inactive", "Inactive" }, - { "TextOKInfo", "OK Text Foreground" }, - { "TextOK", "Text - OK" }, - { "TextIssueInfo", "Error Text Foreground" }, - { "TextIssue", "Text - Error" }, - // - { "FontChooser", "Font Chooser" }, - { "Fonts", "Fonts" }, - { "Plain", "Plain" }, - { "Italic", "Italic" }, - { "Bold", "Bold" }, - { "BoldItalic", "Bold & Italic" }, - { "Name", "Name" }, - { "Size", "Size" }, - { "Style", "Style" }, - { "TestString", "This is just a Test! The quick brown Fox is doing something. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "Font" }, - // - { "AdempiereColorEditor", "Adempiere Color Editor" }, - { "AdempiereType", "Color Type" }, - { "GradientUpperColor", "Gradient Upper Color" }, - { "GradientLowerColor", "Gradient Lower Color" }, - { "GradientStart", "Gradient Start" }, - { "GradientDistance", "Gradient Distance" }, - { "TextureURL", "Texture URL" }, - { "TextureAlpha", "Texture Alpha" }, - { "TextureTaintColor", "Texture Taint Color" }, - { "LineColor", "Line Color" }, - { "LineBackColor", "Background Color" }, - { "LineWidth", "Line Width" }, - { "LineDistance", "Line Distance" }, - { "FlatColor", "Flat Color" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_pl.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_pl.java deleted file mode 100644 index c14103b915..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_pl.java +++ /dev/null @@ -1,130 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Adam Bodurka - * @version $Id: PlafRes_pl.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_pl extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Typ koloru t\u0142a" }, - { "BackColType_Flat", "P\u0142aski" }, - { "BackColType_Gradient", "Stopniowany" }, - { "BackColType_Lines", "Linie" }, - { "BackColType_Texture", "Tekstura" }, - // - { "LookAndFeelEditor", "Edytor Wygl\u0105du" }, - { "LookAndFeel", "Wygl\u0105d" }, - { "Theme", "Temat" }, - { "EditAdempiereTheme", "Edytuj Temat Compiera" }, - { "SetDefault", "Domy\u015blne T\u0142o" }, - { "SetDefaultColor", "Domy\u015blny Kolor" }, - { "Example", "Przyk\u0142ad" }, - { "Reset", "Resetuj" }, - { "OK", "OK" }, - { "Cancel", "Anuluj" }, - // - { "AdempiereThemeEditor", "Edytor Tematu Compiera" }, - { "MetalColors", "Kolory Metalowe" }, - { "AdempiereColors", "Kolory Compiera" }, - { "AdempiereFonts", "Czcionki Compiera" }, - { "Primary1Info", "Tekst Etykiety" }, - { "Primary1", "Podstawowy 1" }, - { "Primary2Info", "Linia Fokusu, Wybrany CheckBox" }, - { "Primary2", "Podstawowy 2" }, - { "Primary3Info", "Wybrany Wiersz Tabeli, Wybrany Tekst, T\u0142o Podpowiedzi" }, - { "Primary3", "Podstawowy 3" }, - { "Secondary1Info", "Linie Obramowania" }, - { "Secondary1", "Drugorz\u0119dny 1" }, - { "Secondary2Info", "Nieaktywne Zak\u0142adki, Naci\u015bni\u0119te Pola, Nieaktywna Ramka + Tekst" }, - { "Secondary2", "Drugorz\u0119dny 2" }, - { "Secondary3Info", "T\u0142o" }, - { "Secondary3", "Drugorz\u0119dny 3" }, - // - { "ControlFontInfo", "Czcionka Kontrolki" }, - { "ControlFont", "Czcionka Etykiety" }, - { "SystemFontInfo", "Podpowiedzi, Ga\u0142\u0119zie drzewa" }, - { "SystemFont", "Czcionka Systemowa" }, - { "UserFontInfo", "Dane wprowadzone przez U\u017cytkownika" }, - { "UserFont", "Czcionka Pola" }, -// { "SmallFontInfo", "Raporty" }, - { "SmallFont", "Ma\u0142a Czcionka" }, - { "WindowTitleFont", "Czcionka Tytu\u0142u" }, - { "MenuFont", "Czcionka Menu" }, - // - { "MandatoryInfo", "Obowi\u0105zkowe T\u0142o Pola" }, - { "Mandatory", "Obowi\u0105zkowe" }, - { "ErrorInfo", "B\u0142\u0105d T\u0142a Pola" }, - { "Error", "B\u0142\u0105d" }, - { "InfoInfo", "Informacja T\u0142a Pola" }, - { "Info", "Informacja" }, - { "WhiteInfo", "Linie" }, - { "White", "Bia\u0142y" }, - { "BlackInfo", "Linie, Tekst" }, - { "Black", "Czarny" }, - { "InactiveInfo", "Nieaktywne T\u0142o Pola" }, - { "Inactive", "Nieaktywny" }, - { "TextOKInfo", "OK Pierwszoplanowy Tekst" }, - { "TextOK", "Tekst - OK" }, - { "TextIssueInfo", "B\u0142\u0105d Pierwszoplanowego Tekstu" }, - { "TextIssue", "Tekst - B\u0142\u0105d" }, - // - { "FontChooser", "Wyb\u00f3r Czcionki" }, - { "Fonts", "Czcionki" }, - { "Plain", "G\u0142adki" }, - { "Italic", "Kursywa" }, - { "Bold", "Pogrubiony" }, - { "BoldItalic", "Pogrubiony i Kursywa" }, - { "Name", "Nazwa" }, - { "Size", "Rozmiar" }, - { "Style", "Styl" }, - { "TestString", "To jest tylko test!" }, - { "FontString", "Czcionka" }, - // - { "AdempiereColorEditor", "Edytor Koloru Compiera" }, - { "AdempiereType", "Typ Koloru" }, - { "GradientUpperColor", "G\u00f3rny Kolor Stopniowania" }, - { "GradientLowerColor", "Dolny Kolor Stopniowania" }, - { "GradientStart", "Pocz\u0105tek Stopniowania" }, - { "GradientDistance", "Odst\u0119p Stopniowania" }, - { "TextureURL", "Tekstura URL" }, - { "TextureAlpha", "Tekstura Alpha" }, - { "TextureTaintColor", "Kolor t\u0142a Tekstury" }, - { "LineColor", "Kolor Linii" }, - { "LineBackColor", "Kolor T\u0142a" }, - { "LineWidth", "Grubo\u015b\u0107 Linii" }, - { "LineDistance", "Odst\u0119p Linii" }, - { "FlatColor", "Kolor P\u0142aski" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_pt.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_pt.java deleted file mode 100644 index 8b421b85f0..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_pt.java +++ /dev/null @@ -1,133 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Jesse Jr - * @version $Id: PlafRes_pt.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_pt extends ListResourceBundle -{ - /** The data */ - //Characters encoded to UTF8 Hex, so no more problems with svn commits - //Fernando Lucktemberg - CenturuyOn Consultoria - static final Object[][] contents = new String[][] - { - { "BackColType", "Tipo da Cor de Fundo" }, - { "BackColType_Flat", "Plano" }, - { "BackColType_Gradient", "Degrad\u00ea" }, - { "BackColType_Lines", "Linhas" }, - { "BackColType_Texture", "Textura" }, - // - { "LookAndFeelEditor", "Editor: Look & Feel" }, - { "LookAndFeel", "Look & Feel" }, - { "Theme", "Tema" }, - { "EditAdempiereTheme", "Editar Tema Adempiere" }, - { "SetDefault", "Fundo Padr\u00e3o" }, - { "SetDefaultColor", "Cor de Fundo" }, - { "ColorBlind", "Defici\u00eancia de Cor" }, - { "Example", "Exemplo" }, - { "Reset", "Reinicializar" }, - { "OK", "OK" }, - { "Cancel", "Cancelar" }, - // - { "AdempiereThemeEditor", "Adempiere: Editor de Temas" }, - { "MetalColors", "Cores Metal" }, - { "AdempiereColors", "Cores Adempiere" }, - { "AdempiereFonts", "Fontes Adempiere" }, - { "Primary1Info", "Sombra, Separador" }, - { "Primary1", "Prim\u00e1rio 1" }, - { "Primary2Info", "Linha de Foco, Menu Selecionado" }, - { "Primary2", "Prim\u00e1rio 2" }, - { "Primary3Info", "Linha da Tabele Selecionada, Texto Selecionado, Fundo Dicas" }, - { "Primary3", "Prim\u00e1rio 3" }, - { "Secondary1Info", "Bordas de Linhas" }, - { "Secondary1", "Secund\u00e1rio 1" }, - { "Secondary2Info", "Tabs Inativas, Campos Pressed, Borda Inativa + Texto" }, - { "Secondary2", "Secund\u00e1rio 2" }, - { "Secondary3Info", "ïżœrea de Fundo" }, - { "Secondary3", "Secund\u00e1rio 3" }, - // - { "ControlFontInfo", "Controle de Fonte" }, - { "ControlFont", "R\u00f3tulo da Fonte" }, - { "SystemFontInfo", "Tool Tip, Tree nodes" }, - { "SystemFont", "System Font" }, - { "UserFontInfo", "Entrada de Dados pelo Usu\u00e1rio" }, - { "UserFont", "Fonte dos Campos" }, -// { "SmallFontInfo", "Relat\u00f3rios" }, - { "SmallFont", "Fonte pequena" }, - { "WindowTitleFont", "Fonte do T\u00edtulo" }, - { "MenuFont", "Fonte do Menu" }, - // - { "MandatoryInfo", "Fundo de Campos Obrigatïżœrios" }, - { "Mandatory", "Obrigat\u00f3rio" }, - { "ErrorInfo", "Fundo de Campo de Erro" }, - { "Error", "Erro" }, - { "InfoInfo", "Fundo de Campos Informativos" }, - { "Info", "Info" }, - { "WhiteInfo", "Linhas" }, - { "White", "Branco" }, - { "BlackInfo", "Linhas, Texto" }, - { "Black", "Preto" }, - { "InactiveInfo", "Fundo de Campo Inativo" }, - { "Inactive", "Inativo" }, - { "TextOKInfo", "OK Fundo do Texto" }, - { "TextOK", "Texto - OK" }, - { "TextIssueInfo", "Fundo do Texto de Erro" }, - { "TextIssue", "Texto - Erro" }, - // - { "FontChooser", "Selecionar Fonte" }, - { "Fonts", "Fontes" }, - { "Plain", "Plano" }, - { "Italic", "It\u00e1lico" }, - { "Bold", "Negrito" }, - { "BoldItalic", "Negrito & It\u00e1lico" }, - { "Name", "Nome" }, - { "Size", "Tamanho" }, - { "Style", "Estilo" }, - { "TestString", "Somente teste! The quick brown Fox is doing something. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "Fonte" }, - // - { "AdempiereColorEditor", "Adempiere: Editor de Cores" }, - { "AdempiereType", "Tipo de Cor" }, - { "GradientUpperColor", "Cor Degrad\u00ea Superior" }, - { "GradientLowerColor", "Cor Degrad\u00ea Inferior" }, - { "GradientStart", "In\u00edcio do Degrad\u00ea" }, - { "GradientDistance", "Dist\u00e2ncia do Degrad\u00ea" }, - { "TextureURL", "URL Textura" }, - { "TextureAlpha", "Alfa Textura" }, - { "TextureTaintColor", "Colora\u00e7\u00e3o da Textura" }, - { "LineColor", "Cor da Linha" }, - { "LineBackColor", "Cores de Fundo" }, - { "LineWidth", "Largura da Linha" }, - { "LineDistance", "Dist\u00e2ncia das linhas" }, - { "FlatColor", "Cores Planas" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ro.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ro.java deleted file mode 100644 index 7a89ab6f76..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ro.java +++ /dev/null @@ -1,131 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Jorg Janke - * @version $Id: PlafRes_ro.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_ro extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Tip al culorii de fundal" }, - { "BackColType_Flat", "Plin" }, - { "BackColType_Gradient", "Gradient" }, - { "BackColType_Lines", "Linii" }, - { "BackColType_Texture", "Ha\u015fur\u0103" }, - // - { "LookAndFeelEditor", "Editor de aspect grafic" }, - { "LookAndFeel", "Aspect grafic" }, - { "Theme", "Tem\u0103" }, - { "EditAdempiereTheme", "Editare a temei Adempiere" }, - { "SetDefault", "Fundal implicit" }, - { "SetDefaultColor", "Culoare de fundal" }, - { "ColorBlind", "Deficien\u0163\u0103 cromatic\u0103" }, - { "Example", "Exemplu" }, - { "Reset", "Reini\u0163ializare" }, - { "OK", "OK" }, - { "Cancel", "Anulare" }, - // - { "AdempiereThemeEditor", "Editor de tem\u0103 grafic\u0103" }, - { "MetalColors", "Culori metalice" }, - { "AdempiereColors", "Culori Adempiere" }, - { "AdempiereFonts", "Font-uri Adempiere" }, - { "Primary1Info", "Umbr\u0103, separator" }, - { "Primary1", "Principal 1" }, - { "Primary2Info", "Linie curent\u0103, meniu selectat" }, - { "Primary2", "Principal 2" }, - { "Primary3Info", "R\u00e2nd de tabel selectat, text selectat, fundal pentru indica\u0163ii" }, - { "Primary3", "Principal 3" }, - { "Secondary1Info", "Margini" }, - { "Secondary1", "Secundar 1" }, - { "Secondary2Info", "File inactive, butoane ap\u0103sate, margini \u015fi text inactive" }, - { "Secondary2", "Secundar 2" }, - { "Secondary3Info", "Fundal" }, - { "Secondary3", "Secundar 3" }, - // - { "ControlFontInfo", "Font pentru obiecte grafice" }, - { "ControlFont", "Font pentru etichete" }, - { "SystemFontInfo", "Indica\u0163ii, noduri \u00een arborescen\u0163e" }, - { "SystemFont", "Font de sistem" }, - { "UserFontInfo", "Date introduse de utilizator" }, - { "UserFont", "Font pentru c\u00e2mpuri" }, -// { "SmallFontInfo", "Font pentru rapoarte" }, - { "SmallFont", "Font de dimensiune mic\u0103" }, - { "WindowTitleFont", "Font pentru titluri" }, - { "MenuFont", "Font de meniuri" }, - // - { "MandatoryInfo", "Fundal pentru c\u00e2mpuri obligatorii" }, - { "Mandatory", "Obligatoriu" }, - { "ErrorInfo", "Fundal pentru c\u00e2mpuri cu valori eronate" }, - { "Error", "Erori" }, - { "InfoInfo", "Fundal pentru c\u00e2mpuri de informare" }, - { "Info", "Informare" }, - { "WhiteInfo", "R\u00e2nduri goale" }, - { "White", "\"Alb\"" }, - { "BlackInfo", "Linii, text" }, - { "Black", "\"Negru\"" }, - { "InactiveInfo", "Fundal pentru c\u00e2mpuri inactive" }, - { "Inactive", "Inactiv" }, - { "TextOKInfo", "Culoare pentru mesaje de confirmare" }, - { "TextOK", "Text de confirmare" }, - { "TextIssueInfo", "Culoare pentru mesaje de eroare" }, - { "TextIssue", "Text de eroare" }, - // - { "FontChooser", "Selector de font-uri" }, - { "Fonts", "Font-uri" }, - { "Plain", "Normal" }, - { "Italic", "Cursiv" }, - { "Bold", "Aldin" }, - { "BoldItalic", "Aldin \u015fi cursiv" }, - { "Name", "Nume" }, - { "Size", "Dimensiune" }, - { "Style", "Stil" }, - { "TestString", "Acesta este un test! Ziua bun\u0103 se cunoa\u015fte de diminea\u0163\u0103. 123.456,78 Lunu = l1 Ozero = O0" }, - { "FontString", "Font" }, - // - { "AdempiereColorEditor", "Editor de culoare " }, - { "AdempiereType", "Tip de culoare" }, - { "GradientUpperColor", "Culoare superioar\u0103 pentru gradient" }, - { "GradientLowerColor", "Culoare inferioar\u0103 pentru gradient" }, - { "GradientStart", "\u00cenceput de gradient" }, - { "GradientDistance", "Distan\u0163\u0103 de gradient" }, - { "TextureURL", "URL pentru ha\u015fur\u0103" }, - { "TextureAlpha", "Masc\u0103 alpha pentru ha\u015fur\u0103" }, - { "TextureTaintColor", "Nuan\u0163\u0103 a ha\u015furii" }, - { "LineColor", "Culoare de desenare" }, - { "LineBackColor", "Culoare de fundal" }, - { "LineWidth", "L\u0103\u0163imea liniei" }, - { "LineDistance", "Distan\u0163a \u00eentre linii" }, - { "FlatColor", "Culoare plin\u0103" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ru.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ru.java deleted file mode 100644 index 8098fe90a8..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_ru.java +++ /dev/null @@ -1,131 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Vyacheslav Pedak - * @version $Id: PlafRes_ru.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_ru extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "\u0422\u0438\u043f \u0444\u043e\u043d\u043e\u0432\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430" }, - { "BackColType_Flat", "\u0417\u0430\u043b\u0438\u0432\u043a\u0430" }, - { "BackColType_Gradient", "\u0413\u0440\u0430\u0434\u0438\u0435\u043d\u0442" }, - { "BackColType_Lines", "\u041b\u0438\u043d\u0438\u0438" }, - { "BackColType_Texture", "\u0422\u0435\u043a\u0441\u0442\u0443\u0440\u0430" }, - // - { "LookAndFeelEditor", "\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0432\u0438\u0434\u0430" }, - { "LookAndFeel", "\u0412\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434" }, - { "Theme", "\u0422\u0435\u043c\u0430" }, - { "EditAdempiereTheme", "\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043c\u044b Adempiere" }, - { "SetDefault", "\u0424\u043e\u043d \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e" }, - { "SetDefaultColor", "\u0426\u0432\u0435\u0442 \u0444\u043e\u043d\u0430" }, - { "ColorBlind", "\u0420\u0430\u0437\u043c\u044b\u0442\u043e\u0441\u0442\u044c \u0446\u0432\u0435\u0442\u0430" }, - { "Example", "\u041f\u0440\u0438\u043c\u0435\u0440" }, - { "Reset", "\u0421\u0431\u0440\u043e\u0441" }, - { "OK", "\u0414\u0430" }, - { "Cancel", "\u041e\u0442\u043c\u0435\u043d\u0430" }, - // - { "AdempiereThemeEditor", "\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0442\u0435\u043c Adempiere" }, - { "MetalColors", "\u041c\u0435\u0442\u0430\u043b\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0446\u0432\u0435\u0442\u0430" }, - { "AdempiereColors", "\u0426\u0432\u0435\u0442\u0430 Adempiere" }, - { "AdempiereFonts", "\u0428\u0440\u0438\u0444\u0442\u044b Adempiere" }, - { "Primary1Info", "\u0422\u0435\u043d\u044c, \u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c" }, - { "Primary1", "\u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 1" }, - { "Primary2Info", "\u0424\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u043a\u0430, \u0412\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0435 \u043c\u0435\u043d\u044e" }, - { "Primary2", "\u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 2" }, - { "Primary3Info", "\u0412\u044b\u0431\u0440\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0432 \u0442\u0430\u043b\u0438\u0446\u0435, \u0412\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0446\u0432\u0435\u0442, \u0424\u043e\u043d ToolTip" }, - { "Primary3", "\u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 3" }, - { "Secondary1Info", "\u041b\u0438\u043d\u0438\u0438 \u0433\u0440\u0430\u043d\u0438\u0446\u044b" }, - { "Secondary1", "\u0412\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0439 1" }, - { "Secondary2Info", "\u041d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0438, \u041d\u0430\u0436\u0430\u0442\u044b\u0435 \u043f\u043e\u043b\u044f, \u041d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0433\u0440\u0430\u043d\u0438\u0446\u044b + \u0442\u0435\u043a\u0441\u0442" }, - { "Secondary2", "\u0412\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0439 2" }, - { "Secondary3Info", "\u0424\u043e\u043d" }, - { "Secondary3", "\u0412\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0439 3" }, - // - { "ControlFontInfo", "\u0428\u0440\u0438\u0444\u0442 \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f" }, - { "ControlFont", "\u0428\u0440\u0438\u0444\u0442 \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u043a" }, - { "SystemFontInfo", "Tool Tip, \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0434\u0435\u0440\u0435\u0432\u0430" }, - { "SystemFont", "\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0448\u0440\u0438\u0444\u0442" }, - { "UserFontInfo", "\u0412\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435" }, - { "UserFont", "\u0428\u0440\u0438\u0444\u0442 \u0434\u043b\u044f \u043f\u043e\u043b\u0435\u0439 \u0432\u0432\u043e\u0434\u0430" }, -// { "SmallFontInfo", "\u041e\u0442\u0447\u0435\u0442\u044b" }, - { "SmallFont", "\u041c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0448\u0440\u0438\u0444\u0442" }, - { "WindowTitleFont", "\u0428\u0440\u0438\u0444\u0442 \u0434\u043b\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c" }, - { "MenuFont", "\u0428\u0440\u0438\u0444\u0442 \u0434\u043b\u044f \u043c\u0435\u043d\u044e" }, - // - { "MandatoryInfo", "\u0424\u043e\u043d \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0432\u0432\u043e\u0434\u0430" }, - { "Mandatory", "\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439" }, - { "ErrorInfo", "\u0424\u043e\u043d \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439" }, - { "Error", "\u041e\u0448\u0438\u0431\u043a\u0430" }, - { "InfoInfo", "\u0424\u043e\u043d \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439" }, - { "Info", "\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f" }, - { "WhiteInfo", "\u041b\u0438\u043d\u0438\u0438" }, - { "White", "\u0411\u0435\u043b\u044b\u0439" }, - { "BlackInfo", "\u041b\u0438\u043d\u0438\u0438, \u0422\u0435\u043a\u0441\u0442" }, - { "Black", "\u0427\u0435\u0440\u043d\u044b\u0439" }, - { "InactiveInfo", "\u0424\u043e\u043d \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439" }, - { "Inactive", "\u041d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439" }, - { "TextOKInfo", "\u0426\u0432\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u0430 '\u0414\u0430'" }, - { "TextOK", "\u0422\u0435\u043a\u0441\u0442 - '\u0414\u0430'" }, - { "TextIssueInfo", "\u0426\u0432\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u0430 '\u041e\u0448\u0438\u0431\u043a\u0430'" }, - { "TextIssue", "\u0422\u0435\u043a\u0441\u0442 - '\u041e\u0448\u0438\u0431\u043a\u0430'" }, - // - { "FontChooser", "\u0412\u044b\u0431\u043e\u0440 \u0448\u0440\u0438\u0444\u0442\u043e\u0432" }, - { "Fonts", "\u0428\u0440\u0438\u0444\u0442\u044b" }, - { "Plain", "\u041e\u0431\u044b\u0447\u043d\u044b\u0439" }, - { "Italic", "\u041d\u0430\u043a\u043b\u043e\u043d\u043d\u044b\u0439" }, - { "Bold", "\u0416\u0438\u0440\u043d\u044b\u0439" }, - { "BoldItalic", "\u0416\u0438\u0440\u043d\u044b\u0439 \u0438 \u041d\u0430\u043a\u043b\u043e\u043d\u043d\u044b\u0439" }, - { "Name", "\u0418\u043c\u044f" }, - { "Size", "\u0420\u0430\u0437\u043c\u0435\u0440" }, - { "Style", "\u0421\u0442\u0438\u0442\u044c" }, - { "TestString", "\u042d\u0442\u043e \u0432\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0442\u0435\u0441\u0442! \u0422\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043d\u0430\u0434\u043f\u0438\u0441\u044c. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "\u0428\u0440\u0438\u0444\u0442" }, - // - { "AdempiereColorEditor", "\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0446\u0432\u0435\u0442\u043e\u0432 Adempiere" }, - { "AdempiereType", "\u0422\u0438\u043f \u0446\u0432\u0435\u0442\u0430" }, - { "GradientUpperColor", "\u0412\u0435\u0440\u0445\u043d\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442" }, - { "GradientLowerColor", "\u041d\u0438\u0436\u043d\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442" }, - { "GradientStart", "\u041d\u0430\u0447\u0430\u043b\u043e \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430" }, - { "GradientDistance", "\u041f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u043a \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430" }, - { "TextureURL", "URL \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b" }, - { "TextureAlpha", "Alpha \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b" }, - { "TextureTaintColor", "\u0426\u0432\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b" }, - { "LineColor", "\u0426\u0432\u0435\u0442 \u043b\u0438\u043d\u0438\u0438" }, - { "LineBackColor", "\u0426\u0432\u0435\u0442 \u0444\u043e\u043d\u0430" }, - { "LineWidth", "\u0428\u0438\u0440\u0438\u043d\u0430 \u043b\u0438\u043d\u0438\u0439" }, - { "LineDistance", "\u041f\u0440\u043e\u043c\u0435\u0436\u0434\u0443\u0442\u043e\u043a \u043c\u0435\u0436\u0434\u0443 \u043b\u0438\u043d\u0438\u044f\u043c\u0438" }, - { "FlatColor", "\u0426\u0432\u0435\u0442 \u0437\u0430\u043b\u0438\u0432\u043a\u0438" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_sl.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_sl.java deleted file mode 100644 index c5a3b89b62..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_sl.java +++ /dev/null @@ -1,132 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Matja\u017e Godec - * @version $Id: PlafRes_sl.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_sl extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Tip ozadja" }, - { "BackColType_Flat", "Barva" }, - { "BackColType_Gradient", "Preliv" }, - { "BackColType_Lines", "\u010crte" }, - { "BackColType_Texture", "Tekstura" }, - // - { "LookAndFeelEditor", "Urejevalnik izgleda" }, - { "LookAndFeel", "Izgled" }, - { "Theme", "Tema" }, - { "EditAdempiereTheme", "Urejanje Adempiere teme" }, - { "SetDefault", "Privzeto ozadje" }, - { "SetDefaultColor", "Barva ozadja" }, - { "ColorBlind", "Color Deficiency" }, - { "Example", "Primer" }, - { "Reset", "Ponastavi" }, - { "OK", "V redu" }, - { "Cancel", "Prekli\u010di" }, - // - { "AdempiereThemeEditor", "Urejanje Adempiere teme" }, - { "MetalColors", "Barve Metal" }, - { "AdempiereColors", "Barve Adempiere" }, - { "AdempiereFonts", "Adempiere pisave" }, - { "Primary1Info", "Sen\u010denje, Lo\u010dilo" }, - { "Primary1", "Primarna 1" }, - { "Primary2Info", "\u010crta s fokusom, Izbran meni" }, - { "Primary2", "Primarna 2" }, - { "Primary3Info", "Izbrana vrstice tabele, Izbran tekst, Ozadje nasvetov" }, - { "Primary3", "Primarna 3" }, - { "Secondary1Info", "\u010crte okvirja" }, - { "Secondary1", "Sekundarno 1" }, - { "Secondary2Info", "Neaktivni zavihki, Izbrana (pritisnjena) polja, Neaktivne meje + tekst" }, - { "Secondary2", "Sekundarno 2" }, - { "Secondary3Info", "Ozadje" }, - { "Secondary3", "Sekundarno 3" }, - // - { "ControlFontInfo", "Pisava za kontrole" }, - { "ControlFont", "Pisava za oznake" }, - { "SystemFontInfo", "Nasveti, listi drevesa" }, - { "SystemFont", "Sistemska pisava" }, - { "UserFontInfo", "Uporabni\u0161ko vne\u0161eni podatki" }, - { "UserFont", "Pisava za polje" }, -// { "SmallFontInfo", "Reporti" }, - { "SmallFont", "Majhna pisava" }, - { "WindowTitleFont", "Pisava naslovov" }, - { "MenuFont", "Pisava menija" }, - // - { "MandatoryInfo", "Ozadje obveznega polja" }, - { "Mandatory", "Obvezno" }, - { "ErrorInfo", "Ozadje polja z napako" }, - { "Error", "Napaka" }, - { "InfoInfo", "Ozadje informacijskih polj" }, - { "Info", "Informacije" }, - { "WhiteInfo", "\u010crte" }, - { "White", "Belo" }, - { "BlackInfo", "\u010crte, tekst" }, - { "Black", "\u010crno" }, - { "InactiveInfo", "Ozadje neaktivnih polj" }, - { "Inactive", "Neaktivno" }, - { "TextOKInfo", "Barva pisave polja V redu" }, - { "TextOK", "Tekst - V redu" }, - { "TextIssueInfo", "Barva teksta napake" }, - { "TextIssue", "Tekst - Napaka" }, - // - { "FontChooser", "Font Chooser" }, - { "Fonts", "Fonts" }, - { "Plain", "Plain" }, - { "Italic", "Italic" }, - { "Bold", "Bold" }, - { "BoldItalic", "Bold & Italic" }, - { "Name", "Ime" }, - { "Size", "Velikost" }, - { "Style", "Stil" }, - { "TestString", "To je samo test. The quick brown Fox is doing something. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "Font" }, - // - { "AdempiereColorEditor", "Adempiere Color Editor" }, - { "AdempiereType", "Color Type" }, - { "GradientUpperColor", "Gradient Upper Color" }, - { "GradientLowerColor", "Gradient Lower Color" }, - { "GradientStart", "Gradient Start" }, - { "GradientDistance", "Gradient Distance" }, - { "TextureURL", "Texture URL" }, - { "TextureAlpha", "Texture Alpha" }, - { "TextureTaintColor", "Texture Taint Color" }, - { "LineColor", "Line Color" }, - { "LineBackColor", "Background Color" }, - { "LineWidth", "Line Width" }, - { "LineDistance", "Line Distance" }, - { "FlatColor", "Flat Color" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res - diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_sr.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_sr.java deleted file mode 100644 index dfa34ec6f4..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_sr.java +++ /dev/null @@ -1,132 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Nikola Petkov - * @version $Id: patch-java-trl-sr_RS.txt,v 1.1 2008/12/05 11:39:16 mgifos Exp $ - */ -public class PlafRes_sr extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "\u0422\u0438\u043F \u043F\u043E\u0437\u0430\u0434\u0438\u043D\u0435" }, - { "BackColType_Flat", "Flat" }, - { "BackColType_Gradient", "\u0413\u0440\u0430\u0434\u0438\u0458\u0435\u043D\u0442" }, - { "BackColType_Lines", "\u041B\u0438\u043D\u0438\u0458\u0435" }, - { "BackColType_Texture", "\u0422\u0435\u043A\u0441\u0442\u0443\u0440\u0435" }, - // - { "LookAndFeelEditor", "\u0415\u0434\u0438\u0442\u043E\u0440 \u0438\u0437\u0433\u043B\u0435\u0434\u0430" }, - { "LookAndFeel", "\u0418\u0437\u0433\u043B\u0435\u0434" }, - { "Theme", "\u0422\u0435\u043C\u0430" }, - { "EditAdempiereTheme", "\u0423\u0440\u0435\u0452\u0438\u0432\u0430\u045A\u0435 Adempiere \u0442\u0435\u043C\u0435" }, - { "SetDefault", "\u0423\u043E\u0431\u0438\u0447\u0430\u0458\u0435\u043D\u0430 \u043F\u043E\u0437\u0430\u0434\u0438\u043D\u0430" }, - { "SetDefaultColor", "\u0411\u043E\u0458\u0430 \u043F\u043E\u0437\u0430\u0434\u0438\u043D\u0435" }, - { "ColorBlind", "Color Deficiency" }, - { "Example", "\u041F\u0440\u0438\u043C\u0435\u0440" }, - { "Reset", "\u041F\u043E\u043D\u0438\u0448\u0442\u0438 \u0438\u0437\u043C\u0435\u043D\u0435" }, - { "OK", "\u0423 \u0440\u0435\u0434\u0443" }, - { "Cancel", "\u041E\u0434\u0443\u0441\u0442\u0430\u043D\u0438" }, - // - { "AdempiereThemeEditor", "\u0423\u0440\u0435\u0452\u0438\u0432\u0430\u045A\u0435 Adempiere \u0442\u0435\u043C\u0435" }, - { "MetalColors", "Metal Colors" }, - { "AdempiereColors", "Adempiere Colors" }, - { "AdempiereFonts", "Adempiere Fonts" }, - { "Primary1Info", "Shadow, Separator" }, - { "Primary1", "Primary 1" }, - { "Primary2Info", "Focus Line, Selected Menu" }, - { "Primary2", "Primary 2" }, - { "Primary3Info", "Table Selected Row, Selected Text, ToolTip Background" }, - { "Primary3", "Primary 3" }, - { "Secondary1Info", "Border Lines" }, - { "Secondary1", "Secondary 1" }, - { "Secondary2Info", "Inactive Tabs, Pressed Fields, Inactive Border + Text" }, - { "Secondary2", "Secondary 2" }, - { "Secondary3Info", "Background" }, - { "Secondary3", "Secondary 3" }, - // - { "ControlFontInfo", "Control Font" }, - { "ControlFont", "Label Font" }, - { "SystemFontInfo", "Tool Tip, Tree nodes" }, - { "SystemFont", "System Font" }, - { "UserFontInfo", "User Entered Data" }, - { "UserFont", "Field Font" }, -// { "SmallFontInfo", "Reports" }, - { "SmallFont", "Small Font" }, - { "WindowTitleFont", "Title Font" }, - { "MenuFont", "Menu Font" }, - // - { "MandatoryInfo", "Mandatory Field Background" }, - { "Mandatory", "Mandatory" }, - { "ErrorInfo", "Error Field Background" }, - { "Error", "Error" }, - { "InfoInfo", "Info Field Background" }, - { "Info", "Info" }, - { "WhiteInfo", "Lines" }, - { "White", "White" }, - { "BlackInfo", "Lines, Text" }, - { "Black", "Black" }, - { "InactiveInfo", "Inactive Field Background" }, - { "Inactive", "Inactive" }, - { "TextOKInfo", "OK Text Foreground" }, - { "TextOK", "Text - OK" }, - { "TextIssueInfo", "Error Text Foreground" }, - { "TextIssue", "Text - Error" }, - // - { "FontChooser", "Font Chooser" }, - { "Fonts", "Fonts" }, - { "Plain", "Plain" }, - { "Italic", "Italic" }, - { "Bold", "Bold" }, - { "BoldItalic", "Bold & Italic" }, - { "Name", "Name" }, - { "Size", "Size" }, - { "Style", "Style" }, - { "TestString", "This is just a Test! The quick brown Fox is doing something. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "Font" }, - // - { "AdempiereColorEditor", "Adempiere Color Editor" }, - { "AdempiereType", "Color Type" }, - { "GradientUpperColor", "Gradient Upper Color" }, - { "GradientLowerColor", "Gradient Lower Color" }, - { "GradientStart", "Gradient Start" }, - { "GradientDistance", "Gradient Distance" }, - { "TextureURL", "Texture URL" }, - { "TextureAlpha", "Texture Alpha" }, - { "TextureTaintColor", "Texture Taint Color" }, - { "LineColor", "Line Color" }, - { "LineBackColor", "Background Color" }, - { "LineWidth", "Line Width" }, - { "LineDistance", "Line Distance" }, - { "FlatColor", "Flat Color" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res - diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_sv.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_sv.java deleted file mode 100644 index 5d6423752a..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_sv.java +++ /dev/null @@ -1,131 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Swedish Translation Texts for Look & Feel - * - * @author Thomas Dilts - * @version $Id: PlafRes_sv.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_sv extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Bakgrundsfïżœrgtyp" }, - { "BackColType_Flat", "Platt" }, - { "BackColType_Gradient", "Toning" }, - { "BackColType_Lines", "Linjer" }, - { "BackColType_Texture", "Struktur" }, - // - { "LookAndFeelEditor", "Utseenderedigeringsprogram" }, - { "LookAndFeel", "Utseendet" }, - { "Theme", "Tema" }, - { "EditAdempiereTheme", "Redigera adempiere tema" }, - { "SetDefault", "Standardbakgrund" }, - { "SetDefaultColor", "Bakgrundsfïżœrg" }, - { "ColorBlind", "Bristfïżœlligfïżœrg" }, - { "Example", "Exempel" }, - { "Reset", "ïżœterstïżœlla" }, - { "OK", "OK" }, - { "Cancel", "Avbryt" }, - // - { "AdempiereThemeEditor", "Adempiere temaredigeringsprogram" }, - { "MetalColors", "Metal fïżœrg" }, - { "AdempiereColors", "Adempiere fïżœrger" }, - { "AdempiereFonts", "Adempiere teckensnitt" }, - { "Primary1Info", "Skugga, avskiljare" }, - { "Primary1", "Primïżœr 1" }, - { "Primary2Info", "Fokus linje, vald meny" }, - { "Primary2", "Primïżœr 2" }, - { "Primary3Info", "Tabel vald rad, vald text, knappbeskrivning bakgrund" }, - { "Primary3", "Primïżœr 3" }, - { "Secondary1Info", "Ram linjer" }, - { "Secondary1", "Sekundïżœr 1" }, - { "Secondary2Info", "Inactiv tabbar, nedtrycktfïżœlt, inactive ram + text" }, - { "Secondary2", "Sekundïżœr 2" }, - { "Secondary3Info", "Bakgrund" }, - { "Secondary3", "Sekundïżœr 3" }, - // - { "ControlFontInfo", "Kontrolteckensnitt" }, - { "ControlFont", "Textetiketter teckensnitt" }, - { "SystemFontInfo", "Knappbeskrivning, Trïżœd gren" }, - { "SystemFont", "System teckensnitt" }, - { "UserFontInfo", "Anvïżœndare angiven data" }, - { "UserFont", "Fïżœlt teckensnitt" }, -// { "SmallFontInfo", "Reports" }, - { "SmallFont", "Liten teckensnitt" }, - { "WindowTitleFont", "Rubrik teckensnitt" }, - { "MenuFont", "Meny teckensnitt" }, - // - { "MandatoryInfo", "Obligatoriskt fïżœlt bakgrund" }, - { "Mandatory", "Obligatorisk" }, - { "ErrorInfo", "Fel fïżœlt bakgrund" }, - { "Error", "Fel" }, - { "InfoInfo", "Information fïżœlt bakgrund" }, - { "Info", "Information" }, - { "WhiteInfo", "Linjer" }, - { "White", "Vit" }, - { "BlackInfo", "Linjer, text" }, - { "Black", "Svart" }, - { "InactiveInfo", "Inactiv fïżœlt bakgrund" }, - { "Inactive", "Inactiv" }, - { "TextOKInfo", "OK text fïżœrgrund" }, - { "TextOK", "Text - OK" }, - { "TextIssueInfo", "Fel text fïżœrgrund" }, - { "TextIssue", "Text - Fel" }, - // - { "FontChooser", "Teckensnittvïżœljare" }, - { "Fonts", "Teckensnitt" }, - { "Plain", "Oformaterad" }, - { "Italic", "Kursiv" }, - { "Bold", "Fet" }, - { "BoldItalic", "Fet & kursiv" }, - { "Name", "Namn" }, - { "Size", "Storlek" }, - { "Style", "Stil" }, - { "TestString", "Denna ïżœr en test! ABCDEFG abcdefg ïżœïżœïżœïżœïżœïżœ. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "Teckensnitt" }, - // - { "AdempiereColorEditor", "Adempiere fïżœrgredigeringsprogram" }, - { "AdempiereType", "Fïżœrgtyp" }, - { "GradientUpperColor", "Toning ïżœverfïżœrg" }, - { "GradientLowerColor", "Toning underfïżœrg" }, - { "GradientStart", "Toning start" }, - { "GradientDistance", "Toning lïżœngd" }, - { "TextureURL", "Struktur URL" }, - { "TextureAlpha", "Struktur Alpha" }, - { "TextureTaintColor", "Struktur flïżœckfïżœrg" }, - { "LineColor", "Linje fïżœrg" }, - { "LineBackColor", "Bakgrundsfïżœrg" }, - { "LineWidth", "Linje bred" }, - { "LineDistance", "Linje lïżœngd" }, - { "FlatColor", "Mattfïżœrg" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_th.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_th.java deleted file mode 100644 index 0caad22d96..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_th.java +++ /dev/null @@ -1,131 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel (Thai) - * - * @author Sureeraya Limpaibul - * @version $Id: PlafRes_th.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_th extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e02\u0e2d\u0e07\u0e1e\u0e37\u0e49\u0e19\u0e2b\u0e25\u0e31\u0e07" }, - { "BackColType_Flat", "Flat" }, - { "BackColType_Gradient", "Gradient" }, - { "BackColType_Lines", "Lines" }, - { "BackColType_Texture", "Texture" }, - // - { "LookAndFeelEditor", "Look & Feel Editor" }, - { "LookAndFeel", "Look & Feel" }, - { "Theme", "Theme" }, - { "EditAdempiereTheme", "Edit Adempiere Theme" }, - { "SetDefault", "Default Background" }, - { "SetDefaultColor", "Background Color" }, - { "ColorBlind", "Color Deficiency" }, - { "Example", "\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07" }, - { "Reset", "Reset" }, - { "OK", "\u0e15\u0e01\u0e25\u0e07" }, - { "Cancel", "\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01" }, - // - { "AdempiereThemeEditor", "Adempiere Theme Editor" }, - { "MetalColors", "Metal Colors" }, - { "AdempiereColors", "Adempiere Colors" }, - { "AdempiereFonts", "Adempiere Fonts" }, - { "Primary1Info", "Shadow, Separator" }, - { "Primary1", "Primary 1" }, - { "Primary2Info", "Focus Line, Selected Menu" }, - { "Primary2", "Primary 2" }, - { "Primary3Info", "Table Selected Row, Selected Text, ToolTip Background" }, - { "Primary3", "Primary 3" }, - { "Secondary1Info", "Border Lines" }, - { "Secondary1", "Secondary 1" }, - { "Secondary2Info", "Inactive Tabs, Pressed Fields, Inactive Border + Text" }, - { "Secondary2", "Secondary 2" }, - { "Secondary3Info", "Background" }, - { "Secondary3", "Secondary 3" }, - // - { "ControlFontInfo", "Control Font" }, - { "ControlFont", "Label Font" }, - { "SystemFontInfo", "Tool Tip, Tree nodes" }, - { "SystemFont", "System Font" }, - { "UserFontInfo", "User Entered Data" }, - { "UserFont", "Field Font" }, -// { "SmallFontInfo", "Reports" }, - { "SmallFont", "\u0e2d\u0e31\u0e01\u0e29\u0e23\u0e02\u0e19\u0e32\u0e14\u0e40\u0e25\u0e47\u0e01" }, - { "WindowTitleFont", "Title Font" }, - { "MenuFont", "\u0e40\u0e21\u0e19\u0e39\u0e2d\u0e31\u0e01\u0e29\u0e23" }, - // - { "MandatoryInfo", "Mandatory Field Background" }, - { "Mandatory", "Mandatory" }, - { "ErrorInfo", "Error Field Background" }, - { "Error", "Error" }, - { "InfoInfo", "Info Field Background" }, - { "Info", "Info" }, - { "WhiteInfo", "Lines" }, - { "White", "White" }, - { "BlackInfo", "Lines, Text" }, - { "Black", "Black" }, - { "InactiveInfo", "Inactive Field Background" }, - { "Inactive", "Inactive" }, - { "TextOKInfo", "OK Text Foreground" }, - { "TextOK", "Text - OK" }, - { "TextIssueInfo", "Error Text Foreground" }, - { "TextIssue", "Text - Error" }, - // - { "FontChooser", "\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e41\u0e1a\u0e1a\u0e2d\u0e31\u0e01\u0e29\u0e23" }, - { "Fonts", "\u0e15\u0e31\u0e27\u0e2d\u0e31\u0e01\u0e29\u0e23" }, - { "Plain", "\u0e18\u0e23\u0e23\u0e21\u0e14\u0e32" }, - { "Italic", "\u0e15\u0e31\u0e27\u0e40\u0e2d\u0e35\u0e22\u0e07" }, - { "Bold", "\u0e15\u0e31\u0e27\u0e2b\u0e19\u0e32" }, - { "BoldItalic", "\u0e15\u0e31\u0e27\u0e2b\u0e19\u0e32 \u0e15\u0e31\u0e27\u0e40\u0e2d\u0e35\u0e22\u0e07" }, - { "Name", "\u0e0a\u0e37\u0e48\u0e2d" }, - { "Size", "\u0e02\u0e19\u0e32\u0e14" }, - { "Style", "\u0e25\u0e31\u0e01\u0e29\u0e13\u0e30\u0e41\u0e1a\u0e1a\u0e2d\u0e31\u0e01\u0e29\u0e23" }, - { "TestString", "This is just a Test! The quick brown Fox is doing something. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "\u0e15\u0e31\u0e27\u0e2d\u0e31\u0e01\u0e29\u0e23" }, - // - { "AdempiereColorEditor", "Adempiere Color Editor" }, - { "AdempiereType", "Color Type" }, - { "GradientUpperColor", "Gradient Upper Color" }, - { "GradientLowerColor", "Gradient Lower Color" }, - { "GradientStart", "Gradient Start" }, - { "GradientDistance", "Gradient Distance" }, - { "TextureURL", "Texture URL" }, - { "TextureAlpha", "Texture Alpha" }, - { "TextureTaintColor", "Texture Taint Color" }, - { "LineColor", "Line Color" }, - { "LineBackColor", "Background Color" }, - { "LineWidth", "Line Width" }, - { "LineDistance", "Line Distance" }, - { "FlatColor", "Flat Color" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_vi.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_vi.java deleted file mode 100644 index ca279dfea0..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_vi.java +++ /dev/null @@ -1,131 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Bui Chi Trung - * @version $Id: PlafRes_vi.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $ - */ -public class PlafRes_vi extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "Lo\u1EA1i mïżœu n\u1EC1n" }, - { "BackColType_Flat", "Ph\u1EB3ng" }, - { "BackColType_Gradient", "D\u1ED1c" }, - { "BackColType_Lines", "\u0110\u01B0\u1EDDng th\u1EB3ng" }, - { "BackColType_Texture", "\u0110an chïżœo" }, - // - { "LookAndFeelEditor", "Cïżœng c\u1EE5 thay \u0111\u1ED5i V\u1EBB ngoïżœi vïżœ C\u1EA3m nh\u1EADn" }, - { "LookAndFeel", "V\u1EBB ngoïżœi vïżœ C\u1EA3m nh\u1EADn" }, - { "Theme", "Ch\u1EE7 \u0111\u1EC1" }, - { "EditAdempiereTheme", "Hi\u1EC7u ch\u1EC9nh ch\u1EE7 \u0111\u1EC1 C\u0103mpia-\u01A1" }, - { "SetDefault", "N\u1EC1n m\u1EB7c nhiïżœn" }, - { "SetDefaultColor", "Mïżœu n\u1EC1n" }, - { "ColorBlind", "Mïżœ mïżœu" }, - { "Example", "Vïżœ d\u1EE5" }, - { "Reset", "C\u1EA5u hïżœnh l\u1EA1i" }, - { "OK", "\u0110\u1ED3ng ïżœ" }, - { "Cancel", "H\u1EE7y" }, - // - { "AdempiereThemeEditor", "Cïżœng c\u1EE5 thay \u0111\u1ED5i ch\u1EE7 \u0111\u1EC1 C\u0103mpia-\u01A1" }, - { "MetalColors", "B\u1ED9 mïżœu ïżœnh kim" }, - { "AdempiereColors", "B\u1ED9 mïżœu C\u0103mpia-\u01A1" }, - { "AdempiereFonts", "B\u1ED9 Font C\u0103mpia-\u01A1" }, - { "Primary1Info", "Bïżœng, Tïżœch bi\u1EC7t" }, - { "Primary1", "Ch\u1EE7 \u0111\u1EA1o 1" }, - { "Primary2Info", "\u0110\u01B0\u1EDDng tiïżœu \u0111i\u1EC3m, Th\u1EF1c \u0111\u01A1n \u0111\u01B0\u1EE3c ch\u1ECDn" }, - { "Primary2", "Ch\u1EE7 \u0111\u1EA1o 2" }, - { "Primary3Info", "Table Selected Row, Selected Text, ToolTip Background" }, - { "Primary3", "Primary 3" }, - { "Secondary1Info", "\u0110\u01B0\u1EDDng biïżœn" }, - { "Secondary1", "Ph\u1EE5 1" }, - { "Secondary2Info", "Inactive Tabs, Pressed Fields, Inactive Border + Text" }, - { "Secondary2", "Ph\u1EE5 2" }, - { "Secondary3Info", "N\u1EC1n" }, - { "Secondary3", "Ph\u1EE5 3" }, - // - { "ControlFontInfo", "Control Font" }, - { "ControlFont", "Label Font" }, - { "SystemFontInfo", "Tool Tip, Tree nodes" }, - { "SystemFont", "System Font" }, - { "UserFontInfo", "User Entered Data" }, - { "UserFont", "Field Font" }, -// { "SmallFontInfo", "Reports" }, - { "SmallFont", "Small Font" }, - { "WindowTitleFont", "Title Font" }, - { "MenuFont", "Menu Font" }, - // - { "MandatoryInfo", "N\u1EC1n c\u1EE7a tr\u01B0\u1EDDng b\u1EAFt bu\u1ED9c" }, - { "Mandatory", "B\u1EAFt bu\u1ED9c" }, - { "ErrorInfo", "N\u1EC1n c\u1EE7a tr\u01B0\u1EDDng b\u1ECB l\u1ED7i" }, - { "Error", "L\u1ED7i" }, - { "InfoInfo", "N\u1EC1n c\u1EE7a tr\u01B0\u1EDDng thïżœng tin" }, - { "Info", "Thïżœng tin" }, - { "WhiteInfo", "\u0110\u01B0\u1EDDng th\u1EB3ng" }, - { "White", "Tr\u1EAFng" }, - { "BlackInfo", "\u0110\u01B0\u1EDDng th\u1EB3ng, \u0110o\u1EA1n v\u0103n" }, - { "Black", "Black" }, - { "InactiveInfo", "Inactive Field Background" }, - { "Inactive", "Inactive" }, - { "TextOKInfo", "OK Text Foreground" }, - { "TextOK", "Text - OK" }, - { "TextIssueInfo", "Error Text Foreground" }, - { "TextIssue", "Text - Error" }, - // - { "FontChooser", "Ch\u1ECDn Font" }, - { "Fonts", "Fonts" }, - { "Plain", "Plain" }, - { "Italic", "Italic" }, - { "Bold", "Bold" }, - { "BoldItalic", "Bold & Italic" }, - { "Name", "Tïżœn" }, - { "Size", "Kïżœch th\u01B0\u1EDBc" }, - { "Style", "Ki\u1EC3u" }, - { "TestString", "\u0110ïżœy ch\u1EC9 lïżœ ph\u1EA7n th\u1EED nghi\u1EC7m" }, - { "FontString", "Font" }, - // - { "AdempiereColorEditor", "Cïżœng c\u1EE5 thay \u0111\u1ED5i mïżœu C\u0103mpia-\u01A1" }, - { "AdempiereType", "Lo\u1EA1i mïżœu" }, - { "GradientUpperColor", "Gradient Upper Color" }, - { "GradientLowerColor", "Gradient Lower Color" }, - { "GradientStart", "Gradient Start" }, - { "GradientDistance", "Gradient Distance" }, - { "TextureURL", "Texture URL" }, - { "TextureAlpha", "Texture Alpha" }, - { "TextureTaintColor", "Texture Taint Color" }, - { "LineColor", "Line Color" }, - { "LineBackColor", "Background Color" }, - { "LineWidth", "Chi\u1EC1u r\u1ED9ng \u0111\u01B0\u1EDDng" }, - { "LineDistance", "Chi\u1EC1u xa \u0111\u01B0\u1EDDng" }, - { "FlatColor", "Mïżœu ph\u1EB3ng" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_zh.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_zh.java deleted file mode 100644 index 310d6a835c..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_zh.java +++ /dev/null @@ -1,131 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author Kirin Lin - * @version $Id: PlafRes_zh.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $ - */ -public class PlafRes_zh extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "\u80cc\u666f\u984f\u8272" }, - { "BackColType_Flat", "\u55ae\u8272" }, - { "BackColType_Gradient", "\u6f38\u5c64" }, - { "BackColType_Lines", "\u689d\u7d0b" }, - { "BackColType_Texture", "\u5716\u6848" }, - // - { "LookAndFeelEditor", "\u5916\u89c0\u7de8\u8f2f\u5668" }, - { "LookAndFeel", "\u5916\u89c0" }, - { "Theme", "\u4f48\u666f" }, - { "EditAdempiereTheme", "\u7de8\u8f2f Adempiere \u4f48\u666f" }, - { "SetDefault", "\u8a2d\u6210\u9810\u8a2d\u80cc\u666f" }, - { "SetDefaultColor", "\u80cc\u666f\u984f\u8272" }, - { "ColorBlind", "\u8272\u5dee" }, - { "Example", "\u7bc4\u4f8b" }, - { "Reset", "\u91cd\u7f6e" }, - { "OK", "\u78ba\u5b9a" }, - { "Cancel", "\u53d6\u6d88" }, - // - { "AdempiereThemeEditor", "Adempiere \u4f48\u666f\u7de8\u8f2f\u5668" }, - { "MetalColors", "\u91d1\u5c6c\u8272\u7cfb" }, - { "AdempiereColors", "Adempiere \u984f\u8272" }, - { "AdempiereFonts", "Adempiere \u5b57\u578b" }, - { "Primary1Info", "\u9670\u5f71, \u5206\u9694" }, - { "Primary1", "\u4e3b\u8981\u8272 1" }, - { "Primary2Info", "\u7126\u9ede\u7dda\u6846, \u9078\u55ae\u7126\u9ede" }, - { "Primary2", "\u4e3b\u8981\u8272 2" }, - { "Primary3Info", "\u9078\u53d6\u7684\u884c, \u9078\u53d6\u7684\u5b57, \u5de5\u5177\u63d0\u793a\u80cc\u666f" }, - { "Primary3", "\u4e3b\u8981\u8272 3" }, - { "Secondary1Info", "\u908a\u6846" }, - { "Secondary1", "\u6b21\u8981\u8272 1" }, - { "Secondary2Info", "\u975e\u6d3b\u52d5 Tabs, \u6309\u4e0b\u7684\u6309\u9215\u908a\u7de3, \u975e\u6d3b\u52d5\u5340\u908a\u6846 + \u6587\u5b57" }, - { "Secondary2", "\u6b21\u8981\u8272 2" }, - { "Secondary3Info", "\u80cc\u666f" }, - { "Secondary3", "\u6b21\u8981\u8272 3" }, - // - { "ControlFontInfo", "\u63a7\u5236\u8a0a\u606f\u5b57\u578b" }, - { "ControlFont", "\u6a19\u7c64\u5b57\u578b" }, - { "SystemFontInfo", "\u5de5\u5177\u63d0\u793a, \u6a39\u72c0\u76ee\u9304" }, - { "SystemFont", "\u7cfb\u7d71\u5b57\u578b" }, - { "UserFontInfo", "\u4f7f\u7528\u8005\u8f38\u5165\u8cc7\u6599" }, - { "UserFont", "\u6b04\u4f4d\u5b57\u578b" }, -// { "SmallFontInfo", "\u5831\u8868" }, - { "SmallFont", "\u5c0f\u5b57\u578b" }, - { "WindowTitleFont", "\u6a19\u984c\u5b57\u578b" }, - { "MenuFont", "\u9078\u55ae\u5b57\u578b" }, - // - { "MandatoryInfo", "\u9078\u9805\u6b04\u4f4d\u80cc\u666f" }, - { "Mandatory", "\u9078\u9805" }, - { "ErrorInfo", "\u932f\u8aa4\u8a0a\u606f\u80cc\u666f" }, - { "Error", "\u932f\u8aa4\u8a0a\u606f" }, - { "InfoInfo", "\u4e00\u822c\u8a0a\u606f\u6b04\u4f4d\u80cc\u666f" }, - { "Info", "\u4e00\u822c\u8a0a\u606f" }, - { "WhiteInfo", "\u7dda\u689d" }, - { "White", "\u767d" }, - { "BlackInfo", "\u7dda\u689d, \u6587\u5b57" }, - { "Black", "\u9ed1" }, - { "InactiveInfo", "\u975e\u6d3b\u52d5\u6b04\u4f4d\u80cc\u666f" }, - { "Inactive", "\u975e\u6d3b\u52d5" }, - { "TextOKInfo", "\u78ba\u5b9a\u9805\u524d\u666f\u8272" }, - { "TextOK", "\u6587\u5b57 - \u78ba\u5b9a" }, - { "TextIssueInfo", "\u932f\u8aa4\u9805\u524d\u666f\u8272" }, - { "TextIssue", "\u6587\u5b57 - \u932f\u8aa4" }, - // - { "FontChooser", "\u5b57\u578b\u8a2d\u5b9a" }, - { "Fonts", "\u5b57\u9ad4" }, - { "Plain", "\u4e00\u822c" }, - { "Italic", "\u659c\u9ad4" }, - { "Bold", "\u7c97\u9ad4" }, - { "BoldItalic", "\u7c97\u659c\u9ad4" }, - { "Name", "\u540d\u7a31" }, - { "Size", "\u5927\u5c0f" }, - { "Style", "\u98a8\u683c" }, - { "TestString", "\u9019\u662f\u6e2c\u8a66! The quick brown Fox is doing something. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "\u5b57\u9ad4" }, - // - { "AdempiereColorEditor", "Adempiere \u984f\u8272\u7de8\u8f2f\u5668" }, - { "AdempiereType", "\u984f\u8272\u7a2e\u985e" }, - { "GradientUpperColor", "\u6f38\u5c64\u8272 1" }, - { "GradientLowerColor", "\u6f38\u5c64\u8272 2" }, - { "GradientStart", "\u6f38\u5c64\u65b9\u5411" }, - { "GradientDistance", "\u9593\u8ddd" }, - { "TextureURL", "\u5716\u6848 URL" }, - { "TextureAlpha", "\u5716\u6848\u900f\u660e\u5ea6" }, - { "TextureTaintColor", "\u5716\u6848\u8457\u8272" }, - { "LineColor", "\u7dda\u689d\u984f\u8272" }, - { "LineBackColor", "\u80cc\u666f\u984f\u8272" }, - { "LineWidth", "\u7dda\u689d\u5bec\u5ea6" }, - { "LineDistance", "\u7dda\u689d\u9593\u8ddd" }, - { "FlatColor", "\u55ae\u8272" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_zh_CN.java b/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_zh_CN.java deleted file mode 100644 index a8639566b7..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/PlafRes_zh_CN.java +++ /dev/null @@ -1,131 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -import java.util.ListResourceBundle; - -/** - * Translation Texts for Look & Feel - * - * @author ZhaoXing Meng - * @version $Id: PlafRes_zh_CN.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class PlafRes_zh_CN extends ListResourceBundle -{ - /** The data */ - static final Object[][] contents = new String[][] - { - { "BackColType", "\u80cc\u666f\u989c\u8272" }, - { "BackColType_Flat", "\u5355\u8272" }, - { "BackColType_Gradient", "\u6e10\u53d8" }, - { "BackColType_Lines", "\u6761\u7eb9" }, - { "BackColType_Texture", "\u56fe\u6587" }, - // - { "LookAndFeelEditor", "\u5916\u89c2\u7f16\u8f91\u5668" }, - { "LookAndFeel", "\u5916\u89c2" }, - { "Theme", "\u5e03\u666f" }, - { "EditAdempiereTheme", "\u7f16\u8f91 Adempiere \u5e03\u666f" }, - { "SetDefault", "\u8bbe\u6210\u9884\u5b9a\u80cc\u666f" }, - { "SetDefaultColor", "\u80cc\u666f\u989c\u8272" }, - { "ColorBlind", "\u8272\u5dee" }, - { "Example", "\u8303\u4f8b" }, - { "Reset", "\u91cd\u8bbe" }, - { "OK", "\u786e\u8ba4" }, - { "Cancel", "\u64a4\u6d88" }, - // - { "AdempiereThemeEditor", "Adempiere \u5e03\u666f\u7f16\u8f91\u5668" }, - { "MetalColors", "\u91d1\u5c5e\u8272\u7cfb" }, - { "AdempiereColors", "Adempiere \u989c\u8272" }, - { "AdempiereFonts", "Adempiere \u5b57\u4f53" }, - { "Primary1Info", "\u9634\u5f71, \u5206\u9694" }, - { "Primary1", "\u4e3b\u8981\u8272 1" }, - { "Primary2Info", "\u7126\u70b9\u7ebf\u6846, \u83dc\u5355\u7126\u70b9" }, - { "Primary2", "\u4e3b\u8981\u8272 2" }, - { "Primary3Info", "\u9009\u62e9\u7684\u884c, \u9009\u62e9\u7684\u6587\u5b57, \u5de5\u5177\u63d0\u793a\u80cc\u666f" }, - { "Primary3", "\u4e3b\u8981\u8272 3" }, - { "Secondary1Info", "\u8fb9\u6846" }, - { "Secondary1", "\u6b21\u8981\u8272 1" }, - { "Secondary2Info", "\u975e\u6d3b\u52a8\u6807\u7b7e, \u6309\u4e0b\u7684\u6309\u94ae\u8fb9\u7f18, \u975e\u6d3b\u52a8\u533a\u8fb9\u6846 + \u6587\u5b57" }, - { "Secondary2", "\u6b21\u8981\u8272 2" }, - { "Secondary3Info", "\u80cc\u666f" }, - { "Secondary3", "\u6b21\u8981\u8272 3" }, - // - { "ControlFontInfo", "\u63a7\u5236\u4fe1\u606f\u5b57\u4f53" }, - { "ControlFont", "\u6807\u7b7e\u5b57\u4f53" }, - { "SystemFontInfo", "\u5de5\u5177\u63d0\u793a, \u6811\u72b6\u76ee\u5f55" }, - { "SystemFont", "\u7cfb\u7edf\u5b57\u4f53" }, - { "UserFontInfo", "\u4f7f\u7528\u8005\u8f93\u5165\u6570\u636e" }, - { "UserFont", "\u5b57\u6bb5\u5b57\u4f53" }, -// { "SmallFontInfo", "\u62a5\u8868" }, - { "SmallFont", "\u5c0f\u5b57\u4f53" }, - { "WindowTitleFont", "\u6807\u9898\u5b57\u4f53" }, - { "MenuFont", "\u83dc\u5355\u5b57\u4f53" }, - // - { "MandatoryInfo", "\u9009\u9879\u5b57\u6bb5\u80cc\u666f" }, - { "Mandatory", "\u9009\u9879" }, - { "ErrorInfo", "\u9519\u8bef\u5b57\u6bb5\u80cc\u666f" }, - { "Error", "\u9519\u8bef\u4fe1\u606f" }, - { "InfoInfo", "\u4e00\u822c\u4fe1\u606f\u5b57\u6bb5\u80cc\u666f" }, - { "Info", "\u4e00\u822c\u4fe1\u606f" }, - { "WhiteInfo", "\u7ebf\u6761" }, - { "White", "\u767d" }, - { "BlackInfo", "\u7ebf\u6761, \u6587\u5b57" }, - { "Black", "\u9ed1" }, - { "InactiveInfo", "\u975e\u6d3b\u52a8\u5b57\u6bb5\u80cc\u666f" }, - { "Inactive", "\u975e\u6d3b\u52a8" }, - { "TextOKInfo", "\u786e\u8ba4 - \u524d\u666f\u8272" }, - { "TextOK", "\u6587\u5b57 - \u786e\u8ba4" }, - { "TextIssueInfo", "\u9519\u8bef\u6587\u5b57\u524d\u666f\u8272" }, - { "TextIssue", "\u6587\u5b57 - \u9519\u8bef" }, - // - { "FontChooser", "\u5b57\u4f53\u9009\u62e9" }, - { "Fonts", "\u5b57\u4f53" }, - { "Plain", "\u666e\u901a" }, - { "Italic", "\u659c\u4f53" }, - { "Bold", "\u7c97\u4f53" }, - { "BoldItalic", "\u7c97\u659c\u4f53" }, - { "Name", "\u540d\u79f0" }, - { "Size", "\u5927\u5c0f" }, - { "Style", "\u7c7b\u578b" }, - { "TestString", "\u8fd9\u662f\u6d4b\u8bd5! The quick brown Fox is doing something. 12,3456.78 LetterLOne = l1 LetterOZero = O0" }, - { "FontString", "\u5b57\u4f53" }, - // - { "AdempiereColorEditor", "Adempiere \u989c\u8272\u7f16\u8f91\u5668" }, - { "AdempiereType", "\u989c\u8272\u79cd\u7c7b" }, - { "GradientUpperColor", "\u6e10\u589e\u8272 1" }, - { "GradientLowerColor", "\u6e10\u51cf\u8272 2" }, - { "GradientStart", "\u6e10\u589e\u65b9\u5411" }, - { "GradientDistance", "\u95f4\u8ddd" }, - { "TextureURL", "\u56fe\u6848 URL" }, - { "TextureAlpha", "\u56fe\u6848\u900f\u660e\u5ea6" }, - { "TextureTaintColor", "\u56fe\u6848\u7740\u8272" }, - { "LineColor", "\u7ebf\u6761\u989c\u8272" }, - { "LineBackColor", "\u80cc\u666f\u989c\u8272" }, - { "LineWidth", "\u7ebf\u6761\u5bbd\u5ea6" }, - { "LineDistance", "\u7ebf\u6761\u95f4\u8ddd" }, - { "FlatColor", "\u5355\u8272" } - }; - - /** - * Get Contents - * @return contents - */ - public Object[][] getContents() - { - return contents; - } -} // Res diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/RubyTheme.java b/org.adempiere.ui.swing/src/org/compiere/plaf/RubyTheme.java deleted file mode 100644 index 332b3adee7..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/RubyTheme.java +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.plaf; - -/* - * @(#)RubyTheme.java 1.9 04/07/26 - */ - -import javax.swing.plaf.ColorUIResource; -import javax.swing.plaf.metal.DefaultMetalTheme; - -/** - * This class describes a theme using red colors. - * - * @version 1.9 07/26/04 - * @author Jeff Dinkins - */ -public class RubyTheme extends DefaultMetalTheme { - - public String getName() { return "Ruby"; } - - private final ColorUIResource primary1 = new ColorUIResource(80, 10, 22); - private final ColorUIResource primary2 = new ColorUIResource(193, 10, 44); - private final ColorUIResource primary3 = new ColorUIResource(244, 10, 66); - - protected ColorUIResource getPrimary1() { return primary1; } - protected ColorUIResource getPrimary2() { return primary2; } - protected ColorUIResource getPrimary3() { return primary3; } - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/icons/CL16.gif b/org.adempiere.ui.swing/src/org/compiere/plaf/icons/CL16.gif deleted file mode 100644 index 27d903c3e2cf63b6a22cafb96e0a7b3b5a190f3b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 929 zcmV;S177@zP)WFU8GbZ8({Xk{QrNlj4iWF>9@00RX{L_t(I%Vm?zYhz^; z#-I1|e!aQ(W6 zs@R1EoiZ(qg`|x)$z*QRo80@pE@m2wb5`fTd46y>&qMIP+Su5jNs`=}pPzrPTCL7< z&T)2jcC^30|8=|F{$+W2Szp~JSBJH=wb#QiTx~X+Z$wc9N+|%q7=t*DvA4JP)8XOa z-KC|aUoSQ6vRPeS{mA$IuND^<=fW_YK#eiT^BjyZl*{GmBuPGLHk*HJZ*TuO0j#X7 zyeg&KYBUOL9-&}yG^Yb(na1sz0N0g( z)*89iIKQ|+p63X|5aaRqMQ&LZbzK)qDcs^0c&*~&WXKS@0$(0<@bI4}2(1EO3`V07 z`rR&U+Xkf+gTWxFwANY(K{@AOjA1kyVK^M(1(9RM%~5hVX2PehwQUjWFU8GbZ8({Xk{QrNlj4iWF>9@00;?5L_t(o!=+bUY#dh= z{_g+G?s}cE*Xyq1rmkb+B#QE5HHlgwq*5qEGzgyP6A!%b#5)f>1gVOMgoKorLbLY;v zVHiG1Dg9QhRy+3SqmPc)YBf|U6>!cGMG<`8$DKQO?%ug`=XbvEUkHNWk0(x?==@&* zUVZgdv9hvq%oy|IdcA(|@ZrO#*XtmJfRN3fT5AzS5w2gqj@jASYwPRlCstQiFP=Je zD*N03UVQPz(e?H9pEJguIdI?rnVy~o=e(p$*z*EPTecU7-+4bltR5;C%*6RCWL(b$dMy| zdFP#X7C#lhnKNhhBuVmnrPSo!y?Ze}KHfborF6@AVToQ4#u!ja;dvg`*4F9(zBw~9 zbMexpOUn-gaQgJ=;UEZJE0@b(Xfzs_n3w=#43yHou@FjWS2hAEEI}!SloDYWRw<=V z?A^QfSC=ne?rZ|^_S`T2PZ0JH!wH#hf$we~xX<6wArxa)AmX*uTrA!sLg*Th=uO>+RC zlx_lAtJP30mr*K}o;`T*;NyK3xNzYDZ?#&#AcRbnN+pbskHc{sNGTzugb)IR5S;(} zM>zZLJdQl#!4-7Vz4wmRS`b2Dj6t5?1DzxZf*@d&(ub#~r(d~x^{U|j5XbQz08cuO z1Eo|KIp-XdQfRG_=QL{W5H2tk!n5JJFO3&!rbN1o@PlmdjHA}Mms(MdD>^ba?YX^VH{w1}Fb?8n+ao{)( zgb?`lPJtg?YT~79pTKhk%925GikaBPF9AP$dK^+t9|M)lM+sscu%=m>Ys1K+@@;*q>60EX%+-ht@jg zuIn1DwWgHPVo~o#{@NO*2P$}MY_yO0ZZ5Sk*XrQravOe};poFvlmzR3mun5*_mRYL zSGf=Zj4>oh0sw7F=_)Um%Xt(*Wn zBYeD`z+nWxxzWUg=U|&+$g>1A>%enZpK>8YH!KMu%e7i9r=z2z8Rz_Jmm2SbD5PLR z;GQEbE-s?gYJp}QJoQK!og_t;rikMX=091%t&f{vS%g|iK=m+bF;d!P|Esrd-OA{$ zUAwFh;RW@4gjrI>n+doVq=U`d7k%Wv|eizM72>4j#aULtcsg!IfRhi(-&irTkaDO zq9{6l{rdIWT>vk?{IaH$KBu)_OVhMl%@ilucqLnb*i|3EzQ!P$v4s%#))mRDkUYgDob#9V?Ai0d@#DugSH-ilvm-$eyu=v$n&){?N^MfwtGIVwR6-l8=0c(br&*qbA^>JfUcp!h$IhiZN!u7{l*}sAh~A&bj8CgL95N n&r_}SO1WIN588MC{{8en2DVv(%1P7t00000NkvXXu0mjfVR0cm diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/icons/Cancel24.gif b/org.adempiere.ui.swing/src/org/compiere/plaf/icons/Cancel24.gif deleted file mode 100644 index d91a52dc0c631b17dc1132962d0b4495ab7c4221..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1268 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 O0000W~QdMmlr4dytt0lBR3q?&; zsf}7ieW{ceqQ0~w%0ngR(l(+>6RT|+k)U#E5K0IT8=Mf^q}b(RJRV=>K69@7oZW{E z6%PeG5mk@0w56kc*8i=4U(N#l&kxlzdElw1LXir#G9KKfp!(p+CIA4}as(RoJ?ph< z1O7I&f4_Oh0lvTIXM4f;uUc2F*Hc}+k+#-Wgu^;CM({lsi;Ii6bn(1#X=2n?p8Ult zFa3J(jsOe{JflYw)=*=zShA`mbU-k=^sX0S3bG^fyY9h&Y0*p?-h1EjYvd&-0xsN}5e{ec8zp`u9n(Vo=?+@1vuxr;( zdmq{sySgZ`X-yEFtvWOgk1=u?K@veSA{RswfCnfq-Vjh%=E~LCoS`1w+!r}> z`egsc4Sj>7qo=I@ro(Oqz;w2~xpQOK_66FLgqDN`0whSeMC33|HYc(f!R7=@<79G1 zR#?~UctgM_n@*u@OS`XsbC~ID`%QIj>OTwYZ0%eZ%2h0^Y}4Vx_lPN%Kn_7UM6fv{ zi!o+0P8Ja?jWdIDG6RBDf;y{S&XkIM_uZ#~={xJ+gud6+5RKznriy?F03ZoPF5|En zk;92O#FS(p7l7|GQp#7bUC(1g#h|W*3RRm{G^d)Oyw!CBDCI>pp}|u&OviJALUW1W z5XfPSY{p=J20;=aPXl~c`BbR53&8+ajL0`#54zx_d_P(@05PouWhWVvm|mz_@rdpL z%pro!h%5%OI3t@Fa~VM@U-?0l0G~0c*1ZRa_*l7=MN?FF77CV; zEm~y&Hi2x;$YdNQ=VWLM6-Ror^Ck1VCFRVT6^W*xu2q7Jnai8PTCP~O7}F-}2Jk%d zx7RL?mRB}6dR!yt@?tf=@vcNFq!Z7Tt#q;MPAyjKiMhNvTru2n!C5w9&wr&dH~DBl zXojvc;|pzxI6l^@7iZ|Y^bJcm^55Je(FYX)}8FA}7hJYg1-a35r zueOloU{^~#GCY|bHykfJezouxm?|xcg}XZ2k`E^1(H;)UgKOs^&36r^nqq64qWZ=c zo_~(p(%U&WIB0zCpV5vzKj{tWp?`dH$8JN3$mEKqfFjN_hUtt&LRvl?;3b_4Ly)_H zc+f9d648MEqka3H6{TYF$yZ+d&7W_TpWP1N)t8?C*mbS%o_zO+NH&HNnVfaiHVO$w zN(#;#oeP7QYhS!Lk#s%h(}sZPo){lDi-q#w?ZlS^0089E>ACc^SXl6oRGyWdnJs7M z(n(@WGF`dv9Xr~do}Hc4HBsTj+OAxgCIxwRDY=&f@bb(1b5i;r&s>|KWevgAhEs`s z^x?6uUHa#H+b(``bm!Rk$tPB?jOqkRaAG~DPJIy589rD_Zf&U@k?op$|ML2Q6W`mj zV^yjpsV__mICk-FrhqlwD-exEzvwzub@1)O*BsXwdU5c%**o47Zr}0v!C0c_v4^*8 zK~K+GG)5!fTmvH@n_Iv;Zy(0^_{8P;jK1#Bp%?5s>Hq+=Hs>GOve|~O7~Xi}PslEm z;7Sh-4FL$vK|VL-<*a9NcX#vCnx=$dOrcyhK}f5*DU#?W3N0#5)c%sGQnK9pimif5HF z4xc%b`Q`k4vHV$+3KxK^jqc}hKnD=0MR0n$WKK?IhdVoaWpi_P-|pQ%*EVf>1k=-H zJDsi^IC5m<)oRriweP65#MgsrP)i1&8>;`03jjjtbb7j@qvM{jv9Z?C(NRC2&yO8H ze*BM~=Xn79n$UFzRPCK#bEB>$pqi*&8$}I72M}m)Z*TT}pJy_eVoksWVAn#{!U162 wYzgYQ39nnK)ttN0UffXS^-8b1am$VPZ%s-(_>=>Px# diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/icons/Ok24.gif b/org.adempiere.ui.swing/src/org/compiere/plaf/icons/Ok24.gif deleted file mode 100644 index 027d18f53194005ce4fd7feb1cacdd34079a2f86..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 936 zcmV;Z16TZsP)rlw3&J^L?ECq}sjrCW$9hBY3;Tn5Lvb!x^KyB%hAhV| z8)n;2+CN!iKiJ#|Gy1Q%5WKm#GFwAdYlLzO* z9noC6I#=U%g4;|0L@*fxAlSsTEC=1e8b5M?DJAbNU77ph+B^E%+B&~`|6Y0~?l_`Z zzB*rX#UzK3AQ0^SofFFdicQcBAMgV_pU-`_vRb-%X=YyL3Zl~A3*TN_XD1@{hT>8> z&E?9QHBY|5$-2NkO#~2+VOUT9)q3t5V?O2ehGO|b?%S2s(#?hWMKM;Ggd=lIdZ_eX ziqsp5yY2`tcr%>A1&BcVpKd9Fwt;@ydhTbLxwW|w8vg!=V|T8sUjC@Guq2B4aR3%l zxRBCiQlZl8jw00?4$tLebNQ`OZM-nc1+me)~`>$F|gAsmC}ugu{q93BFoI-7$sR3QM#+Qw>rK)f&&1* z{x0tHgRsh7Q_iablhQpL4oA3fq-3t5%GAu*^7PaKlaBXdfCz|_U4(I0Z$Iw%X{wLm z0Ko6xOYQY4eccbjs&I8#DUV6%9g9dQSusCJ((wQ~m`;mfyn{iwr~iE1@ss2v4geeg zUPOjfA+xfl9OgO-L?cQH7n}=#EXWd!jW8H?&>QshACEeI9H*z^hk@gfsOm^tc0J96 zumB8-V-F4gVcK5jZWPRE{~0000c51Uox{ZvFPmABOQO@lyk*M)EF8k`(QBS3i09%n#3r zpBXqU67(ap_3&?hFo@2LpX)uSHxw@vy&uw42XT~sa`d%&J=Q-U(WIS3N#DKz0000< KMNUMnLSTaOowC6I diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/icons/Question.gif b/org.adempiere.ui.swing/src/org/compiere/plaf/icons/Question.gif deleted file mode 100644 index dc19aa1706d0f5e2a4b28ded5b126c29cd56194f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1482 zcmV;*1vUDKP)=kG(Ola9m-rMN!$C11Xr@Bf|e`~A=VlJmju z@_!aF+ZQd9sH*US5G=|U*xq)S!Cwu)GEsE5yMN)j%}Ye~8W+x-{CYBzX>L1=eXF^Y z*#KxNJvFNzSfqaSHsaz*;>q>%b(QC5lS`S!?A@+Ve6LT*7&3PQ>!Dct-&&lYl3dc*1QDYuFiXB%fvUj|U;2 z#g)6Pc&Za!mPzc60q7bBBdy75=f7vLtD49*bdp`L0Xw<^=i9SH7qwRF8n4_D0Lvue zjW=&LG8a_}ImX)efKU)ZkY2eDoIHB^g7DQg{@F6ApK}0R6E8=amQ_1LA7MvVkgZ#f z5L2hvj<01heh<#@XG9m)M|EB4ol^kIq^@G&vitS#z7RNh((QXo#f1?D;+ky*8GYF~_e#=M0sEoUF) zzS{eEcY@Dw~qax%?3bg>?HKPMtc%(9jS&ckZOOx0k-YKDKV%%J}#=Cr+Fo zyJ|0}I*gpBs=m3t|1mbt8bEh@daJ4xm%b9)b3Ch9E%oPCV@L#?YD8TtSejj{IKr7^G9i`(r6VE69b zSe8XB7Ne`H3n2u#z{oL3Q$H@;<}@nM``qIBe@ zkKcg<2RL@@7~yc3qeqWo7{=7NFNVGR378zC!c*{QUjKf}#Q4Pks=_0o#cLAs(rKh> zFy6kaRCLlWRlw2+EVcngu4=ZXH1p{~OO`BQ$BrEwI&=tCRm+Ocl)|#VAcJ+t z(Mv>XV>P(_~&a>^&`6qiQ_+<+Hw6@6N9@2JH%QA}3+Oca1TFbQOUERZYu^0(U= ki61CG0GL*0*x$B%4=3XEQPtwWDgXcg07*qoM6N<$f(_BmO8@`> diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/icons/Warn.gif b/org.adempiere.ui.swing/src/org/compiere/plaf/icons/Warn.gif deleted file mode 100644 index a05e160c2070e197599c5fd98b45958af0da4910..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1377 zcmV-n1)lneP)6jv0-e|KhfXTN5%4RO;f>*i~TCP>z(RfwO(fCWQog*+6~q9~DAK}`&$ zR_M3%p%0~fkP3Fdmp)bS$>K*|5+YG!@Z%v-G{&YXnyA5KGjVt4_95AA%t~7mV=45& zpW&W+&;9@BoHKW3;D7sDle2NeU=0t!A z^MYk%O^(~Qk>lgInwk)*3PRv+X+b8Fi2i=^OG+9{D0%4ugre*(ip7lh#fxZ*7vo&N ze!?#V&gyC$t5#w4^f14))TyZI7cW(S36a;!%NxbDYsh30cXKmBQ4m5P#KckJZD|21 zv9Dhz6pg-TLgh;nplI5sh2`aX{K^%y>S`P-R}zoMX>D!g%$YNcjg6tjV(1$-@U*Xw zP$;Bm4#&Zla#ovAe!8kEd3E7Jc>(0LW5?vpn>S^9d%FZAAUirbWPg9Zym|Vxyr3xZ zQbB=it*DSDte$lSG+qBPTwJVLy}g-^7eZhdMrMuA=R*jAR#t{<(jZ zF=r#dgg3&m*rr5x_e8fhH)m?@^ZA|;kZwq$xf$VflIZCn9F0~3Z_ikO)8jc9Dku=+ zeSJ7&+6N27~yvZ^s@PAz<5h4dZij;=3Wso|~F?;N56-brTmaB2y`hLx)fd zBa0{!iLh?nI-=2N)|?)TF?#eUsRs}6mXrhr@82Ih4xN9S0TWbjZthpP4hPA>L0t9q zs09U?yH67g4-a$r@L`S|Il_}CPo61_5CSz2z`tu3wq@b7Ec`h+pO|3$lM=jNv~+1j zyt5PG_2S;SGm9LcyStmSXV22!-cDCnSJoOK1pbBw)L@XOw{9^%9G(X>|78hG(EY*S zFOj^wfYsB3r?C;erY4JA2tg)js!KOm z){)~d`rL0q6Lwd=_11TytqtjLklWUV;`e8fPsj88X&;FMzb#)*a$o?;%DCFw`~4Ov zcW0I05O@Ol`TM;iBiN&(xa;a>O)i8$(RFgRYysQG@#qn`fxwO*VSZKyet#P3|egZ>K3(G>LQefLiDZ#d3@|qsY zDL$mkjGysOi?`89%v+ z6o0~2z!o4UuPH@JTSysC!OvIK6dpuP@0~}M3_9>G{$ERP-Hjo06Kw=7#ldxy| jXC$Uzdc2&5|Azemil@Gh0_=Kr00000NkvXXu0mjflYoJh diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/package.html b/org.adempiere.ui.swing/src/org/compiere/plaf/package.html deleted file mode 100644 index bcca4ad220..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/package.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - -

    Provides for Pluggabe Look & Feel User Interface. -

    -

    Package Specification

    - -

    The classes extend the Metal Look & Feel.

    -

    Related Documentation

    - -For overviews, tutorials, examples, guides, and tool documentation, please see -http://www.adempiere.org/looks - - diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/sounds/FrameClose.wav b/org.adempiere.ui.swing/src/org/compiere/plaf/sounds/FrameClose.wav deleted file mode 100644 index 873285b1efc8823c5231277285d3396e047e7329..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2036 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 diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/sounds/FrameMinimize.wav b/org.adempiere.ui.swing/src/org/compiere/plaf/sounds/FrameMinimize.wav deleted file mode 100644 index 2dab1ce569f841da2e9334a7c9bfa11d8f33eb49..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4876 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 PeKs%0+2rs4q(uH3TB>RB diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/sounds/FrameRestoreUp.wav b/org.adempiere.ui.swing/src/org/compiere/plaf/sounds/FrameRestoreUp.wav deleted file mode 100644 index d82b011188e0c5c0e6e0d496ecbf10d3fac24df2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7916 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 E2RppEf&c&j diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/sounds/MenuItemCommand.wav b/org.adempiere.ui.swing/src/org/compiere/plaf/sounds/MenuItemCommand.wav deleted file mode 100644 index 487746c6616d2313b51cbf3d62b76ea8b6ed05aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4092 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 diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/sounds/OptionPaneError.wav b/org.adempiere.ui.swing/src/org/compiere/plaf/sounds/OptionPaneError.wav deleted file mode 100644 index 55e39eb4993a83fa332f69dd1912ecb1b9c4ebb2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32914 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 Zmq+>E{}Rq1&-i~Ejx-7H`v3R;{{Uthju!v` diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/sounds/OptionPaneInformation.wav b/org.adempiere.ui.swing/src/org/compiere/plaf/sounds/OptionPaneInformation.wav deleted file mode 100644 index 6dad743f1d1c348ca0f32d541db93440db888359..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20804 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⁢J<6+mq~?;EZ#` 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 diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/sounds/OptionPaneQuestion.wav b/org.adempiere.ui.swing/src/org/compiere/plaf/sounds/OptionPaneQuestion.wav deleted file mode 100644 index 82eccb4f765a1e71d284e5caae8cb077e3d28605..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11884 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 diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/sounds/PopupMenuPopup.wav b/org.adempiere.ui.swing/src/org/compiere/plaf/sounds/PopupMenuPopup.wav deleted file mode 100644 index 1eb388fcedd61a4af3ae24cfde182173ec9235ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2460 zcmWkve@xZa6+h?R?|TmveF!ayKhf8)vavz1tXNI42$jJ?#X&I=sVHhkw8N-4S{&vX zt*)=7l46}yEv`rJb&V}Xh625^)=qM*b5dO|RG(j&xJ|y#3+^TPV4d?k&mGbz*`4_I0&AK*q z?SC`Uw%J8b_D+1Gewfx@$jHS9p%= zUHs5K$xrE!IYTU!JazWWy|_+oC5FG^M$A=XDjDC9ABY-U zPkr_cI?2s;JHLv5HoT6_p&jOZ3W$5gukG8`23Y2}DK6O6T*(KGb2yDw(F%SF4|!Z8 z)y60J+*rpi7XEwD_eDQ_?%UwAuY}}}lkV||&5&yU;m0eJAI*NpXmMX1%AJzL2@y&3 z(Rj2m-<2gle)PHNjTnl!^|*+q%-V2ef5MrF-TkxXr`z*f-$3U0JI_YCN=6zVl{qG6 zY>+claD-f$a*LQ3u7~HNR>%jTH~FFbk8{9WMzxN`c*J;U_k`Ctm#9W{j;FH=EuP5= z&%y{VHU4A+92KlCz1m-XG>aR>OJiR$=Y$aX5EV-I-Y6kVf2_)Y-5>G1_RS3W&MvgGLP49kdt$;_v`3;X!MTY``0^h$Y>G zCGtA^RTqqrNioSjL%F$ae2vkFAFhzAc1sWmtX#Zbj32_R1_REOb)2&w?3@B&DM zaqw_9da=n4(btZ{bWwY=lGDTpm$An>sO`QQqGYugRfXiE9ASz?ObYw?jOa7UcuhDT z9*KT=O1)>##(KE`>g_trv!}?@IMe?B+maKppN>HRoKYS=Aqydgvef_$7&mpDJ{1pR z;v|_?3&z13NZ}GLfHtV1X1)NG*h8-Fzf zd_Yt{I~=1tx`RtNUyKn@iQ%RiXyOz~6kT}OQo_{lBpOY28RZKvCTm>Q+IMib^l=8) z+r4l=CQt`OGe8m!lb>U-o6D(5SCNY8y5q&z0h?5UX0lj!;WPZ`QR`Jdb;=CUs#2}R zy6z&;M_xMwEf_B@@)ga=K3t2tc!;{l2VZEF?&B^BaSaS=mNGa?E9^e}k{9Y6NrnpT zs{?#d?+Z2VWi&_UY!{UaH?^uOvV&su_ZC$F_3BewM`tv8l7t;s67VPc*w5Q7>8&jSJ6eR5Z5_J<63~Gc0)jA!m$4TMXsaua0(hY zo6{f(vUCo_Kr1C`wDb8A-=bLAXVg%)Jw$mpCNFWJIgO)azi@(SHM5l2A`ASwZxE>% z%d2>i)@mh`@-2?%Slweh?4uyu2`_a7u|WA`P{gY}Fhs|wKq|Z!N`=!fD2I7@xDgCv zi*QmrwR4pbhsy5e9Q%aPprSRhS5>#M+5FDPg4Nn{iBN~PjCtW*>@-q%F=E@m$M&izhM)h2#o;yhwqpVKlwZYxDNsIRO4um}xCQoGrF70w$MtH6ilNET z$2Ha*aAS$M0F9={>Nes@#HXQc#(Uu~BpUa^Ka032BEnm!QFyr5I6=jeJ|kIN zmv?QC)eAmH0fy*|)=-{Ygf7m54C;bfo$MiwQeCu4UKLJtQ&ouuYLOXm*7iXO&U);Q zlB$d|amAC5r`J2zO>p><^QK5~eKP+0Q0~-B;T4ykCQwj5aRh9sT177p;1;S@0gP3x zu+8elJ&tz#t=*_Ic#|3w=`h>OMkVX?JU?wGz%(OB_aOyas9&>}t^MJ#8pMFEb<`SF zrLKS#R5RsFa%ul&Sw0TRY;NXQ UXJ|Ga)4UaETu*W_WO5z;4=Dn}asU7T diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/vincent.jpg b/org.adempiere.ui.swing/src/org/compiere/plaf/vincent.jpg deleted file mode 100644 index 0ee8ede1070e1a38b99627dd342a66e90b7a9216..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 53604 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 Before: ") + previousValue + " Now: " + actualValue); - cl.saveEx(); - } - cash = MCash.get(p_pos.getCtx(), /*p_pos.getAD_Org_ID(),*/ p_pos.getC_CashBook_ID(), today, null); - v_previousBalance.setValue(cash.getEndingBalance()); - v_ActualBalance.setValue(Env.ZERO); - v_difference.setValue(Env.ZERO); - } - - - /** - * calculate difference in cash scrutiny every time the cursor moves - */ - public void caretPositionChanged(InputMethodEvent event) - { - cmd_calculateDifference(); - } - - - /** - * calculate difference between cash scrutiniy each time the actual balance text changes - */ - public void inputMethodTextChanged(InputMethodEvent event) - { - cmd_calculateDifference(); - } - - - @Override - protected void close() { - } - - - @Override - protected void enableButtons() { - } - - - @Override - public void reset() { - } - -} // CashSubFunctions diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/POSKeyboard.java b/org.adempiere.ui.swing/src/org/compiere/pos/POSKeyboard.java deleted file mode 100644 index 3843c700a5..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/POSKeyboard.java +++ /dev/null @@ -1,261 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ - -package org.compiere.pos; - -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.math.BigDecimal; -import java.text.ParseException; -import java.util.HashMap; -import java.util.logging.Level; - -import javax.swing.JFormattedTextField; -import javax.swing.JTextField; - -import net.miginfocom.swing.MigLayout; - -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.model.MPOSKey; -import org.compiere.model.MPOSKeyLayout; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; - - -/** - * On Screen Keyboard - * @author Paul Bowden - * Adaxa Pty Ltd - */ -public class POSKeyboard extends CDialog implements ActionListener, PosKeyListener -{ - /** - * - */ - private static final long serialVersionUID = 3296839634889851637L; - - private PosTextField field; - - private MPOSKeyLayout keylayout; - - - /** - * Constructor - * @param posPanel POS Panel - */ - public POSKeyboard (PosBasePanel posPanel, int C_POSKeyLayout_ID, PosTextField field, String title) - { - this(posPanel, C_POSKeyLayout_ID); - setTitle(title); - setPosTextField(field); - } - - public POSKeyboard(PosBasePanel posPanel, int keyLayoutId) { - super(AEnv.getFrame(posPanel), true); - keylayout = MPOSKeyLayout.get(posPanel.getCtx(), keyLayoutId); - init( keyLayoutId ); - } - - private JFormattedTextField text = new JFormattedTextField(); - - private HashMap keys; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(POSKeyboard.class); - - - /** - * Initialize - * @param startText - * @param POSKeyLayout_ID - */ - public void init(int POSKeyLayout_ID ) - { - CPanel panel = new CPanel(); - getContentPane().add(panel); - - // Content - panel.setLayout(new MigLayout("fill")); - - if ( keylayout.getPOSKeyLayoutType().equals(MPOSKeyLayout.POSKEYLAYOUTTYPE_Numberpad)) - text.setHorizontalAlignment(JTextField.TRAILING); - panel.add(text, "north, growx, h 30!, wrap, gap 10 10 10 10"); - - PosKeyPanel keys = new PosKeyPanel(POSKeyLayout_ID, this); - panel.add(keys, "center, growx, growy"); - - ConfirmPanel confirm = new ConfirmPanel(true, false, true, false, false, false, false); - confirm.addActionListener(this); - Dimension buttonDim = new Dimension(50,50); - confirm.getResetButton().setPreferredSize(buttonDim); - confirm.getOKButton().setPreferredSize(buttonDim); - confirm.getCancelButton().setPreferredSize(buttonDim); - panel.add(confirm, "south"); - pack(); - setLocationByPlatform(true); - text.requestFocusInWindow(); - - } // init - - /** - * Dispose - Free Resources - */ - public void dispose() - { - if (keys != null) - { - keys.clear(); - keys = null; - } - super.dispose(); - } // dispose - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - String action = e.getActionCommand(); - if (action == null || action.length() == 0) - return; - else if ( action.equals(ConfirmPanel.A_RESET)) - { - if ( keylayout.getPOSKeyLayoutType().equals(MPOSKeyLayout.POSKEYLAYOUTTYPE_Numberpad)) - text.setText("0"); - else - text.setText(""); - try { - text.commitEdit(); - } catch (ParseException e1) { - if (log.isLoggable(Level.FINE))log.log(Level.FINE, "JFormattedTextField commit failed"); - } - } - else if ( action.equals(ConfirmPanel.A_CANCEL)) - { - dispose(); - } - else if (action.equals(ConfirmPanel.A_OK)) - { - field.setText(text.getText()); - try { - field.commitEdit(); - } catch (ParseException e1) { - if (log.isLoggable(Level.FINE))log.log(Level.FINE, "JFormattedTextField commit failed"); - } - dispose(); - } - if (log.isLoggable(Level.INFO)) log.info( "PosSubBasicKeys - actionPerformed: " + action); - - } // actionPerformed - - public void keyReturned(MPOSKey key) { - - String entry = key.getText(); - String old = text.getText(); - int caretPos = text.getCaretPosition(); - if ( text.getSelectedText() != null ) - caretPos = text.getSelectionStart(); - String head = old.substring(0, caretPos); - if ( text.getSelectedText() != null ) - caretPos = text.getSelectionEnd(); - String tail = old.substring(caretPos, old.length()); - - if ( entry != null && !entry.isEmpty() ) - { - if ( keylayout.getPOSKeyLayoutType().equals(MPOSKeyLayout.POSKEYLAYOUTTYPE_Keyboard)) - { - if ( key.getText() != null ) - text.setText( head + entry + tail); - } - else if ( keylayout.getPOSKeyLayoutType().equals(MPOSKeyLayout.POSKEYLAYOUTTYPE_Numberpad)) - { - if ( entry.equals(".") ) - { - text.setText(head + entry + tail); - } - if ( entry.equals(",") ) - { - text.setText(head + entry + tail); - } - else if ( entry.equals("C") ) - { - text.setText("0"); - } - else { - try - { - int number = Integer.parseInt(entry); // test if number - if ( number >= 0 && number <= 9 ) - { - text.setText(head + number + tail); - } - // greater than 9, add to existing - else - { - Object current = text.getValue(); - if ( current == null ) - { - text.setText(Integer.toString(number)); - } - else if ( current instanceof BigDecimal ) - { - text.setText(((BigDecimal) current).add( - new BigDecimal(Integer.toString(number))).toPlainString()); - } - else if ( current instanceof Integer ) - { - text.setText(Integer.toString(((Integer) current) + number)); - } - else if ( current instanceof Long ) - { - text.setText(Long.toString(((Long) current) + number)); - } - else if ( current instanceof Double ) - { - text.setText(Double.toString(((Double) current) + number)); - } - } - - - } - catch (NumberFormatException e) - { - // ignore non-numbers - } - } - - try { - text.commitEdit(); - } catch (ParseException e) { - if (log.isLoggable(Level.FINE))log.log(Level.FINE, "JFormattedTextField commit failed"); - } - } - } - } - - public void setPosTextField(PosTextField posTextField) { - - field = posTextField; - text.setFormatterFactory(field.getFormatterFactory()); - text.setText(field.getText()); - text.setValue(field.getValue()); - getContentPane().invalidate(); - - } - -} // PosSubBasicKeys diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosApplication.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosApplication.java deleted file mode 100644 index 8c97cb7a3f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosApplication.java +++ /dev/null @@ -1,94 +0,0 @@ -//red1 -- use for POS GUI Testing in Fitnesse with UISpec4J. -package org.compiere.pos; - -import java.awt.KeyboardFocusManager; -import java.awt.event.WindowEvent; -import java.awt.event.WindowListener; -import java.util.Properties; - -import javax.swing.JFrame; - -import org.compiere.Adempiere; -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.AKeyboardFocusManager; -import org.compiere.apps.ALogin; -import org.compiere.model.MSession; -import org.compiere.swing.CFrame; -import org.compiere.util.DB; -import org.compiere.util.Env; - -public class PosApplication { - private Properties m_ctx; - - PosApplication() { - Adempiere.startup(true); // needs to be here for UI -// Splash splash = Splash.getSplash(); -- red1 -- not mandatory, so its removed for faster GUI testing - final CFrame frame = new CFrame(); - // Focus Traversal - KeyboardFocusManager.setCurrentKeyboardFocusManager(AKeyboardFocusManager.get()); - - - ALogin login = new ALogin(frame); - if (!login.initLogin()) // no automatic login - { - // Center the window - try - { - AEnv.showCenterScreen(login); // HTML load errors - } - catch (Exception ex) - { - } - if (!login.isConnected()) // '|| !login.isOKpressed()' -- red1 -- can't work during UISpec4J testing - AEnv.exit(1); - } - - // Check Build - if (!DB.isBuildOK(m_ctx)) // red1 - m_ctx seems null - AEnv.exit(1); - Env.setContext( Env.getCtx(), "#M_Warehouse_ID", 104 ); //red1 - presetting to Store Central for GUI Testing - if (!Adempiere.startupEnvironment(true)) // Load Environment - System.exit(1); - MSession.get (Env.getCtx(), true); // Start Session - - @SuppressWarnings("unused") - int m_WindowNo = AEnv.createWindowNo(frame); - - // Default Image - frame.setIconImage(Adempiere.getImage16()); - - // Setting close operation/listener - teo_sarca [ 1684168 ] - frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); - frame.addWindowListener(new WindowListener() { - public void windowClosing(WindowEvent e) { - if (!ADialog.ask(0, null, "ExitApplication?")) - return; - frame.dispose(); - } - public void windowActivated(WindowEvent e) {} - public void windowClosed(WindowEvent e) {} - public void windowDeactivated(WindowEvent e) {} - public void windowDeiconified(WindowEvent e) {} - public void windowIconified(WindowEvent e) {} - public void windowOpened(WindowEvent e) {} - }); - - PosBasePanel pos = new PosBasePanel(); - pos.init(0,frame); - frame.pack(); -// splash.dispose(); -// splash = null; - frame.setVisible(true); - } - - /** - * @param args - */ - public static void main(String[] args) { - - new PosApplication(); - - } - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosBasePanel.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosBasePanel.java deleted file mode 100644 index 87e4dc7029..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosBasePanel.java +++ /dev/null @@ -1,396 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ - -package org.compiere.pos; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.KeyboardFocusManager; -import java.awt.MouseInfo; -import java.awt.PointerInfo; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.sql.Timestamp; -import java.util.HashMap; -import java.util.Properties; -import java.util.logging.Level; - -import javax.swing.JFrame; -import javax.swing.JOptionPane; - -import net.miginfocom.swing.MigLayout; - -import org.compiere.apps.ADialog; -import org.compiere.model.MPOS; -import org.compiere.swing.CFrame; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Point of Sales Main Window. - * - * @author Comunidad de Desarrollo OpenXpertya - * *Basado en Codigo Original Modificado, Revisado y Optimizado de: - * *Copyright (c) Jorg Janke - * @version $Id: PosPanel.java,v 1.10 2004/07/12 04:10:04 jjanke Exp $ - */ -public class PosBasePanel extends CPanel - //implements FormPanel -{ - /** - * - */ - private static final long serialVersionUID = 7477837683408198860L; - - public static String trxName = null; //Trx.createTrxName("GUIPOSTesting_"); --red1 won't persist trx for recall in display - //trxName for not committing test so tests does not impact DB.. temporary halt due to above issue. - /** - * Constructor - see init - */ - public PosBasePanel() - { - super (new MigLayout(" fill","[500!]10[300:350:, fill]","")); - originalKeyboardFocusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager(); - m_focusMgr = new PosKeyboardFocusManager(); - KeyboardFocusManager.setCurrentKeyboardFocusManager(m_focusMgr); - } // PosPanel - - /** Window No */ - private int m_WindowNo = 0; - /** FormFrame */ - private CFrame m_frame; - /** Logger */ - private CLogger log = CLogger.getCLogger(getClass()); - /** Context */ - private Properties m_ctx = Env.getCtx(); - /** Sales Rep */ - private int m_SalesRep_ID = 0; - /** POS Model */ - protected MPOS p_pos = null; - /** Keyoard Focus Manager */ - private PosKeyboardFocusManager m_focusMgr = null; - - /** Order Panel */ - protected SubOrder f_order; - /** Current Line */ - protected SubCurrentLine f_curLine; - /** Function Keys */ - protected SubFunctionKeys f_functionKeys; - - protected CashSubFunctions f_cashfunctions; - - private javax.swing.Timer logoutTimer; - - - PosOrderModel m_order = null; - - // Today's (login) date */ - private Timestamp m_today = Env.getContextAsDate(m_ctx, "#Date"); - - private KeyboardFocusManager originalKeyboardFocusManager; - private boolean debug = true; - private CFrame frame; - private HashMap keyboards = new HashMap(); - - - public String getTrxName(){ - return trxName; - } - /** - * Initialize Panel - * @param WindowNo window - * @param frame parent frame - */ - public void init (int WindowNo, CFrame frame) - { - this.frame = frame; - if ( debug ) - frame.setPreferredSize(new Dimension(1024,768)); - else - { - frame.setExtendedState(JFrame.MAXIMIZED_BOTH); - frame.setResizable(false); - } - - m_SalesRep_ID = Env.getAD_User_ID(m_ctx); - if (log.isLoggable(Level.INFO)) log.info("init - SalesRep_ID=" + m_SalesRep_ID); - m_WindowNo = WindowNo; - m_frame = frame; - frame.setJMenuBar(null); - // - try - { - if (!dynInit()) - { - dispose(); - frame.dispose(); - return; - } - frame.getContentPane().add(this, BorderLayout.CENTER); - } - catch(Exception e) - { - log.log(Level.SEVERE, "init", e); - } - if (log.isLoggable(Level.CONFIG)) log.config( "PosPanel.init - " + getPreferredSize()); - - if ( p_pos.getAutoLogoutDelay() > 0 && logoutTimer == null ) - { - logoutTimer = new javax.swing.Timer(1000, - new ActionListener() { - - PointerInfo pi = null; - long lastMouseMove = System.currentTimeMillis(); - long lastKeyboardEvent = System.currentTimeMillis(); - public void actionPerformed(ActionEvent e) { - long now = e.getWhen(); - PointerInfo newPi = MouseInfo.getPointerInfo(); - // mouse moved - if ( newPi != null && pi != null - && !pi.getLocation().equals(newPi.getLocation()) ) - { - lastMouseMove = now; - } - pi = newPi; - - lastKeyboardEvent = m_focusMgr.getLastWhen(); - - if ( p_pos.getAutoLogoutDelay()*1000 < now - Math.max(lastKeyboardEvent, lastMouseMove) ) - { - // new PosLogin(this); - } - } - }); - logoutTimer.start(); - } - m_focusMgr.start(); - - } // init - - /** - * Dispose - Free Resources - */ - public void dispose() - { - keyboards.clear(); - keyboards = null; - if ( logoutTimer != null ) - logoutTimer.stop(); - logoutTimer = null; - - if (m_focusMgr != null) - m_focusMgr.stop(); - m_focusMgr = null; - KeyboardFocusManager.setCurrentKeyboardFocusManager(originalKeyboardFocusManager); - // - if (f_order != null) - f_order.dispose(); - f_order = null; - if (f_curLine != null) - { - // if ( m_order != null ) - // m_order.deleteOrder(); - f_curLine.dispose(); - } - f_curLine = null; - if (f_functionKeys != null) - f_functionKeys.dispose(); - f_functionKeys = null; - - if (f_cashfunctions != null) - f_cashfunctions.dispose(); - f_cashfunctions = null; - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - m_ctx = null; - } // dispose - - - /************************************************************************** - * Dynamic Init. - * PosPanel has a GridBagLayout. - * The Sub Panels return their position - */ - private boolean dynInit() - { - if (!setMPOS()) - return false; - frame.setTitle("Adempiere POS: " + p_pos.getName()); - // Create Sub Panels - f_order = new SubOrder (this); - add (f_order, "split 2, flowy, growx, spany"); - // - f_curLine = new SubCurrentLine (this); - add (f_curLine, "h 300, growx, growy, gaptop 10"); - - f_functionKeys = new SubFunctionKeys (this); - add (f_functionKeys, "aligny top, h 500, growx, growy, flowy, split 2"); - - return true; - } // dynInit - - /** - * Set MPOS - * @return true if found/set - */ - private boolean setMPOS() - { - MPOS[] poss = null; - if (m_SalesRep_ID == 100) // superUser - poss = getPOSs (0); - else - poss = getPOSs (m_SalesRep_ID); - // - if (poss.length == 0) - { - ADialog.error(m_WindowNo, m_frame, "NoPOSForUser"); - return false; - } - else if (poss.length == 1) - { - p_pos = poss[0]; - return true; - } - - // Select POS - String msg = Msg.getMsg(m_ctx, "SelectPOS"); - String title = Env.getHeader(m_ctx, m_WindowNo); - Object selection = JOptionPane.showInputDialog(m_frame, msg, title, - JOptionPane.QUESTION_MESSAGE, null, poss, poss[0]); - if (selection != null) - { - p_pos = (MPOS)selection; - return true; - } - return false; - } // setMPOS - - /** - * Get POSs for specific Sales Rep or all - * @param SalesRep_ID - * @return array of POS - */ - private MPOS[] getPOSs (int SalesRep_ID) - { - String pass_field = "SalesRep_ID"; - int pass_ID = SalesRep_ID; - if (SalesRep_ID==0) - { - pass_field = "AD_Client_ID"; - pass_ID = Env.getAD_Client_ID(m_ctx); - } - return MPOS.getAll(m_ctx, pass_field, pass_ID); - } // getPOSs - - /************************************************************************** - * Get Today's date - * @return date - */ - public Timestamp getToday() - { - return m_today; - } // getToday - - /** - * New Order - * - */ - public void newOrder() - { - log.info( "PosPanel.newOrder"); - f_order.setC_BPartner_ID(0); - m_order = null; - m_order = PosOrderModel.createOrder(p_pos, f_order.getBPartner(), trxName); - f_curLine.newLine(); - f_curLine.f_name.requestFocusInWindow(); - updateInfo(); - } // newOrder - - /** - * Get the number of the window for the function calls that it needs - * - * @return the window number - */ - public int getWindowNo() - { - return m_WindowNo; - } - - /** - * Get the properties for the process calls that it needs - * - * @return getProperties m_ctx - */ - public Properties getCtx() - { - return m_ctx; - } - - public void updateInfo() - { - // reload order - if ( m_order != null ) - { - m_order.reload(); - } - if ( f_curLine != null ) - f_curLine.updateTable(m_order); - if (f_order != null) - { - f_order.updateOrder(); - } - } - - /** - * @param m_c_order_id - */ - public void setOldOrder(int m_c_order_id) - { - if ( m_order != null ) - m_order.deleteOrder(); - - if ( m_c_order_id == 0 ) - m_order = null; - else - m_order = new PosOrderModel(m_ctx , m_c_order_id, trxName, p_pos); - updateInfo(); - } - - /** - * @param m_c_order_id - */ - public void setOrder(int m_c_order_id) - { - if ( m_c_order_id == 0 ) - m_order = null; - else - m_order = new PosOrderModel(m_ctx , m_c_order_id, trxName, p_pos); - } - - public POSKeyboard getKeyboard(int keyLayoutId) { - if ( keyboards.containsKey(keyLayoutId) ) - return keyboards.get(keyLayoutId); - else - { - POSKeyboard keyboard = new POSKeyboard(this, keyLayoutId); - keyboards.put(keyLayoutId, keyboard); - return keyboard; - } - } - -} // PosPanel - diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyListener.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyListener.java deleted file mode 100644 index db8fd64b38..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyListener.java +++ /dev/null @@ -1,30 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ - - -package org.compiere.pos; - -import org.compiere.model.MPOSKey; - -/** - * Interface for listening to on screen key events - * @author Paul Bowden - * Adaxa Pty Ltd - * - */ -public interface PosKeyListener { - - void keyReturned( MPOSKey key ); - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyPanel.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyPanel.java deleted file mode 100644 index 941ee286bd..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyPanel.java +++ /dev/null @@ -1,249 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ - -package org.compiere.pos; - -import java.awt.CardLayout; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.HashMap; -import java.util.logging.Level; - -import javax.swing.Icon; -import javax.swing.SwingConstants; - -import net.miginfocom.swing.MigLayout; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.model.MImage; -import org.compiere.model.MPOSKey; -import org.compiere.model.MPOSKeyLayout; -import org.compiere.print.MPrintColor; -import org.compiere.print.MPrintFont; -import org.compiere.swing.CButton; -import org.compiere.swing.CPanel; -import org.compiere.swing.CScrollPane; -import org.compiere.util.CLogger; -import org.compiere.util.Env; - -/** - * Button panel supporting multiple linked layouts - * @author Paul Bowden - * Adaxa Pty Ltd - * - */ -public class PosKeyPanel extends CPanel implements ActionListener { - /** - * - */ - private static final long serialVersionUID = -1773720355288801510L; - - - /** - * Constructor - */ - public PosKeyPanel (int C_POSKeyLayout_ID, PosKeyListener caller) - { - if (C_POSKeyLayout_ID == 0) - return; - - setLayout(cardLayout); - add(createCard(C_POSKeyLayout_ID), Integer.toString(C_POSKeyLayout_ID)); - currentLayout = C_POSKeyLayout_ID; - cardLayout.show(this, Integer.toString(C_POSKeyLayout_ID)); - this.caller = caller; - } // PosSubFunctionKeys - - /** layout */ - private CardLayout cardLayout = new CardLayout(); - /** Map of map of keys */ - private HashMap> keymap = new HashMap>(); - /** Currently displayed layout */ - int currentLayout; - /** Logger */ - private static CLogger log = CLogger.getCLogger(PosKeyPanel.class); - /** Caller */ - private PosKeyListener caller; - - - /** - * @return - */ - private CPanel createCard(int C_POSKeyLayout_ID) { - - // already added - if ( keymap.containsKey(C_POSKeyLayout_ID) ) - { - return null; - } - - CPanel card = new CPanel(); - card.setLayout(new MigLayout("fill, ins 0")); - MPOSKeyLayout keyLayout = MPOSKeyLayout.get(Env.getCtx(), C_POSKeyLayout_ID); - - Color stdColor = Color.lightGray; - if (keyLayout.getAD_PrintColor_ID() != 0) - { - MPrintColor color = MPrintColor.get(Env.getCtx(), keyLayout.getAD_PrintColor_ID()); - stdColor = color.getColor(); - } - Font stdFont = AdempierePLAF.getFont_Field(); - if (keyLayout.getAD_PrintFont_ID() != 0) - { - MPrintFont font = MPrintFont.get(keyLayout.getAD_PrintFont_ID()); - stdFont = font.getFont(); - } - - if (keyLayout.get_ID() == 0) - return null; - MPOSKey[] keys = keyLayout.getKeys(false); - - HashMap map = new HashMap(keys.length); - - keymap.put(C_POSKeyLayout_ID, map); - - int COLUMNS = 3; // Min Columns - int ROWS = 3; // Min Rows - int noKeys = keys.length; - int cols = keyLayout.getColumns(); - if ( cols == 0 ) - cols = COLUMNS; - - int buttons = 0; - - if (log.isLoggable(Level.FINE)) log.fine( "PosSubFunctionKeys.init - NoKeys=" + noKeys - + ", Cols=" + cols); - // Content - CPanel content = new CPanel (new MigLayout("fill, wrap " + Math.max(cols, 3))); - String buttonSize = "h 50, w 50, growx, growy, sg button,"; - for (MPOSKey key : keys) - { - - if ( key.getSubKeyLayout_ID() > 0 ) - { - CPanel subCard = createCard(key.getSubKeyLayout_ID()); - if ( subCard != null ) - add(subCard, Integer.toString(key.getSubKeyLayout_ID())); - } - - map.put(key.getC_POSKey_ID(), key); - Color keyColor = stdColor; - Font keyFont = stdFont; - StringBuilder buttonHTML = new StringBuilder("

    "); - if (key.getAD_PrintColor_ID() != 0) - { - MPrintColor color = MPrintColor.get(Env.getCtx(), key.getAD_PrintColor_ID()); - keyColor = color.getColor(); - } - - if ( key.getAD_PrintFont_ID() != 0) - { - MPrintFont font = MPrintFont.get(key.getAD_PrintFont_ID()); - keyFont = font.getFont(); - } - - buttonHTML.append(key.getName()); - buttonHTML.append("

    "); - if (log.isLoggable(Level.FINE)) log.fine( "#" + map.size() + " - " + keyColor); - CButton button = new CButton(buttonHTML.toString()); - button.setBackground(keyColor); - button.setFont(keyFont); - - if ( key.getAD_Image_ID() != 0 ) - { - MImage image = MImage.get(Env.getCtx(), key.getAD_Image_ID()); - Icon icon = image.getIcon(); - button.setIcon(icon); - button.setVerticalTextPosition(SwingConstants.BOTTOM); - button.setHorizontalTextPosition(SwingConstants.CENTER); - } - button.setFocusable(false); - if ( !key.isActive() ) - button.setEnabled(false); - button.setActionCommand(String.valueOf(key.getC_POSKey_ID())); - button.addActionListener(this); - String constraints = buttonSize; - int size = 1; - if ( key.getSpanX() > 1 ) - { - constraints += "spanx " + key.getSpanX() + ","; - size = key.getSpanX(); - } - if ( key.getSpanY() > 1 ) - { - constraints += "spany " + key.getSpanY() + ","; - size = size*key.getSpanY(); - } - buttons = buttons + size; - content.add (button, constraints); - } - - int rows = Math.max ((buttons / cols), ROWS); - if ( buttons % cols > 0 ) - rows = rows + 1; - - for (int i = buttons; i < rows*cols; i++) - { - CButton button = new CButton(""); - button.setFocusable(false); - button.setReadWrite(false); - content.add (button, buttonSize); - } - - CScrollPane scroll = new CScrollPane(content); - // scroll.setPreferredSize(new Dimension( 600 - 20, 400-20)); - card.add (scroll, "growx, growy"); - // increase scrollbar width for touchscreen - scroll.getVerticalScrollBar().setPreferredSize(new Dimension(30, 0)); - scroll.getHorizontalScrollBar().setPreferredSize(new Dimension(0,30)); - return card; - } - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - String action = e.getActionCommand(); - if (action == null || action.length() == 0 || keymap == null) - return; - if (log.isLoggable(Level.INFO)) log.info( "PosSubFunctionKeys - actionPerformed: " + action); - HashMap currentKeymap = keymap.get(currentLayout); - - try - { - int C_POSKey_ID = Integer.parseInt(action); - MPOSKey key = currentKeymap.get(C_POSKey_ID); - // switch layout - if ( key.getSubKeyLayout_ID() > 0 ) - { - currentLayout = key.getSubKeyLayout_ID(); - cardLayout.show(this, Integer.toString(key.getSubKeyLayout_ID())); - } - else - { - caller.keyReturned(key); - } - } - catch (Exception ex) - { - } - - } // actionPerformed - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyboardFocusManager.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyboardFocusManager.java deleted file mode 100644 index 4b47a65d5c..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyboardFocusManager.java +++ /dev/null @@ -1,133 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ - -package org.compiere.pos; - -import java.awt.DefaultKeyboardFocusManager; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.util.LinkedList; -import java.util.logging.Level; - -import org.compiere.util.CLogger; - -/** - * POS Keyboard Focus Manager - * - * @author Comunidad de Desarrollo OpenXpertya - * *Basado en Codigo Original Modificado, Revisado y Optimizado de: - * *Copyright (c) Jorg Janke - * @version $Id: PosKeyboardFocusManager.java,v 1.2 2004/07/11 19:50:12 jjanke - * Exp $ - */ -public class PosKeyboardFocusManager extends DefaultKeyboardFocusManager - implements ActionListener { - - /** - * PosKeyboardFocusManager - */ - public PosKeyboardFocusManager() { - super(); - } // PosKeyboardFocusManager - - /** FirstIn First Out List */ - private LinkedList m_fifo = new LinkedList(); - - /** Last Key Type */ - private long m_lastWhen = 0; - - public long getLastWhen() { - return m_lastWhen; - } - - /** Timer */ - private javax.swing.Timer m_timer = null; - /** Logger */ - private static CLogger log = CLogger.getCLogger(PosKeyboardFocusManager.class); - - /** - * Dispose - */ - public void dispose() { - if (m_timer != null) - m_timer.stop(); - m_timer = null; - if (m_fifo != null) - m_fifo.clear(); - m_fifo = null; - } // dispose - - /** - * Start Timer - */ - public void start() { - // Unqueue time - 200 ms - int delay = 200; - if (log.isLoggable(Level.FINE)) log.fine("PosKeyboardFocusManager.start - " + delay); - if (m_timer == null) - m_timer = new javax.swing.Timer(delay, this); - if (!m_timer.isRunning()) - m_timer.start(); - } // start - - /** - * Stop Timer - */ - public void stop() { - if (log.isLoggable(Level.FINE)) log.fine("PosKeyboardFocusManager.stop - " + m_timer); - - if (m_timer != null) - m_timer.stop(); - } // stop - - /*************************************************************************** - * Dispatch Key Event - queue - * - * @param eevent - * event - * @return true - */ - public boolean dispatchKeyEvent(KeyEvent event) { - if (event.getID() == KeyEvent.KEY_PRESSED) { - // Keyboard Repeat: 485 - then 31 - // log.fine( "PosKeyboardFocusManager.dispatchKeyEvent - " - // - " - // + event.getWhen() + " - " + (event.getWhen() - m_lastWhen)); - m_lastWhen = event.getWhen(); - } - if (m_timer == null) - super.dispatchKeyEvent(event); - else - m_fifo.add(event); - return true; - } // displatchEvent - - /** - * Action Performed - unqueue - * - * @param e - * event - */ - public void actionPerformed(ActionEvent e) { - if (m_timer == null) - return; - // log.fine( "actionPerformed - " + m_fifo.size()); - while (m_fifo.size() > 0) { - KeyEvent event = (KeyEvent) m_fifo.removeFirst(); - super.dispatchKeyEvent(event); - } - } // actionPerformed - -} // PosKeyboardFocusManager diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosLogin.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosLogin.java deleted file mode 100644 index 2d2b980153..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosLogin.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.compiere.pos; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; - -import javax.swing.KeyStroke; - -import net.miginfocom.swing.MigLayout; - -import org.compiere.apps.AEnv; -import org.compiere.apps.AppsAction; -import org.compiere.model.MUser; -import org.compiere.swing.CButton; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.Msg; - -public class PosLogin extends CDialog implements ActionListener { - - /** - * - */ - private static final long serialVersionUID = 8490567722808711399L; - private PosBasePanel posPanel; - private PosTextField username; - private PosTextField pin; - private CButton bProcess; - - /** - * Constructor - * @param posPanel POS Panel - */ - public PosLogin (PosBasePanel posPanel) - { - super (AEnv.getFrame(posPanel),Msg.translate(posPanel.getCtx(), "Login"), true); - init(); - this.posPanel = posPanel; - } - - private void init() { - CPanel panel = new CPanel(); - panel.setLayout(new MigLayout()); - getContentPane().add(panel); - - panel.add(new CLabel(Msg.translate(posPanel.getCtx(),"SalesRep_ID"))); - - username = new PosTextField(Msg.translate(posPanel.getCtx(),"SalesRep_ID"), - posPanel, posPanel.p_pos.getOSK_KeyLayout_ID()); - - panel.add( username, "wrap"); - - panel.add(new CLabel(Msg.translate(posPanel.getCtx(), "UserPIN"))); - - pin = new PosTextField(Msg.translate(posPanel.getCtx(), "UserPIN"), posPanel, posPanel.p_pos.getOSNP_KeyLayout_ID()); - - panel.add(pin, ""); - - AppsAction act = new AppsAction("Ok", KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), false); - act.setDelegate(this); - bProcess = (CButton)act.getButton(); - bProcess.setFocusable(false); - panel.add (bProcess, "h 50!, w 50!"); - - pack(); - - } - - @Override - public void actionPerformed(ActionEvent e) { - if ( e.getSource().equals(bProcess) ) - { - MUser.get(posPanel.getCtx(), username.getText(), pin.getText()); - } - - dispose(); - } - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosOrderModel.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosOrderModel.java deleted file mode 100644 index 4c601281da..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosOrderModel.java +++ /dev/null @@ -1,473 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.pos; - -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Properties; -import java.util.logging.Level; - -import org.compiere.model.MBPartner; -import org.compiere.model.MBankAccountProcessor; -import org.compiere.model.MOrder; -import org.compiere.model.MOrderLine; -import org.compiere.model.MOrderTax; -import org.compiere.model.MPOS; -import org.compiere.model.MPayment; -import org.compiere.model.MProduct; -import org.compiere.process.DocAction; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.ValueNamePair; - -/** - * Wrapper for standard order - * @author Paul Bowden - * Adaxa Pty Ltd - * - */ -public class PosOrderModel extends MOrder { - /** - * - */ - private static final long serialVersionUID = 5253837037827124425L; - - private MPOS m_pos; - - private String trxName; - - public PosOrderModel(Properties ctx, int C_Order_ID, String trxName, MPOS pos) { - super(ctx, C_Order_ID, trxName); - this.trxName = trxName; - m_pos = pos; - } - - /** - * Get/create Order - * - * @return order or null - */ - public static PosOrderModel createOrder(MPOS pos, MBPartner partner, String trxName) { - - PosOrderModel order = new PosOrderModel(Env.getCtx(), 0, trxName, pos); - order.setAD_Org_ID(pos.getAD_Org_ID()); - order.setIsSOTrx(true); - order.setC_POS_ID(pos.getC_POS_ID()); - if (pos.getC_DocType_ID() != 0) - order.setC_DocTypeTarget_ID(pos.getC_DocType_ID()); - else - order.setC_DocTypeTarget_ID(MOrder.DocSubTypeSO_POS); - if (partner == null || partner.get_ID() == 0) - partner = pos.getBPartner(); - if (partner == null || partner.get_ID() == 0) { - throw new AdempierePOSException("No BPartner for order"); - } - order.setBPartner(partner); - // - order.setM_PriceList_ID(pos.getM_PriceList_ID()); - order.setM_Warehouse_ID(pos.getM_Warehouse_ID()); - order.setSalesRep_ID(pos.getSalesRep_ID()); - order.setPaymentRule(MOrder.PAYMENTRULE_Cash); - if (!order.save()) - { - order = null; - throw new AdempierePOSException("Save order failed"); - } - - return order; - } // createOrder - - - /** - * @author Community Development OpenXpertya - * *Based on Modified Original Code, Revised and Optimized: - * *Copyright ConSerTi - */ - public void setBPartner(MBPartner partner) - { - if (getDocStatus().equals("DR")) - { - if (partner == null || partner.get_ID() == 0) { - throw new AdempierePOSException("no BPartner"); - } - else - { - if (log.isLoggable(Level.INFO)) log.info("SubCurrentLine.getOrder -" + partner); - super.setBPartner(partner); - MOrderLine[] lineas = getLines(); - for (int i = 0; i < lineas.length; i++) - { - lineas[i].setC_BPartner_ID(partner.getC_BPartner_ID()); - lineas[i].setTax(); - lineas[i].saveEx(); - } - saveEx(); - } - } - - } - - /** - * Create new Line - * - * @return line or null - */ - public MOrderLine createLine(MProduct product, BigDecimal QtyOrdered, - BigDecimal PriceActual) { - - if (!getDocStatus().equals("DR") ) - return null; - //add new line or increase qty - - // catch Exceptions at order.getLines() - int numLines = 0; - MOrderLine[] lines = null; - try - { - lines = getLines(null,"Line"); - numLines = lines.length; - for (int i = 0; i < numLines; i++) - { - if (lines[i].getM_Product_ID() == product.getM_Product_ID()) - { - //increase qty - BigDecimal current = lines[i].getQtyEntered(); - BigDecimal toadd = QtyOrdered; - BigDecimal total = current.add(toadd); - lines[i].setQty(total); - lines[i].setPrice(); // sets List/limit - if ( PriceActual.compareTo(Env.ZERO) > 0 ) - lines[i].setPrice(PriceActual); - lines[i].saveEx(); - return lines[i]; - } - } - } - catch (Exception e) - { - log.severe("Order lines cannot be created - " + e.getMessage()); - } - - //create new line - MOrderLine line = new MOrderLine(this); - line.setProduct(product); - line.setQty(QtyOrdered); - - line.setPrice(); // sets List/limit - if ( PriceActual.compareTo(Env.ZERO) > 0 ) - line.setPrice(PriceActual); - line.saveEx(); - return line; - - } // createLine - - - /** - * Delete order from database - * - * @author Comunidad de Desarrollo OpenXpertya - * *Basado en Codigo Original Modificado, Revisado y Optimizado de: - * *Copyright ConSerTi - */ - public boolean deleteOrder () { - if (getDocStatus().equals("DR")) - { - MOrderLine[] lines = getLines(); - if (lines != null) - { - int numLines = lines.length; - if (numLines > 0) - for (int i = numLines - 1; i >= 0; i--) - { - if (lines[i] != null) - deleteLine(lines[i].getC_OrderLine_ID()); - } - } - - MOrderTax[] taxs = getTaxes(true); - if (taxs != null) - { - int numTax = taxs.length; - if (numTax > 0) - for (int i = taxs.length - 1; i >= 0; i--) - { - if (taxs[i] != null) - taxs[i].delete(true); - taxs[i].saveEx(); - taxs[i] = null; - } - } - - getLines(true, null); // requery order - setDocStatus("VO");//delete(true); red1 -- should not delete but void the order - setProcessed(true); //red1 -- to avoid been in history during query - saveEx(); - return true; - } - return false; - } // deleteOrder - - /** - * to erase the lines from order - * @return true if deleted - */ - public void deleteLine (int C_OrderLine_ID) { - if ( C_OrderLine_ID != -1 ) - { - for ( MOrderLine line : getLines(true, "M_Product_ID") ) - { - if ( line.getC_OrderLine_ID() == C_OrderLine_ID ) - { - line.delete(true); - line.saveEx(); - } - } - } - } // deleteLine - - /** - * Process Order - * @author Comunidad de Desarrollo OpenXpertya - * *Basado en Codigo Original Modificado, Revisado y Optimizado de: - * *Copyright ïżœ ConSerTi - */ - public boolean processOrder() - { - //Returning orderCompleted to check for order completeness - boolean orderCompleted = false; - // check if order completed OK - if (getDocStatus().equals("DR") || getDocStatus().equals("IP") ) - { - setDocAction(DocAction.ACTION_Complete); - try - { - if (processIt(DocAction.ACTION_Complete) ) - { - saveEx(); - } - else - { - log.info( "Process Order FAILED"); - } - } - catch (Exception e) - { - log.severe("Order can not be completed - " + e.getMessage()); - } - finally - { // When order failed convert it back to draft so it can be processed - if( getDocStatus().equals("IN") ) - { - setDocStatus("DR"); - } - else if( getDocStatus().equals("CO") ) - { - orderCompleted = true; - log.info( "SubCheckout - processOrder OK"); - } - else - { - log.info( "SubCheckout - processOrder - unrecognized DocStatus"); - } - } // try-finally - - } - - return orderCompleted; - } // processOrder - - public BigDecimal getTaxAmt() { - BigDecimal taxAmt = Env.ZERO; - for (MOrderTax tax : getTaxes(true)) - { - taxAmt = taxAmt.add(tax.getTaxAmt()); - } - return taxAmt; - } - - public BigDecimal getSubtotal() { - return getGrandTotal().subtract(getTaxAmt()); - } - - public BigDecimal getPaidAmt() - { - String sql = "SELECT sum(PayAmt) FROM C_Payment WHERE C_Order_ID = ? AND DocStatus IN ('CO','CL')"; - BigDecimal received = DB.getSQLValueBD(null, sql, getC_Order_ID()); - if ( received == null ) - received = Env.ZERO; - - sql = "SELECT sum(Amount) FROM C_CashLine WHERE C_Invoice_ID = ? "; - BigDecimal cashline = DB.getSQLValueBD(null, sql, getC_Invoice_ID()); - if ( cashline != null ) - received = received.add(cashline); - - return received; - } - - public boolean payCash(BigDecimal amt) { - - MPayment payment = createPayment(MPayment.TENDERTYPE_Cash); - payment.setC_CashBook_ID(m_pos.getC_CashBook_ID()); - payment.setAmount(getC_Currency_ID(), amt); - payment.setC_BankAccount_ID(m_pos.getC_BankAccount_ID()); - payment.saveEx(); - payment.setDocAction(MPayment.DOCACTION_Complete); - payment.setDocStatus(MPayment.DOCSTATUS_Drafted); - if ( payment.processIt(MPayment.DOCACTION_Complete) ) - { - payment.saveEx(); - return true; - } - else return false; - } // payCash - - public boolean payCheck(BigDecimal amt, String accountNo, String routingNo, String checkNo) - { - MPayment payment = createPayment(MPayment.TENDERTYPE_Check); - payment.setAmount(getC_Currency_ID(), amt); - payment.setC_BankAccount_ID(m_pos.getC_BankAccount_ID()); - payment.setAccountNo(accountNo); - payment.setRoutingNo(routingNo); - payment.setCheckNo(checkNo); - payment.saveEx(); - payment.setDocAction(MPayment.DOCACTION_Complete); - payment.setDocStatus(MPayment.DOCSTATUS_Drafted); - if ( payment.processIt(MPayment.DOCACTION_Complete) ) - { - payment.saveEx(); - return true; - } - else return false; - } // payCheck - - public boolean payCreditCard(BigDecimal amt, String accountName, int month, int year, - String cardNo, String cvc, String cardtype) - { - - MPayment payment = createPayment(MPayment.TENDERTYPE_CreditCard); - payment.setAmount(getC_Currency_ID(), amt); - payment.setC_BankAccount_ID(m_pos.getC_BankAccount_ID()); - payment.setCreditCard(MPayment.TRXTYPE_Sales, cardtype, - cardNo, cvc, month, year); - payment.saveEx(); - payment.setDocAction(MPayment.DOCACTION_Complete); - payment.setDocStatus(MPayment.DOCSTATUS_Drafted); - if ( payment.processIt(MPayment.DOCACTION_Complete) ) - { - payment.saveEx(); - return true; - } - else return false; - } // payCheck - - private MPayment createPayment(String tenderType) - { - MPayment payment = new MPayment(getCtx(), 0, trxName); - payment.setAD_Org_ID(m_pos.getAD_Org_ID()); - payment.setTenderType(tenderType); - payment.setC_Order_ID(getC_Order_ID()); - payment.setIsReceipt(true); - payment.setC_BPartner_ID(getC_BPartner_ID()); - return payment; - } - - public void reload() { - load( get_TrxName()); - getLines(true, ""); - } - - /** - * Duplicated from MPayment - * Get Accepted Credit Cards for amount - * @param amt trx amount - * @return credit cards - */ - public ValueNamePair[] getCreditCards (BigDecimal amt) - { - try - { - MBankAccountProcessor[] m_mBankAccountProcessors = MBankAccountProcessor.find(getCtx (), null, null, - getAD_Client_ID (), getAD_Org_ID(), getC_Currency_ID (), amt, get_TrxName()); - // - HashMap map = new HashMap(); // to eliminate duplicates - for (int i = 0; i < m_mBankAccountProcessors.length; i++) - { - MBankAccountProcessor bankAccountProcessor = m_mBankAccountProcessors[i]; - if (bankAccountProcessor.isAcceptAMEX()) - map.put (MPayment.CREDITCARDTYPE_Amex, getCreditCardPair (MPayment.CREDITCARDTYPE_Amex)); - if (bankAccountProcessor.isAcceptDiners()) - map.put (MPayment.CREDITCARDTYPE_Diners, getCreditCardPair (MPayment.CREDITCARDTYPE_Diners)); - if (bankAccountProcessor.isAcceptDiscover()) - map.put (MPayment.CREDITCARDTYPE_Discover, getCreditCardPair (MPayment.CREDITCARDTYPE_Discover)); - if (bankAccountProcessor.isAcceptMC()) - map.put (MPayment.CREDITCARDTYPE_MasterCard, getCreditCardPair (MPayment.CREDITCARDTYPE_MasterCard)); - if (bankAccountProcessor.isAcceptCorporate()) - map.put (MPayment.CREDITCARDTYPE_PurchaseCard, getCreditCardPair (MPayment.CREDITCARDTYPE_PurchaseCard)); - if (bankAccountProcessor.isAcceptVisa()) - map.put (MPayment.CREDITCARDTYPE_Visa, getCreditCardPair (MPayment.CREDITCARDTYPE_Visa)); - } // for all payment processors - // - ValueNamePair[] retValue = new ValueNamePair[map.size ()]; - map.values ().toArray (retValue); - if (log.isLoggable(Level.FINE)) log.fine("getCreditCards - #" + retValue.length + " - Processors=" + m_mBankAccountProcessors.length); - return retValue; - } - catch (Exception ex) - { - ex.printStackTrace(); - return null; - } - } // getCreditCards - - /** - * - * Duplicated from MPayment - * Get Type and name pair - * @param CreditCardType credit card Type - * @return pair - */ - private ValueNamePair getCreditCardPair (String CreditCardType) - { - return new ValueNamePair (CreditCardType, getCreditCardName(CreditCardType)); - } // getCreditCardPair - - /** - * - * Duplicated from MPayment - * Get Name of Credit Card - * @param CreditCardType credit card type - * @return Name - */ - public String getCreditCardName(String CreditCardType) - { - if (CreditCardType == null) - return "--"; - else if (MPayment.CREDITCARDTYPE_MasterCard.equals(CreditCardType)) - return "MasterCard"; - else if (MPayment.CREDITCARDTYPE_Visa.equals(CreditCardType)) - return "Visa"; - else if (MPayment.CREDITCARDTYPE_Amex.equals(CreditCardType)) - return "Amex"; - else if (MPayment.CREDITCARDTYPE_ATM.equals(CreditCardType)) - return "ATM"; - else if (MPayment.CREDITCARDTYPE_Diners.equals(CreditCardType)) - return "Diners"; - else if (MPayment.CREDITCARDTYPE_Discover.equals(CreditCardType)) - return "Discover"; - else if (MPayment.CREDITCARDTYPE_PurchaseCard.equals(CreditCardType)) - return "PurchaseCard"; - return "?" + CreditCardType + "?"; - } // getCreditCardName - -} // PosOrderModel.class diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosPanel.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosPanel.java deleted file mode 100644 index 02d639c456..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosPanel.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.compiere.pos; - -import org.compiere.apps.form.FormFrame; -import org.compiere.apps.form.FormPanel; - -public class PosPanel implements FormPanel { - private PosBasePanel panel; - - public void dispose() { - panel.dispose(); - } - - public void init(int WindowNo, FormFrame frame) { - panel = new PosBasePanel(); - panel.init(0, frame); - } - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosPayment.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosPayment.java deleted file mode 100644 index dd6e5cd665..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosPayment.java +++ /dev/null @@ -1,529 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.pos; - -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; -import java.beans.VetoableChangeListener; -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.text.NumberFormat; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Locale; -import java.util.Properties; - -import javax.swing.DefaultComboBoxModel; -import javax.swing.DefaultListCellRenderer; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JTextField; -import javax.swing.KeyStroke; -import javax.swing.ListCellRenderer; -import javax.swing.SwingUtilities; -import javax.swing.border.TitledBorder; - -import net.miginfocom.swing.MigLayout; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.AppsAction; -import org.compiere.model.MCurrency; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MPOS; -import org.compiere.model.MPOSKey; -import org.compiere.model.MPayment; -import org.compiere.model.MPaymentValidate; - -import static org.compiere.model.SystemIDs.*; - -import org.compiere.swing.CButton; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CDialog; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTextField; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.ValueNamePair; - -public class PosPayment extends CDialog implements PosKeyListener, VetoableChangeListener, ActionListener { - /** - * - */ - private static final long serialVersionUID = -1961758117289056671L; - - NumberFormat formatter = new DecimalFormat("#0.00"); //red1 - parser to remove commas or dots separator for above '000s. - NumberFormat nf = NumberFormat.getInstance(Locale.getDefault()); // make locale-specific - - @Override - public void actionPerformed(ActionEvent e) { - - if ( e.getSource().equals(fTenderAmt) || e.getSource().equals(fPayAmt) ) - { - //red1 - remove commas from thousand value - BigDecimal tender = Env.ZERO; - BigDecimal pay = Env.ZERO; - try - { - tender = new BigDecimal(formatter.format((nf.parse(fTenderAmt.getText())).floatValue())); - pay = new BigDecimal(formatter.format((nf.parse(fPayAmt.getText())).floatValue())); - } - catch (ParseException n) - { - n.printStackTrace(); - } - if ( tender.compareTo(Env.ZERO) != 0 ) - { - fReturnAmt.setValue(tender.subtract(pay)); - } - return; - } - - if ( e.getSource().equals(f_bProcess)) - { - processPayment(); - } - if ( e.getSource().equals(f_bCancel)) - { - paid = false; - dispose(); - return; - } - - setTotals(); - - super.actionPerformed(e); - } - - private void processPayment() { - - try { - - String tenderType = ((ValueNamePair) tenderTypePick.getValue()).getID(); - BigDecimal amt = new BigDecimal(formatter.format((nf.parse(fPayAmt.getText())).floatValue()));; - - if ( tenderType.equals(MPayment.TENDERTYPE_Cash) ) - { - p_posPanel.m_order.payCash(amt); - } - else if ( tenderType.equals(MPayment.TENDERTYPE_Check) ) - { - p_posPanel.m_order.payCheck(amt,fCheckAccountNo.getText(), fCheckRouteNo.getText(), fCheckNo.getText()); - p_posPanel.f_order.openCashDrawer(); - } - else if ( tenderType.equals(MPayment.TENDERTYPE_CreditCard) ) - { - String error = null; - error = MPaymentValidate.validateCreditCardExp(fCCardMonth.getText()); - if ( error != null && !error.isEmpty() ) - { - ADialog.warn(0, p_posPanel, error); - return; - } - int month = MPaymentValidate.getCreditCardExpMM(fCCardMonth.getText()); - int year = MPaymentValidate.getCreditCardExpYY(fCCardMonth.getText()); - - String type = ((ValueNamePair) fCCardType.getSelectedItem()).getValue(); - error = MPaymentValidate.validateCreditCardNumber(fCCardNo.getText(), type); - if ( error != null && !error.isEmpty() ) - { - ADialog.warn(0, p_posPanel, error); - return; - } - p_posPanel.m_order.payCreditCard(amt, fCCardName.getText(), - month, year, fCCardNo.getText(), fCCardVC.getText(), type); - p_posPanel.f_order.openCashDrawer(); - } - else if ( tenderType.equals(MPayment.TENDERTYPE_Account) ) - { - p_posPanel.m_order.payCash(amt); - p_posPanel.f_order.openCashDrawer(); - } - else - { - ADialog.warn(0, this, "Unsupported payment type"); - } - - - p_posPanel.f_order.openCashDrawer(); - setTotals(); - } - catch (Exception e ) - { - ADialog.warn(0, this, "Payment processing failed: " + e.getMessage()); - } - } - - private PosBasePanel p_posPanel; - private MPOS p_pos; - private Properties p_ctx; - private PosOrderModel p_order; - private CTextField fTotal = new CTextField(10); - private CTextField fBalance = new CTextField(10); - private CComboBoxtenderTypePick = new CComboBox(); - private PosTextField fPayAmt; - private CButton f_bProcess; - private boolean paid = false; - private BigDecimal balance = Env.ZERO; - private PosTextField fCheckAccountNo; - private PosTextField fCheckNo; - private PosTextField fCheckRouteNo; - private PosTextField fCCardNo; - private PosTextField fCCardName; - private CComboBoxfCCardType; - private PosTextField fCCardMonth; - private PosTextField fCCardVC; - - private CLabel lCheckNo; - private CLabel lCheckAccountNo; - private CLabel lCheckRouteNo; - private CLabel lCCardNo; - private CLabel lCCardName; - private CLabel lCCardType; - private CLabel lCCardMonth; - private CLabel lCCardVC; - private PosTextField fTenderAmt; - private CLabel lTenderAmt; - private PosTextField fReturnAmt; - private CLabel lReturnAmt; - private CButton f_bCancel; - - public PosPayment(PosBasePanel posPanel) { - super(AEnv.getFrame(posPanel),true); - p_posPanel = posPanel; - p_pos = posPanel.p_pos; - p_ctx = p_pos.getCtx(); - p_order = p_posPanel.m_order; - - if ( p_order == null ) - dispose(); - - init(); - pack(); - setLocationByPlatform(true); - } - - private void init() { - - Font font = AdempierePLAF.getFont_Field().deriveFont(18f); - - // North - CPanel mainPanel = new CPanel(new MigLayout("hidemode 3", - "[100:100:300, trailing]20[200:200:300,grow, trailing]")); - getContentPane().add(mainPanel); - - mainPanel.setBorder(new TitledBorder(Msg.translate(p_ctx, "Payment"))); - CLabel gtLabel = new CLabel(Msg.translate(p_ctx, "GrandTotal")); - mainPanel.add(gtLabel, "growx"); - mainPanel.add(fTotal, "wrap, growx"); - fTotal.setEditable(false); - fTotal.setFont(font); - fTotal.setHorizontalAlignment(JTextField.TRAILING); - - mainPanel.add(new CLabel(Msg.translate(p_ctx, "Balance")), "growx"); - mainPanel.add(fBalance, "wrap, growx"); - fBalance.setEditable(false); - fBalance.setFont(font); - fBalance.setHorizontalAlignment(JTextField.TRAILING); - - - mainPanel.add(new CLabel(Msg.translate(p_ctx, "TenderType"), "growx")); - // Payment type selection - int AD_Column_ID = COLUMN_C_PAYMENT_V_TENDERTYPE; //C_Payment_v.TenderType - MLookup lookup = MLookupFactory.get(Env.getCtx(), 0, 0, AD_Column_ID, DisplayType.List); - ArrayList types = lookup.getData(true, false, true, true, false); // IDEMPIERE 90 - - DefaultComboBoxModel typeModel = new DefaultComboBoxModel(types.toArray()); - tenderTypePick.setModel(typeModel); - // default to cash payment - for (Object obj : types) - { - if ( obj instanceof ValueNamePair ) - { - ValueNamePair key = (ValueNamePair) obj; - if ( key.getID().equals("X")) // Cash - tenderTypePick.setSelectedItem(key); - - if ( ! "CKX".contains(key.getID() ) ) - tenderTypePick.removeItem(key); - } - } - - tenderTypePick.setFont(font); - tenderTypePick.addActionListener(this); - tenderTypePick.setName("tenderTypePick"); //red1 for ID purpuse during testing - tenderTypePick.setRenderer(new ListCellRenderer() { - protected DefaultListCellRenderer defaultRenderer = new DefaultListCellRenderer(); - - public Component getListCellRendererComponent(JList list, Object value, - int index, boolean isSelected, boolean cellHasFocus) { - - JLabel renderer = (JLabel) defaultRenderer - .getListCellRendererComponent(list, value, index, isSelected, - cellHasFocus); - - renderer.setPreferredSize(new Dimension(50, 50)); - renderer.setHorizontalAlignment(JLabel.CENTER); - - return renderer; - - } - }); - - mainPanel.add(tenderTypePick, "wrap, h 50!, growx"); - - fPayAmt = new PosTextField(Msg.translate(p_ctx, "PayAmt"), p_posPanel, p_pos.getOSNP_KeyLayout_ID(), DisplayType.getNumberFormat(DisplayType.Amount)); - mainPanel.add(new CLabel(Msg.translate(p_ctx, "PayAmt")), "growx"); - fPayAmt.setFont(font); - fPayAmt.setHorizontalAlignment(JTextField.TRAILING); - fPayAmt.addActionListener(this); - mainPanel.add(fPayAmt, "wrap, growx"); - - fTenderAmt = new PosTextField(Msg.translate(p_ctx, "AmountTendered"), p_posPanel, p_pos.getOSNP_KeyLayout_ID(), DisplayType.getNumberFormat(DisplayType.Amount)); - lTenderAmt = new CLabel(Msg.translate(p_ctx, "AmountTendered")); - mainPanel.add(lTenderAmt, "growx"); - fTenderAmt.addActionListener(this); - fTenderAmt.setFont(font); - fTenderAmt.setHorizontalAlignment(JTextField.TRAILING); - mainPanel.add(fTenderAmt, "wrap, growx"); - - fReturnAmt = new PosTextField(Msg.translate(p_ctx, "AmountReturned"), p_posPanel, p_pos.getOSNP_KeyLayout_ID(), DisplayType.getNumberFormat(DisplayType.Amount)); - lReturnAmt = new CLabel(Msg.translate(p_ctx, "AmountReturned")); - mainPanel.add(lReturnAmt, "growx"); - fReturnAmt.setFont(font); - fReturnAmt.setHorizontalAlignment(JTextField.TRAILING); - mainPanel.add(fReturnAmt, "wrap, growx"); - fReturnAmt.setEditable(false); - - fCheckRouteNo = new PosTextField(Msg.translate(p_ctx, "RoutingNo"), p_posPanel, p_pos.getOSNP_KeyLayout_ID(), new DecimalFormat("#")); - lCheckRouteNo = new CLabel(Msg.translate(p_ctx, "RoutingNo")); - mainPanel.add(lCheckRouteNo, "growx"); - mainPanel.add(fCheckRouteNo, "wrap, growx"); - fCheckRouteNo.setFont(font); - fCheckRouteNo.setHorizontalAlignment(JTextField.TRAILING); - - fCheckAccountNo = new PosTextField(Msg.translate(p_ctx, "AccountNo"), p_posPanel, p_pos.getOSNP_KeyLayout_ID(), new DecimalFormat("#")); - lCheckAccountNo = new CLabel(Msg.translate(p_ctx, "AccountNo")); - mainPanel.add(lCheckAccountNo, "growx"); - mainPanel.add(fCheckAccountNo, "wrap, growx"); - fCheckAccountNo.setFont(font); - fCheckAccountNo.setHorizontalAlignment(JTextField.TRAILING); - - fCheckNo = new PosTextField(Msg.translate(p_ctx, "CheckNo"), p_posPanel, p_pos.getOSNP_KeyLayout_ID(), new DecimalFormat("#")); - lCheckNo = new CLabel(Msg.translate(p_ctx, "CheckNo")); - mainPanel.add(lCheckNo, "growx"); - mainPanel.add(fCheckNo, "wrap, growx"); - fCheckNo.setFont(font); - fCheckNo.setHorizontalAlignment(JTextField.TRAILING); - - /** - * Load Credit Cards - */ - ValueNamePair[] ccs = p_order.getCreditCards((BigDecimal) fPayAmt.getValue()); - // Set Selection - fCCardType = new CComboBox(ccs); - fCCardType.setName("cardType"); //red1 Id for testing - fCCardType.setRenderer(new ListCellRenderer() { - protected DefaultListCellRenderer defaultRenderer = new DefaultListCellRenderer(); - - public Component getListCellRendererComponent(JList list, Object value, - int index, boolean isSelected, boolean cellHasFocus) { - - JLabel renderer = (JLabel) defaultRenderer - .getListCellRendererComponent(list, value, index, isSelected, - cellHasFocus); - - renderer.setPreferredSize(new Dimension(50, 50)); - renderer.setHorizontalAlignment(JLabel.CENTER); - - return renderer; - - } - }); - lCCardType = new CLabel(Msg.translate(p_ctx, "CreditCardType")); - mainPanel.add(lCCardType, "growx"); - mainPanel.add(fCCardType, "h 50, wrap, growx"); - fCCardType.setFont(font); - - fCCardNo = new PosTextField(Msg.translate(p_ctx, "CreditCardNumber"), p_posPanel, p_pos.getOSNP_KeyLayout_ID(), new DecimalFormat("#")); - lCCardNo = new CLabel(Msg.translate(p_ctx, "CreditCardNumber")); - fCCardNo.setName("cardNo"); - mainPanel.add(lCCardNo, "growx"); - mainPanel.add(fCCardNo, "wrap, growx"); - fCCardNo.setFont(font); - fCCardNo.setHorizontalAlignment(JTextField.TRAILING); - - fCCardName = new PosTextField(Msg.translate(p_ctx, "Name"), p_posPanel, p_pos.getOSK_KeyLayout_ID()); - lCCardName = new CLabel(Msg.translate(p_ctx, "Name")); - mainPanel.add(lCCardName, "growx"); - mainPanel.add(fCCardName, "wrap, growx"); - fCCardName.setFont(font); - fCCardName.setHorizontalAlignment(JTextField.TRAILING); - - fCCardMonth = new PosTextField(Msg.translate(p_ctx, "Expires"), p_posPanel, p_pos.getOSNP_KeyLayout_ID(), new DecimalFormat("#")); - lCCardMonth = new CLabel(Msg.translate(p_ctx, "Expires")); - fCCardMonth.setName("expiry"); - mainPanel.add(lCCardMonth, "growx"); - mainPanel.add(fCCardMonth, "wrap, w 75!"); - fCCardMonth.setFont(font); - fCCardMonth.setHorizontalAlignment(JTextField.TRAILING); - - fCCardVC = new PosTextField(Msg.translate(p_ctx, "CVC"), p_posPanel, p_pos.getOSNP_KeyLayout_ID(), new DecimalFormat("#")); - lCCardVC = new CLabel(Msg.translate(p_ctx, "CVC")); - mainPanel.add(lCCardVC, "growx"); - mainPanel.add(fCCardVC, "wrap, w 75!"); - fCCardVC.setFont(font); - fCCardVC.setHorizontalAlignment(JTextField.TRAILING); - - AppsAction actCancel = new AppsAction("Cancel", KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), false); - actCancel.setDelegate(this); - f_bCancel = (CButton)actCancel.getButton(); - f_bCancel.setFocusable(false); - mainPanel.add (f_bCancel, "h 50!, w 50!, skip, split 2, trailing"); - - AppsAction act = new AppsAction("Ok", KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), false); - act.setDelegate(this); - f_bProcess = (CButton)act.getButton(); - f_bProcess.setFocusable(false); - mainPanel.add (f_bProcess, "h 50!, w 50!"); - - pack(); - - setTotals(); - } - - private void setTotals() { - - String tenderType = ((ValueNamePair) tenderTypePick.getValue()).getID(); - boolean cash = MPayment.TENDERTYPE_Cash.equals(tenderType); - boolean check = MPayment.TENDERTYPE_Check.equals(tenderType); - boolean creditcard = MPayment.TENDERTYPE_CreditCard.equals(tenderType); - //boolean account = MPayment.TENDERTYPE_Account.equals(tenderType); - - fTenderAmt.setVisible(cash); - fReturnAmt.setVisible(cash); - lTenderAmt.setVisible(cash); - lReturnAmt.setVisible(cash); - - fCheckAccountNo.setVisible(check); - fCheckNo.setVisible(check); - fCheckRouteNo.setVisible(check); - lCheckAccountNo.setVisible(check); - lCheckNo.setVisible(check); - lCheckRouteNo.setVisible(check); - - fCCardMonth.setVisible(creditcard); - fCCardName.setVisible(creditcard); - fCCardNo.setVisible(creditcard); - fCCardType.setVisible(creditcard); - fCCardVC.setVisible(creditcard); - lCCardMonth.setVisible(creditcard); - lCCardName.setVisible(creditcard); - lCCardNo.setVisible(creditcard); - lCCardType.setVisible(creditcard); - lCCardVC.setVisible(creditcard); - - fTotal.setValue(p_order.getGrandTotal()); - - BigDecimal received = p_order.getPaidAmt(); - balance = p_order.getGrandTotal().subtract(received); - balance = balance.setScale(MCurrency.getStdPrecision(p_ctx, p_order.getC_Currency_ID())); - if ( balance.compareTo(Env.ZERO) <= 0 ) - { - paid = true; - - if ( balance.compareTo(Env.ZERO) < 0 ) - ADialog.warn(0, this, Msg.getMsg(p_ctx, "Change") + ": " + balance); - dispose(); - } - - fBalance.setValue(balance); - fPayAmt.setValue(balance); - if ( !MPayment.TENDERTYPE_Cash.equals(tenderType) ) - { - fPayAmt.requestFocusInWindow(); - SwingUtilities.invokeLater(new Runnable() { - - public void run() { - fPayAmt.selectAll(); - } - }); - } - else - { - fTenderAmt.requestFocusInWindow(); - } - - pack(); - } - - public void keyReturned(MPOSKey key) { - - String text = key.getText(); - String payAmt = fPayAmt.getText(); - String selected = fPayAmt.getSelectedText(); - if ( selected != null && !selected.isEmpty() ) - { - payAmt = payAmt.replaceAll(selected, ""); - } - - if ( text != null && !text.isEmpty() ) - { - if ( text.equals(".") && payAmt.indexOf(".") == -1 ) - { - fPayAmt.setText(payAmt + text); - return; - } - try - { - Integer.parseInt(text); // test if number - fPayAmt.setText(payAmt + text); - } - catch (NumberFormatException e) - { - // ignore non-numbers - } - } - } - - public static boolean pay(PosBasePanel posPanel) { - - PosPayment pay = new PosPayment(posPanel); - pay.setVisible(true); - - return pay.isPaid(); - } - - private boolean isPaid() { - return paid ; - } - - public void vetoableChange(PropertyChangeEvent arg0) - throws PropertyVetoException { - // TODO Auto-generated method stub - - } - - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosQuery.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosQuery.java deleted file mode 100644 index 5a23339f37..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosQuery.java +++ /dev/null @@ -1,141 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.pos; - -import java.awt.Dimension; -import java.awt.HeadlessException; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.util.Properties; - -import javax.swing.KeyStroke; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; - -import org.compiere.apps.AEnv; -import org.compiere.apps.AppsAction; -import org.compiere.apps.ConfirmPanel; -import org.compiere.model.MPOS; -import org.compiere.swing.CButton; -import org.compiere.swing.CDialog; -import org.compiere.swing.CPanel; -import org.compiere.swing.CScrollPane; -import org.compiere.util.CLogger; - -public abstract class PosQuery extends CDialog implements MouseListener, ListSelectionListener, ActionListener { - /** - * - */ - private static final long serialVersionUID = -6227838436743951898L; - - protected Properties p_ctx; - /** POS Panel */ - protected PosBasePanel p_posPanel = null; - /** Underlying POS Model */ - protected MPOS p_pos = null; - /** The Table */ - protected PosTable m_table; - protected CPanel northPanel; - protected CScrollPane centerScroll; - protected ConfirmPanel confirm; - protected CButton f_up; - protected CButton f_down; - /** Logger */ - protected static CLogger log = CLogger.getCLogger(QueryProduct.class); - - public PosQuery() throws HeadlessException { - super(); - } - - protected abstract void close(); - - public abstract void reset(); - - public abstract void actionPerformed(ActionEvent e); - - public void dispose() { - removeAll(); - northPanel = null; - centerScroll = null; - confirm = null; - m_table = null; - super.dispose(); - } - - protected abstract void init(); - protected abstract void enableButtons(); - - /** - * Constructor - */ - public PosQuery (PosBasePanel posPanel) - { - super(AEnv.getFrame(posPanel), true); - p_posPanel = posPanel; - p_pos = posPanel.p_pos; - p_ctx = p_pos.getCtx(); - init(); - pack(); - setLocationByPlatform(true); - } // PosQueryBPartner - - /** - * Mouse Clicked - * @param e event - */ - public void mouseClicked(MouseEvent e) - { - // Single click with selected row => exit - if (e.getClickCount() > 0 && m_table.getSelectedRow() != -1) - { - enableButtons(); - close(); - } - } // mouseClicked - - public void mouseEntered (MouseEvent e) {} - public void mouseExited (MouseEvent e) {} - public void mousePressed (MouseEvent e) {} - public void mouseReleased (MouseEvent e) {} - - /** - * Table selection changed - * @param e event - */ - public void valueChanged (ListSelectionEvent e) - { - if (e.getValueIsAdjusting()) - return; - enableButtons(); - } // valueChanged - - /** - * Create Action Button - * @param action action - * @return button - */ - protected CButton createButtonAction(String action, KeyStroke accelerator) { - AppsAction act = new AppsAction(action, accelerator, false); - act.setDelegate(this); - CButton button = (CButton)act.getButton(); - button.setPreferredSize(new Dimension(WIDTH, HEIGHT)); - button.setMinimumSize(getPreferredSize()); - button.setMaximumSize(getPreferredSize()); - button.setFocusable(false); - return button; - } // getButtonAction - -} \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosSubPanel.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosSubPanel.java deleted file mode 100644 index 1a825030fb..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosSubPanel.java +++ /dev/null @@ -1,165 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ - -package org.compiere.pos; - -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.Properties; - -import javax.swing.KeyStroke; - -import org.compiere.apps.AEnv; -import org.compiere.apps.AppsAction; -import org.compiere.model.MOrder; -import org.compiere.model.MPOS; -import org.compiere.print.ReportCtl; -import org.compiere.print.ReportEngine; -import org.compiere.swing.CButton; -import org.compiere.swing.CPanel; -import org.compiere.util.Env; - -/** - * POS Sub Panel Base Class. - * @author Comunidad de Desarrollo OpenXpertya - * *Basado en Codigo Original Modificado, Revisado y Optimizado de: - * *Copyright (c) Jorg Janke - * - */ -public abstract class PosSubPanel extends CPanel - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -8112502747494990955L; - - /** - * Constructor - * @param posPanel POS Panel - */ - public PosSubPanel (PosBasePanel posPanel) - { - super(); - p_posPanel = posPanel; - p_pos = posPanel.p_pos; - init(); - } // PosSubPanel - - /** POS Panel */ - protected PosBasePanel p_posPanel; - /** Underlying POS Model */ - protected MPOS p_pos; - /** Context */ - protected Properties p_ctx = Env.getCtx(); - - protected static CButton f_cashPayment; - - /** Button Width = 50 */ - private static final int WIDTH = 50; - /** Button Height = 50 */ - private static final int HEIGHT = 50; - - /** - * Initialize - */ - protected abstract void init(); - - /** - * Dispose - Free Resources - */ - public void dispose() - { - p_pos = null; - } // dispose - - - /** - * Create Action Button - * @param action action - * @return button - */ - protected CButton createButtonAction (String action, KeyStroke accelerator) - { - AppsAction act = new AppsAction(action, accelerator, false); - act.setDelegate(this); - CButton button = (CButton)act.getButton(); - button.setPreferredSize(new Dimension(WIDTH, HEIGHT)); - button.setMinimumSize(getPreferredSize()); - button.setMaximumSize(getPreferredSize()); - button.setFocusable(false); - return button; - } // getButtonAction - - /** - * Create Standard Button - * @param text text - * @return button - */ - protected CButton createButton (String text) - { - // if (text.indexOf("") == -1) - // text = "

    " + text + "

    "; - CButton button = new CButton(text); - button.addActionListener(this); - button.setPreferredSize(new Dimension(WIDTH, HEIGHT)); - button.setMinimumSize(getPreferredSize()); - button.setMaximumSize(getPreferredSize()); - button.setFocusable(false); - return button; - } // getButton - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - } // actionPerformed - /** - * Print Ticket - * @author Comunidad de Desarrollo OpenXpertya - * *Basado en Codigo Original Modificado, Revisado y Optimizado de: - * *Copyright ConSerTi - */ - public void printTicket() - { - if ( p_posPanel.m_order == null ) - return; - - MOrder order = p_posPanel.m_order; - //int windowNo = p_posPanel.getWindowNo(); - //Properties m_ctx = p_posPanel.getPropiedades(); - - if (order != null) - { - try - { - //TODO: to incorporate work from Posterita - /* - if (p_pos.getAD_PrintLabel_ID() != 0) - PrintLabel.printLabelTicket(order.getC_Order_ID(), p_pos.getAD_PrintLabel_ID()); - */ - //print standard document - ReportCtl.startDocumentPrint(ReportEngine.ORDER, order.getC_Order_ID(), null, AEnv.getWindowNo(this), true); - - } - catch (Exception e) - { - //log.severe("PrintTicket - Error Printing Ticket"); - } - } - } -} // PosSubPanel diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosTable.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosTable.java deleted file mode 100644 index 4977afa683..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosTable.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.compiere.pos; - -import java.awt.Container; -import java.awt.Dimension; - -import javax.swing.JScrollPane; -import javax.swing.JViewport; -import javax.swing.ListSelectionModel; - -import org.compiere.minigrid.MiniTable; - -public class PosTable extends MiniTable { - - /** - * - */ - private static final long serialVersionUID = 7884238751207398699L; - - public PosTable() { - - super(); - setRowSelectionAllowed(true); - setColumnSelectionAllowed(false); - setMultiSelection(false); - setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - setRowHeight(30); - setAutoResize(false); - } - - public void growScrollbars() { - // fatter scroll bars - Container p = getParent(); - if (p instanceof JViewport) { - Container gp = p.getParent(); - if (gp instanceof JScrollPane) { - JScrollPane scrollPane = (JScrollPane) gp; - scrollPane.getVerticalScrollBar().setPreferredSize(new Dimension(30,0)); - scrollPane.getHorizontalScrollBar().setPreferredSize(new Dimension(0,30)); - } - } - } - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosTextField.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosTextField.java deleted file mode 100644 index ffc3871cf0..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosTextField.java +++ /dev/null @@ -1,93 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.pos; - -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.text.Format; - -import javax.swing.JFormattedTextField; -import javax.swing.text.DefaultFormatterFactory; - -/** - * Formatted Text field with on-screen keyboard support - * @author Paul Bowden - * Adaxa Pty Ltd - * - */ -public class PosTextField extends JFormattedTextField implements MouseListener { - /** - * - */ - private static final long serialVersionUID = -2453719110038264481L; - @SuppressWarnings("unused") - private DefaultFormatterFactory formatFactory = new DefaultFormatterFactory(); - PosBasePanel pos = null; - int keyLayoutId = 0; - private String title; - - public PosTextField(String title, PosBasePanel pos, final int posKeyLayout_ID, Format format ) { - super(format); - - if ( posKeyLayout_ID > 0 ) - addMouseListener(this); - - keyLayoutId = posKeyLayout_ID; - this.pos = pos; - this.title = title; - - } - - public PosTextField(String title, PosBasePanel pos, final int posKeyLayout_ID, AbstractFormatter formatter ) { - super(formatter); - - if ( posKeyLayout_ID > 0 ) - addMouseListener(this); - - keyLayoutId = posKeyLayout_ID; - this.pos = pos; - this.title = title; - - } - - - public PosTextField(String title, PosBasePanel pos, final int posKeyLayout_ID) { - super(); - - if ( posKeyLayout_ID > 0 ) - addMouseListener(this); - - keyLayoutId = posKeyLayout_ID; - this.pos = pos; - this.title = title; - - } - - public void mouseReleased(MouseEvent arg0) {} - public void mousePressed(MouseEvent arg0) {} - public void mouseExited(MouseEvent arg0) {} - public void mouseEntered(MouseEvent arg0) {} - - public void mouseClicked(MouseEvent arg0) { - - if ( isEnabled() && isEditable() ) - { - POSKeyboard keyboard = pos.getKeyboard(keyLayoutId); - keyboard.setTitle(title); - keyboard.setPosTextField(this); - keyboard.setVisible(true); - fireActionPerformed(); - } - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/QueryBPartner.java b/org.adempiere.ui.swing/src/org/compiere/pos/QueryBPartner.java deleted file mode 100644 index 759e0a20ac..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/QueryBPartner.java +++ /dev/null @@ -1,300 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ - -package org.compiere.pos; - -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.KeyEvent; -import java.util.logging.Level; - -import javax.swing.KeyStroke; -import javax.swing.border.TitledBorder; - -import net.miginfocom.swing.MigLayout; - -import org.compiere.minigrid.ColumnInfo; -import org.compiere.minigrid.IDColumn; -import org.compiere.model.MBPartnerInfo; -import org.compiere.swing.CButton; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CScrollPane; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * POS Query BPartner - * - * @author Comunidad de Desarrollo OpenXpertya - * *Basado en Codigo Original Modificado, Revisado y Optimizado de: - * *Copyright (c) Jorg Janke - * @version $Id: QueryBPartner.java,v 1.1 2004/07/12 04:10:04 jjanke Exp $ - */ -public class QueryBPartner extends PosQuery -{ - /** - * - */ - private static final long serialVersionUID = -4500636033505855695L; - - /** - * Constructor - */ - public QueryBPartner (PosBasePanel posPanel) - { - super(posPanel); - } // PosQueryBPartner - - private PosTextField f_value; - private PosTextField f_name; - private PosTextField f_contact; - private PosTextField f_email; - private PosTextField f_phone; - private CTextField f_city; - - private int m_C_BPartner_ID; - private CButton f_refresh; - private CButton f_ok; - private CButton f_cancel; - /** Logger */ - private static CLogger log = CLogger.getCLogger(QueryBPartner.class); - - - /** Table Column Layout Info */ - private static ColumnInfo[] s_layout = new ColumnInfo[] - { - new ColumnInfo(" ", "C_BPartner_ID", IDColumn.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "Value"), "Value", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "Name", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "Email"), "Email", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "Phone"), "Phone", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "Postal"), "Postal", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "City"), "City", String.class) - }; - /** From Clause */ - private static String s_sqlFrom = "RV_BPartner"; - /** Where Clause */ - private static String s_sqlWhere = "IsActive='Y'"; - - /** - * Set up Panel - */ - protected void init() - { - CPanel panel = new CPanel(); - - panel.setLayout(new MigLayout("fill")); - getContentPane().add(panel); - // North - northPanel = new CPanel(new MigLayout("fill","", "[50][50][]")); - panel.add (northPanel, "north"); - northPanel.setBorder(new TitledBorder(Msg.getMsg(p_ctx, "Query"))); - - CLabel lvalue = new CLabel(Msg.translate(p_ctx, "Value")); - northPanel.add (lvalue, " growy"); - f_value = new PosTextField("", p_posPanel, p_pos.getOSK_KeyLayout_ID()); - lvalue.setLabelFor(f_value); - northPanel.add(f_value, "h 30, w 200"); - f_value.addActionListener(this); - - // - CLabel lcontact = new CLabel(Msg.translate(p_ctx, "Contact")); - northPanel.add (lcontact, " growy"); - f_contact = new PosTextField("", p_posPanel, p_pos.getOSK_KeyLayout_ID()); - lcontact.setLabelFor(f_contact); - northPanel.add(f_contact, "h 30, w 200"); - f_contact.addActionListener(this); - - // - CLabel lphone = new CLabel(Msg.translate(p_ctx, "Phone")); - northPanel.add (lphone, " growy"); - f_phone = new PosTextField("", p_posPanel, p_pos.getOSK_KeyLayout_ID()); - lphone.setLabelFor(f_phone); - northPanel.add(f_phone, "h 30, w 200, wrap"); - f_phone.addActionListener(this); - - // - CLabel lname = new CLabel(Msg.translate(p_ctx, "Name")); - northPanel.add (lname, " growy"); - f_name = new PosTextField("", p_posPanel, p_pos.getOSK_KeyLayout_ID()); - lname.setLabelFor(f_name); - northPanel.add(f_name, "h 30, w 200"); - f_name.addActionListener(this); - // - CLabel lemail = new CLabel(Msg.translate(p_ctx, "Email")); - northPanel.add (lemail, " growy"); - f_email = new PosTextField("", p_posPanel, p_pos.getOSK_KeyLayout_ID()); - lemail.setLabelFor(f_email); - northPanel.add(f_email, "h 30, w 200"); - f_email.addActionListener(this); - // - CLabel lcity = new CLabel(Msg.translate(p_ctx, "City")); - northPanel.add (lcity, " growy"); - f_city = new CTextField(10); - lcity.setLabelFor(f_city); - northPanel.add(f_city, "h 30, w 200"); - f_city.addActionListener(this); - // - - f_refresh = createButtonAction("Refresh", KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0)); - northPanel.add(f_refresh, "w 50!, h 50!, wrap, alignx trailing"); - - f_up = createButtonAction("Previous", KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0)); - northPanel.add(f_up, "w 50!, h 50!, span, split 4"); - f_down = createButtonAction("Next", KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0)); - northPanel.add(f_down, "w 50!, h 50!"); - - f_ok = createButtonAction("Ok", KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)); - northPanel.add(f_ok, "w 50!, h 50!"); - - f_cancel = createButtonAction("Cancel", KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0)); - northPanel.add(f_cancel, "w 50!, h 50!"); - - // Center - m_table = new PosTable(); - @SuppressWarnings("unused") - String sql = m_table.prepareTable (s_layout, s_sqlFrom, - s_sqlWhere, false, "RV_BPartner") - + " ORDER BY Value"; - m_table.addMouseListener(this); - m_table.getSelectionModel().addListSelectionListener(this); - enableButtons(); - centerScroll = new CScrollPane(m_table); - panel.add (centerScroll, "growx, growy"); - m_table.growScrollbars(); - panel.setPreferredSize(new Dimension(800,600)); - f_value.requestFocus(); - } // init - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (log.isLoggable(Level.INFO)) log.info(e.getActionCommand()); - if ("Refresh".equals(e.getActionCommand()) - || e.getSource() == f_value // || e.getSource() == f_upc - || e.getSource() == f_name // || e.getSource() == f_sku - ) - { - setResults(MBPartnerInfo.find (p_ctx, - f_value.getText(), f_name.getText(), - null, f_email.getText(), - f_phone.getText(), f_city.getText())); - return; - } - else if ("Reset".equals(e.getActionCommand())) - { - reset(); - return; - } - else if ("Previous".equalsIgnoreCase(e.getActionCommand())) - { - int rows = m_table.getRowCount(); - if (rows == 0) - return; - int row = m_table.getSelectedRow(); - row--; - if (row < 0) - row = 0; - m_table.getSelectionModel().setSelectionInterval(row, row); - return; - } - else if ("Next".equalsIgnoreCase(e.getActionCommand())) - { - int rows = m_table.getRowCount(); - if (rows == 0) - return; - int row = m_table.getSelectedRow(); - row++; - if (row >= rows) - row = rows - 1; - m_table.getSelectionModel().setSelectionInterval(row, row); - return; - } - // Exit - close(); - } // actionPerformed - - - /** - * Set/display Results - * @param results results - */ - public void setResults (MBPartnerInfo[] results) - { - m_table.loadTable(results); - enableButtons(); - } // setResults - - /** - * Enable/Set Buttons and set ID - */ - protected void enableButtons() - { - m_C_BPartner_ID = -1; - int row = m_table.getSelectedRow(); - boolean enabled = row != -1; - if (enabled) - { - Integer ID = m_table.getSelectedRowKey(); - if (ID != null) - { - m_C_BPartner_ID = ID.intValue(); - // m_BPartnerName = (String)m_table.getValueAt(row, 2); - // m_Price = (BigDecimal)m_table.getValueAt(row, 7); - } - } - f_ok.setEnabled(enabled); - if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_ID=" + m_C_BPartner_ID); - } // enableButtons - - /** - * Close. - * Set Values on other panels and close - */ - protected void close() - { - if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_ID=" + m_C_BPartner_ID); - - if (m_C_BPartner_ID > 0) - { - p_posPanel.f_order.setC_BPartner_ID(m_C_BPartner_ID); - // p_posPanel.f_curLine.setCurrency(m_Price); - } - else - { - p_posPanel.f_order.setC_BPartner_ID(0); - // p_posPanel.f_curLine.setPrice(Env.ZERO); - } - dispose(); - } // close - - - @Override - public void reset() { - f_value.setText(null); - f_name.setText(null); - f_contact.setText(null); - f_email.setText(null); - f_phone.setText(null); - f_city.setText(null); - setResults(new MBPartnerInfo[0]); - } - -} // PosQueryBPartner diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/QueryProduct.java b/org.adempiere.ui.swing/src/org/compiere/pos/QueryProduct.java deleted file mode 100644 index 50f2f95520..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/QueryProduct.java +++ /dev/null @@ -1,316 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ - -package org.compiere.pos; - -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.KeyEvent; -import java.math.BigDecimal; -import java.util.logging.Level; - -import javax.swing.KeyStroke; -import javax.swing.border.TitledBorder; - -import net.miginfocom.swing.MigLayout; - -import org.compiere.minigrid.ColumnInfo; -import org.compiere.minigrid.IDColumn; -import org.compiere.model.MWarehousePrice; -import org.compiere.swing.CButton; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CScrollPane; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * POS Query Product - * - * @author Based on Modified Original Code, Revised and Optimized - * *Copyright (c) Jorg Janke - */ -public class QueryProduct extends PosQuery -{ - /** - * - */ - private static final long serialVersionUID = 2618144050021362472L; - - /** - * Constructor - */ - public QueryProduct (PosBasePanel posPanel) - { - super(posPanel); - } // PosQueryProduct - - private PosTextField f_value; - private PosTextField f_name; - private PosTextField f_upc; - private PosTextField f_sku; - - private int m_M_Product_ID; - private String m_ProductName; - private BigDecimal m_Price; - // - private int m_M_PriceList_Version_ID; - private int m_M_Warehouse_ID; - private CButton f_refresh; - private CButton f_ok; - private CButton f_cancel; - /** Logger */ - private static CLogger log = CLogger.getCLogger(QueryProduct.class); - - - /** Table Column Layout Info */ - private static ColumnInfo[] s_layout = new ColumnInfo[] - { - new ColumnInfo(" ", "M_Product_ID", IDColumn.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "Value"), "Value", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "Name", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "UPC"), "UPC", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "SKU"), "SKU", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "QtyAvailable"), "QtyAvailable", Double.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOnHand"), "QtyOnHand", Double.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "PriceStd"), "PriceStd", BigDecimal.class) - }; - /** From Clause */ - private static String s_sqlFrom = "RV_WarehousePrice"; - /** Where Clause */ - private static String s_sqlWhere = "IsActive='Y'"; - - /** - * Set up Panel - */ - protected void init() - { - CPanel panel = new CPanel(); - - panel.setLayout(new MigLayout("fill")); - getContentPane().add(panel); - // North - northPanel = new CPanel(new MigLayout("fill", "", "[50][50][]")); - panel.add (northPanel, "north"); - northPanel.setBorder(new TitledBorder(Msg.getMsg(p_ctx, "Query"))); - - // - CLabel lvalue = new CLabel(Msg.translate(p_ctx, "Value")); - northPanel.add (lvalue, "growy"); - f_value = new PosTextField("", p_posPanel, p_pos.getOSK_KeyLayout_ID()); - f_value.setName("ProductKey"); //red1 for UISpec4J testing call - lvalue.setLabelFor(f_value); - northPanel.add(f_value, "h 30, w 200"); - f_value.addActionListener(this); - // - CLabel lupc = new CLabel(Msg.translate(p_ctx, "UPC")); - northPanel.add (lupc, "growy"); - f_upc = new PosTextField("", p_posPanel, p_pos.getOSK_KeyLayout_ID()); - lupc.setLabelFor(f_upc); - northPanel.add(f_upc, "h 30, w 200, wrap"); - f_upc.addActionListener(this); - // - CLabel lname = new CLabel(Msg.translate(p_ctx, "Name")); - northPanel.add (lname, "growy"); - f_name = new PosTextField("", p_posPanel, p_pos.getOSK_KeyLayout_ID()); - f_name.setName("ProductName"); //red1 for UISpec4J testing call - lname.setLabelFor(f_name); - northPanel.add(f_name, "h 30, w 200"); - f_name.addActionListener(this); - // - CLabel lsku = new CLabel(Msg.translate(p_ctx, "SKU")); - northPanel.add (lsku, "growy"); - f_sku = new PosTextField("", p_posPanel, p_pos.getOSK_KeyLayout_ID()); - lsku.setLabelFor(f_sku); - northPanel.add(f_sku, "h 30, w 200"); - f_sku.addActionListener(this); - // - - - f_refresh = createButtonAction("Refresh", KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0)); - northPanel.add(f_refresh, "w 50!, h 50!, wrap, alignx trailing"); - - f_up = createButtonAction("Previous", KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0)); - northPanel.add(f_up, "w 50!, h 50!, span, split 4"); - f_down = createButtonAction("Next", KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0)); - northPanel.add(f_down, "w 50!, h 50!"); - - f_ok = createButtonAction("Ok", KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)); - northPanel.add(f_ok, "w 50!, h 50!"); - - f_cancel = createButtonAction("Cancel", KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0)); - northPanel.add(f_cancel, "w 50!, h 50!"); - - // Center - m_table = new PosTable(); - @SuppressWarnings("unused") - String sql = m_table.prepareTable (s_layout, s_sqlFrom, - s_sqlWhere, false, "RV_WarehousePrice") - + " ORDER BY Margin, QtyAvailable"; - m_table.addMouseListener(this); - m_table.getSelectionModel().addListSelectionListener(this); - m_table.setColumnVisibility(m_table.getColumn(0), false); - m_table.getColumn(1).setPreferredWidth(175); - m_table.getColumn(2).setPreferredWidth(175); - m_table.getColumn(3).setPreferredWidth(100); - m_table.getColumn(4).setPreferredWidth(75); - m_table.getColumn(5).setPreferredWidth(75); - m_table.getColumn(6).setPreferredWidth(75); - m_table.getColumn(7).setPreferredWidth(75); - enableButtons(); - m_table.setFillsViewportHeight( true ); //@Trifon - m_table.growScrollbars(); - centerScroll = new CScrollPane(m_table); - panel.add (centerScroll, "growx, growy,south"); - panel.setPreferredSize(new Dimension(800,600)); - f_value.requestFocus(); - } // init - - /** - * Set Query Data - * @param M_PriceList_Version_ID plv - * @param M_Warehouse_ID wh - */ - public void setQueryData (int M_PriceList_Version_ID, int M_Warehouse_ID) - { - m_M_PriceList_Version_ID = M_PriceList_Version_ID; - m_M_Warehouse_ID = M_Warehouse_ID; - } // setQueryData - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (log.isLoggable(Level.INFO)) log.info(e.getActionCommand()); - if ("Refresh".equals(e.getActionCommand()) - || e.getSource() == f_value || e.getSource() == f_upc - || e.getSource() == f_name || e.getSource() == f_sku) - { - setResults(MWarehousePrice.find (p_ctx, - m_M_PriceList_Version_ID, m_M_Warehouse_ID, - f_value.getText(), f_name.getText(), f_upc.getText(), f_sku.getText(), null)); - return; - } - else if ("Reset".equals(e.getActionCommand())) - { - reset(); - return; - } - else if ("Previous".equalsIgnoreCase(e.getActionCommand())) - { - int rows = m_table.getRowCount(); - if (rows == 0) - return; - int row = m_table.getSelectedRow(); - row--; - if (row < 0) - row = 0; - m_table.getSelectionModel().setSelectionInterval(row, row); - // https://sourceforge.net/tracker/?func=detail&atid=879332&aid=3121975&group_id=176962 - m_table.scrollRectToVisible(m_table.getCellRect(row, 1, true)); //@Trifon - BF[3121975] - return; - } - else if ("Next".equalsIgnoreCase(e.getActionCommand())) - { - int rows = m_table.getRowCount(); - if (rows == 0) - return; - int row = m_table.getSelectedRow(); - row++; - if (row >= rows) - row = rows - 1; - m_table.getSelectionModel().setSelectionInterval(row, row); - // https://sourceforge.net/tracker/?func=detail&atid=879332&aid=3121975&group_id=176962 - m_table.scrollRectToVisible(m_table.getCellRect(row, 1, true)); //@Trifon - BF[3121975] - return; - } - // Exit - close(); - } // actionPerformed - - - /** - * Set/display Results - * @param results results - */ - public void setResults (MWarehousePrice[] results) - { - m_table.loadTable(results); - if (m_table.getRowCount() >0 ) - m_table.setRowSelectionInterval(0, 0); - enableButtons(); - } // setResults - - /** - * Enable/Set Buttons and set ID - */ - protected void enableButtons() - { - m_M_Product_ID = -1; - m_ProductName = null; - m_Price = null; - int row = m_table.getSelectedRow(); - boolean enabled = row != -1; - if (enabled) - { - Integer ID = m_table.getSelectedRowKey(); - if (ID != null) - { - m_M_Product_ID = ID.intValue(); - m_ProductName = (String)m_table.getValueAt(row, 2); - m_Price = (BigDecimal)m_table.getValueAt(row, 7); - } - } - f_ok.setEnabled(enabled); - if (log.isLoggable(Level.FINE)) log.fine("M_Product_ID=" + m_M_Product_ID + " - " + m_ProductName + " - " + m_Price); - } // enableButtons - - - - /** - * Close. - * Set Values on other panels and close - */ - protected void close() - { - if (log.isLoggable(Level.FINE)) log.fine("M_Product_ID=" + m_M_Product_ID); - - if (m_M_Product_ID > 0) - { - p_posPanel.f_curLine.setM_Product_ID(m_M_Product_ID); - p_posPanel.f_curLine.setPrice(m_Price); - } - else - { - p_posPanel.f_curLine.setM_Product_ID(0); - p_posPanel.f_curLine.setPrice(Env.ZERO); - } - dispose(); - } // close - - - @Override - public void reset() { - - f_value.setText(null); - f_name.setText(null); - f_sku.setText(null); - f_upc.setText(null); - setResults(new MWarehousePrice[0]); - } - -} // PosQueryProduct diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/QueryTicket.java b/org.adempiere.ui.swing/src/org/compiere/pos/QueryTicket.java deleted file mode 100644 index 266698e243..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/QueryTicket.java +++ /dev/null @@ -1,306 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ - -package org.compiere.pos; - -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.KeyEvent; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.Timestamp; -import java.util.Properties; -import java.util.logging.Level; - -import javax.swing.KeyStroke; -import javax.swing.border.TitledBorder; - -import net.miginfocom.swing.MigLayout; - -import org.compiere.grid.ed.VDate; -import org.compiere.minigrid.ColumnInfo; -import org.compiere.minigrid.IDColumn; -import org.compiere.swing.CButton; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CScrollPane; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * POS Query Product - * - * @author Comunidad de Desarrollo OpenXpertya - * *Basado en Codigo Original Modificado, Revisado y Optimizado de: - * *Jose A.Gonzalez, Conserti. - * - * @version $Id: QueryTicket.java,v 0.9 $ - * - * @Colaborador $Id: Consultoria y Soporte en Redes y Tecnologias de la Informacion S.L. - * - */ - -public class QueryTicket extends PosQuery -{ - /** - * - */ - private static final long serialVersionUID = 1487067464540688770L; - - /** - * Constructor - */ - public QueryTicket (PosBasePanel posPanel) - { - super(posPanel); - } // PosQueryProduct - - - private PosTextField f_documentno; - private VDate f_date; - - private int m_c_order_id; - private CCheckBox f_processed; - private CButton f_refresh; - private CButton f_ok; - private CButton f_cancel; - - /** Table Column Layout Info */ - private static ColumnInfo[] s_layout = new ColumnInfo[] - { - new ColumnInfo(" ", "C_Order_ID", IDColumn.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "DocumentNo"), "DocumentNo", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "TotalLines"), "TotalLines", BigDecimal.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "GrandTotal"), "GrandTotal", BigDecimal.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "C_BPartner_ID"), "Name", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "Processed"), "Processed", Boolean.class) - }; - - /** - * Set up Panel - */ - @Override - protected void init() - { - CPanel panel = new CPanel(); - - panel.setLayout(new MigLayout("fill")); - getContentPane().add(panel); - // North - northPanel = new CPanel(new MigLayout("fill","", "[50][50][]")); - panel.add (northPanel, "north"); - northPanel.setBorder(new TitledBorder(Msg.getMsg(p_ctx, "Query"))); - - CLabel ldoc = new CLabel(Msg.translate(p_ctx, "DocumentNo")); - northPanel.add (ldoc, " growy"); - f_documentno = new PosTextField("", p_posPanel, p_pos.getOSK_KeyLayout_ID()); - ldoc.setLabelFor(f_documentno); - northPanel.add(f_documentno, "h 30, w 200"); - f_documentno.addActionListener(this); - // - CLabel ldate = new CLabel(Msg.translate(p_ctx, "DateOrdered")); - northPanel.add (ldate, "growy"); - f_date = new VDate(); - f_date.setValue(Env.getContextAsDate(Env.getCtx(), "#Date")); - ldate.setLabelFor(f_date); - northPanel.add(f_date, "h 30, w 200"); - f_date.addActionListener(this); - - f_processed = new CCheckBox(Msg.translate(p_ctx, "Processed")); - f_processed.setSelected(false); - northPanel.add(f_processed, ""); - - f_refresh = createButtonAction("Refresh", KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0)); - northPanel.add(f_refresh, "w 50!, h 50!, wrap, alignx trailing"); - - f_up = createButtonAction("Previous", KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0)); - northPanel.add(f_up, "w 50!, h 50!, span, split 4"); - f_down = createButtonAction("Next", KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0)); - northPanel.add(f_down, "w 50!, h 50!"); - - f_ok = createButtonAction("Ok", KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)); - northPanel.add(f_ok, "w 50!, h 50!"); - - f_cancel = createButtonAction("Cancel", KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0)); - northPanel.add(f_cancel, "w 50!, h 50!"); - - - // Center - m_table = new PosTable(); - - @SuppressWarnings("unused") - String sql = m_table.prepareTable (s_layout, "C_Order", - "C_POS_ID = " + p_pos.getC_POS_ID() - , false, "C_Order") - + " ORDER BY Margin, QtyAvailable"; - m_table.addMouseListener(this); - m_table.getSelectionModel().addListSelectionListener(this); - enableButtons(); - centerScroll = new CScrollPane(m_table); - panel.add (centerScroll, "growx, growy"); - m_table.growScrollbars(); - panel.setPreferredSize(new Dimension(800,600)); - - f_documentno.requestFocus(); - pack(); - - setResults(p_ctx, f_processed.isSelected(), f_documentno.getText(), f_date.getTimestamp()); - } // init - - - /** - * Action Listener - * @param e event - */ - @Override - public void actionPerformed (ActionEvent e) - { - if (log.isLoggable(Level.INFO)) log.info("PosQueryProduct.actionPerformed - " + e.getActionCommand()); - if ("Refresh".equals(e.getActionCommand()) - || e.getSource() == f_processed || e.getSource() == f_documentno - || e.getSource() == f_date) - { - setResults(p_ctx, f_processed.isSelected(), f_documentno.getText(), f_date.getTimestamp()); - return; - } - else if ("Reset".equals(e.getActionCommand())) - { - reset(); - return; - } - else if ("Previous".equalsIgnoreCase(e.getActionCommand())) - { - int rows = m_table.getRowCount(); - if (rows == 0) - return; - int row = m_table.getSelectedRow(); - row--; - if (row < 0) - row = 0; - m_table.getSelectionModel().setSelectionInterval(row, row); - return; - } - else if ("Next".equalsIgnoreCase(e.getActionCommand())) - { - int rows = m_table.getRowCount(); - if (rows == 0) - return; - int row = m_table.getSelectedRow(); - row++; - if (row >= rows) - row = rows - 1; - m_table.getSelectionModel().setSelectionInterval(row, row); - return; - } - else if ("Cancel".equalsIgnoreCase(e.getActionCommand())) - { - dispose(); - return; - } - // Exit - close(); - } // actionPerformed - - - /** - * - */ - @Override - public void reset() - { - f_processed.setSelected(false); - f_documentno.setText(null); - f_date.setValue(Env.getContextAsDate(Env.getCtx(), "#Date")); - setResults(p_ctx, f_processed.isSelected(), f_documentno.getText(), f_date.getTimestamp()); - } - - - /** - * Set/display Results - * @param results results - */ - public void setResults (Properties ctx, boolean processed, String doc, Timestamp date) - { - String sql = ""; - try - { - sql = "SELECT o.C_Order_ID, o.DocumentNo, o.TotalLines, o.GrandTotal, b.Name, o.Processed" + - " FROM C_Order o INNER JOIN C_BPartner b ON o.C_BPartner_ID=b.C_BPartner_ID" + - " WHERE o.C_POS_ID = " + p_pos.getC_POS_ID(); - sql += " AND o.Processed = " + ( processed ? "'Y' " : "'N' "); - if (doc != null && !doc.equalsIgnoreCase("")) - sql += " AND o.DocumentNo = '" + doc + "'"; - if ( date != null ) - sql += " AND o.DateOrdered = ? Order By o.DocumentNo DESC"; - - PreparedStatement pstm = DB.prepareStatement(sql, null); - if ( date != null ) - pstm.setTimestamp(1, date); - ResultSet rs = pstm.executeQuery(); - m_table.loadTable(rs); - if ( m_table.getRowCount() > 0 ) - m_table.setRowSelectionInterval(0, 0); - enableButtons(); - } - catch(Exception e) - { - log.severe("QueryTicket.setResults: " + e + " -> " + sql); - - } - } // setResults - - /** - * Enable/Set Buttons and set ID - */ - protected void enableButtons() - { - m_c_order_id = -1; - int row = m_table.getSelectedRow(); - boolean enabled = row != -1; - if (enabled) - { - Integer ID = m_table.getSelectedRowKey(); - if (ID != null) - { - m_c_order_id = ID.intValue(); - } - } - - f_ok.setEnabled(enabled); - - if (log.isLoggable(Level.INFO)) log.info("ID=" + m_c_order_id); - } // enableButtons - - /** - * Close. - * Set Values on other panels and close - */ - @Override - protected void close() - { - if (log.isLoggable(Level.INFO)) log.info("C_Order_ID=" + m_c_order_id); - - if (m_c_order_id > 0) - { - p_posPanel.setOrder(m_c_order_id); - p_posPanel.updateInfo(); - - } - dispose(); - } // close - -} // PosQueryProduct diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/SubCheckout.java b/org.adempiere.ui.swing/src/org/compiere/pos/SubCheckout.java deleted file mode 100644 index 137424279c..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/SubCheckout.java +++ /dev/null @@ -1,235 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ - -package org.compiere.pos; - -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.logging.Level; - -import javax.swing.border.TitledBorder; - -import org.compiere.grid.ed.VNumber; -import org.compiere.swing.CButton; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Checkout Sub Panel - * - * @author Comunidad de Desarrollo OpenXpertya - * *Basado en Codigo Original Modificado, Revisado y Optimizado de: - * *Copyright ïżœ Jorg Janke - * @version $Id: SubCheckout.java,v 1.1 2004/07/12 04:10:04 jjanke Exp $ - */ -public class SubCheckout extends PosSubPanel implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -5088462537034950615L; - - /** - * Constructor - * @param posPanel POS Panel - */ - public SubCheckout (PosBasePanel posPanel) - { - super (posPanel); - } // PosSubCheckout - - private CButton f_summary = null; - - //TODO: credit card -/* private CLabel f_lcreditCardNumber = null; - private CTextField f_creditCardNumber = null; - private CLabel f_lcreditCardExp = null; - private CTextField f_creditCardExp = null; - private CLabel f_lcreditCardVV = null; - private CTextField f_creditCardVV = null; - private CButton f_creditPayment = null; -*/ - private CLabel f_lcashGiven = null; - private VNumber f_cashGiven; - private CLabel f_lcashReturn = null; - private VNumber f_cashReturn; - - private CButton f_cashRegisterFunctions; - /** Logger */ - private static CLogger log = CLogger.getCLogger(SubCheckout.class); - - /** - * Initialize - */ - public void init() - { - // Content - setLayout(new GridBagLayout()); - GridBagConstraints gbc = new GridBagConstraints(); - - // BOX 1 - CASH - gbc.gridx = 0; - gbc.gridheight = 2; - gbc.fill = GridBagConstraints.BOTH; - gbc.weightx = .1; - CPanel cash = new CPanel(new GridBagLayout()); - cash.setBackground(java.awt.Color.lightGray); - cash.setBorder(new TitledBorder(Msg.getMsg(Env.getCtx(), "Checkout"))); - gbc.gridy = 0; - add (cash, gbc); - GridBagConstraints gbc0 = new GridBagConstraints(); -// gbc0.anchor = GridBagConstraints.EAST; - // - f_lcashGiven = new CLabel(Msg.getMsg(Env.getCtx(),"CashGiven")); - cash.add (f_lcashGiven, gbc0); - f_cashGiven = new VNumber("CashGiven", false, false, true, DisplayType.Amount, Msg.translate(Env.getCtx(), "CashGiven")); - f_cashGiven.setColumns(12, 25); - cash.add (f_cashGiven, gbc0); - f_cashGiven.setValue(Env.ZERO); - f_cashGiven.addActionListener(this); //to update the change with the money - // - f_lcashReturn = new CLabel(Msg.getMsg(Env.getCtx(),"CashReturn")); - cash.add (f_lcashReturn, gbc0); - f_cashReturn = new VNumber("CashReturn", false, true, false, DisplayType.Amount, "CashReturn"); - f_cashReturn.setColumns(8, 25); - cash.add (f_cashReturn, gbc0); - f_cashReturn.setValue(Env.ZERO); - - // BOX 2 - UTILS - CPanel utils = new CPanel(new GridBagLayout()); - utils.setBorder(new TitledBorder(Msg.getMsg(Env.getCtx(), "Utils"))); - gbc.gridx = 0; - gbc.gridy = 2; - gbc.weightx = .1; - add (utils, gbc); - GridBagConstraints gbcU = new GridBagConstraints(); - gbcU.anchor = GridBagConstraints.EAST; - //CASH FUNCTIONS - f_cashRegisterFunctions = createButtonAction("CashRegisterFunction", null); - f_cashRegisterFunctions.setText("Cash Functions"); - f_cashRegisterFunctions.setPreferredSize(new Dimension(130,37)); - f_cashRegisterFunctions.setMaximumSize(new Dimension(130,37)); - f_cashRegisterFunctions.setMinimumSize(new Dimension(130,37)); - utils.add(f_cashRegisterFunctions, gbcU); - //SUMMARY - f_summary = createButtonAction("Summary", null); - utils.add (f_summary, gbcU); - - - -//TODO: Credit card -/* Panel para la introducciïżœn de los datos de CreditCard para el pago quitada por ConSerTi al no considerar - * que sea ïżœtil de momento - - // -- 1 -- Creditcard - CPanel creditcard = new CPanel(new GridBagLayout()); - creditcard.setBorder(new TitledBorder(Msg.translate(Env.getCtx(), "CreditCardType"))); - gbc.gridy = 2; - add (creditcard, gbc); - GridBagConstraints gbc1 = new GridBagConstraints(); - gbc1.insets = INSETS2; - gbc1.anchor = GridBagConstraints.WEST; - - gbc1.gridx = 0; - gbc1.gridy = 0; - f_lcreditCardNumber = new CLabel(Msg.translate(Env.getCtx(), "CreditCardNumber")); - creditcard.add (f_lcreditCardNumber, gbc1); - gbc1.gridy = 1; - f_creditCardNumber = new CTextField(18); - creditcard.add (f_creditCardNumber, gbc1); - gbc1.gridx = 1; - gbc1.gridy = 0; - f_lcreditCardExp = new CLabel(Msg.translate(Env.getCtx(),"CreditCardExp")); - creditcard.add (f_lcreditCardExp, gbc1); - gbc1.gridy = 1; - f_creditCardExp = new CTextField(5); - creditcard.add (f_creditCardExp, gbc1); - gbc1.gridx = 2; - gbc1.gridy = 0; - f_lcreditCardVV = new CLabel(Msg.translate(Env.getCtx(), "CreditCardVV")); - creditcard.add (f_lcreditCardVV, gbc1); - gbc1.gridy = 1; - f_creditCardVV = new CTextField(5); - creditcard.add (f_creditCardVV, gbc1); - // - gbc1.gridx = 3; - gbc1.gridy = 0; - gbc1.gridheight = 2; - f_creditPayment = createButtonAction("Payment", null); - f_creditPayment.setActionCommand("CreditCard"); - gbc1.anchor = GridBagConstraints.EAST; - gbc1.weightx = 0.1; - creditcard.add (f_creditPayment, gbc1); - - **/ //fin del comentario para quitar la parte del CreditCard - } // init - - /** - * Dispose - Free Resources - */ - public void dispose() - { - super.dispose(); - } // dispose - - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - String action = e.getActionCommand(); - if (action == null || action.length() == 0) - return; - if (log.isLoggable(Level.INFO)) log.info( "PosSubCheckout - actionPerformed: " + action); - - - if (action.equals("Summary")) - { - //displaySummary(); - } - - else if (action.equals("CashRegisterFunction")) - { - CashSubFunctions csf = new CashSubFunctions(p_posPanel); - csf.setVisible(true); - } - else if (e.getSource() == f_cashGiven) - //displayReturn(); - -/* // CreditCard (Payment) - else if (action.equals("CreditCard")) - { - Log.print("CreditCard"); - } fin del comentario para la Credit Card*/ - - p_posPanel.updateInfo(); - } // actionPerformed - - - - - - - - -} // PosSubCheckout diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/SubCurrentLine.java b/org.adempiere.ui.swing/src/org/compiere/pos/SubCurrentLine.java deleted file mode 100644 index 7605ddb62f..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/SubCurrentLine.java +++ /dev/null @@ -1,718 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ - -package org.compiere.pos; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.KeyEvent; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.logging.Level; - -import javax.swing.JTextField; -import javax.swing.KeyStroke; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; - -import net.miginfocom.swing.MigLayout; - -import org.compiere.apps.ADialog; -import org.compiere.minigrid.ColumnInfo; -import org.compiere.minigrid.IDColumn; -import org.compiere.model.MOrderLine; -import org.compiere.model.MProduct; -import org.compiere.model.MWarehousePrice; -import org.compiere.model.PO; -import org.compiere.swing.CButton; -import org.compiere.swing.CLabel; -import org.compiere.swing.CScrollPane; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -/** - * Current Line Sub Panel - * - * @author OpenXpertya - * Based on Modified Original Code, Revised and Optimized - * *Copyright Jorg Janke - * red1 - [2093355 ] Small bugs in OpenXpertya POS - */ -public class SubCurrentLine extends PosSubPanel implements ActionListener, FocusListener, ListSelectionListener { - /** - * - */ - private static final long serialVersionUID = 8348032740580968638L; - - private String trxName; - - /** - * Constructor - * - * @param posPanel POS Panel - */ - public SubCurrentLine(PosBasePanel posPanel) { - super(posPanel); - trxName = posPanel.getTrxName(); - } - - private CButton f_up; - private CButton f_delete; - private CButton f_down; - // - private CButton f_plus; - private CButton f_minus; - private PosTextField f_price; - private PosTextField f_quantity; - protected PosTextField f_name; - private CButton f_bSearch; - private int orderLineId = 0; - - - /** The Product */ - private MProduct m_product = null; - - /** Warehouse */ - private int m_M_Warehouse_ID; - /** PLV */ - private int m_M_PriceList_Version_ID; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(SubCurrentLine.class); - - - /** The Table */ - PosTable m_table; - /** The Query SQL */ - private String m_sql; - /** Logger */ - - /** Table Column Layout Info */ - private static ColumnInfo[] s_layout = new ColumnInfo[] - { - new ColumnInfo(" ", "C_OrderLine_ID", IDColumn.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "Name", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "Qty"), "QtyOrdered", Double.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "C_UOM_ID"), "UOMSymbol", String.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "PriceActual"), "PriceActual", BigDecimal.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "LineNetAmt"), "LineNetAmt", BigDecimal.class), - new ColumnInfo(Msg.translate(Env.getCtx(), "C_Tax_ID"), "TaxIndicator", String.class), - }; - /** From Clause */ - private static String s_sqlFrom = "C_Order_LineTax_v"; - /** Where Clause */ - private static String s_sqlWhere = "C_Order_ID=? AND LineNetAmt <> 0"; - - /** - * Initialize - */ - public void init() { - - // Content - setLayout(new MigLayout("fill, ins 0 0")); - - String buttonSize = "w 50!, h 50!,"; - // - f_bSearch = createButtonAction ("Product", KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.CTRL_MASK)); - f_bSearch.setName("ProductSearch"); - add (f_bSearch, buttonSize ); - - CLabel productLabel = new CLabel(Msg.translate(Env.getCtx(), "M_Product_ID")); - add(productLabel, ", flowy, h 15"); - - f_name = new PosTextField(Msg.translate(Env.getCtx(), "M_Product_ID"), p_posPanel, p_pos.getOSK_KeyLayout_ID()); - f_name.setName("ProductInput"); - f_name.addActionListener(this); - f_name.addFocusListener(this); - f_name.requestFocusInWindow(); - - add (f_name, "spanx 3, growx, pushx, h 25!"); - - // PAYMENT - add (new CLabel(),""); - f_cashPayment = createButtonAction("Payment", null); - f_cashPayment.setActionCommand("Payment"); - add (f_cashPayment, "w 75!, h 50!, pushx, wrap"); - f_cashPayment.setEnabled(false); - - m_table = new PosTable(); - CScrollPane scroll = new CScrollPane(m_table); - m_sql = m_table.prepareTable (s_layout, s_sqlFrom, - s_sqlWhere, false, "C_Order_LineTax_v") - + " ORDER BY Line"; - // m_table.addMouseListener(this); - m_table.getSelectionModel().addListSelectionListener(this); - m_table.setColumnVisibility(m_table.getColumn(0), false); - m_table.getColumn(1).setPreferredWidth(175); - m_table.getColumn(2).setPreferredWidth(75); - m_table.getColumn(3).setPreferredWidth(30); - m_table.getColumn(4).setPreferredWidth(75); - m_table.getColumn(5).setPreferredWidth(75); - m_table.getColumn(6).setPreferredWidth(30); - m_table.setFocusable(false); - m_table.setFillsViewportHeight( true ); //@Trifon - m_table.growScrollbars(); - - add (scroll, "growx, spanx, growy, pushy, h 200:300:"); - - f_up = createButtonAction("Previous", KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0)); - add (f_up, buttonSize); - f_down = createButtonAction("Next", KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0)); - add (f_down, buttonSize); - - - f_delete = createButtonAction("Cancel", KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, ActionEvent.SHIFT_MASK)); - add (f_delete, buttonSize); - - // - f_minus = createButtonAction("Minus", null); - add(f_minus, buttonSize); - - - - CLabel qtyLabel = new CLabel(Msg.translate(Env.getCtx(), "QtyOrdered")); - add(qtyLabel, "split 2, flowy, h 15"); - - // - f_quantity = new PosTextField(Msg.translate(Env.getCtx(), "QtyOrdered"), - p_posPanel,p_pos.getOSNP_KeyLayout_ID(), DisplayType.getNumberFormat(DisplayType.Quantity)); - f_quantity.setHorizontalAlignment(JTextField.TRAILING); - f_quantity.addActionListener(this); - add(f_quantity, "h 30:30:, w 100"); - setQty(Env.ONE); - // - f_plus = createButtonAction("Plus", null); - add(f_plus, buttonSize); - - - CLabel priceLabel = new CLabel(Msg.translate(Env.getCtx(), "PriceActual")); - add(priceLabel, "split 2, flowy, h 15"); - - // - f_price = new PosTextField(Msg.translate(Env.getCtx(), "PriceActual"), - p_posPanel,p_pos.getOSNP_KeyLayout_ID(), DisplayType.getNumberFormat(DisplayType.Amount)); - f_price.addActionListener(this); - f_price.setHorizontalAlignment(JTextField.TRAILING); - add(f_price, "h 30, w 100, wrap"); - setPrice(Env.ZERO); - - enableButtons(); - } //init - - - /** - * Dispose - Free Resources - */ - public void dispose() { - super.dispose(); - } // dispose - - /** - * Action Listener - * - * @param e event - */ - public void actionPerformed(ActionEvent e) { - String action = e.getActionCommand(); - if (action == null || action.length() == 0) - return; - if (log.isLoggable(Level.INFO)) log.info( "SubCurrentLine - actionPerformed: " + action); - - // Plus - if (action.equals("Plus")) - { - if ( orderLineId > 0 ) - { - MOrderLine line = new MOrderLine(p_ctx, orderLineId, null); - if ( line != null ) - { - line.setQty(line.getQtyOrdered().add(Env.ONE)); - line.saveEx(); - p_posPanel.updateInfo(); - } - } - } - // Minus - else if (action.equals("Minus")) - { - if ( orderLineId > 0 ) - { - MOrderLine line = new MOrderLine(p_ctx, orderLineId, null); - if ( line != null ) - { - line.setQty(line.getQtyOrdered().subtract(Env.ONE)); - line.saveEx(); - p_posPanel.updateInfo(); - } - } - - } - else if (action.equals("Payment")) - payOrder(); - - // VNumber - else if (e.getSource() == f_price) { - MOrderLine line = new MOrderLine(p_ctx, orderLineId, null); - if ( line != null ) - { - line.setQty(new BigDecimal(f_price.getValue().toString())); - line.saveEx(); - p_posPanel.updateInfo(); - } - } - else if (e.getSource() == f_quantity && orderLineId > 0 ) - { - MOrderLine line = new MOrderLine(p_ctx, orderLineId, null); - if ( line != null ) - { - line.setQty(new BigDecimal(f_quantity.getValue().toString())); - line.saveEx(); - p_posPanel.updateInfo(); - } - } - // Product - if (action.equals("Product")) - { - setParameter(); - QueryProduct qt = new QueryProduct(p_posPanel); - qt.setQueryData(m_M_PriceList_Version_ID, m_M_Warehouse_ID); - qt.setVisible(true); - findProduct(); - - int row = m_table.getSelectedRow(); - if (row < 0) row = 0; -// m_table.getSelectionModel().setSelectionInterval(row, row); --red1 - use product window first will gives out of bound error - // https://sourceforge.net/tracker/?func=detail&atid=879332&aid=3121975&group_id=176962 - m_table.scrollRectToVisible(m_table.getCellRect(row, 1, true)); //@Trifon - BF[3121975] - } - // Name - else if (e.getSource() == f_name) - findProduct(); - if ("Previous".equalsIgnoreCase(e.getActionCommand())) - { - int rows = m_table.getRowCount(); - if (rows == 0) - return; - int row = m_table.getSelectedRow(); - row--; - if (row < 0) - row = 0; - m_table.getSelectionModel().setSelectionInterval(row, row); - // https://sourceforge.net/tracker/?func=detail&atid=879332&aid=3121975&group_id=176962 - m_table.scrollRectToVisible(m_table.getCellRect(row, 1, true)); //@Trifon - BF[3121975] - return; - } - else if ("Next".equalsIgnoreCase(e.getActionCommand())) - { - int rows = m_table.getRowCount(); - if (rows == 0) - return; - int row = m_table.getSelectedRow(); - row++; - if (row >= rows) - row = rows - 1; - m_table.getSelectionModel().setSelectionInterval(row, row); - // https://sourceforge.net/tracker/?func=detail&atid=879332&aid=3121975&group_id=176962 - m_table.scrollRectToVisible(m_table.getCellRect(row, 1, true)); //@Trifon - BF[3121975] - return; - } - // Delete - else if (action.equals("Cancel")) - { - int rows = m_table.getRowCount(); - if (rows != 0) - { - int row = m_table.getSelectedRow(); - if (row != -1) - { - if ( p_posPanel.m_order != null ) - p_posPanel.m_order.deleteLine(m_table.getSelectedRowKey()); - setQty(null); - setPrice(null); - - orderLineId = 0; - } - } - } - p_posPanel.updateInfo(); - } // actionPerformed - /** - * - */ - private void payOrder() { - - //Check if order is completed, if so, print and open drawer, create an empty order and set cashGiven to zero - - if( p_posPanel.m_order != null ) //red1 wrong action flow below - { - if (!PosPayment.pay(p_posPanel) ) - return; //red1 not paid (cancelled) cannot continue process the order. - - if (!p_posPanel.m_order.isProcessed() && !p_posPanel.m_order.processOrder() ) - { - ADialog.warn(0, p_posPanel, "PosOrderProcessFailed"); - return; - } - else - { - printTicket(); - p_posPanel.setOrder(0); - } - } - } - - /** - * Update Table - * @param order order - */ - public void updateTable (PosOrderModel order) - { - int C_Order_ID = 0; - if (order != null) - C_Order_ID = order.getC_Order_ID(); - if (C_Order_ID == 0) - { - p_posPanel.f_curLine.m_table.loadTable(new PO[0]); - p_posPanel.f_order.setSums(null); - } - - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement (m_sql, null); - pstmt.setInt (1, C_Order_ID); - rs = pstmt.executeQuery (); - m_table.loadTable(rs); - } - catch (Exception e) - { - log.log(Level.SEVERE, m_sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - - for ( int i = 0; i < m_table.getRowCount(); i ++ ) - { - IDColumn key = (IDColumn) m_table.getModel().getValueAt(i, 0); - if ( key != null && orderLineId > 0 && key.getRecord_ID() == orderLineId ) - { - m_table.getSelectionModel().setSelectionInterval(i, i); - break; - } - } - - enableButtons(); - - p_posPanel.f_order.setSums(order); - - } // updateTable - - private void enableButtons() - { - boolean enabled = true; - if ( m_table == null || m_table.getRowCount() == 0 || m_table.getSelectedRowKey() == null ) - { - enabled = false; - } - f_down.setEnabled(enabled); - f_up.setEnabled(enabled); - f_delete.setEnabled(enabled); - f_minus.setEnabled(enabled); - f_plus.setEnabled(enabled); - f_quantity.setEnabled(enabled); - f_price.setEnabled(enabled); - } - - /** - * Set Query Parameter - */ - private void setParameter() - { - // What PriceList ? - m_M_Warehouse_ID = p_pos.getM_Warehouse_ID(); - m_M_PriceList_Version_ID = p_posPanel.f_order.getM_PriceList_Version_ID(); - } // setParameter - - /** - * Set Price - * - * @param price - */ - public void setPrice(BigDecimal price) { - if (price == null) - price = Env.ZERO; - f_price.setValue(price); - boolean rw = Env.ZERO.compareTo(price) == 0 || p_pos.isModifyPrice(); - f_price.setEditable(rw); - } // setPrice - - /** - * Get Price - * - * @return price - */ - public BigDecimal getPrice() { - return (BigDecimal) f_price.getValue(); - } // getPrice - - /** - * Set Qty - * - * @param qty - */ - public void setQty(BigDecimal qty) { - f_quantity.setValue(qty); - } // setQty - - /** - * Get Qty - * - * @return qty - */ - public BigDecimal getQty() { - return (BigDecimal) f_quantity.getValue(); - } // getQty - - /*************************************************************************** - * New Line - */ - public void newLine() { - setM_Product_ID(0); - setQty(Env.ONE); - setPrice(Env.ZERO); - orderLineId = 0; - f_name.requestFocusInWindow(); - } // newLine - - /** - * Save Line - * - * @return true if saved - */ - public boolean saveLine() { - MProduct product = getProduct(); - if (product == null) - return false; - BigDecimal QtyOrdered = (BigDecimal) f_quantity.getValue(); - BigDecimal PriceActual = (BigDecimal) f_price.getValue(); - - if ( p_posPanel.m_order == null ) - { - p_posPanel.m_order = PosOrderModel.createOrder(p_posPanel.p_pos, p_posPanel.f_order.getBPartner(),trxName); - } - - MOrderLine line = null; - - if ( p_posPanel.m_order != null ) - { - line = p_posPanel.m_order.createLine(product, QtyOrdered, PriceActual); - - if (line == null) - return false; - if (!line.save()) - return false; - } - - orderLineId = line.getC_OrderLine_ID(); - setM_Product_ID(0); - // - return true; - } // saveLine - - - /** - * Get Product - * @return product - */ - public MProduct getProduct() - { - return m_product; - } // getProduct - - /** - * Set Price for defined product - */ - public void setPrice() - { - if (m_product == null) - return; - // - setParameter(); - MWarehousePrice result = MWarehousePrice.get (m_product, - m_M_PriceList_Version_ID, m_M_Warehouse_ID, null); - if (result != null) - p_posPanel.f_curLine.setPrice(result.getPriceStd()); - else - p_posPanel.f_curLine.setPrice(Env.ZERO); - } // setPrice - - - - /************************************************************************** - * Find/Set Product & Price - */ - private void findProduct() - { - String query = f_name.getText(); - if (query == null || query.length() == 0) - return; - query = query.toUpperCase(); - // Test Number - boolean allNumber = true; - try - { - Integer.getInteger(query); - } - catch (Exception e) - { - allNumber = false; - } - String Value = query; - String Name = query; - String UPC = (allNumber ? query : null); - String SKU = (allNumber ? query : null); - - MWarehousePrice[] results = null; - setParameter(); - // - results = MWarehousePrice.find (p_ctx, - m_M_PriceList_Version_ID, m_M_Warehouse_ID, - Value, Name, UPC, SKU, null); - - // Set Result - if (results.length == 0) - { - String message = Msg.translate(p_ctx, "search.product.notfound"); - ADialog.warn(0, p_posPanel, message + query); - setM_Product_ID(0); - p_posPanel.f_curLine.setPrice(Env.ZERO); - } - else if (results.length == 1) - { - setM_Product_ID(results[0].getM_Product_ID()); - setQty(Env.ONE); - f_name.setText(results[0].getName()); - p_posPanel.f_curLine.setPrice(results[0].getPriceStd()); - saveLine(); - } - else // more than one - { - QueryProduct qt = new QueryProduct(p_posPanel); - qt.setResults(results); - qt.setQueryData(m_M_PriceList_Version_ID, m_M_Warehouse_ID); - qt.setVisible(true); - } - } // findProduct - - - /************************************************************************** - * Set Product - * @param M_Product_ID id - */ - public void setM_Product_ID (int M_Product_ID) - { - if (log.isLoggable(Level.FINE)) log.fine( "PosSubProduct.setM_Product_ID=" + M_Product_ID); - if (M_Product_ID <= 0) - m_product = null; - else - { - m_product = MProduct.get(p_ctx, M_Product_ID); - if (m_product.get_ID() == 0) - m_product = null; - } - // Set String Info - if (m_product != null) - { - f_name.setText(m_product.getName()); - f_name.setToolTipText(m_product.getDescription()); - } - else - { - f_name.setText(null); - f_name.setToolTipText(null); - } - } // setM_Product_ID - - /** - * Focus Gained - * @param e - */ - public void focusGained (FocusEvent e) - { - - - } // focusGained - - - /** - * Focus Lost - * @param e - */ - public void focusLost (FocusEvent e) - { - if (e.isTemporary()) - return; - log.info( "PosSubProduct - focusLost"); - findProduct(); - - p_posPanel.updateInfo(); - } // focusLost - - - public void valueChanged(ListSelectionEvent e) { - if ( e.getValueIsAdjusting() ) - return; - - int row = m_table.getSelectedRow(); - if (row != -1 ) - { - Object data = m_table.getModel().getValueAt(row, 0); - if ( data != null ) - { - Integer id = (Integer) ((IDColumn)data).getRecord_ID(); - orderLineId = id; - loadLine(id); - } - } - enableButtons(); - - } - - - private void loadLine(int lineId) { - - if ( lineId <= 0 ) - return; - - if (log.isLoggable(Level.FINE)) log.fine("SubCurrentLine - loading line " + lineId); - MOrderLine ol = new MOrderLine(p_ctx, lineId, null); - if ( ol != null ) - { - setPrice(ol.getPriceActual()); - setQty(ol.getQtyOrdered()); - } - - } - -} // PosSubCurrentLine diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/SubFunctionKeys.java b/org.adempiere.ui.swing/src/org/compiere/pos/SubFunctionKeys.java deleted file mode 100644 index b2f701b7b3..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/SubFunctionKeys.java +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ - -package org.compiere.pos; - -import net.miginfocom.swing.MigLayout; - -import org.compiere.apps.ADialog; -import org.compiere.model.MPOSKey; -import org.compiere.util.CLogger; - - -/** - * Function Key Sub Panel - * - * @author Comunidad de Desarrollo OpenXpertya - * *Basado en Codigo Original Modificado, Revisado y Optimizado de: - * *Copyright (c) Jorg Janke - * @version $Id: SubFunctionKeys.java,v 1.1 2004/07/12 04:10:04 jjanke Exp $ - */ -public class SubFunctionKeys extends PosSubPanel implements PosKeyListener -{ - /** - * - */ - private static final long serialVersionUID = -1870924843670214389L; - - /** - * Constructor - * @param posPanel POS Panel - */ - public SubFunctionKeys (PosBasePanel posPanel) - { - super (posPanel); - } // PosSubFunctionKeys - - /** Keys */ - //private MPOSKey[] m_keys; - /** Logger */ - @SuppressWarnings("unused") - private static CLogger log = CLogger.getCLogger(SubFunctionKeys.class); - - /** - * Initialize - */ - public void init() - { - int C_POSKeyLayout_ID = p_pos.getC_POSKeyLayout_ID(); - if (C_POSKeyLayout_ID == 0) - return; - - PosKeyPanel panel = new PosKeyPanel(C_POSKeyLayout_ID, this); - this.setLayout(new MigLayout("fill, ins 0")); - add(panel, "growx, growy"); - - } // init - - /** - * Dispose - Free Resources - */ - public void dispose() - { - super.dispose(); - } // dispose - - /** - * Call back from key panel - */ - public void keyReturned(MPOSKey key) { - // processed order - if ( p_posPanel.m_order != null && p_posPanel.m_order.isProcessed() ) - return; - - // new line - p_posPanel.f_curLine.setM_Product_ID(key.getM_Product_ID()); - p_posPanel.f_curLine.setPrice(); - p_posPanel.f_curLine.setQty(key.getQty()); - if ( !p_posPanel.f_curLine.saveLine() ) - { - ADialog.error(0, this, "Could not save order line"); - } - p_posPanel.updateInfo(); - return; - } - -} // PosSubFunctionKeys diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/SubOrder.java b/org.adempiere.ui.swing/src/org/compiere/pos/SubOrder.java deleted file mode 100644 index ea5f194e0a..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/SubOrder.java +++ /dev/null @@ -1,661 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ - -package org.compiere.pos; - -import java.awt.Color; -import java.awt.Event; -import java.awt.Font; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.KeyEvent; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Vector; -import java.util.logging.Level; - -import javax.swing.DefaultComboBoxModel; -import javax.swing.JFormattedTextField; -import javax.swing.JTextField; -import javax.swing.KeyStroke; - -import net.miginfocom.swing.MigLayout; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.apps.ADialog; -import org.compiere.model.MBPartner; -import org.compiere.model.MBPartnerInfo; -import org.compiere.model.MBPartnerLocation; -import org.compiere.model.MCurrency; -import org.compiere.model.MOrder; -import org.compiere.model.MPriceList; -import org.compiere.model.MPriceListVersion; -import org.compiere.model.MUser; -import org.compiere.swing.CButton; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CLabel; -import org.compiere.swing.CTextField; -import org.compiere.util.CLogger; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; - - -/** - * Customer Sub Panel - * - * @author Comunidad de Desarrollo OpenXpertya - * *Basado en Codigo Original Modificado, Revisado y Optimizado de: - * *Copyright ïżœ Jorg Janke - * @version $Id: SubBPartner.java,v 1.1 2004/07/12 04:10:04 jjanke Exp $ - */ -public class SubOrder extends PosSubPanel - implements ActionListener, FocusListener -{ - /** - * - */ - private static final long serialVersionUID = -2985454173868605178L; - - /** - * Constructor - * @param posPanel POS Panel - */ - public SubOrder (PosBasePanel posPanel) - { - super (posPanel); - } // PosSubCustomer - - private CButton f_history; - private PosTextField f_name; - private CButton f_bNew; - //private CButton f_bSearch; - private CComboBox f_location; - private CComboBox f_user; - private CButton f_process; - private CButton f_print; - private CTextField f_DocumentNo; - private CButton f_logout; - private JFormattedTextField f_net; - private JFormattedTextField f_tax; - private JFormattedTextField f_total; - - /** The Business Partner */ - private MBPartner m_bpartner; - /** Price List Version to use */ - private int m_M_PriceList_Version_ID = 0; - private CTextField f_currency = new CTextField(); - private CButton f_bEdit; - private CButton f_bSettings; - /** Logger */ - private static CLogger log = CLogger.getCLogger(SubOrder.class); - - /** - * Initialize - */ - public void init() - { - // Content - MigLayout layout = new MigLayout("ins 0 0","[fill|fill|fill|fill]","[nogrid]unrel[||]"); - setLayout(layout); - - Font bigFont = AdempierePLAF.getFont_Field().deriveFont(20f); - - String buttonSize = "w 50!, h 50!,"; - // NEW - f_bNew = createButtonAction("New", KeyStroke.getKeyStroke(KeyEvent.VK_F2, Event.F2)); - add (f_bNew, buttonSize); - - // HISTORY - f_history = createButtonAction("History", null); - add (f_history, buttonSize); - - // EDIT - f_bEdit = createButtonAction("Edit", null); - add(f_bEdit, buttonSize); - f_bEdit.setEnabled(false); - - // CANCEL - f_process = createButtonAction("Delete", null); - add (f_process, buttonSize); - f_process.setEnabled(false); - - - //PRINT - f_print = createButtonAction("Print", null); - add (f_print, buttonSize); - f_print.setEnabled(false); - - // Settings - f_bSettings = createButtonAction("Preference", null); - add (f_bSettings, buttonSize); - - // - f_logout = createButtonAction ("Logout", null); - add (f_logout, buttonSize + ", gapx 25, wrap"); - - // SALES REP - add(new CLabel(Msg.translate(Env.getCtx(), "Cashier")), ""); - CLabel cashiername = new CLabel((p_ctx.getProperty("#AD_User_Name")).toUpperCase()); - cashiername.setFont(bigFont); - cashiername.setFontBold(true); - cashiername.setForeground(Color.RED); - add (cashiername, "growx, pushx"); - - CLabel lNet = new CLabel (Msg.translate(Env.getCtx(), "SubTotal")); - add(lNet, ""); - f_net = new JFormattedTextField(DisplayType.getNumberFormat(DisplayType.Amount)); - f_net.setHorizontalAlignment(JTextField.TRAILING); - f_net.setEditable(false); - f_net.setFocusable(false); - lNet.setLabelFor(f_net); - add(f_net, "wrap, growx, pushx"); - f_net.setValue (Env.ZERO); - // - - // BPARTNER -// f_bSearch = createButtonAction ("BPartner", KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.SHIFT_MASK+Event.CTRL_MASK)); -// add (f_bSearch,buttonSize + ", spany 2"); - - // DOC NO - add (new CLabel(Msg.getMsg(Env.getCtx(),"DocumentNo")), ""); - - f_DocumentNo = new CTextField(""); - f_DocumentNo.setName("DocumentNo"); - f_DocumentNo.setEditable(false); - add (f_DocumentNo, "growx, pushx"); - - CLabel lTax = new CLabel (Msg.translate(Env.getCtx(), "TaxAmt")); - add(lTax); - f_tax = new JFormattedTextField(DisplayType.getNumberFormat(DisplayType.Amount)); - f_tax.setHorizontalAlignment(JTextField.TRAILING); - f_tax.setEditable(false); - f_tax.setFocusable(false); - lTax.setLabelFor(f_tax); - add(f_tax, "wrap, growx, pushx"); - f_tax.setValue (Env.ZERO); - // - - /* - f_location = new CComboBox(); - add (f_location, " wrap"); - */ - - // BP - add(new CLabel(Msg.translate(Env.getCtx(), "Customer")), ""); - f_name =new PosTextField(Msg.translate(Env.getCtx(), "C_Partner_ID"), p_posPanel, p_pos.getOSK_KeyLayout_ID()); - f_name.setEditable(true); //red1 - f_name.setName("BPartner"); - f_name.addActionListener(this); - f_name.addFocusListener(this); - add (f_name, " flowy, pushx, h 20!"); - - // - CLabel lTotal = new CLabel (Msg.translate(Env.getCtx(), "TOTAL")); - lTotal.setFont(bigFont); - add(lTotal, ""); - f_total = new JFormattedTextField(DisplayType.getNumberFormat(DisplayType.Amount)); - f_total.setHorizontalAlignment(JTextField.TRAILING);f_total.setFont(bigFont);f_total.setForeground(Color.BLUE); - f_total.setEditable(false); - f_total.setFocusable(false); - f_total.setName("GrandTotal"); - lTotal.setLabelFor(f_total); - add(f_total, "spanx 3, growx, pushx"); - f_total.setValue (Env.ZERO); - /* - // - f_user = new CComboBox(); - add (f_user, "skip 1"); - */ - } // init - - /** - * Dispose - Free Resources - */ - public void dispose() - { - if (f_name != null) - f_name.removeFocusListener(this); - f_name = null; - removeAll(); - super.dispose(); - } // dispose - - - /************************************************************************** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - String action = e.getActionCommand(); - if (action == null || action.length() == 0) - return; - if (log.isLoggable(Level.INFO)) log.info( "PosSubCustomer - actionPerformed: " + action); - // New - if (action.equals("New")) - { - p_posPanel.newOrder(); //red1 New POS Order instead - B_Partner already has direct field - return; - } - // Register - if (action.equals("History")) - { - PosQuery qt = new QueryTicket(p_posPanel); - qt.setVisible(true); - return; - } - else if (action.equals("Delete")) //red1 more apt description - { - deleteOrder(); - p_posPanel.m_order = null; - p_posPanel.f_curLine.newLine(); - p_posPanel.f_curLine.f_name.requestFocusInWindow(); - } - else if (action.equals("Preference")) - { - CashSubFunctions csf = new CashSubFunctions(p_posPanel); - csf.setVisible(true); - } - else if (action.equals("Print")) - printOrder(); - else if (action.equals("BPartner")) - { - PosQuery qt = new QueryBPartner(p_posPanel); - qt.setVisible(true); - } - // Logout - else if (action.equals("Logout")) - { - p_posPanel.dispose(); - return; - } - // Name - else if (e.getSource() == f_name) - findBPartner(); - - p_posPanel.updateInfo(); - } // actionPerformed - - /** - * - */ - private void printOrder() { - { - if (isOrderFullyPaid()) - { - updateOrder(); - printTicket(); - openCashDrawer(); - } - } - } - - - - /** - * - */ - private void deleteOrder() { - if ( p_posPanel != null && ADialog.ask(0, this, "Delete order?") ) - p_posPanel.m_order.deleteOrder(); - // p_posPanel.newOrder(); - - } - - /** - * Focus Gained - * @param e - */ - public void focusGained (FocusEvent e) - { - } // focusGained - - /** - * Focus Lost - * @param e - */ - public void focusLost (FocusEvent e) - { - if (e.isTemporary()) - return; - if (log.isLoggable(Level.INFO)) log.info(e.toString()); - findBPartner(); - } // focusLost - - - /** - * Find/Set BPartner - */ - private void findBPartner() - { - - String query = f_name.getText(); - - if (query == null || query.length() == 0) - return; - - // unchanged - if ( m_bpartner != null && m_bpartner.getName().equals(query)) - return; - - query = query.toUpperCase(); - // Test Number - boolean allNumber = true; - boolean noNumber = true; - char[] qq = query.toCharArray(); - for (int i = 0; i < qq.length; i++) - { - if (Character.isDigit(qq[i])) - { - noNumber = false; - break; - } - } - try - { - Integer.parseInt(query); - } - catch (Exception e) - { - allNumber = false; - } - String Value = query; - String Name = (allNumber ? null : query); - String EMail = (query.indexOf('@') != -1 ? query : null); - String Phone = (noNumber ? null : query); - String City = null; - // - //TODO: contact have been remove from rv_bpartner - MBPartnerInfo[] results = MBPartnerInfo.find(p_ctx, Value, Name, - /*Contact, */null, EMail, Phone, City); - - // Set Result - if (results.length == 0) - { - setC_BPartner_ID(0); - } - else if (results.length == 1) - { - setC_BPartner_ID(results[0].getC_BPartner_ID()); - f_name.setText(results[0].getName()); - } - else // more than one - { - QueryBPartner qt = new QueryBPartner(p_posPanel); - qt.setResults (results); - qt.setVisible(true); - } - } // findBPartner - - - /************************************************************************** - * Set BPartner - * @param C_BPartner_ID id - */ - public void setC_BPartner_ID (int C_BPartner_ID) - { - if (log.isLoggable(Level.FINE)) log.fine( "PosSubCustomer.setC_BPartner_ID=" + C_BPartner_ID); - if (C_BPartner_ID == 0) - m_bpartner = null; - else - { - m_bpartner = new MBPartner(p_ctx, C_BPartner_ID, null); - if (m_bpartner.get_ID() == 0) - m_bpartner = null; - } - - // Set Info - if (m_bpartner != null) - { - f_name.setText(m_bpartner.getName()); - } - else - { - f_name.setText(null); - } - // Sets Currency - m_M_PriceList_Version_ID = 0; - getM_PriceList_Version_ID(); - //fillCombos(); - if ( p_posPanel.m_order != null && m_bpartner != null ) - p_posPanel.m_order.setBPartner(m_bpartner); //added by ConSerTi to update the client in the request - } // setC_BPartner_ID - - /** - * Fill Combos (Location, User) - */ - @SuppressWarnings("unused") - private void fillCombos() - { - Vector locationVector = new Vector(); - if (m_bpartner != null) - { - MBPartnerLocation[] locations = m_bpartner.getLocations(false); - for (int i = 0; i < locations.length; i++) - locationVector.add(locations[i].getKeyNamePair()); - } - DefaultComboBoxModel locationModel = new DefaultComboBoxModel(locationVector); - f_location.setModel(locationModel); - // - Vector userVector = new Vector(); - if (m_bpartner != null) - { - MUser[] users = m_bpartner.getContacts(false); - for (int i = 0; i < users.length; i++) - userVector.add(users[i].getKeyNamePair()); - } - DefaultComboBoxModel userModel = new DefaultComboBoxModel(userVector); - f_user.setModel(userModel); - } // fillCombos - - - /** - * Get BPartner - * @return C_BPartner_ID - */ - public int getC_BPartner_ID () - { - if (m_bpartner != null) - return m_bpartner.getC_BPartner_ID(); - return 0; - } // getC_BPartner_ID - - /** - * Get BPartner - * @return BPartner - */ - public MBPartner getBPartner () - { - return m_bpartner; - } // getBPartner - - /** - * Get BPartner Location - * @return C_BPartner_Location_ID - */ - public int getC_BPartner_Location_ID () - { - if (m_bpartner != null) - { - KeyNamePair pp = (KeyNamePair)f_location.getSelectedItem(); - if (pp != null) - return pp.getKey(); - } - return 0; - } // getC_BPartner_Location_ID - - /** - * Get BPartner Contact - * @return AD_User_ID - */ - public int getAD_User_ID () - { - if (m_bpartner != null) - { - KeyNamePair pp = (KeyNamePair)f_user.getSelectedItem(); - if (pp != null) - return pp.getKey(); - } - return 0; - } // getC_BPartner_Location_ID - - /** - * Get M_PriceList_Version_ID. - * Set Currency - * @return plv - */ - public int getM_PriceList_Version_ID() - { - if (m_M_PriceList_Version_ID == 0) - { - int M_PriceList_ID = p_pos.getM_PriceList_ID(); - if (m_bpartner != null && m_bpartner.getM_PriceList_ID() != 0) - M_PriceList_ID = m_bpartner.getM_PriceList_ID(); - // - MPriceList pl = MPriceList.get(p_ctx, M_PriceList_ID, null); - setCurrency(MCurrency.getISO_Code(p_ctx, pl.getC_Currency_ID())); - f_name.setToolTipText(pl.getName()); - // - MPriceListVersion plv = pl.getPriceListVersion (p_posPanel.getToday()); - if (plv != null && plv.getM_PriceList_Version_ID() != 0) - m_M_PriceList_Version_ID = plv.getM_PriceList_Version_ID(); - } - return m_M_PriceList_Version_ID; - } // getM_PriceList_Version_ID - - - /*************************************************************************** - * Set Currency - * - * @param currency - * currency - */ - public void setCurrency(String currency) { - if (currency == null) - f_currency.setText("---"); - else - f_currency.setText(currency); - } // setCurrency - - - /** - * Is order fully pay ? - * Calculates if the given money is sufficient to pay the order - * - * @author Comunidad de Desarrollo OpenXpertya - * *Basado en Codigo Original Modificado, Revisado y Optimizado de: - * *Copyright ïżœ ConSerTi - */ - public boolean isOrderFullyPaid() - { - /*TODO - BigDecimal given = new BigDecimal(f_cashGiven.getValue().toString()); - boolean paid = false; - if (p_posPanel != null && p_posPanel.f_curLine != null) - { - MOrder order = p_posPanel.f_curLine.getOrder(); - BigDecimal total = Env.ZERO; - if (order != null) - total = order.getGrandTotal(); - paid = given.doubleValue() >= total.doubleValue(); - } - return paid; - */ - return true; - } - - /** - * Display cash return - * Display the difference between tender amount and bill amount - * @author Comunidad de Desarrollo OpenXpertya - * *Basado en Codigo Original Modificado, Revisado y Optimizado de: - * *Copyright ïżœ ConSerTi - */ - public void updateOrder() - { - if (p_posPanel != null ) - { - MOrder order = p_posPanel.m_order; - if (order != null) - { - f_DocumentNo.setText(order.getDocumentNo()); - setC_BPartner_ID(order.getC_BPartner_ID()); - f_bNew.setEnabled(order.getLines().length != 0); - f_bEdit.setEnabled(true); - f_process.setEnabled(true); - f_print.setEnabled(order.isProcessed()); - f_cashPayment.setEnabled(order.getLines().length != 0); - } - else - { - f_DocumentNo.setText(null); - setC_BPartner_ID(0); - f_bNew.setEnabled(true); - f_bEdit.setEnabled(false); - f_process.setEnabled(false); - f_print.setEnabled(false); - f_cashPayment.setEnabled(false); - } - - } - } - - /** - * Abrir caja - * Abre la caja registradora - * @author Comunidad de Desarrollo OpenXpertya - * *Basado en Codigo Original Modificado, Revisado y Optimizado de: - * *Copyright ïżœ ConSerTi - */ - public void openCashDrawer() - { - String port = "/dev/lp"; - - byte data[] = new byte[] {0x1B, 0x40, 0x1C}; - try { - FileOutputStream m_out = null; - if (m_out == null) { - m_out = new FileOutputStream(port); // No poner append = true. - } - m_out.write(data); - } catch (IOException e) { - } - } - - /** - * Set Sums from Table - */ - void setSums(PosOrderModel order) - { - int noLines = p_posPanel.f_curLine.m_table.getRowCount(); - if (order == null || noLines == 0) - { - f_net.setValue(Env.ZERO); - f_total.setValue(Env.ZERO); - f_tax.setValue(Env.ZERO); - } - else - { - // order.getMOrder().prepareIt(); - f_net.setValue(order.getSubtotal()); - f_total.setValue(order.getGrandTotal()); - f_tax.setValue(order.getTaxAmt()); - - } - } // setSums -} // PosSubCustomer diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/package.html b/org.adempiere.ui.swing/src/org/compiere/pos/package.html deleted file mode 100644 index b56874f998..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/pos/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - -

    Package org.compiere.pos

    - -Point of Sale for PC Terminal - -

    Related Documentation

    - -For overviews, tutorials, examples, guides, and tool documentation, please see: - - - - - - diff --git a/org.adempiere.ui.swing/src/org/compiere/print/AReport.java b/org.adempiere.ui.swing/src/org/compiere/print/AReport.java deleted file mode 100644 index f0b08b58d4..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/print/AReport.java +++ /dev/null @@ -1,241 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.print; - -import java.awt.Cursor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Level; -import javax.swing.JComponent; -import javax.swing.JPopupMenu; -import org.adempiere.util.IProcessUI; -import org.compiere.apps.ADialog; -import org.compiere.apps.ClientProcessCtrl; -import org.compiere.apps.ProcessCtl; -import org.compiere.model.MQuery; -import org.compiere.model.MRole; -import org.compiere.model.MTable; -import org.compiere.model.PrintInfo; -import org.compiere.process.ProcessInfo; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; - -/** - * Application Report Launcher. - * Called from APanel; Queries available Reports for Table. - * If no report available, a new one is created and launched. - * If there is one report, it is launched. - * If there are more, the available reports are displayed and the selected is launched. - * - * @author Jorg Janke - * @version $Id: AReport.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - */ -public class AReport implements ActionListener -{ - /** - * Constructor - * - * @param AD_Table_ID table - * @param invoker component to display popup (optional) - * @param query query - */ - public AReport (int AD_Table_ID, JComponent invoker, MQuery query) - { - this (AD_Table_ID, invoker, query, null, 0); - } - - /** - * Constructor - * - * @param AD_Table_ID table - * @param invoker component to display popup (optional) - * @param query query - * @param parent The invoking parent window - * @param WindowNo The invoking parent window number - */ - public AReport (int AD_Table_ID, JComponent invoker, MQuery query, IProcessUI parent, int WindowNo) - { - if (log.isLoggable(Level.CONFIG)) log.config("AD_Table_ID=" + AD_Table_ID + " " + query); - if (!MRole.getDefault().isCanReport(AD_Table_ID)) - { - ADialog.error(0, invoker, "AccessCannotReport", query.getTableName()); - return; - } - - m_query = query; - this.parent = parent; - this.WindowNo = WindowNo; - - int AD_Window_ID = Env.getContextAsInt(Env.getCtx(), WindowNo, "_WinInfo_AD_Window_ID", true); - if (AD_Window_ID == 0) - AD_Window_ID = Env.getZoomWindowID(query); - - // See What is there - getPrintFormats (AD_Table_ID, AD_Window_ID, invoker); - } // AReport - - /** - * Constructor - * - * @param AD_Table_ID table - * @param invoker component to display popup (optional) - * @param query query - * @param parent The invoking parent window - * @param whereExtended The filtering where clause - * @param WindowNo The invoking parent window number - */ - public AReport (int AD_Table_ID, JComponent invoker, MQuery query, IProcessUI parent, int WindowNo, String whereExtended) - { - if (log.isLoggable(Level.CONFIG)) log.config("AD_Table_ID=" + AD_Table_ID + " " + query); - if (!MRole.getDefault().isCanReport(AD_Table_ID)) - { - ADialog.error(0, invoker, "AccessCannotReport", query.getTableName()); - return; - } - - m_query = query; - if (whereExtended != null && whereExtended.length() > 0 && m_query != null) - m_query.addRestriction(Env.parseContext(Env.getCtx(), WindowNo, whereExtended, false)); - this.parent = parent; - this.WindowNo = WindowNo; - this.m_whereExtended = whereExtended; - - int AD_Window_ID = Env.getContextAsInt(Env.getCtx(), WindowNo, "_WinInfo_AD_Window_ID", true); - if (AD_Window_ID == 0) - AD_Window_ID = Env.getZoomWindowID(query); - - // See What is there - getPrintFormats (AD_Table_ID, AD_Window_ID, invoker); - } // AReport - - /** The Query */ - private MQuery m_query; - /** The Popup */ - private JPopupMenu m_popup = new JPopupMenu("ReportMenu"); - /** The Option List */ - private List m_list = new ArrayList(); - /** Logger */ - private static CLogger log = CLogger.getCLogger(AReport.class); - /** The parent window for locking/unlocking during process execution */ - IProcessUI parent; - /** The filter to apply to this report */ - String m_whereExtended; - /** The parent window number */ - int WindowNo; - - /** - * Get the Print Formats for the table. - * Fill the list and the popup menu - * @param AD_Table_ID table - * @param invoker component to display popup (optional) - */ - private void getPrintFormats (int AD_Table_ID, int AD_Window_ID, JComponent invoker) - { - m_list = MPrintFormat.getAccessiblePrintFormats(AD_Table_ID, AD_Window_ID, null, true); - - if (m_list.size() == 1 || invoker == null) - launchReport ((KeyNamePair)m_list.get(0)); - // Multiple Formats exist - show selection - else if (invoker.isShowing()){ - for (KeyNamePair printFormatInfo : m_list) - m_popup.add(printFormatInfo.toString()).addActionListener(this); - - m_popup.show(invoker, 0, invoker.getHeight()); // below button - } - - } // getPrintFormats - - - /** - * Launch Report - * @param pp Key=AD_PrintFormat_ID - */ - private void launchReport (KeyNamePair pp) - { - MPrintFormat pf = MPrintFormat.get(Env.getCtx(), pp.getKey(), false); - launchReport (pf); - } // launchReport - - /** - * Launch Report - * @param pf print format - */ - private void launchReport (MPrintFormat pf) - { - int Record_ID = 0; - if (m_query.getRestrictionCount()==1 && m_query.getCode(0) instanceof Integer) - Record_ID = ((Integer)m_query.getCode(0)).intValue(); - PrintInfo info = new PrintInfo( - pf.getName(), - pf.getAD_Table_ID(), - Record_ID); - info.setDescription(m_query.getInfo()); - - if(pf != null && pf.getJasperProcess_ID() > 0) - { - // It's a report using the JasperReports engine - ProcessInfo pi = new ProcessInfo ("", pf.getJasperProcess_ID(), pf.getAD_Table_ID(), Record_ID); - - // Execute Process - @SuppressWarnings("unused") - ProcessCtl worker = ClientProcessCtrl.process(parent, WindowNo, pi, null); - } - else - { - // It's a default report using the standard printing engine - ReportEngine re = new ReportEngine (Env.getCtx(), pf, m_query, info); - re.setWhereExtended(m_whereExtended); - re.setWindowNo(WindowNo); - ReportCtl.preview(re); - } - } // launchReport - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - m_popup.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - String cmd = e.getActionCommand(); - for (int i = 0; i < m_list.size(); i++) - { - KeyNamePair pp = (KeyNamePair)m_list.get(i); - if (cmd.equals(pp.getName())) - { - launchReport (pp); - return; - } - } - } // actionPerformed - - - /************************************************************************** - * Get AD_Table_ID for Table Name - * @param tableName table name - * @return AD_Table_ID or 0 - */ - public static int getAD_Table_ID (String tableName) - { - return MTable.getTable_ID(tableName); - } // getAD_Table_ID - -} // AReport - diff --git a/org.adempiere.ui.swing/src/org/compiere/print/CPrinter.java b/org.adempiere.ui.swing/src/org/compiere/print/CPrinter.java deleted file mode 100644 index c1eaf4244d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/print/CPrinter.java +++ /dev/null @@ -1,118 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.print; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.print.PrintService; -import javax.print.PrintServiceLookup; -import javax.swing.DefaultComboBoxModel; - -import org.compiere.swing.CComboBox; -import org.compiere.util.CLogger; -import org.compiere.util.Ini; - -/** - * Adempiere Printer Selection - * - * @author Jorg Janke - * @version $Id: CPrinter.java,v 1.3 2006/07/30 00:53:02 jjanke Exp $ - */ -public class CPrinter extends CComboBox implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -6366208617152587573L; - - /** Available Printer Services */ - private static PrintService[] s_services = PrintUtil.getAllPrintServices(); - - /** - * Get Print (Services) Names - * @return Printer Name array - */ - public static String[] getPrinterNames() - { - // Refresh print services every time the combobox is constructed - s_services = PrintUtil.getAllPrintServices(); - - String[] retValue = new String[s_services.length]; - for (int i = 0; i < s_services.length; i++) - retValue[i] = s_services[i].getName(); - return retValue; - } // getPrintServiceNames - - - /** Logger */ - @SuppressWarnings("unused") - private static CLogger log = CLogger.getCLogger (CPrinter.class); - - - /************************************************************************** - * Create PrinterJob - */ - public CPrinter() - { - super(getPrinterNames()); - // Set Default - setValue(Ini.getProperty(Ini.P_PRINTER)); - this.addActionListener(this); - } // CPrinter - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - - } // actionPerformed - - /** - * Get PrintService - * @return print service - */ - public PrintService getPrintService() - { - String currentService = (String)getSelectedItem(); - for (int i = 0; i < s_services.length; i++) - { - if (s_services[i].getName().equals(currentService)) - return s_services[i]; - } - return PrintServiceLookup.lookupDefaultPrintService(); - } // getPrintService - - /** - * Refresh printer list - */ - public void refresh() { - String current = (String) getSelectedItem(); - removeAllItems(); - setModel(new DefaultComboBoxModel(getPrinterNames())); - if (current != null) { - for (int i = 0; i < getItemCount(); i++) { - String item = (String) getItemAt(i); - if (item.equals(current)) - setSelectedIndex(i); - } - } - } - -} // CPrinter diff --git a/org.adempiere.ui.swing/src/org/compiere/print/SwingViewerProvider.java b/org.adempiere.ui.swing/src/org/compiere/print/SwingViewerProvider.java deleted file mode 100644 index efb50c90b3..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/print/SwingViewerProvider.java +++ /dev/null @@ -1,38 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2007 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * - * Copyright (C) 2007 Low Heng Sin hengsin@avantz.com - * _____________________________________________ - *****************************************************************************/ -package org.compiere.print; - -import javax.swing.JFrame; - -import org.compiere.apps.AEnv; -import org.compiere.apps.AMenu; - -/** - * - * @author Low Heng Sin - * - */ -public class SwingViewerProvider implements ReportViewerProvider { - - public void openViewer(ReportEngine re) { - JFrame top = AEnv.getWindow(0); - Viewer viewer = new Viewer(top.getGraphicsConfiguration(), re); - if (top instanceof AMenu) - ((AMenu)top).getWindowManager().add(viewer); - } - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/print/View.java b/org.adempiere.ui.swing/src/org/compiere/print/View.java deleted file mode 100644 index 1650c11a3d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/print/View.java +++ /dev/null @@ -1,344 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.print; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.HashMap; -import java.util.logging.Level; - -import org.compiere.model.MQuery; -import org.compiere.print.layout.LayoutEngine; -import org.compiere.print.layout.Page; -import org.compiere.swing.CPanel; -import org.compiere.util.CLogger; - -/** - * View Panel - * - * @author Jorg Janke - * @version $Id: View.java,v 1.2 2006/07/30 00:53:02 jjanke Exp $ - * - * @author Teo Sarca, www.arhipac.ro - *
  • FR [ 2539927 ] Display Zoom combobox - * https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2539927&group_id=176962 - */ -public class View extends CPanel -{ - /** - * - */ - private static final long serialVersionUID = 5640892952739279088L; - - /** - * Print Preview - * @param layout Layout - */ - public View (LayoutEngine layout) - { - m_layout = layout; - } // View - - /** Layout to be Printed */ - private LayoutEngine m_layout; - - - /** Zoom Level */ - private int m_zoomLevel = 2; - /** Zoom Options */ - public static final String[] ZOOM_OPTIONS = new String[] {"200%", "150%", "100%", "75%", "50%"}; - private static HashMap ZOOM_ScaleValues = new HashMap(); - static { - ZOOM_ScaleValues.put("200%", 2.00); - ZOOM_ScaleValues.put("150%", 1.50); - ZOOM_ScaleValues.put("100%", 1.00); - ZOOM_ScaleValues.put("75%", 0.75); - ZOOM_ScaleValues.put("50%", 0.50); - } - - /** Margin around paper */ - public static int MARGIN = 5; - /** Margin Background Color */ - private static Color COLOR_BACKGROUND = Color.lightGray; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(View.class); - - /*************************************************************************/ - - public int getMarginSize(boolean doScale) - { - double scale = (doScale ? getScale() : 1.00); - return (int)(MARGIN * scale); - } - - /** - * Minimum Size - * @return Max Page Size - */ - public Dimension getMinimumSize() - { - return getMaximumSize(); - } // getMinimumSize - - /** - * Minimum Size - * @return Max Page Size - */ - public Dimension getMaximumSize() - { - return new Dimension (getPaperWidth()+(2*getMarginSize(true)), - (getPaperHeight()+getMarginSize(true))*getPageCount()+getMarginSize(true)); - } // getMaximumSize - - /** - * Preferred Size - * @return Max Page Size - */ - public Dimension getPreferredSize() - { - return getMaximumSize(); - } // getPreferredSize - - /** - * Is Archivable - * @return true if archivable - */ - public boolean isArchivable() - { - return ArchiveEngine.isValid(m_layout); - } // IsArchivable - - /** - * Paint Component - * @param g Graphics - */ - public void paintComponent (Graphics g) - { - // log.fine( "View.paintComponent", g.getClip()); - Graphics2D g2D = (Graphics2D)g; - g2D.scale(getScale(), getScale()); - Rectangle bounds = g2D.getClipBounds(); - // - g2D.setColor(COLOR_BACKGROUND); - g2D.fillRect(bounds.x, bounds.y, bounds.width, bounds.height); - - // for all pages - for (int page = 0; page < m_layout.getPages().size(); page++) - { - Rectangle pageRectangle = getRectangleOfPage(page+1, false); - if (bounds.intersects(pageRectangle)) - { - Page p = (Page)m_layout.getPages().get(page); - p.paint (g2D, pageRectangle, true, false); // sets context - m_layout.getHeaderFooter().paint(g2D, pageRectangle, true); - } // paint page - } // for all pages - } // paintComponent - - - /************************************************************************** - * Set Zoom Level - * @param level zoom level - */ - public void setZoomLevel(int level) - { - m_zoomLevel = level; - } // setZoomLevel - - /** - * Set Zoom Level - * @param levelString zoom level string - */ - public void setZoomLevel(String levelString) - { - for (int i = 0; i < ZOOM_OPTIONS.length; i++) - { - if (ZOOM_OPTIONS[i].equals(levelString)) - { - setZoomLevel(i); - break; - } - } - } // setZoomLevel - - /** - * Get Zoom Level - * @return zoom level - */ - public int getZoomLevel() - { - return m_zoomLevel; - } // getZoomLevel - - private double getScale() - { - Double scale = ZOOM_ScaleValues.get(ZOOM_OPTIONS[m_zoomLevel]); - if (scale != null) - return scale.doubleValue(); - else - return 1.00; - } - - /** - * Get Rectange of Page - * @param pageNo page no - * @return rectangle - */ - public Rectangle getRectangleOfPage(int pageNo) - { - return getRectangleOfPage(pageNo, true); -// int y = (int)(MARGIN + ((pageNo-1) * (getPaperHeight() + MARGIN))); -// return new Rectangle (MARGIN, y, getPaperWidth(), getPaperHeight()); - } // getRectangleOfPage - - public Rectangle getRectangleOfPage(int pageNo, boolean doScale) - { - int y = (int)(getMarginSize(doScale) + ((pageNo-1) * (getPaperHeight(doScale) + getMarginSize(doScale)))); - return new Rectangle (getMarginSize(doScale), y, getPaperWidth(doScale), getPaperHeight(doScale)); - } // getRectangleOfPage - - /** - * Get Page at Point - * @param p Point - * @return page as float to determine also position on page - */ - public float getPageNoAt (Point p) - { - float y = (float)(p.y / getScale()); - float pageHeight = getPaperHeight(false) + getMarginSize(false); - return 1f + (y/pageHeight); - } // getPageAt - - /** - * Get Page Count - * @return page count - */ - public int getPageCount() - { - return m_layout.getPages().size(); - } // getPageCount - - /** - * Get Page Info for Multi-Page tables - * @param pageNo page - * @return info e.g. (1,1) - */ - public String getPageInfo(int pageNo) - { - return m_layout.getPageInfo(pageNo); - } // getPageInfo - - /** - * Get Max Page Info for Multi-Page tables - * @return info e.g. (3,2) - */ - public String getPageInfoMax() - { - return m_layout.getPageInfoMax(); - } // getPageInfo - - /** - * Get Paper - * @return paper - */ - public CPaper getPaper() - { - return m_layout.getPaper(); - } // getPaper - - /** - * Get Paper Height - * @return paper height - */ - public int getPaperHeight() - { - return getPaperHeight(true); -// return (int)(m_layout.getPaper().getHeight(true) * getScale()); - } // getPaperHeight - - public int getPaperHeight(boolean doScale) - { - double scale = (doScale ? getScale() : 1.0); - return (int)(m_layout.getPaper().getHeight(true) * scale); - } // getPaperHeight - - /** - * Get Paper Height - * @return paper height - */ - public int getPaperWidth() - { - return getPaperWidth(true); -// return (int)(m_layout.getPaper().getWidth(true) * getScale()); - } // getPaperHeight - - public int getPaperWidth(boolean doScale) - { - double scale = (doScale ? getScale() : 1.0); - return (int)(m_layout.getPaper().getWidth(true) * scale); - } // getPaperHeight - - /** - * Get Drill Down - * @param absolutePoint point - * @return Drill Down - */ - public MQuery getDrillDown (Point absolutePoint) - { - int pageNo = (int)getPageNoAt(absolutePoint); - Rectangle pageRectangle = getRectangleOfPage(pageNo, false); - Point relativePoint = new Point ( - (int)(absolutePoint.x/getScale()-pageRectangle.x), - (int)(absolutePoint.y/getScale()-pageRectangle.y) - ); - Page page = (Page)m_layout.getPages().get(pageNo-1); - // - if (log.isLoggable(Level.CONFIG)) log.config("Relative=" + relativePoint + ", " + page); - // log.config("AbsolutePoint=" + absolutePoint + ", PageNo=" + pageNo + ", pageRectangle=" + pageRectangle); - MQuery retValue = page.getDrillDown (relativePoint); - if (retValue == null) - retValue = m_layout.getHeaderFooter().getDrillDown (relativePoint); - return retValue; - } // getDrillDown - - /** - * Get Drill Across - * @param absolutePoint point - * @return Drill Across - */ - public MQuery getDrillAcross (Point absolutePoint) - { - int pageNo = (int)getPageNoAt(absolutePoint); - Rectangle pageRectangle = getRectangleOfPage(pageNo); - Point relativePoint = new Point ( - (int)(absolutePoint.x/getScale()-pageRectangle.x), - (int)(absolutePoint.y/getScale()-pageRectangle.y) - ); - Page page = (Page)m_layout.getPages().get(pageNo-1); - // - if (log.isLoggable(Level.CONFIG)) log.config("Relative=" + relativePoint + ", " + page); - // log.config("AbsolutePoint=" + absolutePoint + ", PageNo=" + pageNo + ", pageRectangle=" + pageRectangle); - return page.getDrillAcross (relativePoint); - } // getDrillAcross - - -} // View diff --git a/org.adempiere.ui.swing/src/org/compiere/print/Viewer.java b/org.adempiere.ui.swing/src/org/compiere/print/Viewer.java deleted file mode 100644 index 75a13a41bb..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/print/Viewer.java +++ /dev/null @@ -1,1393 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - * Contributor: phib [ 1566335 ] Report View scrolling (Bug 1566328) * - * Teo Sarca [ 1619449 ] Minor typo problem * - *****************************************************************************/ -package org.compiere.print; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.GraphicsConfiguration; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowEvent; -import java.awt.event.WindowStateListener; -import java.io.File; -import java.io.IOException; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; -import java.util.logging.Level; - -import javax.swing.AbstractAction; -import javax.swing.AbstractButton; -import javax.swing.Icon; -import javax.swing.ImageIcon; -import javax.swing.JComponent; -import javax.swing.JFileChooser; -import javax.swing.JFrame; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JOptionPane; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.JSpinner; -import javax.swing.JToolBar; -import javax.swing.KeyStroke; -import javax.swing.SpinnerNumberModel; -import javax.swing.SwingUtilities; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import org.adempiere.pdf.Document; -import org.compiere.apps.ADialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.AMenu; -import org.compiere.apps.AWindow; -import org.compiere.apps.AWindowListener; -import org.compiere.apps.AppsAction; -import org.compiere.apps.EMailDialog; -import org.compiere.apps.StatusBar; -import org.compiere.apps.WindowMenu; -import org.compiere.apps.search.Find; -import org.compiere.model.GridField; -import org.compiere.model.MArchive; -import org.compiere.model.MClient; -import org.compiere.model.MQuery; -import org.compiere.model.MRole; -import org.compiere.model.MUser; -import org.compiere.model.PrintInfo; -import org.compiere.model.X_C_Invoice; -import org.compiere.swing.CButton; -import org.compiere.swing.CCheckBox; -import org.compiere.swing.CComboBox; -import org.compiere.swing.CFrame; -import org.compiere.swing.CLabel; -import org.compiere.swing.CMenuItem; -import org.compiere.swing.CPanel; -import org.compiere.tools.FileUtil; -import org.compiere.util.CLogMgt; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.ExtensionFileFilter; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Language; -import org.compiere.util.Login; -import org.compiere.util.Msg; -import org.compiere.util.NamePair; -import org.compiere.util.ValueNamePair; - -/** - * Print View Frame - * - * @author Jorg Janke - * @version $Id: Viewer.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ - * globalqss: integrate phib contribution from - * http://sourceforge.net/tracker/index.php?func=detail&aid=1566335&group_id=176962&atid=879334 - * globalqss: integrate Teo Sarca bug fixing - * Colin Rooney 2007/03/20 RFE#1670185 & BUG#1684142 - * Extend security to Info queries - * - * @author Teo Sarca, www.arhipac.ro - *
  • FR [ 1762466 ] Add "Window" menu to report viewer. - *
  • FR [ 1779403 ] Report Viewer: add PgUp and PgDown key handlers - *
  • BF [ 1836908 ] Report customize NPE when no window access - *
  • FR [ 1894640 ] Report Engine: Excel Export support - *
  • FR [ 2539927 ] Display Zoom combobox - * https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2539927&group_id=176962 - * @author victor.perez@e-evolution.com - *
  • FR [ 1966328 ] New Window Info to MRP and CRP into View http://sourceforge.net/tracker/index.php?func=detail&aid=1966328&group_id=176962&atid=879335 - *
  • FR [ 2011569 ] Implementing new Summary flag in Report View http://sourceforge.net/tracker/index.php?func=detail&aid=2011569&group_id=176962&atid=879335 - * - */ -public class Viewer extends CFrame - implements ActionListener, ChangeListener, WindowStateListener, IReportEngineEventListener -{ - /** - * - */ - private static final long serialVersionUID = 3766771249690413641L; - - /** - * @deprecated - * Viewer Constructor - * @param re report engine - */ - public Viewer (ReportEngine re) - { - this(null, re); - } - - /** - * Viewer Constructor - * @param gc - * @param re report engine - */ - public Viewer (GraphicsConfiguration gc, ReportEngine re) - { - super(gc); - log.info(""); - m_WindowNo = AEnv.createWindowNo(this); - Env.setContext(re.getCtx(), m_WindowNo, "_WinInfo_IsReportViewer", "Y"); - m_reportEngine = re; - m_AD_Table_ID = re.getPrintFormat().getAD_Table_ID(); - if (!MRole.getDefault().isCanReport(m_AD_Table_ID)) - { - ADialog.error(m_WindowNo, this, "AccessCannotReport", m_reportEngine.getName()); - this.dispose(); - } - m_isCanExport = MRole.getDefault().isCanExport(m_AD_Table_ID); - try - { - m_viewPanel = new View(re.getLayout()); - re.addEventListener(this); - m_ctx = m_reportEngine.getCtx(); - jbInit(); - dynInit(); - if (!m_viewPanel.isArchivable()) - log.warning("Cannot archive Document"); - AEnv.showCenterScreen(this); - } - catch(Exception e) - { - log.log(Level.SEVERE, "", e); - ADialog.error(m_WindowNo, this, "LoadError", e.getLocalizedMessage()); - this.dispose(); - } - } // Viewer - - /** Window No */ - private int m_WindowNo; - /** Print Context */ - private Properties m_ctx; - /** Page No */ - private int m_pageNo = 1; - /** Max Page Number */ - private int m_pageMax = 1; - /** View Pane */ - private View m_viewPanel; - /** Setting Values */ - private boolean m_setting = false; - /** Report Engine */ - private ReportEngine m_reportEngine; - /** Drill Down/Across */ - private boolean m_drillDown = true; - /** Table ID */ - private int m_AD_Table_ID = 0; - private boolean m_isCanExport; - - private MQuery m_ddQ = null; - private MQuery m_daQ = null; - private CMenuItem m_ddM = null; - private CMenuItem m_daM = null; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(Viewer.class); - - // - private CPanel northPanel = new CPanel(); - private JScrollPane centerScrollPane = new JScrollPane(); - private StatusBar statusBar = new StatusBar(false); - private JMenuBar menuBar = new JMenuBar(); - private JToolBar toolBar = new JToolBar(); - private CButton bPrint = new CButton(); - private CButton bSendMail = new CButton(); - private CButton bPageSetup = new CButton(); - private CButton bArchive = new CButton(); - private BorderLayout northLayout = new BorderLayout(); - private CButton bCustomize = new CButton(); - private CButton bEnd = new CButton(); - private CButton bFind = new CButton(); - private CButton bExport = new CButton(); - private CComboBoxcomboReport = new CComboBox(); - private CButton bPrevious = new CButton(); - private CButton bNext = new CButton(); - private SpinnerNumberModel spinnerModel = new SpinnerNumberModel(1,1,100,1); - private JSpinner spinner = new JSpinner(spinnerModel); - private CLabel labelDrill = new CLabel(); - private CComboBoxcomboDrill = new CComboBox(); - //FR 201156 - private CCheckBox summary = new CCheckBox(); - private CComboBoxcomboZoom = new CComboBox(View.ZOOM_OPTIONS); - - - /** - * Static Layout - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setIconImage(Env.getImage("mReport.png")); - this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - // - northPanel.setLayout(northLayout); - this.getContentPane().add(northPanel, BorderLayout.NORTH); - northPanel.add(toolBar, BorderLayout.EAST); - this.getContentPane().add(centerScrollPane, BorderLayout.CENTER); - centerScrollPane.getViewport().add(m_viewPanel, null); - // pb add: set scrolling with scrollbar buttons to move by 20 pixels - // each press - centerScrollPane.getVerticalScrollBar().setUnitIncrement(20); - centerScrollPane.getHorizontalScrollBar().setUnitIncrement(20); - // end pb - this.getContentPane().add(statusBar, BorderLayout.SOUTH); - - // ToolBar - this.setJMenuBar(menuBar); - // Page Control - toolBar.add(bPrevious); - toolBar.add(spinner); - spinner.setToolTipText(Msg.getMsg(m_ctx, "GoToPage")); - toolBar.add(bNext); - - // Add PgUp and PgDown key handlers - teo_sarca FR [ 1779403 ] - m_viewPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) - .put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "PAGE_UP"); - m_viewPanel.getActionMap().put("PAGE_UP", new AbstractAction() { - private static final long serialVersionUID = -6439939910196779649L; - public void actionPerformed(ActionEvent e) { - setPage(m_pageNo-1); - } - }); - // - m_viewPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) - .put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "PAGE_DOWN"); - m_viewPanel.getActionMap().put("PAGE_DOWN", new AbstractAction() { - private static final long serialVersionUID = -4468272400181368278L; - public void actionPerformed(ActionEvent e) { - setPage(m_pageNo+1); - } - }); - - // Zoom Level - toolBar.addSeparator(); - toolBar.add(comboZoom, null); - comboZoom.setToolTipText(Msg.getMsg(m_ctx, "Zoom")); - // Drill - toolBar.addSeparator(); - labelDrill.setText(Msg.getMsg(m_ctx, "Drill") + ": "); - toolBar.add(labelDrill); - toolBar.add(comboDrill); - comboDrill.setToolTipText(Msg.getMsg(m_ctx, "Drill")); - // Format, Customize, Find - toolBar.addSeparator(); - toolBar.add(comboReport); - comboReport.setToolTipText(Msg.translate(m_ctx, "AD_PrintFormat_ID")); - //FR 201156 - toolBar.add(summary); - summary.setText(Msg.getMsg(m_ctx, "Summary")); - toolBar.add(bCustomize); - bCustomize.setToolTipText(Msg.getMsg(m_ctx, "PrintCustomize")); - toolBar.add(bFind); - bFind.setToolTipText(Msg.getMsg(m_ctx, "Find")); - toolBar.addSeparator(); - // Print/Export - toolBar.add(bPrint); - toolBar.addSeparator(); - toolBar.add(bPageSetup); - bPageSetup.setToolTipText(Msg.getMsg(m_ctx, "PageSetup")); - toolBar.add(bSendMail); - toolBar.add(bArchive); - if (m_isCanExport) - { - bExport.setToolTipText(Msg.getMsg(m_ctx, "Export")); - toolBar.add(bExport); - } - // End - toolBar.addSeparator(); - toolBar.add(bEnd, null); - bEnd.setToolTipText(Msg.getMsg(m_ctx, "End")); - } // jbInit - - /** - * Dynamic Init - */ - private void dynInit() - { - createMenu(); - comboZoom.setSelectedIndex(m_viewPanel.getZoomLevel()); - comboZoom.addActionListener(this); - // Change Listener to set Page no - //pb comment this out so that scrolling works normally - //centerScrollPane.getViewport().addChangeListener(this); - // end pb - //FR 201156 - summary.addActionListener(this); - // Max Page - m_pageMax = m_viewPanel.getPageCount(); - spinnerModel.setMaximum(Integer.valueOf(m_pageMax)); - spinner.addChangeListener(this); - - fillComboReport(m_reportEngine.getPrintFormat().get_ID()); - - // View Panel Mouse Listener - m_viewPanel.addMouseListener(new MouseAdapter() - { - public void mouseClicked(MouseEvent e) - { - if (SwingUtilities.isRightMouseButton(e)) - mouse_clicked(e,true); - else if (e.getClickCount() > 1) - mouse_clicked(e,false); - } - }); - - // fill Drill Options (Name, TableName) - comboDrill.addItem(new ValueNamePair (null,"")); - String sql = "SELECT t.AD_Table_ID, t.TableName, e.PrintName, NULLIF(e.PO_PrintName,e.PrintName) " - + "FROM AD_Column c " - + " INNER JOIN AD_Column used ON (c.ColumnName=used.ColumnName)" - + " INNER JOIN AD_Table t ON (used.AD_Table_ID=t.AD_Table_ID AND t.IsView='N' AND t.AD_Table_ID <> c.AD_Table_ID)" - + " INNER JOIN AD_Column cKey ON (t.AD_Table_ID=cKey.AD_Table_ID AND cKey.IsKey='Y')" - + " INNER JOIN AD_Element e ON (cKey.ColumnName=e.ColumnName) " - + "WHERE c.AD_Table_ID=? AND c.IsKey='Y' " - + "ORDER BY 3"; - boolean trl = !Env.isBaseLanguage(Env.getCtx(), "AD_Element"); - if (trl) - sql = "SELECT t.AD_Table_ID, t.TableName, et.PrintName, NULLIF(et.PO_PrintName,et.PrintName) " - + "FROM AD_Column c" - + " INNER JOIN AD_Column used ON (c.ColumnName=used.ColumnName)" - + " INNER JOIN AD_Table t ON (used.AD_Table_ID=t.AD_Table_ID AND t.IsView='N' AND t.AD_Table_ID <> c.AD_Table_ID)" - + " INNER JOIN AD_Column cKey ON (t.AD_Table_ID=cKey.AD_Table_ID AND cKey.IsKey='Y')" - + " INNER JOIN AD_Element e ON (cKey.ColumnName=e.ColumnName)" - + " INNER JOIN AD_Element_Trl et ON (e.AD_Element_ID=et.AD_Element_ID) " - + "WHERE c.AD_Table_ID=? AND c.IsKey='Y'" - + " AND et.AD_Language=? " - + "ORDER BY 3"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_reportEngine.getPrintFormat().getAD_Table_ID()); - if (trl) - pstmt.setString(2, Env.getAD_Language(Env.getCtx())); - rs = pstmt.executeQuery(); - while (rs.next()) - { - String tableName = rs.getString(2); - String name = rs.getString(3); - String poName = rs.getString(4); - if (poName != null) - name += "/" + poName; - comboDrill.addItem(new ValueNamePair (tableName, name)); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - if (comboDrill.getItemCount() == 1) - { - labelDrill.setVisible(false); - comboDrill.setVisible(false); - } - else - comboDrill.addActionListener(this); - - revalidate(); - } // dynInit - - /** - * Fill ComboBox comboReport (report options) - * @param AD_PrintFormat_ID item to be selected - */ - private void fillComboReport(int AD_PrintFormat_ID) - { - comboReport.removeActionListener(this); - comboReport.removeAllItems(); - KeyNamePair selectValue = null; - - int AD_Window_ID = Env.getContextAsInt(Env.getCtx(), m_reportEngine.getWindowNo(), "_WinInfo_AD_Window_ID", true); - if (AD_Window_ID == 0) - AD_Window_ID = Env.getZoomWindowID(m_reportEngine.getQuery()); - // fill Report Options - String sql = MRole.getDefault().addAccessSQL( - "SELECT AD_PrintFormat_ID, Name, Description " - + "FROM AD_PrintFormat " - + "WHERE AD_Table_ID=? " - //Added Lines by Armen - + "AND IsActive='Y' " - //End of Added Lines - + (AD_Window_ID > 0 ? "AND (AD_Window_ID=? OR AD_Window_ID IS NULL) " : "") - + "ORDER BY Name", - "AD_PrintFormat", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - int AD_Table_ID = m_reportEngine.getPrintFormat().getAD_Table_ID(); - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, AD_Table_ID); - if (AD_Window_ID > 0) - pstmt.setInt(2, AD_Window_ID); - rs = pstmt.executeQuery(); - while (rs.next()) - { - KeyNamePair pp = new KeyNamePair(rs.getInt(1), rs.getString(2)); - comboReport.addItem(pp); - if (rs.getInt(1) == AD_PrintFormat_ID) - selectValue = pp; - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - // IDEMPIERE-297 - Check for Table Access and Window Access for New Report - int pfAD_Window_ID = MPrintFormat.getZoomWindowID(AD_PrintFormat_ID); - if ( MRole.getDefault().isTableAccess(MPrintFormat.Table_ID, false) - && (Boolean.TRUE.equals(MRole.getDefault().getWindowAccess(pfAD_Window_ID)))) - { - StringBuffer sb = new StringBuffer("** ").append(Msg.getMsg(m_ctx, "NewReport")).append(" **"); - KeyNamePair pp = new KeyNamePair(-1, sb.toString()); - comboReport.addItem(pp); - } - if (selectValue != null) - comboReport.setSelectedItem(selectValue); - comboReport.addActionListener(this); - } // fillComboReport - - /** - * Revalidate settings after change of environment - */ - public void revalidate() - { - m_pageMax = m_viewPanel.getPageCount(); - spinnerModel.setMaximum(Integer.valueOf(m_pageMax)); - - // scroll area (page size dependent) - centerScrollPane.setPreferredSize(new Dimension - (m_viewPanel.getPaperWidth()+30, m_viewPanel.getPaperHeight()+15)); - centerScrollPane.getViewport().setViewSize(new Dimension - (m_viewPanel.getPaperWidth()+2*m_viewPanel.getMarginSize(true), - m_viewPanel.getPaperHeight()+2*m_viewPanel.getMarginSize(true))); - - // Report Info - setTitle(Msg.getMsg(m_ctx, "Report") + ": " + m_reportEngine.getName() + " " + Env.getHeader(m_ctx, 0)); - StringBuilder sb = new StringBuilder (); - sb.append(m_viewPanel.getPaper().toString(m_ctx)) - .append(" - ").append(Msg.getMsg(m_ctx, "DataCols")).append("=") - .append(m_reportEngine.getColumnCount()) - .append(", ").append(Msg.getMsg(m_ctx, "DataRows")).append("=") - .append(m_reportEngine.getRowCount()); - statusBar.setStatusLine(sb.toString()); - // - setPage(m_pageNo); - } // revalidate - - - /** - * Create Menu - */ - private void createMenu() - { - // File - JMenu mFile = AEnv.getMenu("File"); - menuBar.add(mFile); - AEnv.addMenuItem("PrintScreen", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, 0), mFile, this); - AEnv.addMenuItem("ScreenShot", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, ActionEvent.SHIFT_MASK), mFile, this); - AEnv.addMenuItem("Report", null, KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.ALT_MASK), mFile, this); - mFile.addSeparator(); - AEnv.addMenuItem("PrintCustomize", "Preference", null, mFile, this); - AEnv.addMenuItem("Translate", null, null, mFile, this); - AEnv.addMenuItem("Find", null, KeyStroke.getKeyStroke(KeyEvent.VK_F, ActionEvent.CTRL_MASK), mFile, this); - mFile.addSeparator(); - AEnv.addMenuItem("PageSetup", null, null, mFile, this); - AEnv.addMenuItem("Print", null, KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.CTRL_MASK), mFile, this); - if (m_isCanExport) - AEnv.addMenuItem("Export", null, null, mFile, this); - mFile.addSeparator(); - AEnv.addMenuItem("End", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK), mFile, this); - AEnv.addMenuItem("Logout", null, KeyStroke.getKeyStroke(KeyEvent.VK_L, ActionEvent.SHIFT_MASK+ActionEvent.ALT_MASK), mFile, this); - AEnv.addMenuItem("Exit", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.SHIFT_MASK+ActionEvent.ALT_MASK), mFile, this); - - // View - JMenu mView = AEnv.getMenu("View"); - menuBar.add(mView); - - if (MRole.getDefault().isAllow_Info_Product()) - { - AEnv.addMenuItem("InfoProduct", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK), mView, this); - } - if (MRole.getDefault().isAllow_Info_BPartner()) - { - AEnv.addMenuItem("InfoBPartner", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK+ActionEvent.CTRL_MASK), mView, this); - } - if (MRole.getDefault().isShowAcct() && MRole.getDefault().isAllow_Info_Account()) - { - AEnv.addMenuItem("InfoAccount", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK+ActionEvent.CTRL_MASK), mView, this); - } - if (MRole.getDefault().isAllow_Info_Schedule()) - { - AEnv.addMenuItem("InfoSchedule", null, null, mView, this); - } - //FR [ 1966328 ] -// if (MRole.getDefault().isAllow_Info_MRP()) -// { -// AEnv.addMenuItem("InfoMRP", "Info", null, mView, this); -// } -// if (MRole.getDefault().isAllow_Info_CRP()) -// { -// AEnv.addMenuItem("InfoCRP", "Info", null, mView, this); -// } - mView.addSeparator(); - if (MRole.getDefault().isAllow_Info_Order()) - { - AEnv.addMenuItem("InfoOrder", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_Invoice()) - { - AEnv.addMenuItem("InfoInvoice", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_InOut()) - { - AEnv.addMenuItem("InfoInOut", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_Payment()) - { - AEnv.addMenuItem("InfoPayment", "Info", null, mView, this); - } -// if (MRole.getDefault().isAllow_Info_CashJournal()) -// { -// AEnv.addMenuItem("InfoCashLine", "Info", null, mView, this); -// } - if (MRole.getDefault().isAllow_Info_Resource()) - { - AEnv.addMenuItem("InfoAssignment", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_Asset()) - { - AEnv.addMenuItem("InfoAsset", "Info", null, mView, this); - } - - - // Go - JMenu mGo = AEnv.getMenu("Go"); - menuBar.add(mGo); - AEnv.addMenuItem("First", "First", KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, ActionEvent.ALT_MASK), mGo, this); - AEnv.addMenuItem("PreviousPage", "Previous", KeyStroke.getKeyStroke(KeyEvent.VK_UP, ActionEvent.ALT_MASK), mGo, this); - AEnv.addMenuItem("NextPage", "Next", KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, ActionEvent.ALT_MASK), mGo, this); - AEnv.addMenuItem("Last", "Last", KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, ActionEvent.ALT_MASK), mGo, this); - - // Tools - JMenu mTools = AEnv.getMenu("Tools"); - menuBar.add(mTools); - AEnv.addMenuItem("Calculator", null, null, mTools, this); - AEnv.addMenuItem("Calendar", null, null, mTools, this); - MUser user = MUser.get(Env.getCtx()); - if (user.isAdministrator()) - AEnv.addMenuItem("Editor", null, null, mTools, this); - AEnv.addMenuItem("Script", null, null, mTools, this); - mTools.addSeparator(); - AEnv.addMenuItem("Preference", null, null, mTools, this); - - // Window - AMenu aMenu = (AMenu)AEnv.getWindow(0); - JMenu mWindow = new WindowMenu(aMenu.getWindowManager(), this); - menuBar.add(mWindow); - - // Help - JMenu mHelp = AEnv.getMenu("Help"); - menuBar.add(mHelp); - AEnv.addMenuItem("Online", null, null, mHelp, this); - AEnv.addMenuItem("SendMail", null, null, mHelp, this); - AEnv.addMenuItem("About", null, null, mHelp, this); - - // ---- ToolBar ---- - // - setButton(bPrint, "Print", "Print"); - setButton(bSendMail, "SendMail", "SendMail"); - setButton(bPageSetup, "PageSetup", "PageSetup"); - setButton(bArchive, "Archive", "Archive"); - if (m_isCanExport) - setButton(bExport, "Export", "Export"); - // - setButton(bNext, "NextPage", "Next"); - setButton(bPrevious, "PreviousPage", "Previous"); - // - setButton(bFind, "Find", "Find"); - setButton(bCustomize, "PrintCustomize", "Preference"); - // - setButton(bEnd, "End", "End"); - } // createMenu - - /** - * Set Button - * @param button button - * @param cmd command - * @param file fine mame - */ - private void setButton (AbstractButton button, String cmd, String file) - { - String text = Msg.getMsg(m_ctx, cmd); - button.setToolTipText(text); - button.setActionCommand(cmd); - // - ImageIcon ii24 = Env.getImageIcon(file+"24.gif"); - if (ii24 != null) - button.setIcon(ii24); - button.setMargin(AppsAction.BUTTON_INSETS); - button.setPreferredSize(AppsAction.BUTTON_SIZE); - button.addActionListener(this); - } // setButton - - /** - * Dispose - */ - public void dispose() - { - Env.clearWinContext(m_WindowNo); - m_reportEngine = null; - m_viewPanel = null; - m_ctx = null; - super.dispose(); - } // dispose - - - /************************************************************************** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (m_setting) - return; - String cmd = e.getActionCommand(); - log.config(cmd); - this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - // - if (e.getSource() == comboZoom) - cmd_zoom(); - else if (e.getSource() == comboReport) - cmd_report(); - else if (e.getSource() == comboDrill) - cmd_drill(); - else if (e.getSource() == summary) //FR 201156 - { - m_reportEngine.setSummary(summary.isSelected()); - cmd_report(); - } - else if (cmd.equals("First")) - setPage(1); - else if (cmd.equals("PreviousPage") || cmd.equals("Previous")) - setPage(m_pageNo-1); - else if (cmd.equals("NextPage") || cmd.equals("Next")) - setPage(m_pageNo+1); - else if (cmd.equals("Last")) - setPage(m_pageMax); - else if (cmd.equals("Find")) - cmd_find(); - else if (cmd.equals("Export")) - cmd_export(); - else if (cmd.equals("Print")) - cmd_print(); - else if (cmd.equals("SendMail")) - cmd_sendMail(); - else if (cmd.equals("Archive")) - cmd_archive(); - else if (cmd.equals("PrintCustomize")) - cmd_customize(); - else if (cmd.equals("PageSetup")) - cmd_pageSetup(); - else if (cmd.equals("Translate")) - cmd_translate(); - else if (cmd.equals("End")) - dispose(); - // - else if (e.getSource() == m_ddM) - cmd_window(m_ddQ); - else if (e.getSource() == m_daM) - cmd_window(m_daQ); - // - else if (!AEnv.actionPerformed(e.getActionCommand(), m_WindowNo, this)) - log.log(Level.SEVERE, "unknown action=" + e.getActionCommand()); - // - this.setCursor(Cursor.getDefaultCursor()); - } // actionPerformed - - /** - * Change Listener (spinner, viewpoint) - * @param e event - */ - public void stateChanged (ChangeEvent e) - { - if (m_setting) - return; - // log.config( "Viewer.stateChanged", e); - m_setting = true; - int newPage = 0; - if (e.getSource() == spinner) - { - newPage = ((Integer)spinnerModel.getValue()).intValue(); - } - // pb with the viewport change listener disabled the following is - // superfluous and should be removed - else // Viewpoint - { - Point p = centerScrollPane.getViewport().getViewPosition(); - newPage = Math.round(m_viewPanel.getPageNoAt(p)); - } - setPage(newPage); - m_setting = false; - } // stateChanged - - - /** - * Set Page No - * @param page page no - */ - private void setPage (int page) - { - m_setting = true; - m_pageNo = page; - if (m_pageNo < 1) - m_pageNo = 1; - if (page > m_pageMax) - m_pageNo = m_pageMax; - bPrevious.setEnabled (m_pageNo != 1); - bNext.setEnabled (m_pageNo != m_pageMax); - // - Rectangle pageRectangle = m_viewPanel.getRectangleOfPage(m_pageNo); - pageRectangle.x -= m_viewPanel.getMarginSize(true); - pageRectangle.y -= m_viewPanel.getMarginSize(true); - centerScrollPane.getViewport().setViewPosition(pageRectangle.getLocation()); - // System.out.println("scrollTo " + pageRectangle); - - // Set Page - spinnerModel.setValue(Integer.valueOf(m_pageNo)); - StringBuffer sb = new StringBuffer (Msg.getMsg(m_ctx, "Page")) - .append(" ").append(m_pageNo) - .append(m_viewPanel.getPageInfo(m_pageNo)) - .append(" ").append(Msg.getMsg(m_ctx, "of")).append(" ") - .append(m_pageMax) - .append(m_viewPanel.getPageInfoMax()); - statusBar.setStatusDB(sb.toString()); - m_setting = false; - } // setPage - - - /************************************************************************** - * (Re)Set Drill Accross Cursor - */ - private void cmd_drill() - { - m_drillDown = comboDrill.getSelectedIndex() < 1; // -1 or 0 - if (m_drillDown) - setCursor(Cursor.getDefaultCursor()); - else - setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - } // cmd_drill - - /** - * Mouse clicked - * @param e event - * @param rightClick true if right click - */ - private void mouse_clicked (MouseEvent e, boolean rightClick) - { - Point point = e.getPoint(); - if (log.isLoggable(Level.INFO)) log.info("Right=" + rightClick + " - " + point.toString()); - if (rightClick) - { - m_ddQ = m_viewPanel.getDrillDown(point); - m_daQ = m_viewPanel.getDrillAcross(point); - m_ddM = null; - m_daM = null; - if (m_ddQ == null && m_daQ == null) - return; - // Create Menu - JPopupMenu pop = new JPopupMenu(); - Icon wi = Env.getImageIcon("mWindow.png"); - if (m_ddQ != null) - { - m_ddM = new CMenuItem(m_ddQ.getDisplayName(Env.getCtx()), wi); - m_ddM.setToolTipText(m_ddQ.toString()); - m_ddM.addActionListener(this); - pop.add(m_ddM); - } - if (m_daQ != null) - { - m_daM = new CMenuItem(m_daQ.getDisplayName(Env.getCtx()), wi); - m_daM.setToolTipText(m_daQ.toString()); - m_daM.addActionListener(this); - pop.add(m_daM); - } - Point pp = e.getPoint(); - pop.show((Component)e.getSource(), pp.x, pp.y); - return; - } - - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - if (m_drillDown) - { - MQuery query = m_viewPanel.getDrillDown(point); - if (query != null) - { - if (log.isLoggable(Level.INFO)) log.info("Drill Down: " + query.getWhereClause(true)); - executeDrill(query); - } - } - else if (comboDrill.getSelectedItem() != null && comboDrill.getSelectedIndex() > 0) - { - MQuery query = m_viewPanel.getDrillAcross(point); - if (query != null) - { - NamePair pp = (NamePair)comboDrill.getSelectedItem(); - query.setTableName(pp.getID()); - if (log.isLoggable(Level.INFO)) log.info("Drill Accross: " + query.getWhereClause(true)); - executeDrill(query); - } - } - cmd_drill(); // setCursor - } // mouse_clicked - - /** - * Execute Drill to Query - * @param query query - */ - private void executeDrill (MQuery query) - { - int AD_Table_ID = AReport.getAD_Table_ID(query.getTableName()); - if (!MRole.getDefault().isCanReport(AD_Table_ID)) - { - ADialog.error(m_WindowNo, this, "AccessCannotReport", query.getTableName()); - return; - } - if (AD_Table_ID != 0) - new AReport (AD_Table_ID, null, query); - else - log.warning("No Table found for " + query.getWhereClause(true)); - } // executeDrill - - /** - * Open Window - * @param query query - */ - private void cmd_window (MQuery query) - { - if (query == null) - return; - AEnv.zoom(query); - } // cmd_window - - /************************************************************************** - * Print Report - */ - private void cmd_print() - { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - m_reportEngine.getPrintInfo().setWithDialog(true); - m_reportEngine.print(); - cmd_drill(); // setCursor - } // cmd_print - - /** - * Send Mail - */ - private void cmd_sendMail() - { - String to = ""; - MUser from = MUser.get(Env.getCtx(), Env.getAD_User_ID(Env.getCtx())); - String subject = m_reportEngine.getName(); - String message = ""; - File attachment = null; - - try - { - attachment = new File(FileUtil.getTempMailName(subject, ".pdf")); - m_reportEngine.getPDF(attachment); - } - catch (Exception e) - { - log.log(Level.SEVERE, "", e); - } - - new EMailDialog (this, - Msg.getMsg(Env.getCtx(), "SendMail"), - from, to, subject, message, attachment); - } // cmd_sendMail - - /** - * Archive Report directly - */ - private void cmd_archive () - { - boolean success = false; - byte[] data = Document.getPDFAsArray(m_reportEngine.getLayout().getPageable(false)); // No Copy - if (data != null) - { - MArchive archive = new MArchive (Env.getCtx(), m_reportEngine.getPrintInfo(), null); - archive.setBinaryData(data); - success = archive.save(); - } - if (success) - ADialog.info(m_WindowNo, this, "Archived"); - else - ADialog.error(m_WindowNo, this, "ArchiveError"); - } // cmd_archive - - /** - * Print Setup Dialog - */ - private void cmd_pageSetup() - { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - m_reportEngine.pageSetupDialog(); - revalidate(); - cmd_drill(); // setCursor - } // cmd_pageSetup - - /** - * Export - */ - private void cmd_export() - { - log.config(""); - if (!m_isCanExport) - { - ADialog.error(m_WindowNo, this, "AccessCannotExport", getTitle()); - return; - } - - // - JFileChooser chooser = new JFileChooser(); - chooser.setDialogType(JFileChooser.SAVE_DIALOG); - chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); - chooser.setDialogTitle(Msg.getMsg(m_ctx, "Export") + ": " + getTitle()); - // - chooser.addChoosableFileFilter(new ExtensionFileFilter("ps", Msg.getMsg(m_ctx, "FilePS"))); - chooser.addChoosableFileFilter(new ExtensionFileFilter("xml", Msg.getMsg(m_ctx, "FileXML"))); - chooser.addChoosableFileFilter(new ExtensionFileFilter("pdf", Msg.getMsg(m_ctx, "FilePDF"))); - chooser.addChoosableFileFilter(new ExtensionFileFilter("html", Msg.getMsg(m_ctx, "FileHTML"))); - chooser.addChoosableFileFilter(new ExtensionFileFilter("txt", Msg.getMsg(m_ctx, "FileTXT"))); - chooser.addChoosableFileFilter(new ExtensionFileFilter("ssv", Msg.getMsg(m_ctx, "FileSSV"))); - chooser.addChoosableFileFilter(new ExtensionFileFilter("csv", Msg.getMsg(m_ctx, "FileCSV"))); - chooser.addChoosableFileFilter(new ExtensionFileFilter("xls", Msg.getMsg(m_ctx, "FileXLS"))); - // - if (chooser.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) - return; - - // Create File - File outFile = ExtensionFileFilter.getFile(chooser.getSelectedFile(), chooser.getFileFilter()); - try - { - outFile.createNewFile(); - } - catch (IOException e) - { - log.log(Level.SEVERE, "", e); - ADialog.error(m_WindowNo, this, "FileCannotCreate", e.getLocalizedMessage()); - return; - } - - String ext = outFile.getPath(); - // no extension - if (ext.lastIndexOf('.') == -1) - { - ADialog.error(m_WindowNo, this, "FileInvalidExtension"); - return; - } - ext = ext.substring(ext.lastIndexOf('.')+1).toLowerCase(); - if (log.isLoggable(Level.CONFIG)) log.config( "File=" + outFile.getPath() + "; Type=" + ext); - - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - try { - if (ext.equals("pdf")) - m_reportEngine.createPDF(outFile); - else if (ext.equals("ps")) - m_reportEngine.createPS(outFile); - else if (ext.equals("xml")) - m_reportEngine.createXML(outFile); - else if (ext.equals("csv")) - m_reportEngine.createCSV(outFile, ',', m_reportEngine.getPrintFormat().getLanguage()); - else if (ext.equals("ssv")) - m_reportEngine.createCSV(outFile, ';', m_reportEngine.getPrintFormat().getLanguage()); - else if (ext.equals("txt")) - m_reportEngine.createCSV(outFile, '\t', m_reportEngine.getPrintFormat().getLanguage()); - else if (ext.equals("html") || ext.equals("htm")) - m_reportEngine.createHTML(outFile, false, m_reportEngine.getPrintFormat().getLanguage()); - else if (ext.equals("xls")) - m_reportEngine.createXLS(outFile, m_reportEngine.getPrintFormat().getLanguage()); - else - ADialog.error(m_WindowNo, this, "FileInvalidExtension"); - } - catch (Exception e) { - ADialog.error(m_WindowNo, this, "Error", e.getLocalizedMessage()); - if (CLogMgt.isLevelFinest()) - e.printStackTrace(); - } - cmd_drill(); // setCursor - } // cmd_export - - - /** - * Report Combo - Start other Report or create new one - */ - private void cmd_report() - { - KeyNamePair pp = (KeyNamePair)comboReport.getSelectedItem(); - if (pp == null) - return; - // - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - MPrintFormat pf = null; - int AD_PrintFormat_ID = pp.getKey(); - - // create new - if (AD_PrintFormat_ID == -1) - { - int AD_ReportView_ID = m_reportEngine.getPrintFormat().getAD_ReportView_ID(); - if (AD_ReportView_ID != 0) - { - String name = m_reportEngine.getName(); - int index = name.lastIndexOf('_'); - if (index != -1) - name = name.substring(0,index); - pf = MPrintFormat.createFromReportView(m_ctx, AD_ReportView_ID, name); - } - else - { - int AD_Table_ID = m_reportEngine.getPrintFormat().getAD_Table_ID(); - pf = MPrintFormat.createFromTable(m_ctx, AD_Table_ID); - } - if (pf != null) - fillComboReport(pf.get_ID()); - else - return; - } - else - pf = MPrintFormat.get (Env.getCtx(), AD_PrintFormat_ID, true); - - // Get Language from previous - thanks Gunther Hoppe - if (m_reportEngine.getPrintFormat() != null) - { - pf.setLanguage(m_reportEngine.getPrintFormat().getLanguage()); // needs to be re-set - otherwise viewer will be blank - pf.setTranslationLanguage(m_reportEngine.getPrintFormat().getLanguage()); - } - m_reportEngine.setPrintFormat(pf); - revalidate(); - - cmd_drill(); // setCursor - } // cmd_report - - /** - * Query Report - */ - private void cmd_find() - { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - int AD_Table_ID = m_reportEngine.getPrintFormat().getAD_Table_ID(); - - String title = null; - String tableName = null; - - // Get Find Tab Info - String sql = "SELECT t.AD_Tab_ID " - // ,w.Name, t.Name, w.IsDefault, t.SeqNo, ABS (tt.AD_Window_ID-t.AD_Window_ID) - + "FROM AD_Tab t" - + " INNER JOIN AD_Window w ON (t.AD_Window_ID=w.AD_Window_ID)" - + " INNER JOIN AD_Table tt ON (t.AD_Table_ID=tt.AD_Table_ID) " - + "WHERE tt.AD_Table_ID=? " - + "ORDER BY w.IsDefault DESC, t.SeqNo, ABS (tt.AD_Window_ID-t.AD_Window_ID)"; - int AD_Tab_ID = DB.getSQLValue(null, sql, AD_Table_ID); - // ASP - MClient client = MClient.get(Env.getCtx()); - String ASPFilter = ""; - if (client.isUseASP()) - ASPFilter = - " AND ( AD_Tab_ID IN ( " - // Just ASP subscribed tabs for client " - + " SELECT t.AD_Tab_ID " - + " FROM ASP_Tab t, ASP_Window w, ASP_Level l, ASP_ClientLevel cl " - + " WHERE w.ASP_Level_ID = l.ASP_Level_ID " - + " AND cl.AD_Client_ID = " + client.getAD_Client_ID() - + " AND cl.ASP_Level_ID = l.ASP_Level_ID " - + " AND t.ASP_Window_ID = w.ASP_Window_ID " - + " AND t.IsActive = 'Y' " - + " AND w.IsActive = 'Y' " - + " AND l.IsActive = 'Y' " - + " AND cl.IsActive = 'Y' " - + " AND t.ASP_Status = 'S') " // Show - + " OR AD_Tab_ID IN ( " - // + show ASP exceptions for client - + " SELECT AD_Tab_ID " - + " FROM ASP_ClientException ce " - + " WHERE ce.AD_Client_ID = " + client.getAD_Client_ID() - + " AND ce.IsActive = 'Y' " - + " AND ce.AD_Tab_ID IS NOT NULL " - + " AND ce.AD_Field_ID IS NULL " - + " AND ce.ASP_Status = 'S') " // Show - + " ) " - + " AND AD_Tab_ID NOT IN ( " - // minus hide ASP exceptions for client - + " SELECT AD_Tab_ID " - + " FROM ASP_ClientException ce " - + " WHERE ce.AD_Client_ID = " + client.getAD_Client_ID() - + " AND ce.IsActive = 'Y' " - + " AND ce.AD_Tab_ID IS NOT NULL " - + " AND ce.AD_Field_ID IS NULL " - + " AND ce.ASP_Status = 'H')"; // Hide - // - sql = "SELECT Name, TableName FROM AD_Tab_v WHERE AD_Tab_ID=? " + ASPFilter; - if (!Env.isBaseLanguage(Env.getCtx(), "AD_Tab")) - sql = "SELECT Name, TableName FROM AD_Tab_vt WHERE AD_Tab_ID=?" - + " AND AD_Language='" + Env.getAD_Language(Env.getCtx()) + "' " + ASPFilter; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, AD_Tab_ID); - rs = pstmt.executeQuery(); - // - if (rs.next()) - { - title = rs.getString(1); - tableName = rs.getString(2); - } - // - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - GridField[] findFields = null; - if (tableName != null) - findFields = GridField.createFields(m_ctx, m_WindowNo, 0, AD_Tab_ID); - - if (findFields == null) // No Tab for Table exists - bFind.setEnabled(false); - else - { - Find find = new Find (this, m_reportEngine.getWindowNo(), title, - AD_Tab_ID, AD_Table_ID, tableName, m_reportEngine.getWhereExtended(), findFields, 1); - m_reportEngine.setQuery(find.getQuery()); - find.dispose(); - find = null; - revalidate(); - } - cmd_drill(); // setCursor - } // cmd_find - - /** - * Call Customize - */ - private void cmd_customize() - { - AWindow win = new AWindow (getGraphicsConfiguration()); - new AWindowListener (win, this); // forwards Window Events - int AD_PrintFormat_ID = m_reportEngine.getPrintFormat().get_ID(); - int AD_Window_ID = MPrintFormat.getZoomWindowID(AD_PrintFormat_ID); - boolean loadedOK = win.initWindow(AD_Window_ID, MQuery.getEqualQuery("AD_PrintFormat_ID", AD_PrintFormat_ID)); - if (loadedOK) - { - AEnv.addToWindowManager(win); - AEnv.showCenterScreen(win); - } - // see windowStateChanged for applying change - } // cmd_customize - - /** - * Window State Listener for Customize Window - * @param e event - */ - public void windowStateChanged (WindowEvent e) - { - // The Customize Window was closed - if (e.getID() == WindowEvent.WINDOW_CLOSED && m_reportEngine != null) - { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - log.info("Re-read PrintFormat"); - int AD_PrintFormat_ID = m_reportEngine.getPrintFormat().get_ID(); - Language language = m_reportEngine.getPrintFormat().getLanguage(); - MPrintFormat pf = MPrintFormat.get (Env.getCtx(), AD_PrintFormat_ID, true); - pf.setLanguage (language); // needs to be re-set - otherwise viewer will be blank - pf.setTranslationLanguage (language); - m_reportEngine.setPrintFormat(pf); - revalidate(); - cmd_drill(); // setCursor - } - } // windowStateChanged - - /** - * Set Zoom Level - */ - private void cmd_zoom() - { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - m_viewPanel.setZoomLevel(comboZoom.getSelectedIndex()); - revalidate(); - cmd_drill(); // setCursor - } // cmd_zoom - - - /** - * Show Translation Dialog. - * Translate base table entry, will be copied to trl tables if not multi-lingual - */ - private void cmd_translate() - { - ArrayList list = new ArrayList(); - ValueNamePair pp = null; - String sql = "SELECT Name, AD_Language FROM AD_Language WHERE IsSystemLanguage='Y' ORDER BY 1"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - rs = pstmt.executeQuery(); - while (rs.next()) - list.add(new ValueNamePair (rs.getString(2), rs.getString(1))); - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - if (list.size() == 0) - { - ADialog.warn(m_WindowNo, this, "NoTranslation"); - return; - } - - // Dialog - String title = Msg.getMsg(Env.getCtx(), "PrintFormatTrl", true); - String message = Msg.getMsg(Env.getCtx(), "PrintFormatTrl", false); - int choice = JOptionPane.showOptionDialog - (this, message, title, - JOptionPane.OK_OPTION, JOptionPane.QUESTION_MESSAGE, null, - list.toArray(), null); - if (choice == JOptionPane.CLOSED_OPTION) - return; - // - pp = (ValueNamePair)list.get(choice); - String AD_Language = pp.getValue(); - int AD_PrintFormat_ID = m_reportEngine.getPrintFormat().get_ID(); - if (log.isLoggable(Level.CONFIG)) log.config(AD_Language + " - AD_PrintFormat_ID=" + AD_PrintFormat_ID); - StringBuilder sb = new StringBuilder(); - // English - if (Language.isBaseLanguage (AD_Language)) - { - sb.append("UPDATE AD_PrintFormatItem pfi " - + "SET Name = (SELECT e.Name FROM AD_Element e, AD_Column c" - + " WHERE e.AD_Element_ID=c.AD_Element_ID AND c.AD_Column_ID=pfi.AD_Column_ID)," - + "PrintName = (SELECT e.PrintName FROM AD_Element e, AD_Column c" - + " WHERE e.AD_Element_ID=c.AD_Element_ID AND c.AD_Column_ID=pfi.AD_Column_ID) " - + "WHERE AD_PrintFormat_ID=").append(AD_PrintFormat_ID).append( - " AND EXISTS (SELECT * FROM AD_Element e, AD_Column c" - + " WHERE e.AD_Element_ID=c.AD_Element_ID AND c.AD_Column_ID=pfi.AD_Column_ID)"); - } - else - { - AD_Language = "'" + AD_Language + "'"; - sb.append("UPDATE AD_PrintFormatItem pfi " - + "SET Name = (SELECT e.Name FROM AD_Element_Trl e, AD_Column c" - + " WHERE e.AD_Language=").append(AD_Language).append( - " AND e.AD_Element_ID=c.AD_Element_ID AND c.AD_Column_ID=pfi.AD_Column_ID), " - + "PrintName = (SELECT e.PrintName FROM AD_Element_Trl e, AD_Column c" - + " WHERE e.AD_Language=").append(AD_Language).append( - " AND e.AD_Element_ID=c.AD_Element_ID AND c.AD_Column_ID=pfi.AD_Column_ID) " - + "WHERE AD_PrintFormat_ID=").append(AD_PrintFormat_ID).append( - " AND EXISTS (SELECT * FROM AD_Element_Trl e, AD_Column c" - + " WHERE e.AD_Language=").append(AD_Language).append( - " AND e.AD_Element_ID=c.AD_Element_ID AND c.AD_Column_ID=pfi.AD_Column_ID)"); - } - int count = DB.executeUpdate(sb.toString(), null); - if (log.isLoggable(Level.CONFIG)) log.config("Count=" + count); - // - m_reportEngine.setPrintFormat(MPrintFormat.get (Env.getCtx(), AD_PrintFormat_ID, true)); - revalidate(); - } // cmd_translate - - /*************************************************************************/ - - /** - * Test - * @param args args - */ - static public void main (String[] args) - { - Login.initTest(true); - - MQuery q = new MQuery("C_Invoice"); - q.addRestriction("C_Invoice_ID", MQuery.EQUAL, Integer.valueOf(103)); - - // 102 = Invoice - 100 = Order - PrintInfo i = new PrintInfo("test", X_C_Invoice.Table_ID, 102, 0); - MPrintFormat f = MPrintFormat.get (Env.getCtx(), 102, false); - ReportEngine re = new ReportEngine(Env.getCtx(), f, q, i); - - // MPrintFormat f = new MPrintFormat(Env.getCtx(), 101); - // ReportEngine re = new ReportEngine(f, null); - - new Viewer(null, re); - } // main - - @Override - public void onPrintFormatChanged(ReportEngineEvent event) { - if (m_viewPanel != null) - m_viewPanel.revalidate(); - } - - @Override - public void onQueryChanged(ReportEngineEvent event) { - if (m_viewPanel != null) - m_viewPanel.revalidate(); - } - - @Override - public void onPageSetupChanged(ReportEngineEvent event) { - if (m_viewPanel != null) - m_viewPanel.revalidate(); - } - -} // Viewer - diff --git a/org.adempiere.ui.swing/src/org/compiere/print/package.html b/org.adempiere.ui.swing/src/org/compiere/print/package.html deleted file mode 100644 index edd76e6f46..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/print/package.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - -Provides for.... - -

    Package org.compiere.print

    - -Report viewer and controller. - - - -

    Related Documentation

    - -For overviews, tutorials, examples, guides, and tool documentation, please see: - - - - - - diff --git a/org.adempiere.ui.swing/src/org/compiere/report/core/ResultTable.java b/org.adempiere.ui.swing/src/org/compiere/report/core/ResultTable.java deleted file mode 100644 index 88948d77a2..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/report/core/ResultTable.java +++ /dev/null @@ -1,264 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.report.core; - -import java.awt.Component; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.logging.Level; - -import javax.swing.JTable; -import javax.swing.ListSelectionModel; -import javax.swing.event.TableModelEvent; -import javax.swing.table.DefaultTableCellRenderer; -import javax.swing.table.TableCellRenderer; -import javax.swing.table.TableColumn; -import javax.swing.table.TableColumnModel; -import javax.swing.table.TableModel; - -import org.compiere.util.CLogger; -import org.compiere.util.MSort; - -/** - * The Table to present RModel information - * - * @author Jorg Janke - * @version $Id: ResultTable.java,v 1.2 2006/07/30 00:51:06 jjanke Exp $ - */ -public class ResultTable extends JTable implements MouseListener -{ - /** - * - */ - private static final long serialVersionUID = -2633317327407673345L; - - /** - * Constructor - */ - public ResultTable() - { - super(); - setCellSelectionEnabled(false); - setColumnSelectionAllowed(false); - setRowSelectionAllowed(false); - setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - setAutoResizeMode(JTable.AUTO_RESIZE_OFF); - - // Default Editor - ResultTableCellEditor rtce = new ResultTableCellEditor(); - setCellEditor(rtce); - - // Mouse Listener - addMouseListener(this); - getTableHeader().addMouseListener(this); - } // ResultTable - - /** Last model index sorted */ - private int m_lastSortIndex = -1; - /** Sort direction */ - private boolean m_asc = true; - /** RModel */ - private RModel m_model = null; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(ResultTable.class); - - /** - * Create a JTable Model from ReportModel - * @param reportModel - */ - public ResultTable (RModel reportModel) - { - this(); - setModel(reportModel); - } // ResultTable - - /** - * Set Model - * @param reportModel - */ - public void setModel (RModel reportModel) - { - if (log.isLoggable(Level.CONFIG)) log.config(reportModel.toString()); - m_model = reportModel; - super.setModel(new ResultTableModel(reportModel)); - // - TableColumnModel tcm = getColumnModel(); - // Set Editor/Renderer - for (int i = 0; i < tcm.getColumnCount(); i++) - { - TableColumn tc = tcm.getColumn(i); - RColumn rc = reportModel.getRColumn(i); - if (rc.getColHeader().equals(tc.getHeaderValue())) - { - ResultTableCellRenderer rtcr = new ResultTableCellRenderer(reportModel, rc); - tc.setCellRenderer(rtcr); - // - } - else - log.log(Level.SEVERE, "RColumn=" + rc.getColHeader() + " <> TableColumn=" + tc.getHeaderValue()); - } - autoSize(); - } // setModel - - /** - * @return RModel - */ - public RModel getRModel() { - return m_model; - } - - /** - * Set Model - * @param ignored - */ - public void setModel (TableModel ignored) - { - // throw new IllegalArgumentException("Requires RModel"); // default construvtor calls this - super.setModel(ignored); - } // setModel - - /** - * Table Model Listener - * @param e - */ - public void tableChanged(TableModelEvent e) - { - super.tableChanged(e); - if (log.isLoggable(Level.FINE)) log.fine("Type=" + e.getType()); - } // tableChanged - - /*************************************************************************/ - - /** - * Mouse Clicked - * @param e - */ - public void mouseClicked(MouseEvent e) - { - int col = getColumnModel().getColumnIndexAtX(e.getX()); - if (log.isLoggable(Level.FINE)) log.fine("Column " + col + " = " + getColumnModel().getColumn(col).getHeaderValue() - + ", Table r=" + this.getSelectedRow() + " c=" + this.getSelectedColumn()); - - // clicked Cell - if (e.getSource() == this) - { - } - // clicked Header - else - { - int mc = convertColumnIndexToModel(col); - sort(mc); - } - } // mouseClicked - - public void mousePressed(MouseEvent e) - { - } - public void mouseReleased(MouseEvent e) - { - } - public void mouseEntered(MouseEvent e) - { - } - public void mouseExited(MouseEvent e) - { - } - - - /************************************************************************** - * Size Columns - */ - private void autoSize() - { - log.config(""); - // - final int SLACK = 8; // making sure it fits in a column - final int MAXSIZE = 300; // max size of a column - // - TableColumnModel tcm = getColumnModel(); - // For all columns - for (int col = 0; col < tcm.getColumnCount(); col++) - { - TableColumn tc = tcm.getColumn(col); - // log.config( "Column=" + col, tc.getHeaderValue()); - int width = 0; - - // Header - TableCellRenderer renderer = tc.getHeaderRenderer(); - if (renderer == null) - renderer = new DefaultTableCellRenderer(); - Component comp = renderer.getTableCellRendererComponent - (this, tc.getHeaderValue(), false, false, 0, 0); - // log.fine( "Hdr - preferred=" + comp.getPreferredSize().width + ", width=" + comp.getWidth()); - width = comp.getPreferredSize().width + SLACK; - - // Cells - int maxRow = Math.min(30, getRowCount()); // first 30 rows - for (int row = 0; row < maxRow; row++) - { - renderer = getCellRenderer(row, col); - comp = renderer.getTableCellRendererComponent - (this, getValueAt(row, col), false, false, row, col); - int rowWidth = comp.getPreferredSize().width + SLACK; - width = Math.max(width, rowWidth); - } - // Width not greater .. - width = Math.min(MAXSIZE, width); - tc.setPreferredWidth(width); - // log.fine( "width=" + width); - } // for all columns - } // autoSize - - /** - * Sort Table - * @param modelColumnIndex - */ - private void sort (final int modelColumnIndex) - { - int rows = getRowCount(); - if (rows == 0) - return; - // other column - if (modelColumnIndex != m_lastSortIndex) - m_asc = true; - else - m_asc = !m_asc; - - m_lastSortIndex = modelColumnIndex; - // - if (log.isLoggable(Level.CONFIG)) log.config("#" + modelColumnIndex - + " - rows=" + rows + ", asc=" + m_asc); - ResultTableModel model = (ResultTableModel)getModel(); - - // Prepare sorting - final MSort sort = new MSort(0, null); - sort.setSortAsc(m_asc); - // Sort the data list - teo_sarca [ 1734327 ] - Collections.sort(model.getDataList(), new Comparator() { - public int compare(Object o1, Object o2) { - Object item1 = ((ArrayList)o1).get(modelColumnIndex); - Object item2 = ((ArrayList)o2).get(modelColumnIndex); - return sort.compare(item1, item2); - } - }); - } // sort - -} // ResultTable diff --git a/org.adempiere.ui.swing/src/org/compiere/report/core/ResultTableCellEditor.java b/org.adempiere.ui.swing/src/org/compiere/report/core/ResultTableCellEditor.java deleted file mode 100644 index 2bb66f260b..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/report/core/ResultTableCellEditor.java +++ /dev/null @@ -1,98 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.report.core; - -import java.awt.Component; -import java.util.EventObject; - -import javax.swing.AbstractCellEditor; -import javax.swing.JTable; -import javax.swing.table.TableCellEditor; - -/** - * Cell Editor for Report Result Table - * - * @author Jorg Janke - * @version $Id: ResultTableCellEditor.java,v 1.2 2006/07/30 00:51:06 jjanke Exp $ - */ -public class ResultTableCellEditor extends AbstractCellEditor implements TableCellEditor -{ - /** - * - */ - private static final long serialVersionUID = -5173884011593230904L; - - /** - * Constructor (read only) - */ - public ResultTableCellEditor() - { - } // ResultTableCellEditor - - /** - * Constructor - */ - public ResultTableCellEditor(RColumn rc) - { - m_rc = rc; - } // ResultTableCellEditor - - /** Report Column */ - private RColumn m_rc = null; - - /** - * Return Editor - */ - public Component getTableCellEditorComponent (JTable table, Object value, - boolean isSelected, int row, int col) - { - if (m_rc == null) - return null; - return null; - } // getTableCellEditorComponent - - /** - * Get Value - */ - public Object getCellEditorValue() - { - if (m_rc == null) - return null; - return null; - } // getCellEditorValue - - /** - * Is Cell editable - */ - public boolean isCellEditable(EventObject anEvent) - { - if (m_rc == null) - return false; - return !m_rc.isReadOnly(); - } // isCellEditable - - /** - * Should Cell be selected - */ - public boolean shouldSelectCell(EventObject anEvent) - { - if (m_rc == null) - return false; - return !m_rc.isReadOnly(); - } // shouldSelectCell - -} // ResultTableCellEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/report/core/ResultTableCellRenderer.java b/org.adempiere.ui.swing/src/org/compiere/report/core/ResultTableCellRenderer.java deleted file mode 100644 index 80539dbbbd..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/report/core/ResultTableCellRenderer.java +++ /dev/null @@ -1,162 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.report.core; - -import java.awt.Component; -import java.awt.Font; -import java.awt.Insets; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; - -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JTable; -import javax.swing.table.DefaultTableCellRenderer; -import javax.swing.table.TableCellRenderer; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.util.DisplayType; - -/** - * Cell Renderer for Report Result Table - * - * @author Jorg Janke - * @version $Id: ResultTableCellRenderer.java,v 1.2 2006/07/30 00:51:06 jjanke Exp $ - */ -class ResultTableCellRenderer extends DefaultTableCellRenderer implements TableCellRenderer -{ - /** - * - */ - private static final long serialVersionUID = -1491594061244117003L; - - - /** - * Constructor (extends Label) - * @param rm - * @param rc - */ - public ResultTableCellRenderer(RModel rm, RColumn rc) - { - m_rm = rm; - m_rc = rc; - int dt = m_rc.getDisplayType(); - // Numbers - if (DisplayType.isNumeric(dt)) - { - super.setHorizontalAlignment(JLabel.TRAILING); - m_nFormat = DisplayType.getNumberFormat(dt); - } - // Dates - else if (DisplayType.isDate(m_rc.getDisplayType())) - { - super.setHorizontalAlignment(JLabel.TRAILING); - m_dFormat = DisplayType.getDateFormat(dt); - } - // - else if (dt == DisplayType.YesNo) - { - m_check = new JCheckBox(); - m_check.setMargin(new Insets(0,0,0,0)); - m_check.setHorizontalAlignment(JLabel.CENTER); - } - } // ResultTableCellRenderer - - /** Report Column */ - private RModel m_rm = null; - /** Report Column */ - private RColumn m_rc = null; - /** Number Format */ - private DecimalFormat m_nFormat = null; - /** Date Format */ - private SimpleDateFormat m_dFormat = null; - /** Boolean renderer */ - private JCheckBox m_check; - - - /** - * Return Renderer Component - * @param table - * @param value - * @param isSelected - * @param hasFocus - * @param row - * @param col - * @return renderer component - */ - public Component getTableCellRendererComponent(JTable table, Object value, - boolean isSelected, boolean hasFocus, int row, int col) - { - // Get Component - Component c = m_check; - if (c == null) // default JLabel - c = super.getTableCellRendererComponent(table,value, isSelected,hasFocus, row,col); - // Background - if (m_rm.isCellEditable(row, col)) - c.setBackground(AdempierePLAF.getFieldBackground_Normal()); - else - c.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - // - if (m_rm.isGroupRow(row)) - c.setFont(c.getFont().deriveFont(Font.BOLD)); - // Value - setValue (value); - return c; - } // getTableCellRendererComponent - - /** - * Set Value - * @param value - */ - protected void setValue (Object value) - { - // Boolean - if (m_check != null) - { - boolean sel = false; - if (value != null && ((Boolean)value).booleanValue()) - sel = true; - m_check.setSelected(sel); - return; - } - - // JLabel - if (value == null) - setText(""); - else if (m_nFormat != null) - try - { - setText(m_nFormat.format(value)); - } - catch (Exception e) - { - setText(value.toString()); - } - else if (m_dFormat != null) - try - { - setText(m_dFormat.format(value)); - } - catch (Exception e) - { - setText(value.toString()); - } - else - setText(value.toString()); - } // setValue - -} // ResultTableCellRenderer diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CButton.java b/org.adempiere.ui.swing/src/org/compiere/swing/CButton.java deleted file mode 100644 index 9b15112726..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CButton.java +++ /dev/null @@ -1,341 +0,0 @@ -/********************************************************************* -* This file is part of Adempiere ERP Bazaar * -* http://www.adempiere.org * -* * -* Copyright (C) 1999 - 2006 Compiere Inc. * -* Copyright (C) Contributors * -* * -* This program is free software; you can redistribute it and/or * -* modify it under the terms of the GNU General Public License * -* as published by the Free Software Foundation; either version 2 * -* of the License, or (at your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License for more details. * -* * -* You should have received a copy of the GNU General Public License * -* along with this program; if not, write to the Free Software * -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * -* MA 02110-1301, USA. * -* * -* Contributors: * -* - Bahman Movaqar (bmovaqar@users.sf.net) * -**********************************************************************/ -package org.compiere.swing; - -import java.awt.Color; -import java.awt.event.ActionEvent; -import java.awt.event.KeyEvent; - -import javax.swing.Action; -import javax.swing.Icon; -import javax.swing.InputMap; -import javax.swing.JButton; -import javax.swing.JComponent; -import javax.swing.KeyStroke; -import javax.swing.SwingUtilities; -import javax.swing.plaf.ComponentInputMapUIResource; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.plaf.CompiereColor; -import org.compiere.plaf.CompiereLookAndFeel; - -/** - * Adempiere Button supporting colored Background - * - * @author Jorg Janke - * @version $Id: CButton.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CButton extends JButton implements CEditor { - /** - * - */ - private static final long serialVersionUID = 70278798402299341L; - - /** - * Creates a button with no set text or icon. - */ - public CButton() { - this(null, null); - } // CButton - - /** - * Creates a button with an icon. - * - * @param icon - * the Icon image to display on the button - */ - public CButton(Icon icon) { - this(null, icon); - } // CButton - - /** - * Creates a button with text. - * - * @param text - * the text of the button - */ - public CButton(String text) { - this(text, null); - } // CButton - - /** - * Creates a button where properties are taken from the Action - * supplied. - * - * @param a - * the Action used to specify the new button - * - * @since 1.3 - */ - public CButton(Action a) { - super(a); - } // CButton - - /** - * Creates a button with initial text and an icon. - * - * @param text - * the text of the button - * @param icon - * the Icon image to display on the button - */ - public CButton(String text, Icon icon) { - super(text, icon); - } // CButton - - /*************************************************************************** - * Set Background - Differentiates between system & user call. If User Call, - * sets Opaque & ContextAreaFilled to true - * - * @param bg - * background color - */ - public void setBackground(Color bg) { - if (bg.equals(getBackground())) - return; - super.setBackground(bg); - setBackgroundColor(new CompiereColor(bg)); - this.repaint(); - } // setBackground - - /** - * Set Background - NOP - * - * @param error - * error - */ - public void setBackground(boolean error) { - } // setBackground - - /** - * Set Standard Background - */ - public void setBackgroundColor() { - setBackgroundColor(null); - } // setBackground - - /** - * Set Background - * - * @param bg - * AdempiereColor for Background, if null set standard background - */ - public void setBackgroundColor(CompiereColor bg) { - if (bg == null) - bg = new CompiereColor(AdempierePLAF.getFormBackground()); - putClientProperty(CompiereLookAndFeel.BACKGROUND, bg); - super.setBackground(bg.getFlatColor()); - this.repaint(); - } // setBackground - - /** - * Get Background - * - * @return Color for Background - */ - public CompiereColor getBackgroundColor() { - try { - return (CompiereColor) getClientProperty(CompiereLookAndFeel.BACKGROUND); - } catch (Exception e) { - System.err.println("CButton - ClientProperty: " + e.getMessage()); - } - return null; - } // getBackgroundColor - - /** Mandatory (default false) */ - private boolean m_mandatory = false; - - /** Read-Write */ - private boolean m_readWrite = true; - - /** - * Set Editor Mandatory - * - * @param mandatory - * true, if you have to enter data - */ - public void setMandatory(boolean mandatory) { - m_mandatory = mandatory; - setBackground(false); - } // setMandatory - - /** - * Is Field mandatory - * - * @return true, if mandatory - */ - public boolean isMandatory() { - return m_mandatory; - } // isMandatory - - /** - * Enable Editor - * - * @param rw - * true, if you can enter/select data - */ - public void setReadWrite(boolean rw) { - if (isEnabled() != rw) - setEnabled(rw); - m_readWrite = rw; - } // setReadWrite - - /** - * Is it possible to edit - * - * @return true, if editable - */ - public boolean isReadWrite() { - return m_readWrite; - } // isReadWrite - - /** - * Set Editor to value - * - * @param value - * value of the editor - */ - public void setValue(Object value) { - if (value == null) - setText(""); - else - setText(value.toString()); - } // setValue - - /** - * Return Editor value - * - * @return current value - */ - public Object getValue() { - return getText(); - } // getValue - - /** - * Return Display Value - * - * @return displayed String value - */ - public String getDisplay() { - return getText(); - } // getDisplay - - /** - * Set Text & Mnemonic - * - * @param text - * text - */ - public void setText(String text) { - if (text == null) { - super.setText(text); - return; - } - int pos = text.indexOf('&'); - if (pos != -1) // We have a nemonic - creates ALT-_ - { - int mnemonic = text.toUpperCase().charAt(pos + 1); - if (mnemonic != ' ') { - setMnemonic(mnemonic); - text = text.substring(0, pos) + text.substring(pos + 1); - } - } - super.setText(text); - if (getName() == null) - setName(text); - } // setText - - /** - * Set Tool Tip Text & Mnemonic - * - * @param text - * text - */ - public void setToolTipText(String text) { - if (text == null) { - //super.setText(text); Angelo Dabala' (genied) fixed, was calling the wrong method - super.setToolTipText(text); - return; - } - int pos = text.indexOf('&'); - if (pos != -1) // We have a nemonic - creates ALT-_ - { - int mnemonic = text.toUpperCase().charAt(pos + 1); - if (mnemonic != ' ') { - setMnemonic(mnemonic); - text = text.substring(0, pos) + text.substring(pos + 1); - } - } - super.setToolTipText(text); - if (getName() == null) - setName(text); - } // setToolTipText - - /** - * Set Action Command - * - * @param actionCommand - * command - */ - public void setActionCommand(String actionCommand) { - super.setActionCommand(actionCommand); - if (getName() == null && actionCommand != null - && actionCommand.length() > 0) - setName(actionCommand); - } // setActionCommand - - /** - * Overrides the JButton.setMnemonic() method, setting modifier keys to - * CTRL+ALT. - * - * @param mnemonic - * The mnemonic character code. - */ - public void setMnemonic(int mnemonic) { - super.setMnemonic(mnemonic); - - // Angelo Dabala' (genied) avoid to register Ctrl+Alt modifier mask without mnemonic - if (mnemonic==KeyEvent.VK_UNDEFINED) { - return; - } - - InputMap map = SwingUtilities.getUIInputMap(this, - JComponent.WHEN_IN_FOCUSED_WINDOW); - - if (map == null) { - map = new ComponentInputMapUIResource(this); - SwingUtilities.replaceUIInputMap(this, - JComponent.WHEN_IN_FOCUSED_WINDOW, map); - } - map.clear(); - int mask = ActionEvent.ALT_MASK + ActionEvent.CTRL_MASK; // Default - // Buttons - map.put(KeyStroke.getKeyStroke(mnemonic, mask, false), "pressed"); - map.put(KeyStroke.getKeyStroke(mnemonic, mask, true), "released"); - map.put(KeyStroke.getKeyStroke(mnemonic, 0, true), "released"); - setInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW, map); - } // setMnemonic -} // CButton diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CCheckBox.java b/org.adempiere.ui.swing/src/org/compiere/swing/CCheckBox.java deleted file mode 100644 index 5a385503c1..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CCheckBox.java +++ /dev/null @@ -1,347 +0,0 @@ -/********************************************************************* -* This file is part of Adempiere ERP Bazaar * -* http://www.adempiere.org * -* * -* Copyright (C) 1999 - 2006 Compiere Inc. * -* Copyright (C) Contributors * -* * -* This program is free software; you can redistribute it and/or * -* modify it under the terms of the GNU General Public License * -* as published by the Free Software Foundation; either version 2 * -* of the License, or (at your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License for more details. * -* * -* You should have received a copy of the GNU General Public License * -* along with this program; if not, write to the Free Software * -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * -* MA 02110-1301, USA. * -* * -* Contributors: * -* - Bahman Movaqar (bmovaqar@users.sf.net) * -**********************************************************************/ -package org.compiere.swing; - -import java.awt.Color; -import java.awt.event.ActionEvent; - -import javax.swing.Action; -import javax.swing.Icon; -import javax.swing.InputMap; -import javax.swing.JCheckBox; -import javax.swing.JComponent; -import javax.swing.KeyStroke; -import javax.swing.SwingUtilities; -import javax.swing.plaf.ComponentInputMapUIResource; - -/** - * Adempiere CheckBox - * - * @author Jorg Janke - * @version $Id: CCheckBox.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CCheckBox extends JCheckBox implements CEditor { - /** - * - */ - private static final long serialVersionUID = 6115543971487470944L; - - /** - * Creates an initially unselected check box button with no text, no icon. - */ - public CCheckBox() { - super(); - init(); - } - - /** - * Creates an initially unselected check box with an icon. - * - * @param icon - * the Icon image to display - */ - public CCheckBox(Icon icon) { - super(icon); - init(); - } - - /** - * Creates a check box with an icon and specifies whether or not it is - * initially selected. - * - * @param icon - * the Icon image to display - * @param selected - * a boolean value indicating the initial selection state. If - * true the check box is selected - */ - public CCheckBox(Icon icon, boolean selected) { - super(icon, selected); - init(); - } - - /** - * Creates an initially unselected check box with text. - * - * @param text - * the text of the check box. - */ - public CCheckBox(String text) { - super(text); - init(); - } - - /** - * Creates a check box where properties are taken from the Action supplied. - * - * @param a - */ - public CCheckBox(Action a) { - super(a); - init(); - } - - /** - * Creates a check box with text and specifies whether or not it is - * initially selected. - * - * @param text - * the text of the check box. - * @param selected - * a boolean value indicating the initial selection state. If - * true the check box is selected - */ - public CCheckBox(String text, boolean selected) { - super(text, selected); - init(); - } - - /** - * Creates an initially unselected check box with the specified text and - * icon. - * - * @param text - * the text of the check box. - * @param icon - * the Icon image to display - */ - public CCheckBox(String text, Icon icon) { - super(text, icon, false); - init(); - } - - /** - * Creates a check box with text and icon, and specifies whether or not it - * is initially selected. - * - * @param text - * the text of the check box. - * @param icon - * the Icon image to display - * @param selected - * a boolean value indicating the initial selection state. If - * true the check box is selected - */ - public CCheckBox(String text, Icon icon, boolean selected) { - super(text, icon, selected); - init(); - } - - /** - * Common Init - */ - private void init() { - // Default to transparent, works better under windows look and feel - setOpaque(false); - } // init - - /** ********************************************************************** */ - - /** Mandatory (default false) */ - private boolean m_mandatory = false; - - /** Read-Write */ - private boolean m_readWrite = true; - - /** - * Set Editor Mandatory - * - * @param mandatory - * true, if you have to enter data - */ - public void setMandatory(boolean mandatory) { - m_mandatory = mandatory; - setBackground(false); - } // setMandatory - - /** - * Is Field mandatory - * - * @return true, if mandatory - */ - public boolean isMandatory() { - return m_mandatory; - } // isMandatory - - /** - * Enable Editor - * - * @param rw - * true, if you can enter/select data - */ - public void setReadWrite(boolean rw) { - if (super.isEnabled() != rw) - super.setEnabled(rw); - setBackground(false); - m_readWrite = rw; - } // setEditable - - /** - * Is it possible to edit - * - * @return true, if editable - */ - public boolean isReadWrite() { - return m_readWrite; - } // isEditable - - /** - * Set Background based on editable/mandatory/error - ignored - - * - * @param error - * if true, set background to error color, otherwise - * mandatory/editable - */ - public void setBackground(boolean error) { - } // setBackground - - /** - * Set Background - * - * @param bg - */ - public void setBackground(Color bg) { - if (bg.equals(getBackground())) - return; - super.setBackground(bg); - } // setBackground - - /** Retain value */ - private Object m_value = null; - - /** - * Set Editor to value. Interpret Y/N and Boolean - * - * @param value - * value of the editor - */ - public void setValue(Object value) { - m_value = value; - boolean sel = false; - if (value == null) - sel = false; - else if (value.toString().equals("Y")) - sel = true; - else if (value.toString().equals("N")) - sel = false; - else if (value instanceof Boolean) - sel = ((Boolean) value).booleanValue(); - else { - try { - sel = Boolean.getBoolean(value.toString()); - } catch (Exception e) { - } - } - this.setSelected(sel); - } // setValue - - /** - * Return Editor value - * - * @return current value as String or Boolean - */ - public Object getValue() { - if (m_value instanceof String) - return super.isSelected() ? "Y" : "N"; - return Boolean.valueOf(isSelected()); - } // getValue - - /** - * Return Display Value - * - * @return displayed String value - */ - public String getDisplay() { - if (m_value instanceof String) - return super.isSelected() ? "Y" : "N"; - return Boolean.toString(super.isSelected()); - } // getDisplay - - /** - * Set Text - * - * @param mnemonicLabel - * text - */ - public void setText(String mnemonicLabel) { - super.setText(createMnemonic(mnemonicLabel)); - } // setText - - /** - * Create Mnemonics of text containing "&". Based on MS notation of &Help => - * H is Mnemonics Creates ALT_ - * - * @param text - * test with Mnemonics - * @return text w/o & - */ - private String createMnemonic(String text) { - if (text == null) - return text; - int pos = text.indexOf('&'); - if (pos != -1) // We have a nemonic - { - char ch = text.charAt(pos + 1); - if (ch != ' ') // &_ - is the & character - { - setMnemonic(ch); - return text.substring(0, pos) + text.substring(pos + 1); - } - } - return text; - } // createMnemonic - - /** - * Overrides the JCheckBox.setMnemonic() method, setting modifier keys to - * CTRL+SHIFT. - * - * @param mnemonic - * The mnemonic character code. - */ - public void setMnemonic(int mnemonic) { - super.setMnemonic(mnemonic); - - InputMap map = SwingUtilities.getUIInputMap(this, - JComponent.WHEN_IN_FOCUSED_WINDOW); - - if (map == null) { - map = new ComponentInputMapUIResource(this); - SwingUtilities.replaceUIInputMap(this, - JComponent.WHEN_IN_FOCUSED_WINDOW, map); - } - map.clear(); - String className = this.getClass().getName(); - int mask = ActionEvent.ALT_MASK; // Default Buttons - if (this instanceof JCheckBox // In Tab - || className.indexOf("VButton") != -1) - mask = ActionEvent.SHIFT_MASK + ActionEvent.CTRL_MASK; - map.put(KeyStroke.getKeyStroke(mnemonic, mask, false), "pressed"); - map.put(KeyStroke.getKeyStroke(mnemonic, mask, true), "released"); - map.put(KeyStroke.getKeyStroke(mnemonic, 0, true), "released"); - setInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW, map); - } // setMnemonic - -} // CCheckBox diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CCheckBoxMenuItem.java b/org.adempiere.ui.swing/src/org/compiere/swing/CCheckBoxMenuItem.java deleted file mode 100644 index 1d707e10f6..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CCheckBoxMenuItem.java +++ /dev/null @@ -1,98 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import javax.swing.Action; -import javax.swing.Icon; -import javax.swing.JCheckBoxMenuItem; - -/** - * Adempiere Check Box Menu Item - * - * @author Jorg Janke - * @version $Id: CCheckBoxMenuItem.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CCheckBoxMenuItem extends JCheckBoxMenuItem -{ - - /** - * - */ - private static final long serialVersionUID = 6701152155152356260L; - - public CCheckBoxMenuItem () - { - super (); - } // CCheckBoxMenuItem - - public CCheckBoxMenuItem (Icon icon) - { - super (icon); - } // CCheckBoxMenuItem - - public CCheckBoxMenuItem (String text) - { - super (text); - } // CCheckBoxMenuItem - - public CCheckBoxMenuItem (Action a) - { - super (a); - } // CCheckBoxMenuItem - - public CCheckBoxMenuItem (String text, Icon icon) - { - super (text, icon); - } // CCheckBoxMenuItem - - public CCheckBoxMenuItem (String text, boolean b) - { - super (text, b); - } // CCheckBoxMenuItem - - public CCheckBoxMenuItem (String text, Icon icon, boolean b) - { - super (text, icon, b); - } // CCheckBoxMenuItem - - /** - * Set Text - * @param text text - */ - public void setText (String text) - { - if (text == null) - { - super.setText(text); - return; - } - int pos = text.indexOf('&'); - if (pos != -1 && text.length() > pos) // We have a nemonic - creates ALT-_ - { - int mnemonic = text.toUpperCase().charAt(pos+1); - if (mnemonic != ' ') - { - setMnemonic(mnemonic); - text = text.substring(0, pos) + text.substring(pos+1); - } - } - super.setText (text); - if (getName() == null) - setName (text); - } // setText - -} // CCheckBoxMenuItem diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CColumnControlButton.java b/org.adempiere.ui.swing/src/org/compiere/swing/CColumnControlButton.java deleted file mode 100644 index 01c05009a7..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CColumnControlButton.java +++ /dev/null @@ -1,890 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2007 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.BorderLayout; -import java.awt.ComponentOrientation; -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ItemEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Enumeration; -import java.util.List; - -import javax.swing.AbstractAction; -import javax.swing.AbstractButton; -import javax.swing.Action; -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.Icon; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JComponent; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.JSeparator; -import javax.swing.ScrollPaneConstants; -import javax.swing.SwingUtilities; -import javax.swing.UIManager; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.TableColumnModelEvent; -import javax.swing.event.TableColumnModelListener; -import javax.swing.table.TableColumn; -import javax.swing.table.TableColumnModel; - -import org.jdesktop.swingx.VerticalLayout; -import org.jdesktop.swingx.action.AbstractActionExt; -import org.jdesktop.swingx.action.ActionContainerFactory; -import org.jdesktop.swingx.table.ColumnControlPopup; - -/** - * Code and description adapted from SwingX ColumnControlButton class. - * - * A component to allow interactive customization of CTable's - * columns. - * It's main purpose is to allow toggling of table columns' visibility. - * Additionally, arbitrary configuration actions can be exposed. - *

    - * - * This component is installed in the CTable's - * trailing corner, if enabled: - * - *

    
    - * table.setColumnControlVisible(true);
    - * 
    - * - * From the perspective of a CTable, the component's behaviour is - * opaque. Typically, the button's action is to popup a component for user - * interaction.

    - * - * This class is responsible for handling/providing/updating the lists of - * actions and to keep all action's state in synch with Table-/Column state. - * The visible behaviour of the popup is delegated to a - * ColumnControlPopup.

    - * - * @see CTable#setColumnControl - * - */ -public class CColumnControlButton extends JButton { - /** - * - */ - private static final long serialVersionUID = 3052540263336100861L; - /** Marker to auto-recognize actions which should be added to the popup. */ - public static final String COLUMN_CONTROL_MARKER = "column."; - /** exposed for testing. */ - protected ColumnControlPopup popup; - // TODO: the table reference is a potential leak? - /** The table which is controlled by this. */ - private CTable table; - /** Listener for table property changes. */ - private PropertyChangeListener tablePropertyChangeListener; - /** Listener for table's columnModel. */ - TableColumnModelListener columnModelListener; - /** the list of actions for column menuitems.*/ - private List columnVisibilityActions; - - /** - * Creates a column control button for the table. The button - * uses the given icon and has no text. - * @param table the JTable controlled by this component - * @param icon the Icon to show - */ - public CColumnControlButton(CTable table, Icon icon) { - super(); - init(); - // JW: icon LF dependent? - setAction(createControlAction(icon)); - installTable(table); - } - - - @Override - public void updateUI() { - super.updateUI(); - // JW: icon LF dependent? - setMargin(new Insets(1, 2, 2, 1)); // Make this LAF-independent - getColumnControlPopup().updateUI(); - } - - /** - * Toggles the popup component's visibility. This method is - * called by this control's default action.

    - * - * Here: delegates to getControlPopup(). - */ - public void togglePopup() { - getColumnControlPopup().toggleVisibility(this); - } - - @Override - public void applyComponentOrientation(ComponentOrientation o) { - super.applyComponentOrientation(o); - getColumnControlPopup().applyComponentOrientation(o); - } - - -//-------------------------- Action in synch with column properties - /** - * A specialized Action which takes care of keeping in synch with - * TableColumn state. - * - * NOTE: client must call releaseColumn if this action is no longer needed! - * - */ - public class ColumnVisibilityAction extends AbstractActionExt { - - /** - * - */ - private static final long serialVersionUID = -5843080042335689992L; - - private TableColumn column; - - private PropertyChangeListener columnListener; - - /** flag to distinguish selection changes triggered by - * column's property change from those triggered by - * user interaction. Hack around #212-swingx. - */ - private boolean fromColumn; - - /** - * Creates a action synched to the table column. - * - * @param column the TableColumn to keep synched to. - */ - public ColumnVisibilityAction(TableColumn column) { - super((String) null); - setStateAction(); - installColumn(column); - } - - /** - * Releases all references to the synched TableColumn. - * Client code must call this method if the - * action is no longer needed. After calling this action must not be - * used any longer. - */ - public void releaseColumn() { - column.removePropertyChangeListener(columnListener); - column = null; - } - - @Override - public void itemStateChanged(final ItemEvent e) { - if ((e.getStateChange() == ItemEvent.DESELECTED) - //JW: guarding against 1 leads to #212-swingx: setting - // column visibility programatically fails if - // the current column is the second last visible - // guarding against 0 leads to hiding all columns - // by deselecting the menu item. - && (table.getColumnCount() <= 1) - // JW Fixed #212: basically implemented Rob's idea to distinguish - // event sources instead of unconditionally reselect - // not entirely sure if the state transitions are completely - // defined but all related tests are passing now. - && !fromColumn) { - reselect(); - } else { - setSelected(e.getStateChange() == ItemEvent.SELECTED); - } - } - - - @Override - public synchronized void setSelected(boolean newValue) { - super.setSelected(newValue); - if (!newValue) { - if (table.isColumnVisible(column)) { - table.setColumnVisibility(column, newValue); - } - } else { - if (!table.isColumnVisible(column)) { - table.setColumnVisibility(column, newValue); - } - } - } - - /** - * Does nothing. Synch from action state to TableColumn state - * is done in itemStateChanged. - */ - public void actionPerformed(ActionEvent e) { - - } - - /** - * Synchs selected property to visible. This - * is called on change of tablecolumn's visible property. - * - * @param visible column visible state to synch to. - */ - private void updateFromColumnVisible(boolean visible) { - fromColumn = true; - setSelected(visible); - fromColumn = false; - } - - /** - * Synchs name property to value. This is called on change of - * tableColumn's headerValue property. - * - * @param value - */ - private void updateFromColumnHeader(Object value) { - if (value == null) { - this.setEnabled(false); - } else { - setName(String.valueOf(value)); - this.setEnabled(true); - } - } - - /** - * Enforces selected to true. Called if user interaction - * tried to de-select the last single visible column. - * - */ - private void reselect() { - firePropertyChange("selected", null, Boolean.TRUE); - } - - // -------------- init - private void installColumn(TableColumn column) { - this.column = column; - column.addPropertyChangeListener(getColumnListener()); - updateFromColumnHeader(column.getHeaderValue()); - // #429-swing: actionCommand must be string - if (column.getIdentifier() != null) { - setActionCommand(column.getIdentifier().toString()); - } - boolean visible = table.isColumnVisible(column); - updateFromColumnVisible(visible); - } - - /** - * Returns the listener to column's property changes. The listener - * is created lazily if necessary. - * - * @return the PropertyChangeListener listening to - * TableColumn's property changes, guaranteed to be - * not null. - */ - protected PropertyChangeListener getColumnListener() { - if (columnListener == null) { - columnListener = createPropertyChangeListener(); - } - return columnListener; - } - - /** - * Creates and returns the listener to column's property changes. - * Subclasses are free to roll their own. - *

    - * Implementation note: this listener reacts to column's - * visible and headerValue properties and - * calls the respective updateFromXX methodes. - * - * @return the PropertyChangeListener to use with the - * column - */ - protected PropertyChangeListener createPropertyChangeListener() { - return new PropertyChangeListener() { - public void propertyChange(PropertyChangeEvent evt) { - if ("visible".equals(evt.getPropertyName())) { - updateFromColumnVisible((Boolean) evt.getNewValue()); - } else if ("headerValue".equals(evt.getPropertyName())) { - updateFromColumnHeader(evt.getNewValue()); - if (evt.getNewValue() == null) - populatePopup(); - } - } - }; - } - } - - // ---------------------- the popup - - /** - * A default implementation of ColumnControlPopup. - * It uses a JPopupMenu with - * MenuItems corresponding to the Actions as - * provided by the ColumnControlButton. - * - * - */ - public class DefaultColumnControlPopup implements ColumnControlPopup { - private JPopupMenu popupMenu; - private JScrollPane scroller; - private JPanel panelMenus; - - //------------------ public methods to control visibility status - - /** - * @inheritDoc - * - */ - public void updateUI() { - SwingUtilities.updateComponentTreeUI(getPopupMenu()); - } - - private JPanel getPanelMenu() { - if (panelMenus == null) { - panelMenus = new JPanel(); - panelMenus.setLayout(new VerticalLayout()); - panelMenus.setBackground(UIManager.getColor("MenuItem.background")); - panelMenus.setBorder(BorderFactory.createEmptyBorder()); - } - return panelMenus; - } - - private JScrollPane getScroller() { - if (scroller == null) { - scroller = createScroller(); - scroller.getVerticalScrollBar().setFocusable( false ); - scroller.setViewportView(getPanelMenu()); - } - return scroller; - } - - /** - * @inheritDoc - * - */ - public void toggleVisibility(JComponent owner) { - JPopupMenu popupMenu = getPopupMenu(); - JPanel panel = getPanelMenu(); - if (popupMenu.isVisible()) { - popupMenu.setVisible(false); - } else if (panel.getComponentCount() > 0) { - JScrollPane scroller = getScroller(); - panel.validate(); - - Dimension pSize = table.getParent().getSize(); - Dimension size = panel.getPreferredSize(); - if (size.height >= pSize.height) { - scroller.setPreferredSize(new Dimension(size.width, pSize.height - 30)); - } else { - scroller.setPreferredSize(size); - } - popupMenu.setPopupSize(new Dimension(scroller.getPreferredSize().width + 20, - scroller.getPreferredSize().height - 20)); - - Dimension buttonSize = owner.getSize(); - int xPos = owner.getComponentOrientation().isLeftToRight() ? buttonSize.width - - popupMenu.getPreferredSize().width - : 0; - - popupMenu.show(owner, - xPos, buttonSize.height); - } - - } - - /** - * @inheritDoc - * - */ - public void applyComponentOrientation(ComponentOrientation o) { - getPopupMenu().applyComponentOrientation(o); - - } - - //-------------------- public methods to manipulate popup contents. - - /** - * @inheritDoc - * - */ - public void removeAll() { - getPanelMenu().removeAll(); - } - - - /** - * @inheritDoc - * - */ - public void addVisibilityActionItems( - List actions) { - addItems(new ArrayList(actions)); - - } - - - /** - * @inheritDoc - * - */ - public void addAdditionalActionItems(List actions) { - if (actions.size() == 0) - return; - addSeparator(); - addItems(actions); - } - - //--------------------------- internal helpers to manipulate popups content - - /** - * Here: creates and adds a menuItem to the popup for every - * Action in the list. Does nothing if - * if the list is empty. - * - * PRE: actions != null. - * - * @param actions a list containing the actions to add to the popup. - * Must not be null. - * - */ - protected void addItems(List actions) { - ActionContainerFactory factory = new ActionContainerFactory(null); - for (Action action : actions) { - AbstractActionExt a = (AbstractActionExt)action; - if (action.isEnabled()) { - if (a.isStateAction()) - addItem(createCheckBox((AbstractActionExt)action)); - else { - addItem(factory.createButton(action)); - } - } - } - } - - private JCheckBox createCheckBox(AbstractActionExt action) { - JCheckBox c = new JCheckBox(action); - c.setSelected(action.isSelected()); - c.addItemListener(action); - return c; - } - - /** - * adds a separator to the popup. - * - */ - protected void addSeparator() { - getPanelMenu().add(Box.createVerticalStrut(2)); - getPanelMenu().add(new JSeparator()); - getPanelMenu().add(Box.createVerticalStrut(2)); - } - - /** - * - * @param item the menuItem to add to the popup. - */ - protected void addItem(AbstractButton item) { - getPanelMenu().add(item); - } - - /** - * - * @return the popup to add menuitems. Guaranteed to be != null. - */ - protected JPopupMenu getPopupMenu() { - if (popupMenu == null) { - popupMenu = new JPopupMenu(); - popupMenu.removeAll(); - popupMenu.setLayout(new BorderLayout()); - popupMenu.add(getScroller(), BorderLayout.CENTER); - } - return popupMenu; - } - - /** - * Creates the scroll pane which houses the scrollable list. - */ - protected JScrollPane createScroller() { - JScrollPane sp = new JScrollPane( null, - ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, - ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER ); - sp.setHorizontalScrollBar(null); - sp.setBorder(BorderFactory.createEmptyBorder()); - return sp; - } - - } - - - /** - * Returns to popup component for user interaction. Lazily - * creates the component if necessary. - * - * @return the ColumnControlPopup for showing the items, guaranteed - * to be not null. - * @see #createColumnControlPopup() - */ - protected ColumnControlPopup getColumnControlPopup() { - if (popup == null) { - popup = createColumnControlPopup(); - } - return popup; - } - - /** - * Factory method to return a ColumnControlPopup. - * Subclasses can override to hook custom implementations. - * - * @return the ColumnControlPopup used. - */ - protected ColumnControlPopup createColumnControlPopup() { - return new DefaultColumnControlPopup(); - } - - -//-------------------------- updates from table propertyChangelistnere - - /** - * Adjusts internal state after table's column model property has changed. - * Handles cleanup of listeners to the old/new columnModel (Note, that - * it listens to the column model only if it can control column visibility). - * Updates content of popup. - * - * @param oldModel the old TableColumnModel we had been listening to. - */ - protected void updateFromColumnModelChange(TableColumnModel oldModel) { - if (oldModel != null && columnModelListener != null) { - oldModel.removeColumnModelListener(columnModelListener); - } - populatePopup(); - table.getColumnModel().addColumnModelListener(getColumnModelListener()); - } - - /** - * Synchs this button's enabled with table's enabled. - * - */ - protected void updateFromTableEnabledChanged() { - getAction().setEnabled(table.isEnabled()); - - } - -// ------------------------ updating the popup - /** - * Populates the popup from scratch. - * - * If applicable, creates and adds column visibility actions. Always adds - * additional actions. - */ - protected void populatePopup() { - clearAll(); - createVisibilityActions(); - addVisibilityActionItems(); - addAdditionalActionItems(); - } - - /** - * - * removes all components from the popup, making sure to release all - * columnVisibility actions. - * - */ - protected void clearAll() { - clearColumnVisibilityActions(); - getColumnControlPopup().removeAll(); - } - - - /** - * Releases actions and clears list of actions. - * - */ - protected void clearColumnVisibilityActions() { - if (columnVisibilityActions == null) - return; - for (ColumnVisibilityAction action : columnVisibilityActions) { - action.releaseColumn(); - } - columnVisibilityActions.clear(); - } - - - /** - * Adds visibility actions into the popup view. - * - * Here: delegates the list of actions to the DefaultColumnControlPopup. - *

    - * PRE: columnVisibilityActions populated before calling this. - * - */ - protected void addVisibilityActionItems() { - getColumnControlPopup().addVisibilityActionItems( - Collections.unmodifiableList(getColumnVisibilityActions())); - } - - /** - * Adds additional actions to the popup. - * Here: delegates the list of actions as returned by #getAdditionalActions() - * to the DefaultColumnControlPopup. - * Does nothing if #getColumnActions() is empty. - * - */ - protected void addAdditionalActionItems() { - getColumnControlPopup().addAdditionalActionItems( - Collections.unmodifiableList(getAdditionalActions())); - } - - - /** - * Creates and adds a ColumnVisiblityAction for every column that should be - * togglable via the column control.

    - * - * Here: all table columns contained in the TableColumnModel - - * visible and invisible columns - to createColumnVisibilityAction and - * adds all not null return values. - * - *

    - * PRE: canControl() - * - * @see #createColumnVisibilityAction - */ - protected void createVisibilityActions() { - Enumeration columns = table.getColumnModel().getColumns(); - while(columns.hasMoreElements()) { - TableColumn column = columns.nextElement(); - if (column.getHeaderValue() != null) { - ColumnVisibilityAction action = createColumnVisibilityAction(column); - if (action != null) { - getColumnVisibilityActions().add(action); - } - } - } - - } - - /** - * Creates and returns a ColumnVisibilityAction for the given - * TableColumn. The return value might be null, f.i. if the - * column should not be allowed to be toggled. - * - * @param column the TableColumn to use for the action - * @return a ColumnVisibilityAction to use for the given column, - * may be null. - */ - protected ColumnVisibilityAction createColumnVisibilityAction(TableColumn column) { - return new ColumnVisibilityAction(column); - } - - /** - * Lazyly creates and returns the List of visibility actions. - * - * @return the list of visibility actions, guaranteed to be != null. - */ - protected List getColumnVisibilityActions() { - if (columnVisibilityActions == null) { - columnVisibilityActions = new ArrayList(); - } - return columnVisibilityActions; - } - - - /** - * creates and returns a list of additional Actions to add to the popup. - * Here: the actions are looked up in the table's actionMap according - * to the keys as returned from #getColumnControlActionKeys(); - * - * @return a list containing all additional actions to include into the popup. - */ - protected List getAdditionalActions() { - List actionKeys = getColumnControlActionKeys(); - List actions = new ArrayList(); - for (Object key : actionKeys) { - actions.add(table.getActionMap().get(key)); - } - return actions; - } - - /** - * Looks up and returns action keys to access actions in the - * table's actionMap which should be included into the popup. - * - * Here: all keys with isColumnControlActionKey(key). The list - * is sorted by those keys. - * - * @return the action keys of table's actionMap entries whose - * action should be included into the popup. - */ - protected List getColumnControlActionKeys() { - Object[] allKeys = table.getActionMap().allKeys(); - List columnKeys = new ArrayList(); - for (int i = 0; i < allKeys.length; i++) { - if (isColumnControlActionKey(allKeys[i])) { - columnKeys.add((String)allKeys[i]); - } - } - // JW: this will blow for non-String keys! - // so this method is less decoupled from the - // decision method isControl than expected. - Collections.sort(columnKeys); - return columnKeys; - } - - /** - * Here: true if a String key starts with #COLUMN_CONTROL_MARKER. - * - * @param actionKey a key in the table's actionMap. - * @return a boolean to indicate whether the given actionKey maps to - * an action which should be included into the popup. - * - */ - protected boolean isColumnControlActionKey(Object actionKey) { - return (actionKey instanceof String) && - ((String) actionKey).startsWith(COLUMN_CONTROL_MARKER); - } - - - //--------------------------- init - - private void installTable(CTable table) { - this.table = table; - table.addPropertyChangeListener(getTablePropertyChangeListener()); - updateFromColumnModelChange(null); - updateFromTableEnabledChanged(); - } - - - /** - * Initialize the column control button's gui - */ - private void init() { - setFocusPainted(false); - setFocusable(false); - // this is a trick to get hold of the client prop which - // prevents closing of the popup - JComboBox box = new JComboBox(); - Object preventHide = box.getClientProperty("doNotCancelPopup"); - putClientProperty("doNotCancelPopup", preventHide); - } - - - /** - * Creates and returns the default action for this button. - * - * @param icon the Icon to use in the action. - * @return the default action. - */ - private Action createControlAction(Icon icon) { - Action control = new AbstractAction() { - - /** - * - */ - private static final long serialVersionUID = -6683797828219296451L; - - public void actionPerformed(ActionEvent e) { - togglePopup(); - } - - }; - control.putValue(Action.SMALL_ICON, icon); - return control; - } - - // -------------------------------- listeners - - /** - * Returns the listener to table's property changes. The listener is - * lazily created if necessary. - * @return the PropertyChangeListener for use with the - * table, guaranteed to be not null. - */ - protected PropertyChangeListener getTablePropertyChangeListener() { - if (tablePropertyChangeListener == null) { - tablePropertyChangeListener = createTablePropertyChangeListener(); - } - return tablePropertyChangeListener; - } - - /** - * Creates the listener to table's property changes. Subclasses are free - * to roll their own.

    - * Implementation note: this listener reacts to table's enabled and - * columnModel properties and calls the respective - * updateFromXX methodes. - * - * @return the PropertyChangeListener for use with the table. - */ - protected PropertyChangeListener createTablePropertyChangeListener() { - return new PropertyChangeListener() { - public void propertyChange(PropertyChangeEvent evt) { - if ("columnModel".equals(evt.getPropertyName())) { - updateFromColumnModelChange((TableColumnModel) evt - .getOldValue()); - } else if ("enabled".equals(evt.getPropertyName())) { - updateFromTableEnabledChanged(); - } - } - }; - } - - /** - * Returns the listener to table's column model. The listener is - * lazily created if necessary. - * @return the TableColumnModelListener for use with the - * table's column model, guaranteed to be not null. - */ - protected TableColumnModelListener getColumnModelListener() { - if (columnModelListener == null) { - columnModelListener = createColumnModelListener(); - } - return columnModelListener; - } - - /** - * Creates the listener to columnModel. Subclasses are free to roll their - * own. - *

    - * Implementation note: this listener reacts to "real" columnRemoved/-Added by - * populating the popups content from scratch. - * - * @return the TableColumnModelListener for use with the - * table's columnModel. - */ - protected TableColumnModelListener createColumnModelListener() { - return new TableColumnModelListener() { - /** Tells listeners that a column was added to the model. */ - public void columnAdded(TableColumnModelEvent e) { - populatePopup(); - } - - /** Tells listeners that a column was removed from the model. */ - public void columnRemoved(TableColumnModelEvent e) { - populatePopup(); - } - - - /** Tells listeners that a column was repositioned. */ - public void columnMoved(TableColumnModelEvent e) { - } - - /** Tells listeners that a column was moved due to a margin change. */ - public void columnMarginChanged(ChangeEvent e) { - } - - /** - * Tells listeners that the selection model of the TableColumnModel - * changed. - */ - public void columnSelectionChanged(ListSelectionEvent e) { - } - }; - } - -} // end class ColumnControlButton diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CComboBox.java b/org.adempiere.ui.swing/src/org/compiere/swing/CComboBox.java deleted file mode 100644 index 80632ed156..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CComboBox.java +++ /dev/null @@ -1,1006 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Color; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.InputEvent; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.util.ArrayList; -import java.util.Vector; - -import javax.swing.ComboBoxModel; -import javax.swing.DefaultComboBoxModel; -import javax.swing.FocusManager; -import javax.swing.Icon; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JComponent; -import javax.swing.MutableComboBoxModel; -import javax.swing.SwingUtilities; -import javax.swing.event.EventListenerList; -import javax.swing.event.ListDataEvent; -import javax.swing.event.ListDataListener; -import javax.swing.plaf.ComboBoxUI; -import javax.swing.text.JTextComponent; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.plaf.CompiereComboBoxUI; -import org.compiere.util.NamePair; -import org.compiere.util.Trace; - -/** - * Adempiere Colored Combo Box. - * - * @author Jorg Janke - * @version $Id: CComboBox.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CComboBox extends JComboBox - implements CEditor -{ - /** - * - */ - private static final long serialVersionUID = 5918151626085721856L; - - /** - * Creates a JComboBox that takes it's items from an - * existing ComboBoxModel. Since the - * ComboBoxModel is provided, a combo box created using - * this constructor does not create a default combo box model and - * may impact how the insert, remove and add methods behave. - * - * @param aModel the ComboBoxModel that provides the - * displayed list of items - * @see DefaultComboBoxModel - */ - public CComboBox(ComboBoxModel aModel) - { - super(aModel); - init(); - } // CComboBox - - /** - * Creates a JComboBox that contains the elements - * in the specified array. By default the first item in the array - * (and therefore the data model) becomes selected. - * - * @param items an array of objects to insert into the combo box - * @see DefaultComboBoxModel - */ - public CComboBox(final E items[]) - { - super(items); - init(); - } // CComboBox - - /** - * Creates a JComboBox that contains the elements - * in the specified array. By default the first item in the array - * (and therefore the data model) becomes selected. - * - * @param items an array of objects to insert into the combo box - * @param key set selected if exists - * @see DefaultComboBoxModel - */ - public CComboBox(final E items[], String key) - { - this(items); - if (key == null) - return; - for (int i = 0; i < 0; i++) - { - Object item = items[i]; - if (item == null) - continue; - boolean found = false; - if (item instanceof NamePair) - found = ((NamePair)item).getID().equals(key); - else - found = item.toString().equals(key); - if (found) - { - setSelectedIndex(i); - break; - } - } - } // CComboBox - - /** - * Creates a JComboBox that contains the elements - * in the specified Vector. By default the first item in the vector - * and therefore the data model) becomes selected. - * - * @param items an array of vectors to insert into the combo box - * @see DefaultComboBoxModel - */ - public CComboBox(Vector items) - { - super(items); - init(); - } // CComboBox - - /** - * Creates a JComboBox with a default data model. - * The default data model is an empty list of objects. - * Use addItem to add items. By default the first item - * in the data model becomes selected. - * - * @see DefaultComboBoxModel - */ - public CComboBox() - { - super(); - init(); - } // CComboBox - - /** Field Height */ - public static int FIELD_HIGHT = 0; - - /** Property key for auto-reduction. */ - public static final String AUTO_REDUCIBLE_PROPERTY = "autoReducible"; - - /** Property key for case sensitive auto-reduction. */ - public static final String CASE_SENSITIVE_PROPERTY = "caseSensitive"; - - /** View model for hiding showing only filtered data */ - ReducibleModel m_reducibleModel; - - /** Key listener for triggering an update the filtering model . */ - private ReducibleKeyListener reducibleKeyListener = new ReducibleKeyListener(); - - /** - * Common Init - */ - private void init() - { - FIELD_HIGHT = getPreferredSize().height; - - setEditable(true); - setAutoReducible(true); - - addMouseListener(new MouseAdapter() - { - public void mousePressed(MouseEvent me) { - if (SwingUtilities.isLeftMouseButton(me) && isAutoReducible()) - updateReducibleModel(false); - } - }); - - // when auto-reducing, the focus listener will ensure all data choices - // are shown on initial focus, and that a valid selection is in place - // when focus is lost - final JTextComponent textComponent = - (JTextComponent)getEditor().getEditorComponent(); - textComponent.addFocusListener(new FocusListener() - { - public void focusGained(FocusEvent fe) - { - if (isEditable()) - textComponent.selectAll(); - textComponent.repaint(); - } - - public void focusLost(FocusEvent fe) - { - if (isAutoReducible()) - { - Object item = m_reducibleModel.getSelectedItem(); - item = (item == null && m_reducibleModel.getSize() != 0) ? - m_reducibleModel.getElementAt(0) : item; - if (item == null) - { - updateReducibleModel(false); - if (m_reducibleModel.getSize() != 0) - item = m_reducibleModel.getElementAt(0); - else - return; - } - m_reducibleModel.setSelectedItem(item); - } - textComponent.setCaretPosition(0); - hidePopup(); - textComponent.repaint(); - } - }); - - textComponent.addMouseListener(new MouseAdapter() - { - public void mouseClicked(MouseEvent me) { - if (SwingUtilities.isLeftMouseButton(me) && - isAutoReducible() && - !isPopupVisible()) - { - updateReducibleModel(false); - showPopup(); - } - } - }); - } // init - - - /*************************************************************************/ - - /** Icon */ - private Icon m_icon = null; - - /** - * Set Icon of arrow button to icon - * @param defaultIcon Icon to be displayed - */ - public void setIcon (Icon defaultIcon) - { - if (getUI() instanceof CompiereComboBoxUI) - ((CompiereComboBoxUI)getUI()).setIcon(defaultIcon); - m_icon = defaultIcon; - } // setIcon - - - public ComboBoxModel getCompleteComboBoxModel() - { - return m_reducibleModel.getModel(); - } // getCompleteComboBoxModel - - /** - * @see javax.swing.JComboBox#setModel(javax.swing.ComboBoxModel) - */ - public void setModel(ComboBoxModel aModel) - { - m_reducibleModel = (m_reducibleModel == null) ? new ReducibleModel() : m_reducibleModel; - m_reducibleModel.setModel(aModel); - - super.setModel(m_reducibleModel); - } // setModel - - /** - * Set UI and re-set Icon for arrow button - * @param ui - */ - public void setUI (ComboBoxUI ui) - { - super.setUI(ui); - if (m_icon != null && ui instanceof CompiereComboBoxUI) - ((CompiereComboBoxUI)getUI()).setIcon(m_icon); - } // setUI - - /** - * Display Popup. - * Called from AdempiereComboPopup and allows to implement - * alternative actions than showing the popup - * @return if true, the popup should be displayed - */ - public boolean displayPopup() - { - return true; - } // displayPopup - - /*************************************************************************/ - - /** Mandatory (default false) */ - private boolean m_mandatory = false; - - /** - * Set Editor Mandatory - * @param mandatory true, if you have to enter data - */ - public void setMandatory (boolean mandatory) - { - m_mandatory = mandatory; - setBackground(false); - } // setMandatory - - /** - * Is Field mandatory - * @return true, if mandatory - */ - public boolean isMandatory() - { - return m_mandatory; - } // isMandatory - - /** - * Enable Editor - * @param rw true, if you can enter/select data - */ - public void setReadWrite (boolean rw) - { - if (super.isEnabled() != rw) - super.setEnabled (rw); - setBackground(false); - } // setReadWrite - - /** - * Is it possible to edit - * @return true, if editable - */ - public boolean isReadWrite() - { - return super.isEnabled(); - } // isReadWrite - - /** - * Set Background based on editable / mandatory / error - * @param error if true, set background to error color, otherwise mandatory/editable - */ - public void setBackground (boolean error) - { - if (error) - setBackground(AdempierePLAF.getFieldBackground_Error()); - else if (!isReadWrite()) - setBackground(AdempierePLAF.getFieldBackground_Inactive()); - else if (m_mandatory) - setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - else - setBackground(AdempierePLAF.getFieldBackground_Normal()); - } // setBackground - - /** - * Set Background - * @param bg - */ - public void setBackground (Color bg) - { - if (bg.equals(getBackground())) - return; - // Set same color for editor component - teo_sarca [ 1735122 ] - if (getEditor() != null && getEditor().getEditorComponent() != null) - getEditor().getEditorComponent().setBackground(bg); - super.setBackground(bg); - } // setBackground - - /** - * Set Editor to value - * @param value value of the editor - */ - public void setValue (Object value) - { - super.setSelectedItem(value); - } // setValue - - /** - * Return Editor value - * @return current value - */ - public Object getValue() - { - return super.getSelectedItem(); - } // getValue - - /** - * Return Display Value - * @return displayed String value - */ - public String getDisplay() - { - Object o = super.getSelectedItem(); - if (o == null) - return ""; - return o.toString(); - } // getDisplay - - /** - * Add Mouse Listener - 1-4-0 Bug. - * Bug in 1.4.0 Metal: arrowButton gets Mouse Events, so add the JComboBox - * MouseListeners to the arrowButton - No context menu if right-click - * @see CompiereComboBoxUI#installUI(JComponent) - * @param ml - */ - public void addMouseListener (MouseListener ml) - { - super.addMouseListener(ml); - // ignore calls from javax.swing.plaf.basic.BasicComboBoxUI.installListeners(BasicComboBoxUI.java:271) - if (getUI() instanceof CompiereComboBoxUI && !Trace.getCallerClass(1).startsWith("javax")) - { - JButton b = ((CompiereComboBoxUI)getUI()).getArrowButton(); - if (b != null) - b.addMouseListener(ml); - } - //begin vpj-cd e-evolution - if (getUI() instanceof org.adempiere.plaf.AdempiereComboBoxUI && !Trace.getCallerClass(1).startsWith("javax")) - { - JButton b = ((org.adempiere.plaf.AdempiereComboBoxUI)getUI()).getArrowButton(); - if (b != null) - b.addMouseListener(ml); - } - //end vpj-cd e-evolution - } // addMouseListener - - /** - * Remove Mouse Listener. - * @param ml - */ - public void removeMouseListener (MouseListener ml) - { - super.removeMouseListener(ml); - if (getUI() instanceof CompiereComboBoxUI) - { - JButton b = ((CompiereComboBoxUI)getUI()).getArrowButton(); - if (b != null) - b.removeMouseListener(ml); - } - } // removeMouseListener - - /** - * Set Action Command - * @param actionCommand command - */ - public void setActionCommand (String actionCommand) - { - super.setActionCommand (actionCommand); - if (getName() == null && actionCommand != null && actionCommand.length() > 0) - setName(actionCommand); - } // setActionCommand - - /** - * Called only when auto-reducing. By default, does a case insensitive - * string search for a match in the string representation of the given - * element. - * - * @param element an element in the combo box model - * - * @return true if the choice is to be displayed in the popup menu - */ - protected boolean isMatchingFilter(Object element) - { - String str = (element != null) ? element.toString().trim() : ""; - str = isCaseSensitive() ? str : str.toLowerCase(); - - return str.indexOf(m_reducibleModel.getMatchingFilter()) > -1; - } - - /** - * Is the combo box auto-reducible? - * - * @return true if isAutoReducible() - */ - public boolean isAutoReducible() - { - Boolean b = (Boolean)getClientProperty(AUTO_REDUCIBLE_PROPERTY); - return (b != null) && b.booleanValue(); - } - - /** - * Set whether the combo box is auto-reducible. The combo box must also be editable - * for auto-reduction to fully functional. Auto-reduction of data will preclude - * the ability for users to enter in their own choices. - * - * @param autoreducible true will activate auto-reduction of choices when user enters text - */ - public void setAutoReducible(boolean autoreducible) - { - if (isAutoReducible() != autoreducible) - { - putClientProperty(AUTO_REDUCIBLE_PROPERTY, Boolean.valueOf(autoreducible)); - updateReducibleModel(false); - - JTextComponent textComponent = - (JTextComponent)getEditor().getEditorComponent(); - if (autoreducible) - textComponent.addKeyListener(reducibleKeyListener); - else - textComponent.removeKeyListener(reducibleKeyListener); - } - } - - /** - * Is the auto-reduction case sensitive? - * - * @return true if case sensitive - */ - public boolean isCaseSensitive() - { - Boolean b = (Boolean)getClientProperty(CASE_SENSITIVE_PROPERTY); - return (b != null) && b.booleanValue(); - } - - /* (non-Javadoc) - * @see javax.swing.JComboBox#removeAllItems() - */ - public void removeAllItems() - { - m_reducibleModel.removeAllElements(); - } - - /** - * Set whether auto-reduction is case sensitive. - * - * @param caseSensitive true will make auto-reduction is case sensitive - */ - public void setCaseSensitive(boolean caseSensitive) - { - putClientProperty(CASE_SENSITIVE_PROPERTY, Boolean.valueOf(caseSensitive)); - } - - /** - * Updates the auto-reduction model. - * - * @param filtering true if the underlying data model should be filtered - */ - void updateReducibleModel(boolean filtering) - { - if (filtering || - m_reducibleModel.getSize() != m_reducibleModel.getModel().getSize()) - { - if (getParent() != null) - hidePopup(); - - // remember to caret position - JTextComponent textComponent = - (JTextComponent)getEditor().getEditorComponent(); - int pos = textComponent.getCaretPosition(); - m_reducibleModel.setFilter(textComponent.getText()); - - // update the model - m_reducibleModel.updateModel(filtering); - - // reset the caret - textComponent.setText(m_reducibleModel.getFilter()); - textComponent.setCaretPosition(pos); - - // ensure the combo box is resized to match the popup, if necessary - if (getParent() != null) - { - getParent().validate(); - getParent().repaint(); - - if (isShowing() && m_reducibleModel.getSize() > 0) { - // only show the popup if there is something to show - showPopup(); - } - } - } - } - - /** - * A view adapter model to hide filtered choices in the underlying combo box model. - */ - private class ReducibleModel implements MutableComboBoxModel, ListDataListener - { - /** - * Default constructor. Creates a ReducibleModel. - */ - public ReducibleModel() - { - } - - /** The wrapped data model. */ - private ComboBoxModel m_model; - - /** The wrapped data model. */ - private EventListenerList m_listenerList = new EventListenerList(); - - /** The filtered data. */ - private ArrayList m_visibleData = new ArrayList(); - - /** The filtered data. */ - private ArrayList m_modelData = new ArrayList(); - - /** The current filter. */ - private String m_filter = ""; - - /** The cached filter for case insensitive filtering. */ - private String m_lcFilter = ""; - - /** - * Pass through to the wrapped model if underlying model is MutableComboBoxModel. - * - * @see javax.swing.DefaultComboBoxModel#addElement(java.lang.Object) - */ - public void addElement(T anObject) - { - checkMutableComboBoxModel(); - m_modelData.add(anObject); - ((MutableComboBoxModel)m_model).addElement(anObject); - } - - /* (non-Javadoc) - * @see javax.swing.ListModel#addListDataListener(javax.swing.event.ListDataListener) - */ - public void addListDataListener(ListDataListener ldl) - { - m_listenerList.remove(ListDataListener.class, ldl); - m_listenerList.add(ListDataListener.class, ldl); - } - - /** - * Checks that the dataModel is an instance of - * MutableComboBoxModel. If not, it throws an exception. - * - * @exception RuntimeException if dataModel is not an - * instance of MutableComboBoxModel. - */ - void checkMutableComboBoxModel() - { - if ( !(m_model instanceof MutableComboBoxModel) ) - throw new RuntimeException("Cannot use this method with a non-Mutable data model."); - } - - /* (non-Javadoc) - * @see javax.swing.event.ListDataListener#contentsChanged(javax.swing.event.ListDataEvent) - */ - public void contentsChanged(ListDataEvent lde) - { - updateDataModel(); - // IDEMPIERE-574 - Swing AutoReducible ComboBox not reduced when used with cursor keys - // tbayen 2013-01-20 - updateModel(isAutoReducible()); - - if (isPopupVisible()) - { - hidePopup(); - showPopup(); - } - } - - /** - * - */ - private void fireContentsChanged() - { - ListDataEvent lde = null; - for (ListDataListener ldl : getListDataListeners()) - { - lde = (lde == null) ? - new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, 0, getSize()) : lde; - ldl.contentsChanged(lde); - } - } - - /* (non-Javadoc) - * @see javax.swing.ListModel#getElementAt(int) - */ - public T getElementAt(int index) - { - return m_visibleData.get(index); - } - - /** - * Return the current filter. - * - * @return the filter - */ - public String getFilter() - { - return m_filter; - } - - /** - * - */ - public ListDataListener[] getListDataListeners() - { - return (ListDataListener[])m_listenerList.getListeners(ListDataListener.class); - } - - /** - * @return the filter to use for matching; hecks case sensistivity - */ - protected String getMatchingFilter() - { - return isCaseSensitive() ? m_filter : m_lcFilter; - } - - /** - * @return the wrapped model - */ - public ComboBoxModel getModel() - { - return m_model; - } - - /** - * @return the selected item in the wrapped model - * - * @see javax.swing.DefaultComboBoxModel#getSelectedItem() - */ - public Object getSelectedItem() - { - return m_model.getSelectedItem(); - } - - /* (non-Javadoc) - * @see javax.swing.ListModel#getSize() - */ - public int getSize() - { - return m_visibleData.size(); - } - - /** - * Pass through to the wrapped model if underlying model is MutableComboBoxModel. - * - * @see javax.swing.DefaultComboBoxModel#insertElementAt(java.lang.Object, int) - */ - public void insertElementAt(T anObject, int index) - { - checkMutableComboBoxModel(); - m_modelData.add(index, anObject); - ((MutableComboBoxModel)m_model).insertElementAt(anObject, index); - } - - /** - * Pass through to the wrapped model if underlying model is MutableComboBoxModel. - * - * @see javax.swing.event.ListDataListener#intervalAdded(javax.swing.event.ListDataEvent) - */ - public void intervalAdded(ListDataEvent lde) - { - updateDataModel(); - updateModel(false); - } - - /** - * Pass through to the wrapped model if underlying model is MutableComboBoxModel. - * - * @see javax.swing.event.ListDataListener#intervalRemoved(javax.swing.event.ListDataEvent) - */ - public void intervalRemoved(ListDataEvent lde) - { - updateDataModel(); - updateModel(false); - } - - /** - * - */ - public void removeAllElements() - { - checkMutableComboBoxModel(); - - ListDataListener[] listeners = getListDataListeners(); - for (int i = 0; i < listeners.length; i++) - removeListDataListener(listeners[i]); - m_model.removeListDataListener(this); - - m_modelData.clear(); - m_visibleData.clear(); - while (m_model.getSize() > 0) - ((MutableComboBoxModel)m_model).removeElementAt(0); - - for (ListDataListener ldl : listeners) - addListDataListener(ldl); - m_model.addListDataListener(this); - - updateModel(false); - } - - /** - * Pass through to the wrapped model if underlying model is MutableComboBoxModel. - * - * @see javax.swing.DefaultComboBoxModel#removeElement(java.lang.Object) - */ - public void removeElement(Object anObject) - { - checkMutableComboBoxModel(); - m_modelData.remove(anObject); - m_visibleData.clear(); - ((MutableComboBoxModel)m_model).removeElement(anObject); - } - - /** - * Pass through to the wrapped model if underlying model is MutableComboBoxModel. - * - * @see javax.swing.DefaultComboBoxModel#removeElementAt(int) - */ - public void removeElementAt(int index) - { - checkMutableComboBoxModel(); - m_modelData.remove(index); - m_visibleData.clear(); - ((MutableComboBoxModel)m_model).removeElementAt(index); - } - - /* (non-Javadoc) - * @see javax.swing.ListModel#removeListDataListener(javax.swing.event.ListDataListener) - */ - public void removeListDataListener(ListDataListener ldl) - { - m_listenerList.remove(ListDataListener.class, ldl); - } - - /** - * @param filter the filter to set - */ - public void setFilter(String filter) - { - this.m_filter = (filter != null) ? filter : ""; - m_lcFilter = filter.trim().toLowerCase(); - } - - /** - * Set the wrapped combo box model. - * - * @param model the model to set - */ - public void setModel(ComboBoxModel model) - { - if (this.m_model != null) - this.m_model.removeListDataListener(this); - - this.m_model = model; - updateDataModel(); - m_filter = ""; - - model.addListDataListener(this); - updateModel(false); - } - - /** - * Set the selected item in the wrapped model. - * - * @see javax.swing.DefaultComboBoxModel#setSelectedItem(java.lang.Object) - */ - public void setSelectedItem(Object anObject) - { - if (anObject == null || m_modelData.contains(anObject)) - m_model.setSelectedItem(anObject); - } - - /** - * Updates the view model based on whether filtering or not. - * - * @param filtering true if the underlying model is to be filtered - */ - public void updateDataModel() - { - m_modelData.clear(); - int size = m_model.getSize(); - for (int i = 0; i < size; i++) - m_modelData.add(m_model.getElementAt(i)); - } - - /** - * Updates the view model based on whether filtering or not. - * - * @param filtering true if the underlying model is to be filtered - */ - public void updateModel(boolean filtering) - { - boolean includeAll = !filtering || !isAutoReducible() || "".equals(m_lcFilter); - if (includeAll) - { - m_visibleData.clear(); - m_visibleData.addAll(m_modelData); - } - else - { - m_visibleData.clear(); - Object selected = getSelectedItem(); - ListDataListener[] listeners = getListDataListeners(); - for (int i = 0; i < listeners.length; i++) - removeListDataListener(listeners[i]); - m_model.removeListDataListener(this); - - - int size = m_model.getSize(); - - for (int i = 0; i < size; i++) - { - T element = m_model.getElementAt(i); - if (element == null || isMatchingFilter(element)) - { - m_visibleData.add(element); - } - } - - if (m_visibleData.contains(selected) || selected == null) - setSelectedItem(selected); - - for (ListDataListener ldl : listeners) - addListDataListener(ldl); - m_model.addListDataListener(this); - } - - fireContentsChanged(); - } - } // ReducibleModel - - /** - * Key listener for editor's text compontent to trigger auto-reduction. Only - * used when auto-reduction is enabled. - */ - class ReducibleKeyListener extends KeyAdapter - { - /** Invokes autoreduction. */ - private Runnable m_invoker = new Runnable() - { - public void run() - { - updateReducibleModel(true); - } - }; - - /** Visibly updates the popup menu. */ - private Runnable m_updateMenu = new Runnable() - { - public void run() - { - hidePopup(); - getParent().validate(); - getParent().repaint(); - showPopup(); - } - }; - - /* (non-Javadoc) - * @see java.awt.event.KeyAdapter#keyPressed(java.awt.event.KeyEvent) - */ - public void keyPressed(KeyEvent ke) - { - if (ke.getKeyCode() != KeyEvent.VK_CONTROL && - ke.getKeyCode() != KeyEvent.VK_ALT && - ke.getKeyCode() != KeyEvent.VK_SHIFT && - ( ke.getModifiersEx() & InputEvent.ALT_DOWN_MASK ) == 0 ) - { - if (ke.getKeyCode() == KeyEvent.VK_ENTER || - ke.getKeyCode() == KeyEvent.VK_TAB) - { - // enter key pressed, so complete editing and select item - Object selObject = getSelectedItem(); - selObject = (selObject == null && getItemCount() > 0) ? getItemAt(0) : selObject; - setSelectedItem(selObject); - getEditor().setItem(getSelectedItem()); - } - else if (ke.getKeyCode() == KeyEvent.VK_ESCAPE) - { - // escape key ends editing and rejects focus of text editor - FocusManager.getCurrentManager().upFocusCycle(); - } - else if (ke.getKeyCode() == KeyEvent.VK_UP || - ke.getKeyCode() == KeyEvent.VK_KP_UP || - ke.getKeyCode() == KeyEvent.VK_DOWN || - ke.getKeyCode() == KeyEvent.VK_KP_DOWN) - { - // up or down selects new value - SwingUtilities.invokeLater(m_updateMenu); - } - else if (ke.getKeyChar() == KeyEvent.CHAR_UNDEFINED) { - ; // ignore keys not modifying text - } - else - { - // key typed, so filter - SwingUtilities.invokeLater(m_invoker); - setSelectedItem(null); - } - } - } - } // ReducibleKeyListener - - // IDEMPIERE 90 - /** show only short list items or all ? */ - private boolean m_ShortListSearch = false; - - /** set the editor to return only short list items */ - public void setShortListSearch (boolean shortList) - { - m_ShortListSearch = shortList; - } // setShortListSearch - - /** does the search should return only short list items ? */ - public boolean isShortListSearch() - { - return m_ShortListSearch; - } // isShortListSearch - - // IDEMPIERE 90 -} // CComboBox diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CComboBoxEditable.java b/org.adempiere.ui.swing/src/org/compiere/swing/CComboBoxEditable.java deleted file mode 100644 index 2ac9e3b366..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CComboBoxEditable.java +++ /dev/null @@ -1,348 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Color; -import java.awt.event.MouseListener; -import java.util.Vector; - -import javax.swing.ComboBoxModel; -import javax.swing.DefaultComboBoxModel; -import javax.swing.Icon; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JComponent; -import javax.swing.plaf.ComboBoxUI; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.plaf.CompiereComboBoxUI; -import org.compiere.util.NamePair; -import org.compiere.util.Trace; - -/** - * Adempiere Colored Combo Box. - * - * @author Jorg Janke - * @version $Id: CComboBoxEditable.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CComboBoxEditable extends JComboBox - implements CEditor -{ - /** - * - */ - private static final long serialVersionUID = -3036970630981224309L; - - /** - * Creates a JComboBox that takes it's items from an - * existing ComboBoxModel. Since the - * ComboBoxModel is provided, a combo box created using - * this constructor does not create a default combo box model and - * may impact how the insert, remove and add methods behave. - * - * @param aModel the ComboBoxModel that provides the - * displayed list of items - * @see DefaultComboBoxModel - */ - public CComboBoxEditable(ComboBoxModel aModel) - { - super(aModel); - init(); - } // CComboBoxEditable - - /** - * Creates a JComboBox that contains the elements - * in the specified array. By default the first item in the array - * (and therefore the data model) becomes selected. - * - * @param items an array of objects to insert into the combo box - * @see DefaultComboBoxModel - */ - public CComboBoxEditable(final E items[]) - { - super(items); - init(); - } // CComboBoxEditable - - /** - * Creates a JComboBox that contains the elements - * in the specified array. By default the first item in the array - * (and therefore the data model) becomes selected. - * - * @param items an array of objects to insert into the combo box - * @param key set selected if exists - * @see DefaultComboBoxModel - */ - public CComboBoxEditable(final E items[], String key) - { - this(items); - if (key == null) - return; - for (int i = 0; i < 0; i++) - { - Object item = items[i]; - if (item == null) - continue; - boolean found = false; - if (item instanceof NamePair) - found = ((NamePair)item).getID().equals(key); - else - found = item.toString().equals(key); - if (found) - { - setSelectedIndex(i); - break; - } - } - } // CComboBoxEditable - - /** - * Creates a JComboBox that contains the elements - * in the specified Vector. By default the first item in the vector - * and therefore the data model) becomes selected. - * - * @param items an array of vectors to insert into the combo box - * @see DefaultComboBoxModel - */ - public CComboBoxEditable(Vector items) - { - super(items); - init(); - } // CComboBoxEditable - - /** - * Creates a JComboBox with a default data model. - * The default data model is an empty list of objects. - * Use addItem to add items. By default the first item - * in the data model becomes selected. - * - * @see DefaultComboBoxModel - */ - public CComboBoxEditable() - { - super(); - init(); - } // CComboBoxEditable - - /** Field Height */ - public static int FIELD_HIGHT = 0; - - /** - * Common Init - */ - private void init() - { - FIELD_HIGHT = getPreferredSize().height; - } // init - - - /*************************************************************************/ - - /** Icon */ - private Icon m_icon = null; - - /** - * Set Icon of arrow button to icon - * @param defaultIcon Icon to be displayed - */ - public void setIcon (Icon defaultIcon) - { - if (getUI() instanceof CompiereComboBoxUI) - ((CompiereComboBoxUI)getUI()).setIcon(defaultIcon); - m_icon = defaultIcon; - } // setIcon - - /** - * Set UI and re-set Icon for arrow button - * @param ui - */ - public void setUI (ComboBoxUI ui) - { - super.setUI(ui); - if (m_icon != null && ui instanceof CompiereComboBoxUI) - ((CompiereComboBoxUI)getUI()).setIcon(m_icon); - } // setUI - - /** - * Display Popup. - * Called from AdempiereComboPopup and allows to implement - * alternative actions than showing the popup - * @return if true, the popup should be displayed - */ - public boolean displayPopup() - { - return true; - } // displayPopup - - /*************************************************************************/ - - /** Mandatory (default false) */ - private boolean m_mandatory = false; - - /** - * Set Editor Mandatory - * @param mandatory true, if you have to enter data - */ - public void setMandatory (boolean mandatory) - { - m_mandatory = mandatory; - setBackground(false); - } // setMandatory - - /** - * Is Field mandatory - * @return true, if mandatory - */ - public boolean isMandatory() - { - return m_mandatory; - } // isMandatory - - /** - * Enable Editor - * @param rw true, if you can enter/select data - */ - public void setReadWrite (boolean rw) - { - if (super.isEnabled() != rw) - super.setEnabled (rw); - setBackground(false); - } // setReadWrite - - /** - * Is it possible to edit - * @return true, if editable - */ - public boolean isReadWrite() - { - return super.isEnabled(); - } // isReadWrite - - /** - * Set Background based on editable / mandatory / error - * @param error if true, set background to error color, otherwise mandatory/editable - */ - public void setBackground (boolean error) - { - if (error) - setBackground(AdempierePLAF.getFieldBackground_Error()); - else if (!isReadWrite()) - setBackground(AdempierePLAF.getFieldBackground_Inactive()); - else if (m_mandatory) - setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - else - setBackground(AdempierePLAF.getFieldBackground_Normal()); - } // setBackground - - /** - * Set Background - * @param bg - */ - public void setBackground (Color bg) - { - if (bg.equals(getBackground())) - return; - // Set same color for editor component - teo_sarca [ 1735122 ] - if (getEditor() != null && getEditor().getEditorComponent() != null) - getEditor().getEditorComponent().setBackground(bg); - super.setBackground(bg); - } // setBackground - - /** - * Set Editor to value - * @param value value of the editor - */ - public void setValue (Object value) - { - super.setSelectedItem(value); - } // setValue - - /** - * Return Editor value - * @return current value - */ - public Object getValue() - { - return super.getSelectedItem(); - } // getValue - - /** - * Return Display Value - * @return displayed String value - */ - public String getDisplay() - { - Object o = super.getSelectedItem(); - if (o == null) - return ""; - return o.toString(); - } // getDisplay - - /** - * Add Mouse Listener - 1-4-0 Bug. - * Bug in 1.4.0 Metal: arrowButton gets Mouse Events, so add the JComboBox - * MouseListeners to the arrowButton - No context menu if right-click - * @see CompiereComboBoxUI#installUI(JComponent) - * @param ml - */ - public void addMouseListener (MouseListener ml) - { - super.addMouseListener(ml); - // ignore calls from javax.swing.plaf.basic.BasicComboBoxUI.installListeners(BasicComboBoxUI.java:271) - if (getUI() instanceof CompiereComboBoxUI && !Trace.getCallerClass(1).startsWith("javax")) - { - JButton b = ((CompiereComboBoxUI)getUI()).getArrowButton(); - if (b != null) - b.addMouseListener(ml); - } - //begin vpj-cd e-evolution - if (getUI() instanceof org.adempiere.plaf.AdempiereComboBoxUI && !Trace.getCallerClass(1).startsWith("javax")) - { - JButton b = ((org.adempiere.plaf.AdempiereComboBoxUI)getUI()).getArrowButton(); - if (b != null) - b.addMouseListener(ml); - } - //end vpj-cd e-evolution - } // addMouseListener - - /** - * Remove Mouse Listener. - * @param ml - */ - public void removeMouseListener (MouseListener ml) - { - super.removeMouseListener(ml); - if (getUI() instanceof CompiereComboBoxUI) - { - JButton b = ((CompiereComboBoxUI)getUI()).getArrowButton(); - if (b != null) - b.removeMouseListener(ml); - } - } // removeMouseListener - - /** - * Set Action Command - * @param actionCommand command - */ - public void setActionCommand (String actionCommand) - { - super.setActionCommand (actionCommand); - if (getName() == null && actionCommand != null && actionCommand.length() > 0) - setName(actionCommand); - } // setActionCommand - -} // CComboBoxEditable diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CDialog.java b/org.adempiere.ui.swing/src/org/compiere/swing/CDialog.java deleted file mode 100644 index 9dec64fdd4..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CDialog.java +++ /dev/null @@ -1,305 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Container; -import java.awt.Dialog; -import java.awt.Frame; -import java.awt.GraphicsConfiguration; -import java.awt.HeadlessException; -import java.awt.Window; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; - -import javax.swing.AbstractAction; -import javax.swing.JDialog; -import javax.swing.JPanel; -import javax.swing.KeyStroke; - -/** - * Conveniance Dialog Class. - * Adempiere Background + Dispose on Close - * Implementing empty Action and Mouse Listener - * - * @author Jorg Janke - * @version $Id: CDialog.java,v 1.3 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CDialog extends JDialog - implements ActionListener, MouseListener -{ - /** - * - */ - private static final long serialVersionUID = -1698027199524570661L; - - /** - * CDialog - * @throws HeadlessException - */ - public CDialog() throws HeadlessException - { - this((Frame)null, false); - } - /** - * CDialog - * @param owner - * @throws HeadlessException - */ - public CDialog(Frame owner) throws HeadlessException - { - this (owner, false); - } - /** - * CDialog - * @param owner - * @param modal - * @throws HeadlessException - */ - public CDialog(Frame owner, boolean modal) throws HeadlessException - { - this (owner, null, modal); - } - /** - * CDialog - * @param owner - * @param title - * @throws HeadlessException - */ - public CDialog(Frame owner, String title) throws HeadlessException - { - this (owner, title, false); - } - /** - * CDialog - * @param owner - * @param title - * @param modal - * @throws HeadlessException - */ - public CDialog(Frame owner, String title, boolean modal) throws HeadlessException - { - super(owner, title, modal); - } - /** - * CDialog - * @param owner - * @param title - * @param modal - * @param gc - */ - public CDialog(Frame owner, String title, boolean modal, GraphicsConfiguration gc) - { - super(owner, title, modal, gc); - } - /** - * CDialog - * @param owner - * @throws HeadlessException - */ - public CDialog(Dialog owner) throws HeadlessException - { - this (owner, false); - } - /** - * CDialog - * @param owner - * @param modal - * @throws HeadlessException - */ - public CDialog(Dialog owner, boolean modal) throws HeadlessException - { - this(owner, null, modal); - } - /** - * CDialog - * @param owner - * @param title - * @throws HeadlessException - */ - public CDialog(Dialog owner, String title) throws HeadlessException - { - this(owner, title, false); - } - /** - * CDialog - * @param owner - * @param title - * @param modal - * @throws HeadlessException - */ - public CDialog(Dialog owner, String title, boolean modal) throws HeadlessException - { - super(owner, title, modal); - } - /** - * CDialog - * @param owner - * @param title - * @param modal - * @param gc - * @throws HeadlessException - */ - public CDialog(Dialog owner, String title, boolean modal, GraphicsConfiguration gc) throws HeadlessException - { - super(owner, title, modal, gc); - } - - /** - * Initialize. - * Install ALT-Pause - */ - protected void dialogInit() - { - super.dialogInit(); - setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - setTitle(getTitle()); // remove Mn - // - Container c = getContentPane(); - if (c instanceof JPanel) - { - JPanel panel = (JPanel)c; - panel.getActionMap().put(ACTION_DISPOSE, s_dialogAction); - panel.getInputMap(JPanel.WHEN_IN_FOCUSED_WINDOW).put(s_disposeKeyStroke, ACTION_DISPOSE); - } - } // init - - - /************************************************************************** - * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) - * @param e - */ - public void actionPerformed(ActionEvent e) - { - } - - /** - * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent) - * @param e - */ - public void mouseClicked(MouseEvent e) - { - } - - /** - * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent) - * @param e - */ - public void mouseEntered(MouseEvent e) - { - } - - /** - * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent) - * @param e - */ - public void mouseExited(MouseEvent e) - { - } - - /** - * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent) - * @param e - */ - public void mousePressed(MouseEvent e) - { - } - - /** - * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent) - * @param e - */ - public void mouseReleased(MouseEvent e) - { - } - - /** - * Set Title - * @param title title - */ - public void setTitle(String title) - { - if (title != null) - { - int pos = title.indexOf('&'); - if (pos != -1 && title.length() > pos) // We have a nemonic - { - int mnemonic = title.toUpperCase().charAt(pos+1); - if (mnemonic != ' ') - title = title.substring(0, pos) + title.substring(pos+1); - } - } - super.setTitle(title); - } // setTitle - - /** Dispose Action Name */ - protected static String ACTION_DISPOSE = "CDialogDispose"; - /** Action */ - protected static DialogAction s_dialogAction = new DialogAction(ACTION_DISPOSE); - /** ALT-EXCAPE */ - protected static KeyStroke s_disposeKeyStroke = - KeyStroke.getKeyStroke(KeyEvent.VK_PAUSE, ActionEvent.ALT_MASK); - - /** - * Adempiere Dialog Action - * - * @author Jorg Janke - * @version $Id: CDialog.java,v 1.3 2006/07/30 00:52:24 jjanke Exp $ - */ - static class DialogAction extends AbstractAction - { - /** - * - */ - private static final long serialVersionUID = -1502992970807699945L; - - DialogAction (String actionName) - { - super(actionName); - putValue(AbstractAction.ACTION_COMMAND_KEY, actionName); - } // DialogAction - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (ACTION_DISPOSE.equals(e.getActionCommand())) - { - Object source = e.getSource(); - while (source != null) - { - if (source instanceof Window) - { - ((Window)source).dispose(); - return; - } - if (source instanceof Container) - source = ((Container)source).getParent(); - else - source = null; - } - } - else - System.out.println("Action: " + e); - } // actionPerformed - } // DialogAction - -} // CDialog diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CEditor.java b/org.adempiere.ui.swing/src/org/compiere/swing/CEditor.java deleted file mode 100644 index 514bed7534..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CEditor.java +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -/** - * Adempiere Editor interface - * - * @author Jorg Janke - * @version $Id: CEditor.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public interface CEditor -{ - /** - * Enable Editor - * @param rw true, if you can enter/select data - */ - public void setReadWrite (boolean rw); - - /** - * Is it possible to edit - * @return true, if editable - */ - public boolean isReadWrite(); - - /** - * Set Editor Mandatory - * @param mandatory true, if you have to enter data - */ - public void setMandatory (boolean mandatory); - - /** - * Is Field mandatory - * @return true, if mandatory - */ - public boolean isMandatory(); - - /** - * Set Background based on editable / mandatory / error - * @param error if true, set background to error color, otherwise mandatory/editable - */ - public void setBackground (boolean error); - - /** - * Set Visible - * @param visible true if field is to be shown - */ - public void setVisible (boolean visible); - - /** - * Set Editor to value - * @param value value of the editor - */ - public void setValue (Object value); - - /** - * Return Editor value - * @return current value - */ - public Object getValue(); - - /** - * Return Display Value - * @return displayed String value - */ - public String getDisplay(); - -} // CEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CField.java b/org.adempiere.ui.swing/src/org/compiere/swing/CField.java deleted file mode 100644 index 249c9551da..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CField.java +++ /dev/null @@ -1,334 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Color; -import java.awt.Dialog; -import java.awt.Frame; -import java.awt.Window; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.lang.reflect.Constructor; -import java.text.DateFormat; -import java.text.DecimalFormat; -import java.text.NumberFormat; -import java.text.SimpleDateFormat; -import java.util.regex.Pattern; - -import javax.swing.Icon; -import javax.swing.JComboBox; -import javax.swing.JOptionPane; -import javax.swing.SwingUtilities; -import javax.swing.plaf.TextUI; - -import org.adempiere.plaf.AdempierePLAF; - -/** - * Adempiere Colored Field with external popup editor. - * It extends ComboBox for UI consistency purposes - * - * @author Jorg Janke - * @version $Id: CField.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CField extends JComboBox - implements CEditor, ActionListener -{ - - /** - * - */ - private static final long serialVersionUID = -2570380982649145678L; - - public static CField createNumeric(NumberFormat format) - { - return null; - } - public static CField createNumeric() - { - return createNumeric(new DecimalFormat()); - } - public static CField createDate(DateFormat format) - { - return null; - } - public static CField createDate() - { - return createDate(new SimpleDateFormat()); - } - public static CField createText(Pattern p) - { - return null; - } - public static CField createText(int length) - { - return null; - } - - /*************************************************************************/ - - public CField () - { - this (null, null, ""); - } - - /** - * Construct Adempiere Field with external popup editor - * - * @param editor the (validating) editor - * @param cFieldPopup the popup dialog - * @param title title for popup - */ - public CField (CFieldEditor editor, Class cFieldPopup, String title) - { - super(new Object[] {"1", "2"}); - if (editor != null) -// setEditor (editor); - setEditable(true); - m_title = title; - - // Check popup - if (cFieldPopup != null) - { - Class[] interfaces = cFieldPopup.getInterfaces(); - boolean found = false; - for (int i = 0; i < interfaces.length; i++) - { - if (interfaces[i].equals(CFieldPopup.class)) - { - found = true; - break; - } - } - if (!found) - throw new IllegalArgumentException ("Popup class must be CFieldPopup"); - } - super.addActionListener(this); - } // CField - - private CFieldEditor m_editor = null; - private Class m_popupClass = null; - private String m_title = null; - private Object m_oldValue = null; - - /*************************************************************************/ - - /** Icon */ - private Icon m_icon = null; - - /** - * Set Icon of arrow button to icon - * @param defaultIcon Icon to be displayed - */ - public void setIcon (Icon defaultIcon) - { - m_icon = defaultIcon; - } // setIcon - - /** - * Get Icon of arrow button to icon - * @return defaultIcon Icon to be displayed - */ - public Icon getIcon () - { - return m_icon; - } // getIcon - - - /** - * Set UI and re-set Icon for arrow button - * @param ui - */ - public void setUI (TextUI ui) - { - super.setUI(ui); - } // setUI - - /** - * Display Popup. - * Called from AdempiereComboPopup and allows to implement - * alternative actions than showing the popup - * @return if true, the popup should be displayed - */ - public boolean displayPopup() - { - if (m_popupClass == null) - return false; - // - try - { - // Get Owner & Create Popup Instance - Window win = SwingUtilities.getWindowAncestor(this); - CFieldPopup popup = null; - if (win instanceof Dialog) - { - Constructor constructor = m_popupClass.getConstructor - (new Class[] {Dialog.class, String.class, Boolean.class}); - popup = (CFieldPopup)constructor.newInstance(new Object[] - {(Dialog)win, m_title, Boolean.TRUE}); - } - else if (win instanceof Frame) - { - Constructor constructor = m_popupClass.getConstructor - (new Class[] {Frame.class, String.class, Boolean.class}); - popup = (CFieldPopup)constructor.newInstance(new Object[] - {(Frame)win, m_title, Boolean.TRUE}); - } - if (popup == null) - return false; - // Start Popup - popup.setValue (m_editor.getItem()); - popup.setFormat (m_editor.getFormat()); - popup.show(); - m_editor.setItem (popup.getValue()); - popup = null; - } - catch (Exception e) - { - notifyUser (e); - } - // - return false; - } // displayPopup - - /** - * Notify User of a Ptoblem with starting popup - * @param e Exception - */ - public void notifyUser (Exception e) - { - JOptionPane.showMessageDialog(this, e.toString(), "Field Error", JOptionPane.ERROR_MESSAGE); - } // notify User - - /*************************************************************************/ - - /** Mandatory (default false) */ - private boolean m_mandatory = false; - - /** - * Set Editor Mandatory - * @param mandatory true, if you have to enter data - */ - public void setMandatory (boolean mandatory) - { - m_mandatory = mandatory; - setBackground(false); - } // setMandatory - - /** - * Is Field mandatory - * @return true, if mandatory - */ - public boolean isMandatory() - { - return m_mandatory; - } // isMandatory - - /** - * Enable Editor - * @param rw true, if you can enter/select data - */ - public void setReadWrite (boolean rw) - { - if (super.isEnabled() != rw) - super.setEnabled (rw); - setBackground(false); - } // setReadWrite - - /** - * Is it possible to edit - * @return true, if editable - */ - public boolean isReadWrite() - { - return super.isEnabled(); - } // isReadWrite - - - /** - * Set Background based on editable / mandatory / error - * @param error if true, set background to error color, otherwise mandatory/editable - */ - public void setBackground (boolean error) - { - Color bg = null; - if (error) - bg = AdempierePLAF.getFieldBackground_Error(); - else if (!isReadWrite()) - bg = AdempierePLAF.getFieldBackground_Inactive(); - else if (m_mandatory) - bg = AdempierePLAF.getFieldBackground_Mandatory(); - else - bg = AdempierePLAF.getFieldBackground_Normal(); - if (bg.equals(m_editor.getBackground())) - return; - m_editor.setBackground(bg); - } // setBackground - - /** - * Set Editor to value - * @param value value of the editor - */ - public void setValue (Object value) - { - m_oldValue = value; - // super.setSelectedItem(value); - } // setValue - - /** - * Return Editor value - * @return current value - */ - public Object getValue() - { - return null;//super.getSelectedItem(); - } // getValue - - /** - * Return Display Value - * @return displayed String value - */ - public String getDisplay() - { - // if (super.getSelectedItem() == null) - return ""; - // return super.getSelectedItem().toString(); - } // getDisplay - - /*************************************************************************/ - - /** - * Action Listener - * @param e ActionEvent - */ - public void actionPerformed(ActionEvent e) - { - // Do er have a change? - Object newValue = getValue(); - if ((newValue != null && newValue.equals(m_oldValue)) - || (newValue == null && m_oldValue == null) ) - return; - super.firePropertyChange("DataChanged", m_oldValue, newValue); - m_oldValue = newValue; - } // // actionPerformed - - @Override - public void setBackground(Color bg) - { - m_editor.setBackground(bg); - } - -} // CField diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CFieldEditor.java b/org.adempiere.ui.swing/src/org/compiere/swing/CFieldEditor.java deleted file mode 100644 index bb89b9c6a3..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CFieldEditor.java +++ /dev/null @@ -1,84 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Component; - -import javax.swing.ComboBoxEditor; -import javax.swing.JTextField; - -/** - * Adempiere Field Editor. - * - * - * @author Jorg Janke - * @version $Id: CFieldEditor.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CFieldEditor extends JTextField implements ComboBoxEditor -{ - /** - * - */ - private static final long serialVersionUID = -1048599104686258148L; - - /** - * - */ - public CFieldEditor() - { - } - - /** - * Return the component that should be added to the tree hierarchy - * for this editor - */ - public Component getEditorComponent() - { - return this; - } // getEditorCimponent - - /** - * Set Editor - * @param anObject - */ - public void setItem (Object anObject) - { - if (anObject == null) - setText(""); - else - setText(anObject.toString()); - } // setItem - - /** - * Get edited item - * @return edited text - */ - public Object getItem() - { - return getText(); - } // getItem - - /** - * Returns format Info (for Popup) - * @return format - */ - public Object getFormat() - { - return null; - } // getFormat - -} // CFieldEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CFieldPopup.java b/org.adempiere.ui.swing/src/org/compiere/swing/CFieldPopup.java deleted file mode 100644 index 45420e67d4..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CFieldPopup.java +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -/** - * Adempiere Field external popup Interface. - * The actual class must be a JDialog - * - * @author Jorg Janke - * @version $Id: CFieldPopup.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public interface CFieldPopup -{ - /** - * Show Popup - */ - public void show(); - - /** - * Set Value - * @param value - */ - public void setValue (Object value); - - /** - * Get Value - * @return value - */ - public Object getValue(); - - /** - * Set Format - * @param format - */ - public void setFormat (Object format); - - /** - * Get Format - * @return format - */ - public Object getFormat(); - -} // CFieldPopup diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CFrame.java b/org.adempiere.ui.swing/src/org/compiere/swing/CFrame.java deleted file mode 100644 index 27f291b84e..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CFrame.java +++ /dev/null @@ -1,143 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Container; -import java.awt.GraphicsConfiguration; -import java.awt.HeadlessException; - -import javax.swing.JFrame; -import javax.swing.JPanel; - -/** - * Adempiere Frame - * - * @author Jorg Janke - * @version $Id: CFrame.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CFrame extends JFrame -{ - /** - * - */ - private static final long serialVersionUID = 6282268921005682543L; - - /** - * CFrame - * @throws HeadlessException - */ - public CFrame () throws HeadlessException - { - super (); - } // CFrame - - /** - * CFrame - * @param gc - */ - public CFrame (GraphicsConfiguration gc) - { - super (gc); - } // CFrame - - /** - * CFrame - * @param title - * @throws HeadlessException - */ - public CFrame (String title) throws HeadlessException - { - super (cleanup(title)); - } // CFrame - - /** - * CFrame - * @param title - * @param gc - */ - public CFrame (String title, GraphicsConfiguration gc) - { - super (cleanup(title), gc); - } // CFrame - - /** Window ID */ - private int p_AD_Window_ID = 0; - - /** - * Frame Init. - * Install ALT-Pause - */ - protected void frameInit () - { - super.frameInit (); - setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - // - Container c = getContentPane(); - if (c instanceof JPanel) - { - JPanel panel = (JPanel)c; - panel.getActionMap().put(CDialog.ACTION_DISPOSE, CDialog.s_dialogAction); - panel.getInputMap(JPanel.WHEN_IN_FOCUSED_WINDOW).put(CDialog.s_disposeKeyStroke, CDialog.ACTION_DISPOSE); - } - } // frameInit - - /** - * Cleanedup Title - * @param title title - * @return title w/o mn - */ - private static String cleanup (String title) - { - if (title != null) - { - int pos = title.indexOf('&'); - if (pos != -1 && title.length() > pos) // We have a mnemonic - { - int mnemonic = title.toUpperCase().charAt(pos+1); - if (mnemonic != ' ') - title = title.substring(0, pos) + title.substring(pos+1); - } - } - return title; - } // getTitle - - /** - * Set Title - * @param title title - */ - public void setTitle(String title) - { - super.setTitle(cleanup(title)); - } // setTitle - - /** - * @return Returns the AD_Window_ID. - */ - public int getAD_Window_ID () - { - return p_AD_Window_ID; - } // getAD_Window_ID - - /** - * @param window_ID The AD_Window_ID to set. - */ - public void setAD_Window_ID (int window_ID) - { - p_AD_Window_ID = window_ID; - } // getAD_Window_ID - -} // CFrame diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CLabel.java b/org.adempiere.ui.swing/src/org/compiere/swing/CLabel.java deleted file mode 100644 index e01b017c99..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CLabel.java +++ /dev/null @@ -1,309 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Font; - -import javax.swing.Icon; -import javax.swing.JLabel; -import javax.swing.text.JTextComponent; - -/** - * Label with Mnemonics interpretation - * - * @author Jorg Janke - * @version $Id: CLabel.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CLabel extends JLabel -{ - /** - * - */ - private static final long serialVersionUID = 3836688834452881595L; - public static int DEFAULT_ALIGNMENT = JLabel.TRAILING; - - /** - * Creates a Label instance with the specified - * text, image, and horizontal alignment. - * The label is centered vertically in its display area. - * The text is on the trailing edge of the image. - * - * @param text The text to be displayed by the label. - * @param icon The image to be displayed by the label. - * @param horizontalAlignment One of the following constants - * defined in SwingConstants: - * LEFT, - * CENTER, - * RIGHT, - * LEADING or - * TRAILING. - */ - public CLabel (String text, Icon icon, int horizontalAlignment) - { - super (text, icon, horizontalAlignment); - init(); - } - - /** - * Creates a Label instance with the specified - * text and horizontal alignment. - * The label is centered vertically in its display area. - * - * @param text The text to be displayed by the label. - * @param horizontalAlignment One of the following constants - * defined in SwingConstants: - * LEFT, - * CENTER, - * RIGHT, - * LEADING or - * TRAILING. - */ - public CLabel (String text, int horizontalAlignment) - { - super(text, horizontalAlignment); - init(); - } - - /** - * Creates a Label instance with the specified text. - * The label is aligned against the leading edge of its display area, - * and centered vertically. - * - * @param text The text to be displayed by the label. - */ - public CLabel (String text) - { - super(text, DEFAULT_ALIGNMENT); - init(); - } - - /** - * Creates a Label instance with the specified - * image and horizontal alignment. - * The label is centered vertically in its display area. - * - * @param image The image to be displayed by the label. - * @param horizontalAlignment One of the following constants - * defined in SwingConstants: - * LEFT, - * CENTER, - * RIGHT, - * LEADING or - * TRAILING. - */ - public CLabel (Icon image, int horizontalAlignment) - { - super (image, horizontalAlignment); - init(); - } - - /** - * Creates a Label instance with the specified image. - * The label is centered vertically and horizontally - * in its display area. - * - * @param image The image to be displayed by the label. - */ - public CLabel (Icon image) - { - super (image, DEFAULT_ALIGNMENT); - init(); - } - - /** - * Creates a JLabel instance with - * no image and with an empty string for the title. - * The label is centered vertically - * in its display area. - * The label's contents, once set, will be displayed on the leading edge - * of the label's display area. - */ - public CLabel () - { - super("", DEFAULT_ALIGNMENT); - init(); - } - - /** - * Creates a Label instance with the specified text. - * The label is aligned against the leading edge of its display area, - * and centered vertically. - * - * @param label The text to be displayed by the label. - * @param toolTip The optional Tooltip text - */ - public CLabel (String label, String toolTip) - { - super (label, DEFAULT_ALIGNMENT); - if (toolTip != null && toolTip.length() > 0) - super.setToolTipText(toolTip); - init(); - } // CLabel - - /** - * Trailing Label for Field - * @param label label - * @param field field - */ - public CLabel (String label, Component field) - { - this (label, TRAILING); - setLabelFor(field); - } // CLabel - - - /** Mnemonic saved */ - private char m_savedMnemonic = 0; - - /** - * Common init - */ - private void init() - { - setFocusable (false); - setOpaque(false); - if (getToolTipText() == null) // force Tool Tip - setToolTipText(getText()); - } // init - - - /** - * Set Background - * @param bg background - */ - public void setBackground (Color bg) - { - if (bg.equals(getBackground())) - return; - super.setBackground(bg); - } // setBackground - - /** - * Set Font to Bold - * @param bold true bold false normal - */ - public void setFontBold (boolean bold) - { - Font font = getFont(); - if (bold != font.isBold()) - { - font = new Font (font.getName(), bold ? - Font.BOLD : Font.PLAIN, - font.getSize()); - setFont (font); - } - } // setFontBold - - /************************************************************************** - * Set label text - if it includes &, the next character is the Mnemonic - * @param mnemonicLabel Label containing Mnemonic - */ - public void setText (String mnemonicLabel) - { - String text = createMnemonic (mnemonicLabel); - super.setText (text); - if (text != null && getName() == null) - setName(text); - //workaround for focus accelerator issue - if (getLabelFor() != null && getLabelFor() instanceof JTextComponent) - { - if ( m_savedMnemonic > 0) - ((JTextComponent)getLabelFor()).setFocusAccelerator(m_savedMnemonic); - else - ((JTextComponent)getLabelFor()).setFocusAccelerator('\0'); - } - } // setText - - /** - * Create Mnemonics of text containing "&". - * Based on MS notation of &Help => H is Mnemonics - * @param text test with Mnemonics - * @return text w/o & - * @see JLabel#setLabelFor(java.awt.Component) - */ - private String createMnemonic(String text) - { - m_savedMnemonic = 0; - if (text == null) - return text; - int pos = text.indexOf('&'); - if (pos != -1) // We have a nemonic - { - char ch = text.charAt(pos+1); - if (ch != ' ') // &_ - is the & character - { - setDisplayedMnemonic(ch); - setSavedMnemonic(ch); - return text.substring(0, pos) + text.substring(pos+1); - } - } - return text; - } // createMnemonic - - /** - * Set ReadWrite - * @param rw enabled - */ - public void setReadWrite (boolean rw) - { - this.setEnabled(rw); - } // setReadWrite - - /** - * Set Label For - * @param c component - */ - public void setLabelFor (Component c) - { - //reset old if any - if (getLabelFor() != null && getLabelFor() instanceof JTextComponent) - { - ((JTextComponent)getLabelFor()).setFocusAccelerator('\0'); - } - super.setLabelFor (c); - if (c.getName() == null) - c.setName(getName()); - //workaround for focus accelerator issue - if (c instanceof JTextComponent) - { - if (m_savedMnemonic > 0) - { - ((JTextComponent)c).setFocusAccelerator(m_savedMnemonic); - } - } - } // setLabelFor - - - /** - * @return Returns the savedMnemonic. - */ - public char getSavedMnemonic () - { - return m_savedMnemonic; - } // getSavedMnemonic - - /** - * @param savedMnemonic The savedMnemonic to set. - */ - public void setSavedMnemonic (char savedMnemonic) - { - m_savedMnemonic = savedMnemonic; - } // getSavedMnemonic - -} // CLabel diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CMenuItem.java b/org.adempiere.ui.swing/src/org/compiere/swing/CMenuItem.java deleted file mode 100644 index 8d9af64037..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CMenuItem.java +++ /dev/null @@ -1,93 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import javax.swing.Action; -import javax.swing.Icon; -import javax.swing.JMenuItem; - -/** - * Adempiere Menu Item - * - * @author Jorg Janke - * @version $Id: CMenuItem.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CMenuItem extends JMenuItem -{ - - /** - * - */ - private static final long serialVersionUID = 5241542923170919340L; - - public CMenuItem () - { - super (); - } // CMenuItem - - public CMenuItem (Icon icon) - { - super (icon); - } // CMenuItem - - public CMenuItem (String text) - { - super (text); - } // CMenuItem - - public CMenuItem (Action a) - { - super (a); - } // CMenuItem - - public CMenuItem (String text, Icon icon) - { - super (text, icon); - } // CMenuItem - - public CMenuItem (String text, int mnemonic) - { - super (text, mnemonic); - } // CMenuItem - - /** - * Set Text - * @param text text - */ - public void setText (String text) - { - if (text == null) - { - super.setText(text); - return; - } - int pos = text.indexOf('&'); - if (pos != -1 && text.length() > pos) // We have a nemonic - creates ALT-_ - { - int mnemonic = text.toUpperCase().charAt(pos+1); - if (mnemonic != ' ') - { - setMnemonic(mnemonic); - text = text.substring(0, pos) + text.substring(pos+1); - } - } - super.setText (text); - if (getName() == null) - setName (text); - } // setText - -} // CMenuItem diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CPanel.java b/org.adempiere.ui.swing/src/org/compiere/swing/CPanel.java deleted file mode 100644 index e72be47ad2..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CPanel.java +++ /dev/null @@ -1,206 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Color; -import java.awt.LayoutManager; - -import javax.swing.JPanel; - -import org.adempiere.plaf.AdempiereLookAndFeel; -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.plaf.CompiereColor; -import org.compiere.plaf.CompiereLookAndFeel; - -/** - * Adempiere Panel supporting colored Backgrounds - * - * @author Jorg Janke - * @version $Id: CPanel.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CPanel extends JPanel -{ - /** - * - */ - private static final long serialVersionUID = 4153588317643163582L; - - - /** - * Creates a new AdempierePanel with the specified layout manager - * and buffering strategy. - * @param layout the LayoutManager to use - * @param isDoubleBuffered a boolean, true for double-buffering, which - * uses additional memory space to achieve fast, flicker-free updates - */ - public CPanel (LayoutManager layout, boolean isDoubleBuffered) - { - super (layout, isDoubleBuffered); - init(); - } // CPanel - - /** - * Create a new buffered CPanel with the specified layout manager - * @param layout the LayoutManager to use - */ - public CPanel (LayoutManager layout) - { - super (layout); - init(); - } // CPanel - - /** - * Creates a new CPanel with FlowLayout - * and the specified buffering strategy. - * If isDoubleBuffered is true, the CPanel - * will use a double buffer. - * @param isDoubleBuffered a boolean, true for double-buffering, which - * uses additional memory space to achieve fast, flicker-free updates - */ - public CPanel (boolean isDoubleBuffered) - { - super (isDoubleBuffered); - init(); - } // CPanel - - /** - * Creates a new CPanel with a double buffer and a flow layout. - */ - public CPanel() - { - super (); - init(); - } // CPanel - - /** - * Creates a new CPanel with a double buffer and a flow layout. - * @param bc Initial Background Color - */ - public CPanel(CompiereColor bc) - { - this (); - init(); - setBackgroundColor (bc); - } // CPanel - - /** - * Common init. - * Adempiere backround requires that for the base, background is set explictily. - * The additional panels should be transparent. - */ - private void init() - { - setOpaque(false); // transparent - } // init - - - /************************************************************************** - * Set Background - ignored by UI - - * @param bg ignored - */ - public void setBackground (Color bg) - { - if (bg.equals(getBackground())) - return; - super.setBackground (bg); - // ignore calls from javax.swing.LookAndFeel.installColors(LookAndFeel.java:61) - //if (!Trace.getCallerClass(1).startsWith("javax")) - setBackgroundColor (new CompiereColor(bg)); - } // setBackground - - /** - * Set Background - * @param bg AdempiereColor for Background, if null set standard background - */ - public void setBackgroundColor (CompiereColor bg) - { - if (bg == null) - bg = new CompiereColor(AdempierePLAF.getFormBackground()); - setOpaque(true); // not transparent - putClientProperty(CompiereLookAndFeel.BACKGROUND, bg); - super.setBackground (bg.getFlatColor()); - } // setBackground - - /** - * Get Background - * @return Color for Background - */ - public CompiereColor getBackgroundColor () - { - try - { - return (CompiereColor)getClientProperty(CompiereLookAndFeel.BACKGROUND); - } - catch (Exception e) - { - System.err.println("CPanel - ClientProperty: " + e.getMessage()); - } - return null; - } // getBackgroundColor - - /*************************************************************************/ - - /** - * Set Tab Hierarchy Level. - * Has only effect, if tabs are on left or right side - * - * @param level - */ - public void setTabLevel (int level) - { - if (level == 0) - putClientProperty(AdempiereLookAndFeel.TABLEVEL, null); - else - putClientProperty(AdempiereLookAndFeel.TABLEVEL, Integer.valueOf(level)); - } // setTabLevel - - /** - * Get Tab Hierarchy Level - * @return Tab Level - */ - public int getTabLevel() - { - try - { - Integer ll = (Integer)getClientProperty(CompiereLookAndFeel.TABLEVEL); - if (ll != null) - return ll.intValue(); - } - catch (Exception e) - { - System.err.println("ClientProperty: " + e.getMessage()); - } - return 0; - } // getTabLevel - - - /************************************************************************** - * String representation - * @return String representation - */ - public String toString() - { - StringBuilder sb = new StringBuilder ("CPanel ["); - sb.append(super.toString()); - CompiereColor bg = getBackgroundColor(); - if (bg != null) - sb.append(bg.toString()); - sb.append("]"); - return sb.toString(); - } // toString - -} // CPanel diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CPassword.java b/org.adempiere.ui.swing/src/org/compiere/swing/CPassword.java deleted file mode 100644 index d6d7536ee9..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CPassword.java +++ /dev/null @@ -1,219 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Color; - -import javax.swing.JPasswordField; -import javax.swing.text.Document; - -import org.adempiere.plaf.AdempierePLAF; - -/** - * Password Field - * - * @author Jorg Janke - * @version $Id: CPassword.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CPassword extends JPasswordField implements CEditor -{ - /** - * - */ - private static final long serialVersionUID = 6516269177469866775L; - - /** - * Constructs a new JPasswordField, - * with a default document, null starting - * text string, and 0 column width. - */ - public CPassword() - { - super(); - init(); - } - - /** - * Constructs a new JPasswordField initialized - * with the specified text. The document model is set to the - * default, and the number of columns to 0. - * - * @param text the text to be displayed, null if none - */ - public CPassword (String text) - { - super (text); - init(); - } - - /** - * Constructs a new empty JPasswordField with the specified - * number of columns. A default model is created, and the initial string - * is set to null. - * - * @param columns the number of columns >= 0 - */ - public CPassword (int columns) - { - super (columns); - init(); - } - - /** - * Constructs a new JPasswordField initialized with - * the specified text and columns. The document model is set to - * the default. - * - * @param text the text to be displayed, null if none - * @param columns the number of columns >= 0 - */ - public CPassword (String text, int columns) - { - super (text,columns); - init(); - } - - /** - * Constructs a new JPasswordField that uses the - * given text storage model and the given number of columns. - * This is the constructor through which the other constructors feed. - * The echo character is set to '*'. If the document model is - * null, a default one will be created. - * - * @param doc the text storage to use - * @param txt the text to be displayed, null if none - * @param columns the number of columns to use to calculate - * the preferred width >= 0; if columns is set to zero, the - * preferred width will be whatever naturally results from - * the component implementation - */ - public CPassword (Document doc, String txt, int columns) - { - super (doc, txt, columns); - init(); - } - - /** - * Common Init - */ - private void init() - { - } // init - - /*************************************************************************/ - - /** Mandatory (default false) */ - private boolean m_mandatory = false; - - /** - * Set Editor Mandatory - * @param mandatory true, if you have to enter data - */ - public void setMandatory (boolean mandatory) - { - m_mandatory = mandatory; - setBackground(false); - } // setMandatory - - /** - * Is Field mandatory - * @return true, if mandatory - */ - public boolean isMandatory() - { - return m_mandatory; - } // isMandatory - - /** - * Enable Editor - * @param rw true, if you can enter/select data - */ - public void setReadWrite (boolean rw) - { - if (super.isEditable() != rw) - super.setEditable (rw); - setBackground(false); - } // setEditable - - /** - * Is it possible to edit - * @return true, if editable - */ - public boolean isReadWrite() - { - return super.isEditable(); - } // isReadWrite - - /** - * Set Background based on editable / mandatory / error - * @param error if true, set background to error color, otherwise mandatory/editable - */ - public void setBackground (boolean error) - { - if (error) - setBackground(AdempierePLAF.getFieldBackground_Error()); - else if (!isReadWrite()) - setBackground(AdempierePLAF.getFieldBackground_Inactive()); - else if (m_mandatory) - setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - else - setBackground(AdempierePLAF.getFieldBackground_Normal()); - } // setBackground - - /** - * Set Background - * @param bg - */ - public void setBackground (Color bg) - { - if (bg.equals(getBackground())) - return; - super.setBackground(bg); - } // setBackground - - /** - * Set Editor to value - * @param value value of the editor - */ - public void setValue (Object value) - { - if (value == null) - setText(""); - else - setText(value.toString()); - } // setValue - - /** - * Return Editor value - * @return current value - */ - public Object getValue() - { - return new String(super.getPassword()); - } // getValue - - /** - * Return Display Value - * @return displayed String value - */ - public String getDisplay() - { - return new String(super.getPassword()); - } // getDisplay - - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CScrollPane.java b/org.adempiere.ui.swing/src/org/compiere/swing/CScrollPane.java deleted file mode 100644 index 8fecda7dd3..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CScrollPane.java +++ /dev/null @@ -1,94 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Component; - -import javax.swing.JScrollPane; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.plaf.CompiereColor; -import org.compiere.plaf.CompiereLookAndFeel; - -/** - * Adempiere Srcoll Pane. - * - * @author Jorg Janke - * @version $Id: CScrollPane.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CScrollPane extends JScrollPane -{ - - /** - * - */ - private static final long serialVersionUID = -2941967111871448295L; - - - /** - * Adempiere ScollPane - */ - public CScrollPane () - { - this (null, VERTICAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_AS_NEEDED); - } // CScollPane - - /** - * Adempiere ScollPane - * @param vsbPolicy vertical policy - * @param hsbPolicy horizontal policy - */ - public CScrollPane (int vsbPolicy, int hsbPolicy) - { - this (null, vsbPolicy, hsbPolicy); - } // CScollPane - - /** - * Adempiere ScollPane - * @param view view - */ - public CScrollPane (Component view) - { - this (view, VERTICAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_AS_NEEDED); - } // CScollPane - - /** - * Adempiere ScollPane - * @param view view - * @param vsbPolicy vertical policy - * @param hsbPolicy horizontal policy - */ - public CScrollPane (Component view, int vsbPolicy, int hsbPolicy) - { - super (view, vsbPolicy, hsbPolicy); - setOpaque(false); - getViewport().setOpaque(false); - } // CScollPane - - - /** - * Set Background - * @param bg AdempiereColor for Background, if null set standard background - */ - public void setBackgroundColor (CompiereColor bg) - { - if (bg == null) - bg = new CompiereColor(AdempierePLAF.getFormBackground()); - putClientProperty(CompiereLookAndFeel.BACKGROUND, bg); - } // setBackground - -} // CScollPane diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CTabbedPane.java b/org.adempiere.ui.swing/src/org/compiere/swing/CTabbedPane.java deleted file mode 100644 index 661c9f5240..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CTabbedPane.java +++ /dev/null @@ -1,382 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Color; -import java.awt.Component; -import java.awt.event.ActionEvent; -import java.awt.event.KeyEvent; -import java.util.ArrayList; - -import javax.swing.Icon; -import javax.swing.JPanel; -import javax.swing.JTabbedPane; -import javax.swing.KeyStroke; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.plaf.CompiereColor; -import org.compiere.plaf.CompiereLookAndFeel; -import org.jdesktop.swingx.UIAction; - -/** - * Adempiere Color Tabbed Pane - * - * @author Jorg Janke - * @version $Id: CTabbedPane.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CTabbedPane extends JTabbedPane -{ - /** - * - */ - private static final long serialVersionUID = 5845265820245543812L; - - - /** - * Creates an empty TabbedPane with a default - * tab placement of JTabbedPane.TOP and default - * tab layout policy of JTabbedPane.WRAP_TAB_LAYOUT. - */ - public CTabbedPane() - { - super(); - init(); - } // CTabbedPane - - /** - * Creates an empty TabbedPane with the specified tab placement - * of either: JTabbedPane.TOP, JTabbedPane.BOTTOM, - * JTabbedPane.LEFT, or JTabbedPane.RIGHT, and a - * default tab layout policy of JTabbedPane.WRAP_TAB_LAYOUT. - * - * @param tabPlacement the placement for the tabs relative to the content - */ - public CTabbedPane(int tabPlacement) - { - super(tabPlacement); - init(); - } // CTabbedPane - - /** - * Creates an empty TabbedPane with the specified tab placement - * and tab layout policy. Tab placement may be either: - * JTabbedPane.TOP, JTabbedPane.BOTTOM, - * JTabbedPane.LEFT, or JTabbedPane.RIGHT. - * Tab layout policy may be either: JTabbedPane.WRAP_TAB_LAYOUT - * or JTabbedPane.SCROLL_TAB_LAYOUT. - * - * @param tabPlacement the placement for the tabs relative to the content - * @param tabLayoutPolicy the policy for laying out tabs when all tabs will not fit on one run - * @exception IllegalArgumentException if tab placement or tab layout policy are not - * one of the above supported values - */ - public CTabbedPane(int tabPlacement, int tabLayoutPolicy) - { - super (tabPlacement, tabLayoutPolicy); - init(); - } // CTabbedPane - - /** - * Creates an empty TabbedPane with a defaults and Color - * @param bg Color - */ - public CTabbedPane (CompiereColor bg) - { - super(); - init(); - setBackgroundColor (bg); - } // CTabbedPane - - /** - * Common Init - */ - private void init() - { - } // init - - - /************************************************************************** - * Set Background - ignored by UI - - * @param bg ignored - */ - public void setBackground (Color bg) - { - if (bg.equals(getBackground())) - return; - super.setBackground (bg); - setBackgroundColor (new CompiereColor(bg)); - } // setBackground - - /** - * Set Standard Background - */ - public void setBackgroundColor () - { - setBackgroundColor (null); - } // setBackground - - /** - * Set Background - * @param bg AdempiereColor for Background, if null set standard background - */ - public void setBackgroundColor (CompiereColor bg) - { - if (bg == null) - bg = new CompiereColor(AdempierePLAF.getFormBackground()); - putClientProperty(CompiereLookAndFeel.BACKGROUND, bg); - super.setBackground (bg.getFlatColor()); - // - repaint(); - } // setBackground - - /** - * Get Background - * @return Color for Background - */ - public CompiereColor getBackgroundColor () - { - try - { - return (CompiereColor)getClientProperty(CompiereLookAndFeel.BACKGROUND); - } - catch (Exception e) - { - System.err.println("ClientProperty: " + e.getMessage()); - } - return null; - } // getBackgroundColor - - - /************************************************************************** - * Insert tab. - * If the component is a JPanel, the backround is set to the default - * AdempiereColor (and Opaque) if nothing was defined. - * Redquired as otherwise a gray background would be pained. - *

    - * Inserts a component, at index, - * represented by a title and/or icon, - * either of which may be null. If icon - * is non-null and it implements - * ImageIcon a corresponding disabled icon will automatically - * be created and set on the tabbedpane. - * Uses java.util.Vector internally, see insertElementAt - * for details of insertion conventions. - * - * @param text the title with Mnemonic to be displayed in this tab - * @param icon the icon to be displayed in this tab - * @param component The component to be displayed when this tab is clicked. - * @param tip the tooltip to be displayed for this tab - * @param index the position to insert this new tab - */ - public void insertTab (String text, Icon icon, Component component, String tip, int index) - { - String title = text; - if (!title.startsWith("")) - { - int pos = title.indexOf('&'); - if (pos != -1) - title = title.substring(0, pos) + title.substring(pos+1); - } - // Enforce Tool Tip - if (tip == null || tip.length() == 0) - tip = title; - super.insertTab (title, icon, component, tip, index); - // Set component background - if (component instanceof JPanel) - { - JPanel p = (JPanel)component; - if (p.getClientProperty(CompiereLookAndFeel.BACKGROUND) == null) - { - //AdempiereColor.setBackground(p); - //p.setOpaque(true); - } - } - // Set first - if (index == 0) - getActionMap().put(ACTION_SELECT, s_action); - // - if (!setMnemonicAt(index, text)) - { // Only one - set direct - if (index < 9) - setMnemonicAt(index, '1'+index); - else if (index == 9) - setMnemonicAt(index, '0'); - } - else // additional ALT-1..0 - { - if (index < 9) - getInputMap(WHEN_IN_FOCUSED_WINDOW) - .put(KeyStroke.getKeyStroke(KeyEvent.VK_1+index, ActionEvent.ALT_MASK), ACTION_SELECT); - else if (index == 9) - getInputMap(WHEN_IN_FOCUSED_WINDOW) - .put(KeyStroke.getKeyStroke(KeyEvent.VK_0, ActionEvent.ALT_MASK), ACTION_SELECT); - } - // - } // insertTab - - /** - * Set Title At - * @param index index - * @param text title with opt Mnemonic - */ - public void setTitleAt (int index, String text) - { - String title = text; - if (!title.startsWith("")) - { - int pos = title.indexOf('&'); - if (pos != -1) // We have a nemonic - creates ALT-_ - title = title.substring(0, pos) + title.substring(pos+1); - } - super.setTitleAt (index, title); - // setMnemonicAt(index, text); - } // setTitleAt - - - /** - * Set Mnemonic for Index based on text - * @param index for index - * @param text text - */ - public boolean setMnemonicAt (int index, String text) - { - // logistics - remove old - while (m_mnemonic.size() < index+1) - m_mnemonic.add((char)0); - char keyCode = m_mnemonic.get(index); - if (keyCode != 0) - getInputMap(WHEN_IN_FOCUSED_WINDOW) - .remove(KeyStroke.getKeyStroke(keyCode, ActionEvent.ALT_MASK)); - m_mnemonic.set(index, (char)0); - // - if (!text.startsWith("")) - { - int pos = text.indexOf('&'); - if (pos != -1 && text.length() > pos) // We have a nemonic - creates ALT-_ - { - keyCode = text.toUpperCase().charAt(pos+1); - if (keyCode != ' ') - { - setMnemonicAt(index, keyCode); - m_mnemonic.set(index, keyCode); - return true; - } - } - } - /** - keyCode = text.toUpperCase().charAt(0); - if (m_mnemonic.contains(keyCode)) - { - keyCode = 0; - // Beginning new word - int pos = text.indexOf(' '); - while (pos != -1 && text.length() > pos) - { - char c = text.toUpperCase().charAt(pos+1); - if (Character.isLetterOrDigit(c) && !m_mnemonic.contains(c)) - { - keyCode = c; - break; - } - pos = text.indexOf(' ', pos+1); - } - // Any character - if (keyCode == 0) - { - for (int i = 1; i < text.length(); i++) - { - char c = text.toUpperCase().charAt(i); - if (Character.isLetterOrDigit(c) && !m_mnemonic.contains(c)) - { - keyCode = c; - break; - } - } - } - // First character fallback - // if (mnemonic == 0) - // mnemonic = text.toUpperCase().charAt(0); - } - if (keyCode != 0) - { - setMnemonicAt(index, keyCode); - m_mnemonic.set(index, keyCode); - } - **/ - return false; - } // setMnemonicAt - - /** Used Mnemonics */ - private ArrayList m_mnemonic = new ArrayList(10); - - - /** - * String representation - * @return String representation - */ - public String toString() - { - StringBuilder sb = new StringBuilder ("CTabbedPane ["); - sb.append(super.toString()); - CompiereColor bg = getBackgroundColor(); - if (bg != null) - sb.append(bg.toString()); - sb.append("]"); - return sb.toString(); - } // toString - - /** Select Action Text */ - private static final String ACTION_SELECT = "CAS"; - /** Select Action */ - private static CTAction s_action = new CTAction(ACTION_SELECT); - - /** - * Select Action - * - * @author Jorg Janke - * @version $Id: CTabbedPane.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ - private static class CTAction extends UIAction - { - /** - * Constructor - */ - public CTAction (String actionName) - { - super (actionName); - } // Action - - public void actionPerformed (ActionEvent e) - { - String key = getName(); - if (!key.equals(ACTION_SELECT) - || !(e.getSource() instanceof CTabbedPane)) - return; - CTabbedPane pane = (CTabbedPane)e.getSource(); - String command = e.getActionCommand(); - if (command == null || command.length() != 1) - return; - int index = command.charAt(0)-'1'; - if (index > -1 && index < pane.getTabCount()) - pane.setSelectedIndex(index); - else - System.out.println("Action: " + e); - } // actionPerformed - - } // Action - -} // CTabbedPane diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CTable.java b/org.adempiere.ui.swing/src/org/compiere/swing/CTable.java deleted file mode 100644 index 1d8103e56d..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CTable.java +++ /dev/null @@ -1,740 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Component; -import java.awt.Container; -import java.awt.Font; -import java.awt.event.HierarchyEvent; -import java.awt.event.HierarchyListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Vector; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.swing.JComponent; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.JViewport; -import javax.swing.ListSelectionModel; -import javax.swing.ScrollPaneConstants; -import javax.swing.event.ChangeEvent; -import javax.swing.event.TableModelEvent; -import javax.swing.table.DefaultTableCellRenderer; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableCellEditor; -import javax.swing.table.TableCellRenderer; -import javax.swing.table.TableColumn; -import javax.swing.table.TableModel; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.util.MSort; -import org.jdesktop.swingx.icon.ColumnControlIcon; - -/** - * Model Independent enhanced JTable. - * Provides sizing and sorting. - * - * @author Jorg Janke - * @version $Id: CTable.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - BF [ 1585369 ], FR [ 1753943 ] - */ -public class CTable extends JTable -{ - /** - * - */ - private static final long serialVersionUID = 975975420639030844L; - - /** - * Default Constructor - */ - public CTable() - { - super(new DefaultTableModel()); - setColumnSelectionAllowed(false); - setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); // teo_sarca - FR [ 1753943 ] - setAutoResizeMode(JTable.AUTO_RESIZE_OFF); - getTableHeader().addMouseListener(new CTableMouseListener()); - setSurrendersFocusOnKeystroke(true); - //Default row height too narrow - setRowHeight(getFont().getSize() + 8); - - setColumnControlVisible(true); - addHierarchyListener(createHierarchyListener()); - } // CTable - - private HierarchyListener createHierarchyListener() { - return new HierarchyListener() { - - public void hierarchyChanged(HierarchyEvent e) { - if (e.getChangeFlags() == HierarchyEvent.PARENT_CHANGED) - configureColumnControl(); - } - - }; - } - - /** Last model index sorted */ - protected int p_lastSortIndex = -1; - /** Sort direction */ - protected boolean p_asc = true; - - /** Sizing: making sure it fits in a column */ - private final int SLACK = 15; - /** Sizing: max size in pt */ - private final int MAXSIZE = 250; - /** Model Index of Key Column */ - protected int p_keyColumnIndex = -1; - /** state variable to indicate sorting in progress **/ - protected boolean sorting; - - /** Logger */ - private static Logger log = Logger.getLogger(CTable.class.getName()); - - /** - * ScrollPane's original vertical scroll policy. If the column control is - * visible the policy is set to ALWAYS. - */ - private int verticalScrollPolicy; - - /** - * Flag to indicate if the column control is visible. - */ - private boolean columnControlVisible = false; - - /** - * The component used a column control in the upper trailing corner of - * an enclosing JScrollPane. - */ - private JComponent columnControlButton; - - private List hiddenColumns = new ArrayList(); - - private Map columnAttributesMap - = new HashMap(); - - /** - * Set Model index of Key Column. - * Used for identifying previous selected row after fort complete to set as selected row. - * If not set, column 0 is used. - * @param keyColumnIndex model index - */ - public void setKeyColumnIndex (int keyColumnIndex) - { - p_keyColumnIndex = keyColumnIndex; - } // setKeyColumnIndex - - /** - * Get Model index of Key Column - * @return model index - */ - public int getKeyColumnIndex() - { - return p_keyColumnIndex; - } // getKeyColumnIndex - - /** - * Get Current Row Key Column Value - * @return value or null - */ - public Object getSelectedKeyColumnValue() - { - int row = getSelectedRow(); - if (row != -1 && p_keyColumnIndex != -1) - return getModel().getValueAt(row, p_keyColumnIndex); - return null; - } // getKeyColumnValue - - /** - * Get Selected Value or null - * @return value - */ - public Object getSelectedValue() - { - int row = getSelectedRow(); - int col = getSelectedColumn(); - if (row == -1 || col == -1) - return null; - return getValueAt(row, col); - } // getSelectedValue - - /** - * Stop Table Editors and remove focus - * @param saveValue save value - */ - public void stopEditor (boolean saveValue) - { - // MultiRow - remove editors - ChangeEvent ce = new ChangeEvent(this); - if (saveValue) - editingStopped(ce); - else - editingCanceled(ce); - // - if (getInputContext() != null) - getInputContext().endComposition(); - // change focus to next - transferFocus(); - } // stopEditor - - - /************************************************************************** - * Size Columns. - * @param useColumnIdentifier if false uses plain content - - * otherwise uses Column Identifier to indicate displayed columns - */ - public void autoSize (boolean useColumnIdentifier) - { - TableModel model = this.getModel(); - int size = model.getColumnCount(); - // for all columns - for (int c = 0; c < size; c++) - { - TableColumn column = getColumnModel().getColumn(c); - // Not displayed columns - if (useColumnIdentifier - && (column.getIdentifier() == null - || column.getMaxWidth() == 0 - || column.getIdentifier().toString().length() == 0)) - continue; - - int width = 0; - // Header - TableCellRenderer renderer = column.getHeaderRenderer(); - if (renderer == null) - renderer = new DefaultTableCellRenderer(); - Component comp = null; - if (renderer != null) - comp = renderer.getTableCellRendererComponent - (this, column.getHeaderValue(), false, false, 0, 0); - // - if (comp != null) - { - width = comp.getPreferredSize().width; - width = Math.max(width, comp.getWidth()); - - // Cells - int col = column.getModelIndex(); - int maxRow = Math.min(20, getRowCount()); - try - { - for (int row = 0; row < maxRow; row++) - { - renderer = getCellRenderer(row, col); - comp = renderer.getTableCellRendererComponent - (this, getValueAt(row, col), false, false, row, col); - if (comp != null) - { - int rowWidth = comp.getPreferredSize().width; - width = Math.max(width, rowWidth); - } - } - } - catch (Exception e) - { - log.log(Level.SEVERE, column.getIdentifier().toString(), e); - } - // Width not greater than 250 - width = Math.min(MAXSIZE, width + SLACK); - } - // - column.setPreferredWidth(width); - } // for all columns - } // autoSize - - public void packColumn(TableColumn column) - { - int width = 0; - // Header - TableCellRenderer renderer = column.getHeaderRenderer(); - if (renderer == null) - renderer = new DefaultTableCellRenderer(); - Component comp = null; - if (renderer != null) - comp = renderer.getTableCellRendererComponent - (this, column.getHeaderValue(), false, false, 0, 0); - // - if (comp != null) - { - width = comp.getPreferredSize().width; - width = Math.max(width, comp.getWidth()); - - // Cells - int col = column.getModelIndex(); - int maxRow = Math.min(20, getRowCount()); - try - { - for (int row = 0; row < maxRow; row++) - { - renderer = getCellRenderer(row, col); - comp = renderer.getTableCellRendererComponent - (this, getValueAt(row, col), false, false, row, col); - if (comp != null) - { - int rowWidth = comp.getPreferredSize().width; - width = Math.max(width, rowWidth); - } - } - } - catch (Exception e) - { - log.log(Level.SEVERE, column.getIdentifier().toString(), e); - } - // Width not greater than 250 - width = Math.min(MAXSIZE, width + SLACK); - } - // - column.setPreferredWidth(width); - } - - - /** - * Sort Table - * @param modelColumnIndex model column sort index - */ - @SuppressWarnings("unchecked") - protected void sort (final int modelColumnIndex) - { - int rows = getRowCount(); - if (rows == 0) - return; - - sorting = true; - - // other column - if (modelColumnIndex != p_lastSortIndex) - p_asc = true; - else - p_asc = !p_asc; - p_lastSortIndex = modelColumnIndex; - // - if (log.isLoggable(Level.CONFIG)) log.config("#" + modelColumnIndex + " - rows=" + rows + ", asc=" + p_asc); - - // Selection - Object selected = null; - int selRow = getSelectedRow(); - int selCol = p_keyColumnIndex == -1 ? 0 : p_keyColumnIndex; // used to identify current row - if (getSelectedRow() >= 0) - selected = getValueAt(selRow, selCol); - - // Prepare sorting - DefaultTableModel model = (DefaultTableModel)getModel(); - final MSort sort = new MSort(0, null); - sort.setSortAsc(p_asc); - /* teo_sarca: commented: [ 1585369 ] CTable sorting is TOO LAZY * - // while something to sort - sorting: - while (true) - { - // Create sortList - ArrayList sortList = new ArrayList(rows); - // fill with data entity - for (int i = 0; i < rows; i++) - { - Object value = model.getValueAt(i, modelColumnIndex); - sortList.add(new MSort(i, value)); - } - // sort list it - Collections.sort(sortList, sort); - // move out of sequence row - for (int i = 0; i < rows; i++) - { - int index = ((MSort)sortList.get(i)).index; - if (i != index) - { - // log.config( "move " + i + " to " + index); - model.moveRow(i,i, index); - continue sorting; - } - } - // we are done - // log.config("done"); - break; - } // while something to sort - */ - // teo_sarca: [ 1585369 ] CTable sorting is TOO LAZY - Collections.sort(model.getDataVector(), new Comparator() { - public int compare(Object o1, Object o2) { - Object item1 = ((Vector)o1).get(modelColumnIndex); - Object item2 = ((Vector)o2).get(modelColumnIndex); - return sort.compare(item1, item2); - } - }); - - // selection - clearSelection(); - if (selected != null) - { - for (int r = 0; r < rows; r++) - { - if (selected.equals(getValueAt(r, selCol))) - { - setRowSelectionInterval(r,r); - scrollRectToVisible(getCellRect(r, modelColumnIndex, true)); // teo_sarca: bug fix [ 1585369 ] - break; - } - } - } // selected != null - - sorting = false; - } // sort - - - @Override - public void tableChanged(TableModelEvent e) { - if (e != null && e.getFirstRow() == 0 && e.getLastRow() == Integer.MAX_VALUE && - e.getColumn() == TableModelEvent.ALL_COLUMNS && e.getType() == TableModelEvent.UPDATE) - { - if (!sorting) - { - //reset sort state after refresh - p_asc = true; - p_lastSortIndex = -1; - } - } - else - { - if (getRowCount() == 0) - { - //reset sort state after clear - p_asc = true; - p_lastSortIndex = -1; - } - } - - super.tableChanged(e); - } - - /** - * String Representation - * @return info - */ - public String toString() - { - return new StringBuffer("CTable[").append(getModel()).append("]").toString(); - } // toString - - - /************************************************************************** - * MouseListener - */ - class CTableMouseListener extends MouseAdapter - { - private TableColumn cachedResizingColumn = null; - - /** - * Constructor - */ - public CTableMouseListener() - { - super(); - } // CTableMouseListener - - /** - * Mouse clicked - * @param e event - */ - public void mouseClicked (MouseEvent e) - { - if (isInResizeRegion(e)) - { - if (e.getClickCount() == 2) - packColumn(cachedResizingColumn); - uncacheResizingColumn(); - } - else - { - int vc = getColumnModel().getColumnIndexAtX(e.getX()); - // log.info( "Sort " + vc + "=" + getColumnModel().getColumn(vc).getHeaderValue()); - int mc = convertColumnIndexToModel(vc); - TableColumn column = getTableHeader().getResizingColumn(); - if (column != null) return; - sort(mc); - } - } - - public void mouseReleased(MouseEvent e) { - cacheResizingColumn(e); - } - - public void mousePressed(MouseEvent e) { - cacheResizingColumn(e); - } - - private void cacheResizingColumn(MouseEvent e) { - TableColumn column = getTableHeader().getResizingColumn(); - if (column != null) { - cachedResizingColumn = column; - } - } - - private void uncacheResizingColumn() { - cachedResizingColumn = null; - } - - private boolean isInResizeRegion(MouseEvent e) { - return cachedResizingColumn != null; // inResize; - } - - public void mouseEntered(MouseEvent e) { - } - - public void mouseExited(MouseEvent e) { - uncacheResizingColumn(); - } - - public void mouseDragged(MouseEvent e) { - uncacheResizingColumn(); - } - - } // CTableMouseListener - - - @Override - public void setFont(Font font) { - super.setFont(font); - //Update row height - setRowHeight(getFont().getSize() + 8); - } - - /** - * @return column index - */ - public int getSortColumn() { - return p_lastSortIndex; - } - - /** - * @return boolean - */ - public boolean isSortAscending() { - return p_asc; - } - - /** - * Returns the column control visible property. - *

    - * - * @return boolean to indicate whether the column control is visible. - * @see #setColumnControlVisible(boolean) - * @see #setColumnControl(JComponent) - */ - public boolean isColumnControlVisible() { - return columnControlVisible; - } - - /** - * Sets the column control visible property. If true and - * JXTable is contained in a JScrollPane, the - * table adds the column control to the trailing corner of the scroll pane. - *

    - * - * Note: if the table is not inside a JScrollPane the column - * control is not shown even if this returns true. In this case it's the - * responsibility of the client code to actually show it. - *

    - * - * The default value is false. - * - * @param visible boolean to indicate if the column control should be shown - * @see #isColumnControlVisible() - * @see #setColumnControl(JComponent) - * - */ - public void setColumnControlVisible(boolean visible) { - boolean old = isColumnControlVisible(); - this.columnControlVisible = visible; - if (old != isColumnControlVisible()) { - configureColumnControl(); - firePropertyChange("columnControlVisible", old, !old); - } - } - - /** - * Returns the component used as column control. Lazily creates the - * control to the default if it is null. - * - * @return component for column control, guaranteed to be != null. - * @see #setColumnControl(JComponent) - * @see #createDefaultColumnControl() - */ - public JComponent getColumnControl() { - if (columnControlButton == null) { - columnControlButton = createDefaultColumnControl(); - } - return columnControlButton; - } - - /** - * Creates the default column control used by this table. - * This implementation returns a ColumnControlButton configured - * with default ColumnControlIcon. - * - * @return the default component used as column control. - * @see #setColumnControl(JComponent) - * @see org.jdesktop.swingx.table.ColumnControlButton - * @see org.jdesktop.swingx.icon.ColumnControlIcon - */ - protected JComponent createDefaultColumnControl() { - return new CColumnControlButton(this, new ColumnControlIcon()); - } - - /** - * Configures the upper trailing corner of an enclosing - * JScrollPane. - * - * Adds/removes the ColumnControl depending on the - * columnControlVisible property.

    - * - * @see #setColumnControlVisible(boolean) - * @see #setColumnControl(JComponent) - */ - protected void configureColumnControl() { - Container p = getParent(); - if (p instanceof JViewport) { - Container gp = p.getParent(); - if (gp instanceof JScrollPane) { - JScrollPane scrollPane = (JScrollPane) gp; - // Make certain we are the viewPort's view and not, for - // example, the rowHeaderView of the scrollPane - - // an implementor of fixed columns might do this. - JViewport viewport = scrollPane.getViewport(); - if (viewport == null || viewport.getView() != this) { - return; - } - if (isColumnControlVisible()) { - verticalScrollPolicy = scrollPane - .getVerticalScrollBarPolicy(); - scrollPane.setCorner(JScrollPane.UPPER_TRAILING_CORNER, - getColumnControl()); - - scrollPane - .setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); - } else { - if (verticalScrollPolicy != 0) { - // Fix #155-swingx: reset only if we had force always before - // PENDING: JW - doesn't cope with dynamically changing the policy - // shouldn't be much of a problem because doesn't happen too often?? - scrollPane.setVerticalScrollBarPolicy(verticalScrollPolicy); - } - try { - scrollPane.setCorner(JScrollPane.UPPER_TRAILING_CORNER, - null); - } catch (Exception ex) { - // Ignore spurious exception thrown by JScrollPane. This - // is a Swing bug! - } - - } - } - } - } - - /** - * - * @param column - * @return boolean - */ - public boolean isColumnVisible(TableColumn column) - { - return !hiddenColumns.contains(column); - } - - /** - * Hide or show column - * @param column - * @param visible - */ - public void setColumnVisibility(TableColumn column, boolean visible) - { - if (visible) - { - if (isColumnVisible(column)) return; - ColumnAttributes attributes = columnAttributesMap.get(column); - if (attributes == null) return; - - column.setCellEditor(attributes.cellEditor); - column.setCellRenderer(attributes.cellRenderer); - column.setMinWidth(attributes.minWidth); - column.setMaxWidth(attributes.maxWidth); - column.setPreferredWidth(attributes.preferredWidth); - columnAttributesMap.remove(column); - hiddenColumns.remove(column); - } - else - { - if (!isColumnVisible(column)) return; - - ColumnAttributes attributes = new ColumnAttributes(); - attributes.cellEditor = column.getCellEditor(); - attributes.cellRenderer = column.getCellRenderer(); - attributes.minWidth = column.getMinWidth(); - attributes.maxWidth = column.getMaxWidth(); - attributes.preferredWidth = column.getPreferredWidth(); - columnAttributesMap.put(column, attributes); - - TableCellNone h = new TableCellNone(column.getIdentifier() != null ? - column.getIdentifier().toString() : column.getHeaderValue().toString()); - column.setCellEditor(h); - column.setCellRenderer(h); - column.setMinWidth(0); - column.setMaxWidth(0); - column.setPreferredWidth(0); - - hiddenColumns.add(column); - } - } - - public Component prepareRenderer(TableCellRenderer renderer, int rowIndex, - int vColIndex) { - Component c = super.prepareRenderer(renderer, rowIndex, vColIndex); - if (c==null) return c; - if (!this.isCellEditable(rowIndex, vColIndex) || isCellSelected(rowIndex, vColIndex)) - return c; - if (rowIndex % 2 == 0) { - c.setBackground(AdempierePLAF.getFieldBackground_Selected()); - } else { - // If not shaded, match the table's background - c.setBackground(getBackground()); - } - return c; - } - - class ColumnAttributes { - protected TableCellEditor cellEditor; - - protected TableCellRenderer cellRenderer; - - protected Object headerValue; - - protected int minWidth; - - protected int maxWidth; - - protected int preferredWidth; - } - -} // CTable diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CTextArea.java b/org.adempiere.ui.swing/src/org/compiere/swing/CTextArea.java deleted file mode 100644 index c63d703333..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CTextArea.java +++ /dev/null @@ -1,528 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Color; -import java.awt.Insets; -import java.awt.KeyboardFocusManager; -import java.awt.event.ActionEvent; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.InputEvent; -import java.awt.event.InputMethodListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.event.MouseListener; -import java.awt.im.InputMethodRequests; - -import javax.swing.AbstractAction; -import javax.swing.ActionMap; -import javax.swing.InputMap; -import javax.swing.InputVerifier; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; -import javax.swing.KeyStroke; -import javax.swing.text.DefaultEditorKit; -import javax.swing.text.Document; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.model.MSysConfig; -import org.compiere.util.Env; - -/** - * Adempiere TextArea - A ScrollPane with a JTextArea. - * Manages visibility, opaque and color consistently - * - * @author Jorg Janke - * @version $Id: CTextArea.java,v 1.3 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CTextArea extends JScrollPane - implements CEditor -{ - /** - * - */ - private static final long serialVersionUID = 6208738910767859872L; - - // IDEMPIERE-320 - private static final String FIRE_CHANGE = "fire-change"; - - /** - * Constructs a new TextArea. A default model is set, the initial string - * is null, and rows/columns are set to 0. - */ - public CTextArea() - { - this (new JTextArea()); - } // CText - - /** - * Constructs a new TextArea with the specified text displayed. - * A default model is created and rows/columns are set to 0. - * - * @param text the text to be displayed, or null - */ - public CTextArea (String text) - { - this (new JTextArea (text)); - } // CText - - /** - * Constructs a new empty TextArea with the specified number of - * rows and columns. A default model is created, and the initial - * string is null. - * - * @param rows the number of rows >= 0 - * @param columns the number of columns >= 0 - * @exception IllegalArgumentException if the rows or columns - * arguments are negative. - */ - public CTextArea (int rows, int columns) - { - this (new JTextArea (rows, columns)); - } // CText - - /** - * Constructs a new TextArea with the specified text and number - * of rows and columns. A default model is created. - * - * @param text the text to be displayed, or null - * @param rows the number of rows >= 0 - * @param columns the number of columns >= 0 - * @exception IllegalArgumentException if the rows or columns - * arguments are negative. - */ - public CTextArea (String text, int rows, int columns) - { - this (new JTextArea(text, rows, columns)); - } // CText - - /** - * Constructs a new JTextArea with the given document model, and defaults - * for all of the other arguments (null, 0, 0). - * - * @param doc the model to use - */ - public CTextArea (Document doc) - { - this (new JTextArea (doc)); - } // CText - - /** - * Constructs a new JTextArea with the specified number of rows - * and columns, and the given model. All of the constructors - * feed through this constructor. - * - * @param doc the model to use, or create a default one if null - * @param text the text to be displayed, null if none - * @param rows the number of rows >= 0 - * @param columns the number of columns >= 0 - * @exception IllegalArgumentException if the rows or columns - * arguments are negative. - */ - public CTextArea (Document doc, String text, int rows, int columns) - { - this (new JTextArea (doc, text, rows, columns)); - } // CTextArea - - - /** - * Create a JScrollArea with a JTextArea. - * (use Cpmpiere Colors, Line wrap) - * @param textArea - */ - public CTextArea (JTextArea textArea) - { - super (textArea); - m_textArea = textArea; - super.setOpaque(false); - super.getViewport().setOpaque(false); - m_textArea.setLineWrap(true); - m_textArea.setWrapStyleWord(true); - // Overwrite default Tab - m_textArea.firePropertyChange("editable", !isEditable(), isEditable()); - - // IDEMPIERE-573 - Swing text areas break user flow when cycling focus with tab key - // tbayen - 2013-01-20 - // remove special treatment of TAB and Ctrl-TAB in JTextArea - m_textArea.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, null); - m_textArea.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, null); - // Use Ctrl-TAB to insert tab character into text area. - KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.CTRL_DOWN_MASK); - m_textArea.getInputMap().put(keyStroke, DefaultEditorKit.insertTabAction); - - // IDEMPIERE-320 (see also comment at IDEMPIERE-573) - // Use Ctrl-ENTER oder Shift-ENTER to insert newline in text area. - // (independent from SWING_OVERRIDE_TEXT_AREA_BEHAVIOUR on or off - // as a convenience for switching users) - keyStroke =KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,InputEvent.SHIFT_DOWN_MASK); - m_textArea.getInputMap().put(keyStroke, DefaultEditorKit.insertBreakAction); - keyStroke =KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,InputEvent.CTRL_DOWN_MASK); - m_textArea.getInputMap().put(keyStroke, DefaultEditorKit.insertBreakAction); - - // IDEMPIERE-320 - boolean taBehaviour = MSysConfig.getBooleanValue(MSysConfig.SWING_OVERRIDE_TEXT_AREA_BEHAVIOUR, false, Env.getAD_Client_ID(Env.getCtx())); - if (taBehaviour) - { - InputMap im = m_textArea.getInputMap(); - im.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), FIRE_CHANGE); - - ActionMap am = m_textArea.getActionMap(); - am.put(FIRE_CHANGE, new AbstractAction() { - - /** - * - */ - private static final long serialVersionUID = -4599908611347627047L; - - @Override - public void actionPerformed(ActionEvent arg0) { - m_textArea.dispatchEvent(new FocusEvent(m_textArea, FocusEvent.FOCUS_LOST)); - m_textArea.requestFocus(); - } - }); - } - } // CTextArea - - /** Text Area */ - private JTextArea m_textArea = null; - - /*************************************************************************/ - - /** Mandatory (default false) */ - private boolean m_mandatory = false; - - /** - * Set Editor Mandatory - * @param mandatory true, if you have to enter data - */ - public void setMandatory (boolean mandatory) - { - m_mandatory = mandatory; - setBackground(false); - } // setMandatory - - /** - * Is Field mandatory - * @return true, if mandatory - */ - public boolean isMandatory() - { - return m_mandatory; - } // isMandatory - - /** - * Enable Editor - * @param rw true, if you can enter/select data - */ - public void setReadWrite (boolean rw) - { - if (m_textArea.isEditable() != rw) - m_textArea.setEditable (rw); - setBackground(false); - } // setReadWrite - - /** - * Is it possible to edit - * @return true, if editable - */ - public boolean isReadWrite() - { - return m_textArea.isEditable(); - } // isReadWrite - - /** - * Set Background based on editable / mandatory / error - * @param error if true, set background to error color, otherwise mandatory/editable - */ - public void setBackground (boolean error) - { - if (error) - setBackground(AdempierePLAF.getFieldBackground_Error()); - else if (!isReadWrite()) - setBackground(AdempierePLAF.getFieldBackground_Inactive()); - else if (m_mandatory) - setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - else - setBackground(AdempierePLAF.getFieldBackground_Normal()); - } // setBackground - - /** - * Set Background color - * @param color color - */ - public void setBackground (Color color) - { - if (color.equals(getBackground())) - return; - if (m_textArea == null) // during init - super.setBackground(color); - else - m_textArea.setBackground(color); - } - /** - * Get Background color - * @return background - */ - public Color getBackground () - { - if (m_textArea == null) // during init - return super.getBackground(); - else - return m_textArea.getBackground(); - } - /** - * Set Foreground color - * @param color - */ - public void setForeground (Color color) - { - if (m_textArea == null) // during init - super.setForeground(color); - else - m_textArea.setForeground(color); - } - /** - * Get Foreground color - * @return color - */ - public Color getForeground () - { - if (m_textArea == null) // during init - return super.getForeground(); - else - return m_textArea.getForeground(); - } - - /** - * Set Editor to value - * @param value value of the editor - */ - public void setValue (Object value) - { - if (value == null) - m_textArea.setText(""); - else - m_textArea.setText(value.toString()); - } // setValue - - /** - * Return Editor value - * @return current value - */ - public Object getValue() - { - return m_textArea.getText(); - } // getValue - - /** - * Return Display Value - * @return displayed String value - */ - public String getDisplay() - { - return m_textArea.getText(); - } // getDisplay - - /************************************************************************* - * Set Text and position top - * @param text - */ - public void setText (String text) - { - m_textArea.setText(text); - m_textArea.setCaretPosition(0); - } - /** - * Get Text - * @return text - */ - public String getText() - { - return m_textArea.getText(); - } - /** - * Append text - * @param text - */ - public void append (String text) - { - m_textArea.append (text); - } - - /** - * Set Columns - * @param cols - */ - public void setColumns (int cols) - { - m_textArea.setColumns (cols); - } - /** - * Get Columns - * @return columns - */ - public int getColumns() - { - return m_textArea.getColumns(); - } - - /** - * Set Rows - * @param rows - */ - public void setRows (int rows) - { - m_textArea.setRows(rows); - } - /** - * Get Rows - * @return rows - */ - public int getRows() - { - return m_textArea.getRows(); - } - - /** - * Set Text Caret Position - * @param pos - */ - public void setCaretPosition (int pos) - { - m_textArea.setCaretPosition (pos); - } - /** - * Get Text Caret Position - * @return position - */ - public int getCaretPosition() - { - return m_textArea.getCaretPosition(); - } - - /** - * Set Text Editable - * @param edit - */ - public void setEditable (boolean edit) - { - m_textArea.setEditable(edit); - } - /** - * Is Text Editable - * @return true if editable - */ - public boolean isEditable() - { - return m_textArea.isEditable(); - } - - /** - * Set Text Line Wrap - * @param wrap - */ - public void setLineWrap (boolean wrap) - { - m_textArea.setLineWrap (wrap); - } - /** - * Set Text Wrap Style Word - * @param word - */ - public void setWrapStyleWord (boolean word) - { - m_textArea.setWrapStyleWord (word); - } - - /** - * Set Opaque - * @param isOpaque - */ - public void setOpaque (boolean isOpaque) - { - // JScrollPane & Viewport is always not Opaque - if (m_textArea == null) // during init of JScrollPane - super.setOpaque(isOpaque); - else - m_textArea.setOpaque(isOpaque); - } // setOpaque - - /** - * Set Text Margin - * @param m insets - */ - public void setMargin (Insets m) - { - if (m_textArea != null) - m_textArea.setMargin(m); - } // setMargin - - - /** - * AddFocusListener - * @param l - */ - public void addFocusListener (FocusListener l) - { - if (m_textArea == null) // during init - super.addFocusListener(l); - else - m_textArea.addFocusListener(l); - } - /** - * Add Text Mouse Listener - * @param l - */ - public void addMouseListener (MouseListener l) - { - m_textArea.addMouseListener(l); - } - /** - * Add Text Key Listener - * @param l - */ - public void addKeyListener (KeyListener l) - { - m_textArea.addKeyListener(l); - } - /** - * Add Text Input Method Listener - * @param l - */ - public void addInputMethodListener (InputMethodListener l) - { - m_textArea.addInputMethodListener(l); - } - /** - * Get text Input Method Requests - * @return requests - */ - public InputMethodRequests getInputMethodRequests() - { - return m_textArea.getInputMethodRequests(); - } - /** - * Set Text Input Verifier - * @param l - */ - public void setInputVerifier (InputVerifier l) - { - m_textArea.setInputVerifier(l); - } - -} // CTextArea diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CTextField.java b/org.adempiere.ui.swing/src/org/compiere/swing/CTextField.java deleted file mode 100644 index 0830442ddb..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CTextField.java +++ /dev/null @@ -1,259 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Color; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; - -import javax.swing.JTextField; -import javax.swing.text.Document; - -import org.adempiere.plaf.AdempierePLAF; - -/** - * Adempiere Text Field - * - * @author Jorg Janke - * @version $Id: CTextField.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CTextField extends JTextField - implements CEditor, KeyListener -{ - /** - * - */ - private static final long serialVersionUID = 460529728891168659L; - - /** - * Constructs a new TextField. A default model is created, - * the initial string is null, - * and the number of columns is set to 0. - */ - public CTextField() - { - super(); - init(); - } // CTextField - - /** - * Constructs a new TextField initialized with the - * specified text. A default model is created and the number of - * columns is 0. - * - * @param text the text to be displayed, or null - */ - public CTextField (String text) - { - super (text); - init(); - } // CTextField - - /** - * Constructs a new empty TextField with the specified - * number of columns. - * A default model is created and the initial string is set to - * null. - * - * @param columns the number of columns to use to calculate - * the preferred width; if columns is set to zero, the - * preferred width will be whatever naturally results from - * the component implementation - */ - public CTextField (int columns) - { - super (columns); - init(); - } // CTextField - - /** - * Constructs a new TextField initialized with the - * specified text and columns. A default model is created. - * - * @param text the text to be displayed, or null - * @param columns the number of columns to use to calculate - * the preferred width; if columns is set to zero, the - * preferred width will be whatever naturally results from - * the component implementation - */ - public CTextField (String text, int columns) - { - super (text, columns); - init(); - } // CTextField - - /** - * Constructs a new JTextField that uses the given text - * storage model and the given number of columns. - * This is the constructor through which the other constructors feed. - * If the document is null, a default model is created. - * - * @param doc the text storage to use; if this is null, - * a default will be provided by calling the - * createDefaultModel method - * @param text the initial string to display, or null - * @param columns the number of columns to use to calculate - * the preferred width >= 0; if columns - * is set to zero, the preferred width will be whatever - * naturally results from the component implementation - * @exception IllegalArgumentException if columns < 0 - */ - public CTextField (Document doc, String text, int columns) - { - super (doc, text, columns); - init(); - } // CTextField - - /** - * Initialization - */ - private void init() - { - setBackground (false); - } // init - - /*************************************************************************/ - - /** Mandatory (default false) */ - private boolean m_mandatory = false; - - /** - * Set Editor Mandatory - * @param mandatory true, if you have to enter data - */ - public void setMandatory (boolean mandatory) - { - m_mandatory = mandatory; - setBackground(false); - } // setMandatory - - /** - * Is Field mandatory - * @return true, if mandatory - */ - public boolean isMandatory() - { - return m_mandatory; - } // isMandatory - - /** - * Enable Editor - * @param rw true, if you can enter/select data - */ - public void setReadWrite (boolean rw) - { - if (super.isEditable() != rw) - super.setEditable (rw); - setBackground(false); - } // setEditable - - /** - * Is it possible to edit - * @return true, if editable - */ - public boolean isReadWrite() - { - return super.isEditable(); - } // isReadWrite - - - /** - * Set Background based on editable / mandatory / error - * @param error if true, set background to error color, otherwise mandatory/editable - */ - public void setBackground (boolean error) - { - if (error) - setBackground(AdempierePLAF.getFieldBackground_Error()); - else if (!isReadWrite()) - setBackground(AdempierePLAF.getFieldBackground_Inactive()); - else if (m_mandatory) - setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - else - setBackground(AdempierePLAF.getFieldBackground_Normal()); - } // setBackground - - /** - * Set Background - * @param bg background - */ - public void setBackground (Color bg) - { - if (bg.equals(getBackground())) - return; - super.setBackground(bg); - } // setBackground - - /** - * Set Editor to value - * @param value value of the editor - */ - public void setValue (Object value) - { - if (value == null) - setText(""); - else - setText(value.toString()); - } // setValue - - /** - * Return Editor value - * @return current value - */ - public Object getValue() - { - return getText(); - } // getValue - - /** - * Return Display Value - * @return displayed String value - */ - public String getDisplay() - { - return getText(); - } // getDisplay - - - /** - * key Pressed - * @see java.awt.event.KeyListener#keyPressed(java.awt.event.KeyEvent) - * @param e - */ - public void keyPressed(KeyEvent e) - { - } // keyPressed - - /** - * key Released - * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent) - * @param e - */ - public void keyReleased(KeyEvent e) - { - } // keyReleased - - /** - * key Typed - * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent) - * @param e - */ - public void keyTyped(KeyEvent e) - { - } // keyTyped - -} // CTextField diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CTextPane.java b/org.adempiere.ui.swing/src/org/compiere/swing/CTextPane.java deleted file mode 100644 index 347acc54fb..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CTextPane.java +++ /dev/null @@ -1,360 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Color; -import java.awt.Insets; -import java.awt.event.FocusListener; -import java.awt.event.InputMethodListener; -import java.awt.event.KeyListener; -import java.awt.event.MouseListener; -import java.awt.im.InputMethodRequests; - -import javax.swing.InputVerifier; -import javax.swing.JScrollPane; -import javax.swing.JTextPane; -import javax.swing.text.StyledDocument; - -import org.adempiere.plaf.AdempierePLAF; - -/** - * Adempiere TextPane - A ScrollPane with a JTextPane. - * Manages visibility, opaque and color consistently * - * @author Jorg Janke - * @version $Id: CTextPane.java,v 1.3 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CTextPane extends JScrollPane - implements CEditor - -{ - /** - * - */ - private static final long serialVersionUID = -6702310899755509377L; - - /** - * Constructs a new TextPane (HTML) - */ - public CTextPane() - { - this (new JTextPane()); - } // CTextPane - - /** - * Constructs a new JTextPane with the given document - * @param doc the model to use - */ - public CTextPane (StyledDocument doc) - { - this (new JTextPane (doc)); - } // CTextPane - - /** - * Create a JScrollArea with a JTextEditor - * @param textPane - */ - public CTextPane (JTextPane textPane) - { - super (textPane); - m_textPane = textPane; - super.setOpaque(false); - super.getViewport().setOpaque(false); - m_textPane.setContentType("text/html"); - } // CTextPane - - private JTextPane m_textPane = null; - - /*************************************************************************/ - - /** Mandatory (default false) */ - private boolean m_mandatory = false; - - /** - * Set Editor Mandatory - * @param mandatory true, if you have to enter data - */ - public void setMandatory (boolean mandatory) - { - m_mandatory = mandatory; - setBackground(false); - } // setMandatory - - /** - * Is Field mandatory - * @return true, if mandatory - */ - public boolean isMandatory() - { - return m_mandatory; - } // isMandatory - - /** - * Enable Editor - * @param rw true, if you can enter/select data - */ - public void setReadWrite (boolean rw) - { - if (m_textPane.isEditable() != rw) - m_textPane.setEditable (rw); - setBackground(false); - } // setReadWrite - - /** - * Is it possible to edit - * @return true, if editable - */ - public boolean isReadWrite() - { - return m_textPane.isEditable(); - } // isReadWrite - - /** - * Set Background based on editable / mandatory / error - * @param error if true, set background to error color, otherwise mandatory/editable - */ - public void setBackground (boolean error) - { - if (error) - setBackground(AdempierePLAF.getFieldBackground_Error()); - else if (!isReadWrite()) - setBackground(AdempierePLAF.getFieldBackground_Inactive()); - else if (m_mandatory) - setBackground(AdempierePLAF.getFieldBackground_Mandatory()); - else - setBackground(AdempierePLAF.getFieldBackground_Normal()); - } // setBackground - - /** - * Set Background - * @param color color - */ - public void setBackground (Color color) - { - if (color.equals(getBackground())) - return; - if (m_textPane == null) // during init - super.setBackground(color); - else - m_textPane.setBackground(color); - } // setBackground - - /** - * Get Background - * @return color - */ - public Color getBackground () - { - if (m_textPane == null) // during init - return super.getBackground(); - else - return m_textPane.getBackground(); - } // getBackground - - /** - * Set Foreground - * @param color color - */ - public void setForeground (Color color) - { - if (m_textPane == null) // during init - super.setForeground(color); - else - m_textPane.setForeground(color); - } // setForeground - - /** - * Get Foreground - * @return color - */ - public Color getForeground () - { - if (m_textPane == null) // during init - return super.getForeground(); - else - return m_textPane.getForeground(); - } // getForeground - - /** - * Set Content Type - * @param type e.g. text/html - */ - public void setContentType (String type) - { - if (m_textPane != null) // during init - m_textPane.setContentType(type); - } // setContentType - - - /** - * Set Editor to value - * @param value value of the editor - */ - public void setValue (Object value) - { - if (value == null) - m_textPane.setText(""); - else - m_textPane.setText(value.toString()); - } // setValue - - /** - * Return Editor value - * @return current value - */ - public Object getValue() - { - return m_textPane.getText(); - } // getValue - - /** - * Return Display Value - * @return displayed String value - */ - public String getDisplay() - { - return m_textPane.getText(); - } // getDisplay - - - /************************************************************************** - * Set Text and position top - * @param text - */ - public void setText (String text) - { - m_textPane.setText(text); - m_textPane.setCaretPosition(0); - } - /** - * Get Text - * @return text - */ - public String getText() - { - return m_textPane.getText(); - } - - /** - * Set Caret Position - * @param pos pos - */ - public void setCaretPosition (int pos) - { - m_textPane.setCaretPosition (pos); - } - /** - * Get Caret Position - * @return position - */ - public int getCaretPosition() - { - return m_textPane.getCaretPosition(); - } - - /** - * Set Editable - * @param edit editable - */ - public void setEditable (boolean edit) - { - m_textPane.setEditable(edit); - } - /** - * Editable - * @return true if editable - */ - public boolean isEditable() - { - return m_textPane.isEditable(); - } - - /** - * Set Text Margin - * @param m insets - */ - public void setMargin (Insets m) - { - if (m_textPane != null) - m_textPane.setMargin(m); - } // setMargin - - /** - * Set Opaque - * @param isOpaque opaque - */ - public void setOpaque (boolean isOpaque) - { - // JScrollPane & Viewport is always not Opaque - if (m_textPane == null) // during init of JScrollPane - super.setOpaque(isOpaque); - else - m_textPane.setOpaque(isOpaque); - } // setOpaque - - /** - * Add Focus Listener - * @param l listener - */ - public void addFocusListener (FocusListener l) - { - if (m_textPane == null) // during init - super.addFocusListener(l); - else - m_textPane.addFocusListener(l); - } - /** - * Add Mouse Listener - * @param l listner - */ - public void addMouseListener (MouseListener l) - { - m_textPane.addMouseListener(l); - } - /** - * Add Key Listener - * @param l listner - */ - public void addKeyListener (KeyListener l) - { - m_textPane.addKeyListener(l); - } - /** - * Add Input Method Listener - * @param l listener - */ - public void addInputMethodListener (InputMethodListener l) - { - m_textPane.addInputMethodListener(l); - } - /** - * Get Input Method Requests - * @return requests - */ - public InputMethodRequests getInputMethodRequests() - { - return m_textPane.getInputMethodRequests(); - } - /** - * Set Input Verifier - * @param l verifyer - */ - public void setInputVerifier (InputVerifier l) - { - m_textPane.setInputVerifier(l); - } - -} // CTextPane diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CToggleButton.java b/org.adempiere.ui.swing/src/org/compiere/swing/CToggleButton.java deleted file mode 100644 index c788993c53..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CToggleButton.java +++ /dev/null @@ -1,266 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Color; - -import javax.swing.Action; -import javax.swing.Icon; -import javax.swing.JToggleButton; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.plaf.CompiereColor; -import org.compiere.plaf.CompiereLookAndFeel; - -/** - * Adempiere Color Taggle Button - * - * @author Jorg Janke - * @version $Id: CToggleButton.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class CToggleButton extends JToggleButton implements CEditor -{ - /** - * - */ - private static final long serialVersionUID = -3527812520795669992L; - - /** - * Creates an initially unselected toggle button - * without setting the text or image. - */ - public CToggleButton () - { - this(null, null, false); - } - - /** - * Creates an initially unselected toggle button - * with the specified image but no text. - * - * @param icon the image that the button should display - */ - public CToggleButton(Icon icon) - { - this(null, icon, false); - } - - /** - * Creates a toggle button with the specified image - * and selection state, but no text. - * - * @param icon the image that the button should display - * @param selected if true, the button is initially selected; - * otherwise, the button is initially unselected - */ - public CToggleButton(Icon icon, boolean selected) - { - this(null, icon, selected); - } - - /** - * Creates an unselected toggle button with the specified text. - * - * @param text the string displayed on the toggle button - */ - public CToggleButton (String text) - { - this(text, null, false); - } - - /** - * Creates a toggle button with the specified text - * and selection state. - * - * @param text the string displayed on the toggle button - * @param selected if true, the button is initially selected; - * otherwise, the button is initially unselected - */ - public CToggleButton (String text, boolean selected) - { - this(text, null, selected); - } - - /** - * Creates a toggle button where properties are taken from the - * Action supplied. - * @param a - */ - public CToggleButton(Action a) - { - this(null, null, false); - setAction(a); - } - - /** - * Creates a toggle button that has the specified text and image, - * and that is initially unselected. - * - * @param text the string displayed on the button - * @param icon the image that the button should display - */ - public CToggleButton(String text, Icon icon) - { - this(text, icon, false); - } - - /** - * Creates a toggle button with the specified text, image, and - * selection state. - * - * @param text the text of the toggle button - * @param icon the image that the button should display - * @param selected if true, the button is initially selected; - * otherwise, the button is initially unselected - */ - public CToggleButton (String text, Icon icon, boolean selected) - { - super(text, icon, selected); - } - - /*************************************************************************/ - - /** - * Set Background - Differentiates between system & user call. - * If User Call, sets Opaque & ContextAreaFilled to true - * @param bg - */ - public void setBackground(Color bg) - { - if (bg.equals(getBackground())) - return; - super.setBackground( bg); - } // setBackground - - /** - * Set Background - NOP - * @param error - */ - public void setBackground (boolean error) - { - } // setBackground - - /** - * Set Standard Background - */ - public void setBackgroundColor () - { - setBackgroundColor (null); - } // setBackground - - /** - * Set Background - * @param bg AdempiereColor for Background, if null set standard background - */ - public void setBackgroundColor (CompiereColor bg) - { - if (bg == null) - bg = new CompiereColor(AdempierePLAF.getFormBackground()); - setOpaque(true); - putClientProperty(CompiereLookAndFeel.BACKGROUND, bg); - super.setBackground (bg.getFlatColor()); - } // setBackground - - /** - * Get Background - * @return Color for Background - */ - public CompiereColor getBackgroundColor () - { - try - { - return (CompiereColor)getClientProperty(CompiereLookAndFeel.BACKGROUND); - } - catch (Exception e) - { - System.err.println("CButton - ClientProperty: " + e.getMessage()); - } - return null; - } // getBackgroundColor - - /** Mandatory (default false) */ - private boolean m_mandatory = false; - - /** - * Set Editor Mandatory - * @param mandatory true, if you have to enter data - */ - public void setMandatory (boolean mandatory) - { - m_mandatory = mandatory; - setBackground(false); - } // setMandatory - - /** - * Is Field mandatory - * @return true, if mandatory - */ - public boolean isMandatory() - { - return m_mandatory; - } // isMandatory - - /** - * Enable Editor - * @param rw true, if you can enter/select data - */ - public void setReadWrite (boolean rw) - { - if (super.isEnabled() != rw) - super.setEnabled(rw); - } // setReadWrite - - /** - * Is it possible to edit - * @return true, if editable - */ - public boolean isReadWrite() - { - return super.isEnabled(); - } // isReadWrite - - /** - * Set Editor to value - * @param value value of the editor - */ - public void setValue (Object value) - { - if (value == null) - setText(""); - else - setText(value.toString()); - } // setValue - - /** - * Return Editor value - * @return current value - */ - public Object getValue() - { - return getText(); - } // getValue - - /** - * Return Display Value - * @return displayed String value - */ - public String getDisplay() - { - return getText(); - } // getDisplay - -} // CToggleButton diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CollapsiblePanel.java b/org.adempiere.ui.swing/src/org/compiere/swing/CollapsiblePanel.java deleted file mode 100644 index e700b2e5ad..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CollapsiblePanel.java +++ /dev/null @@ -1,219 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2007 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Graphics; -import java.awt.Insets; - -import javax.swing.Action; -import javax.swing.BorderFactory; -import javax.swing.JPanel; -import javax.swing.UIManager; -import javax.swing.border.Border; -import javax.swing.border.CompoundBorder; - -import org.adempiere.plaf.AdempierePLAF; -import org.jdesktop.swingx.JXCollapsiblePane; -import org.jdesktop.swingx.JXHyperlink; -import org.jdesktop.swingx.VerticalLayout; - -/** - * Collapsible panel with a title and contents.
    - * - * Based on the StackedBox component develop by - * Frederic Lavigne - * - * @author hengsin - */ -public class CollapsiblePanel extends JPanel { - - /** - * - */ - private static final long serialVersionUID = -7372966868790589720L; - private Color titleBackgroundColor; - private Color titleForegroundColor; - private Color separatorColor; - private Border separatorBorder; - private JXHyperlink link; - private JXCollapsiblePane collapsible; - - /** - * - * @param title - */ - public CollapsiblePanel(String title) { - setLayout(new VerticalLayout()); - setOpaque(true); - setBackground(Color.WHITE); - - separatorBorder = new SeparatorBorder(); - setTitleForegroundColor(Color.BLACK); - setTitleBackgroundColor(new Color(248, 248, 248)); - setSeparatorColor(new Color(214, 223, 247)); - - collapsible = new JXCollapsiblePane(); - collapsible.getContentPane().setBackground( - AdempierePLAF.getFormBackground()); - collapsible.setBorder(new CompoundBorder(separatorBorder, collapsible - .getBorder())); - - Action toggleAction = collapsible.getActionMap().get( - JXCollapsiblePane.TOGGLE_ACTION); - // use the collapse/expand icons from the JTree UI - toggleAction.putValue(JXCollapsiblePane.COLLAPSE_ICON, UIManager - .getIcon("Tree.expandedIcon")); - toggleAction.putValue(JXCollapsiblePane.EXPAND_ICON, UIManager - .getIcon("Tree.collapsedIcon")); - - link = new JXHyperlink(toggleAction); - link.setText(title); - link.setOpaque(true); - link.setBackground(getTitleBackgroundColor()); - link.setFocusPainted(false); - - link.setUnclickedColor(getTitleForegroundColor()); - link.setClickedColor(getTitleForegroundColor()); - - link.setBorder(new CompoundBorder(separatorBorder, BorderFactory - .createEmptyBorder(2, 4, 2, 4))); - link.setBorderPainted(true); - - super.add(link); - super.add(collapsible); - - } - - /** - * - * @return color - */ - public Color getSeparatorColor() { - return separatorColor; - } - - /** - * - * @param separatorColor - */ - public void setSeparatorColor(Color separatorColor) { - this.separatorColor = separatorColor; - } - - /** - * get title foreground color - * - * @return color - */ - public Color getTitleForegroundColor() { - return titleForegroundColor; - } - - /** - * Set title foreground color - * - * @param titleForegroundColor - */ - public void setTitleForegroundColor(Color titleForegroundColor) { - this.titleForegroundColor = titleForegroundColor; - } - - /** - * - * @return title background color - */ - public Color getTitleBackgroundColor() { - return titleBackgroundColor; - } - - /** - * Set background color of title - * - * @param titleBackgroundColor - */ - public void setTitleBackgroundColor(Color titleBackgroundColor) { - this.titleBackgroundColor = titleBackgroundColor; - } - - /** - * Set title of the section - * - * @param title - */ - public void setTitle(String title) { - if (link != null) - link.setText(title); - } - - /** - * - * @return collapsible pane - */ - public JXCollapsiblePane getCollapsiblePane() { - return collapsible; - } - - /** - * The border between the stack components. It separates each component with - * a fine line border. - */ - class SeparatorBorder implements Border { - - boolean isFirst(Component c) { - return c.getParent() == null || c.getParent().getComponent(0) == c; - } - - public Insets getBorderInsets(Component c) { - // if the collapsible is collapsed, we do not want its border to be - // painted. - if (c instanceof JXCollapsiblePane) { - if (((JXCollapsiblePane) c).isCollapsed()) { - return new Insets(0, 0, 0, 0); - } - } - return new Insets(4, 0, 1, 0); - } - - public boolean isBorderOpaque() { - return true; - } - - public void paintBorder(Component c, Graphics g, int x, int y, - int width, int height) { - // if the collapsible is collapsed, we do not want its border to be - // painted. - if (c instanceof JXCollapsiblePane) { - if (((JXCollapsiblePane) c).isCollapsed()) { - return; - } - } - g.setColor(getSeparatorColor()); - if (isFirst(c)) { - g.drawLine(x, y + 2, x + width, y + 2); - } - g.drawLine(x, y + height - 1, x + width, y + height - 1); - } - } - - @Override - public Component add(Component comp) { - if (collapsible != null) - return collapsible.add(comp); - - return null; - } - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/ColorBlind.java b/org.adempiere.ui.swing/src/org/compiere/swing/ColorBlind.java deleted file mode 100644 index 10a46e4260..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/ColorBlind.java +++ /dev/null @@ -1,290 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Color; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.swing.plaf.ColorUIResource; - -/** - * Color Blind Utilities. - * These utilities help to show how color blind/challenged see colors. - * - * Created by Thomas Wolfmaier. - * Copyright (C) 1999-2005 HCIRN. - * All rights reserved. - * @see HCIRN - * - * @author Thomas Wolfmaier - * @version $Id: ColorBlind.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $ - */ -public class ColorBlind -{ - /** Color Blindness Type - 0=none */ - public static final String[] COLORBLIND_TYPE = - {"", "Protanopia", "Deuteranopia", "Tritanopia"}; - - public static final int NORMAL = 0; - public static final int PROTANOPIA = 1; - public static final int DEUTERANOPIA = 2; - public static final int TRITANOPIA = 3; - - /*************************************************************************/ - - private static final double[][] confusionPoints = - { {0.735, 0.265}, - {1.140, -0.140}, - {0.171, -0.003} - }; - private static final double[][][] colorAxes = - { {{0.115807, 0.073581}, {0.471899, 0.527051}}, - {{0.102776, 0.102864}, {0.505845, 0.493211}}, - {{0.045391, 0.294976}, {0.665764, 0.334011}} - }; - private static final double[][] RGBtoXYZMatrix = - { {0.430574, 0.341550, 0.178325}, - {0.222015, 0.706655, 0.071330}, - {0.020183, 0.129553, 0.939180} - }; - private static final double[][] XYZtoRGBMatrix = - { { 3.063218, -1.393325, -0.475802}, - {-0.969243, 1.875966, 0.041555}, - { 0.067871, -0.228834, 1.069251} - }; - private static final double[] whitePoint = - { 0.312713, 0.329016, 0.358271 - }; - private static final double gamma = 2.2; - - /** Color Blind Type */ - private static int s_colorType = NORMAL; - - /** Logger */ - private static Logger log = Logger.getLogger(ColorBlind.class.getName()); - - - /** - * Set Color Type for Color Blind view - * @param colorType (0 = none) - */ - public static void setColorType (int colorType) - { - if (colorType > 0 && colorType < 4) - s_colorType = colorType; - else - s_colorType = 0; - if (s_colorType != 0) - if (log.isLoggable(Level.CONFIG)) log.config(COLORBLIND_TYPE[colorType]); - } // setColorType - - /** - * Get Color Type for Color Blind view - * @return colorType (0 = none) - */ - public static int getColorType () - { - return s_colorType; - } // getColorType - - - /************************************************************************** - * Convert "normal" color to Dichromat Color based on set color type - * @param color Java Color object containing values for RGB - * @return Dichromat Color - */ - public static ColorUIResource getDichromatColorUIResource (ColorUIResource color) - { - if (s_colorType == NORMAL) - return color; - return new ColorUIResource(getDichromatColorUIResource (color, s_colorType)); - } // convertToDichromatColorUIResource - - /** - * Convert "normal" color to Dichromat Color - * @param color Java Color object containing values for RGB - * @param colorType PROTANOPIA = 1, DEUTERANOPIA = 2 or TRITANOPIA = 3 as declared above - * @return Dichromat Color - */ - public static Color getDichromatColorUIResource (ColorUIResource color, int colorType) - { - if (s_colorType == NORMAL) - return color; - return new ColorUIResource(getDichromatColor (color, s_colorType)); - } // convertToDichromatColorUIResource - - /** - * Convert "normal" color to Dichromat Color based on set color type - * @param color Java Color object containing values for RGB - * @return Dichromat Color - */ - public static Color getDichromatColor (Color color) - { - if (s_colorType == NORMAL) - return color; - return getDichromatColor (color, s_colorType); - } // convertToDichromatColor - - /** - * Convert "normal" color to Dichromat Color - * @param color Java Color object containing values for RGB - * @param colorType PROTANOPIA = 1, DEUTERANOPIA = 2 or TRITANOPIA = 3 as declared above - * @return Dichromat Color - */ - public static Color getDichromatColor (Color color, int colorType) - { - // check type & return if not valid - int type = 0; - if (colorType > 0 && colorType < 4) - type = colorType; - // No conversion or no color - if (type == 0 || color == null) - return color; - type--; // correct to zero based - - // Return white & black - not converted - if (color.equals(Color.black) || color.equals(Color.white)) - return color; - - double red = color.getRed(); - double green = color.getGreen(); - double blue = color.getBlue(); - - // System.out.println("Red: " + red + " Green: " + green + " Blue: " + blue); - - double X = RGBtoXYZMatrix[0][0] * Math.pow(red / 255.0, gamma) + - RGBtoXYZMatrix[0][1] * Math.pow(green / 255.0, gamma) + - RGBtoXYZMatrix[0][2] * Math.pow(blue / 255.0, gamma); - double Y = RGBtoXYZMatrix[1][0] * Math.pow(red / 255.0, gamma) + - RGBtoXYZMatrix[1][1] * Math.pow(green / 255.0, gamma) + - RGBtoXYZMatrix[1][2] * Math.pow(blue / 255.0, gamma); - double Z = RGBtoXYZMatrix[2][0] * Math.pow(red / 255.0, gamma) + - RGBtoXYZMatrix[2][1] * Math.pow(green / 255.0, gamma) + - RGBtoXYZMatrix[2][2] * Math.pow(blue / 255.0, gamma); - - // System.out.println("X: " + X + " Y: " + Y + " Z: " + Z); - - double x = 0.0; - double y = 0.0; - - if ((X + Y + Z) != 0.0) - { - x = X / (X + Y + Z); - y = Y / (X + Y + Z); - } - - // System.out.println("x: " + x + " y: " + y + " Y: " + Y); - - double Yn = Y; - double Xn = (whitePoint[0] * Yn) / whitePoint[1]; - double Zn = (whitePoint[2] * Yn) / whitePoint[1]; - - double xc = confusionPoints[type][0]; - double yc = confusionPoints[type][1]; - - double x1 = colorAxes[type][0][0]; - double y1 = colorAxes[type][0][1]; - double x2 = colorAxes[type][1][0]; - double y2 = colorAxes[type][1][1]; - - double ap = (y2 - y1) / (x2 - x1); - double bp = y1 - (x1 * ap); - - // System.out.println("ap: " + ap + " bp: " + bp); - - double a; - if (x < xc) - a = (yc - y) / (xc - x); - else - a = (y - yc) / (x - xc); - - double b = y - (x * a); - - // System.out.println("a: " + a + " b: " + b); - - x = (bp - b) / (a - ap); - y = a * x + b; - - // System.out.println("x: " + x + " y: " + y); - - X = 0.0; - Z = 0.0; - if (y != 0) - { - X = x * (Y / y); - Z = (1 - x - y) * (Y / y); - } - - // System.out.println("X: " + X + " Y: " + Y + " Z: " + Z); - - red = XYZtoRGBMatrix[0][0] * X + - XYZtoRGBMatrix[0][1] * Y + - XYZtoRGBMatrix[0][2] * Z; - green = XYZtoRGBMatrix[1][0] * X + - XYZtoRGBMatrix[1][1] * Y + - XYZtoRGBMatrix[1][2] * Z; - blue = XYZtoRGBMatrix[2][0] * X + - XYZtoRGBMatrix[2][1] * Y + - XYZtoRGBMatrix[2][2] * Z; - - // System.out.println("Red: " + red + " Green: " + green + " Blue: " + blue); - - double reddiff = XYZtoRGBMatrix[0][0] * (Xn - X) + - XYZtoRGBMatrix[0][1] * (Yn - Y) + - XYZtoRGBMatrix[0][2] * (Zn - Z); - double greendiff = XYZtoRGBMatrix[1][0] * (Xn - X) + - XYZtoRGBMatrix[1][1] * (Yn - Y) + - XYZtoRGBMatrix[1][2] * (Zn - Z); - double bluediff = XYZtoRGBMatrix[2][0] * (Xn - X) + - XYZtoRGBMatrix[2][1] * (Yn - Y) + - XYZtoRGBMatrix[2][2] * (Zn - Z); - - double cr = ((red < 0.0 ? 0.0 : 1.0) - red) / reddiff; - double cg = ((green < 0.0 ? 0.0 : 1.0) - green) / greendiff; - double cb = ((blue < 0.0 ? 0.0 : 1.0) - blue) / bluediff; - - // System.out.println("cr: " + cr + " cg: " + cg + " cb: " + cb); - - double c1 = (cr < 0 || cr > 1) ? 0 : cr; - double c2 = (cg < 0 || cg > 1) ? 0 : cg; - double c3 = (cb < 0 || cb > 1) ? 0 : cb; - double c = Math.max(c1, Math.max(c2, c3)); - - // System.out.println("c: " + c); - - red = red + c * reddiff; - green = green + c * greendiff; - blue = blue + c * bluediff; - - // System.out.println("Red: " + red + " Green: " + green + " Blue: " + blue); - - red = Math.pow(red, 1.0 / gamma); - green = Math.pow(green, 1.0 / gamma); - blue = Math.pow(blue, 1.0 / gamma); - - // System.out.println("Red: " + red + " Green: " + green + " Blue: " + blue); - // System.out.println("Red: " + red * 255.0 + " Green: " + green * 255.0 + " Blue: " + blue * 255.0); - - Color retValue = new Color((float)red, (float)green, (float)blue); - if (log.isLoggable(Level.FINE)) log.fine("Color " + color.getRed() + "-" + color.getGreen() + "-" + color.getBlue() - + " -> " + retValue.getRed() + "-" + retValue.getGreen() + "-" + retValue.getBlue() + " <- " + COLORBLIND_TYPE[colorType]); - - return retValue; - } // convertToDichromatColor - -} // ColorBlind diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/ColorEditor.java b/org.adempiere.ui.swing/src/org/compiere/swing/ColorEditor.java deleted file mode 100644 index 5612d6e698..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/ColorEditor.java +++ /dev/null @@ -1,682 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dialog; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Frame; -import java.awt.Graphics; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.Rectangle; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeListener; -import java.beans.PropertyEditor; -import java.util.ResourceBundle; - -import javax.swing.BorderFactory; -import javax.swing.JColorChooser; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.plaf.CompiereColor; -import org.compiere.util.KeyNamePair; -import org.compiere.util.ValueNamePair; - -/** - * Adempiere Color Editor - * - * @author Jorg Janke - * @version $Id: AdempiereColorEditor.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class ColorEditor extends CDialog - implements ActionListener, PropertyEditor -{ - /** - * - */ - private static final long serialVersionUID = -484760951046013782L; - - /** - * Get Background AdempiereColor - * @param owner owner - * @param color optional initial color - * @return AdempiereColor - */ - public static CompiereColor showDialog (Frame owner, CompiereColor color) - { - ColorEditor cce = new ColorEditor (owner, color); - if (cce.isSaved()) - return cce.getColor(); - return color; - } // showDialog - - /** - * Get Background AdempiereColor - * @param owner owner - * @param color optional initial color - * @return AdempiereColor - */ - public static CompiereColor showDialog (Dialog owner, CompiereColor color) - { - ColorEditor cce = new ColorEditor (owner, color); - if (cce.isSaved()) - return cce.getColor(); - return color; - } // showIt - - /*************************************************************************/ - - /** - * Create AdempiereColor Dialog with color - * @param owner owner - * @param color Start Color - */ - public ColorEditor (Frame owner, CompiereColor color) - { - super(owner, "", true); - init (color); - } // AdempiereColorEditor - - /** - * Create AdempiereColor Dialog with color - * @param owner owner - * @param color Start Color - */ - public ColorEditor (Dialog owner, CompiereColor color) - { - super(owner, "", true); - init (color); - } // AdempiereColorEditor - - /** - * Init Dialog - * @param color Start Color - */ - private void init (CompiereColor color) - { - try - { - jbInit(); - } - catch(Exception e) - { - e.printStackTrace(); - } - - bOK.addActionListener(this); - bCancel.addActionListener(this); - typeField.addActionListener(this); - flatField.addActionListener(this); - gradientUpper.addActionListener(this); - gradientLower.addActionListener(this); - urlField.addActionListener(this); - alphaField.addActionListener(this); - taintColor.addActionListener(this); - lineColor.addActionListener(this); - backColor.addActionListener(this); - widthField.addActionListener(this); - distanceField.addActionListener(this); - gradientStartField.addActionListener(this); - gradientDistanceField.addActionListener(this); - - if (color == null) - setColor (m_cc); - else - setColor (new CompiereColor(color)); - AdempierePLAF.showCenterScreen(this); - } // init - - - private static ResourceBundle res = ResourceBundle.getBundle("org.compiere.plaf.PlafRes"); - private CompiereColor m_cc = null; - private boolean m_saved = false; - private boolean m_setting = false; - - // - private CPanel northPanel = new CPanel(); - private CPanel southPanel = new CPanel(); - private CButton bOK = AdempierePLAF.getOKButton(); - private CButton bCancel = AdempierePLAF.getCancelButton(); - private FlowLayout southLayout = new FlowLayout(); - private GridBagLayout northLayout = new GridBagLayout(); - private CLabel typeLabel = new CLabel(); - private CComboBox typeField = new CComboBox(CompiereColor.TYPES); - private CButton gradientUpper = new CButton(); - private CButton gradientLower = new CButton(); - private CLabel urlLabel = new CLabel(); - private CTextField urlField = new CTextField(30); - private CLabel alphaLabel = new CLabel(); - private CTextField alphaField = new CTextField(10); - private CButton taintColor = new CButton(); - private CButton lineColor = new CButton(); - private CButton backColor = new CButton(); - private CLabel widthLabel = new CLabel(); - private CTextField widthField = new CTextField(10); - private CLabel distanceLabel = new CLabel(); - private CTextField distanceField = new CTextField(10); - private CPanel centerPanel = new CPanel(); - private CButton flatField = new CButton(); - private CComboBox gradientStartField = new CComboBox(CompiereColor.GRADIENT_SP); - private CTextField gradientDistanceField = new CTextField(10); - private CLabel gradientStartLabel = new CLabel(); - private CLabel gradientDistanceLabel = new CLabel(); - - /** - * Static Layout. - *
    -	 *      - northPanel
    -	 *          - labels & fields
    -	 *      - centerPanel
    -	 *      - southPanel
    -	 *  
    - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setTitle(res.getString("AdempiereColorEditor")); - southPanel.setLayout(southLayout); - southLayout.setAlignment(FlowLayout.RIGHT); - northPanel.setLayout(northLayout); - typeLabel.setText(res.getString("AdempiereType")); - gradientUpper.setText(res.getString("GradientUpperColor")); - gradientLower.setText(res.getString("GradientLowerColor")); - gradientStartLabel.setText(res.getString("GradientStart")); - gradientDistanceLabel.setText(res.getString("GradientDistance")); - urlLabel.setText(res.getString("TextureURL")); - alphaLabel.setText(res.getString("TextureAlpha")); - taintColor.setText(res.getString("TextureTaintColor")); - lineColor.setText(res.getString("LineColor")); - backColor.setText(res.getString("LineBackColor")); - widthLabel.setText(res.getString("LineWidth")); - distanceLabel.setText(res.getString("LineDistance")); - flatField.setText(res.getString("FlatColor")); - centerPanel.setBorder(BorderFactory.createRaisedBevelBorder()); - centerPanel.setPreferredSize(new Dimension(400, 200)); - centerPanel.setOpaque(true); - northPanel.setPreferredSize(new Dimension(400, 150)); - southPanel.add(bCancel, null); - this.getContentPane().add(northPanel, BorderLayout.NORTH); - southPanel.add(bOK, null); - this.getContentPane().add(southPanel, BorderLayout.SOUTH); - this.getContentPane().add(centerPanel, BorderLayout.CENTER); - northPanel.add(typeLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(typeField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); - northPanel.add(gradientLower, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(urlField, new GridBagConstraints(1, 5, 2, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(alphaLabel, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(alphaField, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(taintColor, new GridBagConstraints(1, 7, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(backColor, new GridBagConstraints(1, 8, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(widthLabel, new GridBagConstraints(0, 9, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(widthField, new GridBagConstraints(1, 9, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(distanceLabel, new GridBagConstraints(0, 10, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(distanceField, new GridBagConstraints(1, 10, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(flatField, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(gradientStartField, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(gradientDistanceField, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(urlLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(gradientStartLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(gradientDistanceLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(gradientUpper, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - northPanel.add(lineColor, new GridBagConstraints(0, 8, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); - } // jbInit - - /** - * Action Listener - * @param e event - */ - public void actionPerformed(ActionEvent e) - { - if (m_setting) - return; - if (e.getSource() == bOK) - { - m_saved = true; - dispose(); - return; - } - else if (e.getSource() == bCancel) - { - dispose(); - return; - } - - /**** Field Changes ****/ - try - { - // Type - if (e.getSource() == typeField) - cmd_type(); - // Flat - else if (e.getSource() == flatField) - m_cc.setFlatColor(JColorChooser.showDialog - (this, flatField.getText(), m_cc.getFlatColor())); - // Gradient - else if (e.getSource() == gradientUpper) - m_cc.setGradientUpperColor(JColorChooser.showDialog - (this, gradientUpper.getText(), m_cc.getGradientUpperColor())); - else if (e.getSource() == gradientLower) - m_cc.setGradientLowerColor(JColorChooser.showDialog - (this, gradientLower.getText(), m_cc.getGradientLowerColor())); - else if (e.getSource() == gradientStartField) - m_cc.setGradientStartPoint - (((KeyNamePair)gradientStartField.getSelectedItem()).getKey()); - else if (e.getSource() == gradientDistanceField) - m_cc.setGradientRepeatDistance(gradientDistanceField.getText()); - // Texture - else if (e.getSource() == urlField) - m_cc.setTextureURL(urlField.getText()); - else if (e.getSource() == alphaField) - m_cc.setTextureCompositeAlpha(alphaField.getText()); - else if (e.getSource() == taintColor) - m_cc.setTextureTaintColor(JColorChooser.showDialog - (this, taintColor.getText(), m_cc.getTextureTaintColor())); - // Lines - else if (e.getSource() == lineColor) - m_cc.setLineColor(JColorChooser.showDialog - (this, lineColor.getText(), m_cc.getLineColor())); - else if (e.getSource() == backColor) - m_cc.setLineBackColor(JColorChooser.showDialog - (this, backColor.getText(), m_cc.getLineBackColor())); - else if (e.getSource() == widthField) - m_cc.setLineWidth(widthField.getText()); - else if (e.getSource() == distanceField) - m_cc.setLineDistance(distanceField.getText()); - } - catch (Exception ee) - { - } - setColor (m_cc); - } // actionPerformed - - /** - * Set Type with default values - */ - private void cmd_type() - { - ValueNamePair vp = (ValueNamePair)typeField.getSelectedItem(); - if (vp.getValue().equals(CompiereColor.TYPE_FLAT)) - m_cc = new CompiereColor(CompiereColor.TYPE_FLAT); - else if (vp.getValue().equals(CompiereColor.TYPE_GRADIENT)) - m_cc = new CompiereColor(CompiereColor.TYPE_GRADIENT); - else if (vp.getValue().equals(CompiereColor.TYPE_TEXTURE)) - m_cc = new CompiereColor(CompiereColor.TYPE_TEXTURE); - else if (vp.getValue().equals(CompiereColor.TYPE_LINES)) - m_cc = new CompiereColor(CompiereColor.TYPE_LINES); - setColor (m_cc); - } // cmd_type - - /** - * Set Color and update UI - * @param color color - */ - public void setColor (CompiereColor color) - { - if (color == null && m_cc != null) - return; - // - // System.out.println("AdempiereColorEditor.setColor " + color); - m_cc = color; - if (m_cc == null) - m_cc = CompiereColor.getDefaultBackground(); - - // update display - updateFields(); - centerPanel.setBackgroundColor(m_cc); - centerPanel.repaint(); - } // setColor - - /** - * UpdateField from AdempiereColor - */ - private void updateFields() - { - m_setting = true; - // Type - for (int i = 0; i < CompiereColor.TYPES.length; i++) - { - if (m_cc.getType().equals(CompiereColor.TYPE_VALUES[i])) - { - typeField.setSelectedItem(CompiereColor.TYPES[i]); - break; - } - } - // - if (m_cc.isFlat()) - { - flatField.setVisible(true); - gradientUpper.setVisible(false); - gradientLower.setVisible(false); - gradientStartLabel.setVisible(false); - gradientDistanceLabel.setVisible(false); - gradientStartField.setVisible(false); - gradientDistanceField.setVisible(false); - urlLabel.setVisible(false); - urlField.setVisible(false); - alphaLabel.setVisible(false); - alphaField.setVisible(false); - taintColor.setVisible(false); - lineColor.setVisible(false); - backColor.setVisible(false); - widthLabel.setVisible(false); - widthField.setVisible(false); - distanceLabel.setVisible(false); - distanceField.setVisible(false); - // - flatField.setBackground(m_cc.getFlatColor()); - } - else if (m_cc.isGradient()) - { - flatField.setVisible(false); - gradientUpper.setVisible(true); - gradientLower.setVisible(true); - gradientStartLabel.setVisible(true); - gradientDistanceLabel.setVisible(true); - gradientStartField.setVisible(true); - gradientDistanceField.setVisible(true); - urlLabel.setVisible(false); - urlField.setVisible(false); - alphaLabel.setVisible(false); - alphaField.setVisible(false); - taintColor.setVisible(false); - lineColor.setVisible(false); - backColor.setVisible(false); - widthLabel.setVisible(false); - widthField.setVisible(false); - distanceLabel.setVisible(false); - distanceField.setVisible(false); - // - gradientUpper.setBackground(m_cc.getGradientUpperColor()); - gradientLower.setBackground(m_cc.getGradientLowerColor()); - gradientDistanceField.setText(String.valueOf(m_cc.getGradientRepeatDistance())); - for (int i = 0; i < CompiereColor.GRADIENT_SP.length; i++) - { - if (m_cc.getGradientStartPoint() == CompiereColor.GRADIENT_SP_VALUES[i]) - { - gradientStartField.setSelectedItem(CompiereColor.GRADIENT_SP[i]); - break; - } - } - } - else if (m_cc.isTexture()) - { - flatField.setVisible(false); - gradientUpper.setVisible(false); - gradientLower.setVisible(false); - gradientStartLabel.setVisible(false); - gradientDistanceLabel.setVisible(false); - gradientStartField.setVisible(false); - gradientDistanceField.setVisible(false); - urlLabel.setVisible(true); - urlField.setVisible(true); - alphaLabel.setVisible(true); - alphaField.setVisible(true); - taintColor.setVisible(true); - lineColor.setVisible(false); - backColor.setVisible(false); - widthLabel.setVisible(false); - widthField.setVisible(false); - distanceLabel.setVisible(false); - distanceField.setVisible(false); - // - urlField.setText(m_cc.getTextureURL().toString()); - alphaField.setText(String.valueOf(m_cc.getTextureCompositeAlpha())); - taintColor.setBackground(m_cc.getTextureTaintColor()); - } - else if (m_cc.isLine()) - { - flatField.setVisible(false); - gradientUpper.setVisible(false); - gradientLower.setVisible(false); - gradientStartLabel.setVisible(false); - gradientDistanceLabel.setVisible(false); - gradientStartField.setVisible(false); - gradientDistanceField.setVisible(false); - urlLabel.setVisible(false); - urlField.setVisible(false); - alphaLabel.setVisible(false); - alphaField.setVisible(false); - taintColor.setVisible(false); - lineColor.setVisible(true); - backColor.setVisible(true); - widthLabel.setVisible(true); - widthField.setVisible(true); - distanceLabel.setVisible(true); - distanceField.setVisible(true); - // - lineColor.setBackground(m_cc.getLineColor()); - backColor.setBackground(m_cc.getLineBackColor()); - widthField.setText(String.valueOf(m_cc.getLineWidth())); - distanceField.setText(String.valueOf(m_cc.getLineDistance())); - } - m_setting = false; - } // updateFields - - /** - * Get Color - * @return Color, when saved - else null - */ - public CompiereColor getColor() - { - return m_cc; - } // getColor - - /** - * Was the selection saved - * @return true if saved - */ - public boolean isSaved() - { - return m_saved; - } // m_saved - - /*************************************************************************/ - - /** - * Set (or change) the object that is to be edited. Primitive types such - * as "int" must be wrapped as the corresponding object type such as - * "java.lang.Integer". - * - * @param value The new target object to be edited. Note that this - * object should not be modified by the PropertyEditor, rather - * the PropertyEditor should create a new object to hold any - * modified value. - */ - public void setValue(Object value) - { - if (value != null && value instanceof CompiereColor) - setColor (new CompiereColor((CompiereColor)value)); - else - throw new IllegalArgumentException("AdempiereColorEditor.setValue requires AdempiereColor"); - } // setValue - - /** - * Gets the property value. - * - * @return The value of the property. Primitive types such as "int" will - * be wrapped as the corresponding object type such as "java.lang.Integer". - */ - public Object getValue() - { - return getColor(); - } // getColor - - /** - * Determines whether this property editor is paintable. - * @return True if the class will honor the paintValue method. - */ - public boolean isPaintable() - { - return false; - } - - /** - * Paint a representation of the value into a given area of screen - * real estate. Note that the propertyEditor is responsible for doing - * its own clipping so that it fits into the given rectangle. - *

    - * If the PropertyEditor doesn't honor paint requests (see isPaintable) - * this method should be a silent noop. - *

    - * The given Graphics object will have the default font, color, etc of - * the parent container. The PropertyEditor may change graphics attributes - * such as font and color and doesn't need to restore the old values. - * - * @param gfx Graphics object to paint into. - * @param box Rectangle within graphics object into which we should paint. - */ - public void paintValue(Graphics gfx, Rectangle box) - { - /**@todo: Implement this java.beans.PropertyEditor method*/ - throw new java.lang.UnsupportedOperationException("Method paintValue() not yet implemented."); - } // paintValue - - /** - * This method is intended for use when generating Java code to set - * the value of the property. It should return a fragment of Java code - * that can be used to initialize a variable with the current property - * value. - *

    - * Example results are "2", "new Color(127,127,34)", "Color.orange", etc. - * - * @return A fragment of Java code representing an initializer for the - * current value. - */ - public String getJavaInitializationString() - { - return "new AdempiereColor()"; - } // String getJavaInitializationString - - /** - * Gets the property value as text. - * - * @return The property value as a human editable string. - *

    Returns null if the value can't be expressed as an editable string. - *

    If a non-null value is returned, then the PropertyEditor should - * be prepared to parse that string back in setAsText(). - */ - public String getAsText() - { - return m_cc.toString(); - } // getAsText - - /** - * Set the property value by parsing a given String. May raise - * java.lang.IllegalArgumentException if either the String is - * badly formatted or if this kind of property can't be expressed - * as text. - * @param text The string to be parsed. - * @throws IllegalArgumentException - */ - public void setAsText(String text) throws java.lang.IllegalArgumentException - { - throw new java.lang.IllegalArgumentException("AdempiereColorEditor.setAsText not supported"); - } // setAsText - - /** - * If the property value must be one of a set of known tagged values, - * then this method should return an array of the tags. This can - * be used to represent (for example) enum values. If a PropertyEditor - * supports tags, then it should support the use of setAsText with - * a tag value as a way of setting the value and the use of getAsText - * to identify the current value. - * - * @return The tag values for this property. May be null if this - * property cannot be represented as a tagged value. - */ - public String[] getTags() - { - return null; - } // getTags - - /** - * A PropertyEditor may choose to make available a full custom Component - * that edits its property value. It is the responsibility of the - * PropertyEditor to hook itself up to its editor Component itself and - * to report property value changes by firing a PropertyChange event. - *

    - * The higher-level code that calls getCustomEditor may either embed - * the Component in some larger property sheet, or it may put it in - * its own individual dialog, or ... - * - * @return A java.awt.Component that will allow a human to directly - * edit the current property value. May be null if this is - * not supported. - */ - public Component getCustomEditor() - { - return this; - } // getCustomEditor - - /** - * Determines whether this property editor supports a custom editor. - * @return True if the propertyEditor can provide a custom editor. - */ - public boolean supportsCustomEditor() - { - return true; - } // supportsCustomEditor - - /** - * Register a listener for the PropertyChange event. When a - * PropertyEditor changes its value it should fire a PropertyChange - * event on all registered PropertyChangeListeners, specifying the - * null value for the property name and itself as the source. - * - * @param listener An object to be invoked when a PropertyChange - * event is fired. - */ - public void addPropertyChangeListener(PropertyChangeListener listener) - { - super.addPropertyChangeListener(listener); - } // addPropertyChangeListener - - /** - * Remove a listener for the PropertyChange event. - * @param listener The PropertyChange listener to be removed. - */ - public void removePropertyChangeListener(PropertyChangeListener listener) - { - super.removePropertyChangeListener(listener); - } // removePropertyChangeListener - -} // AdempiereColorEditor diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/ExtendedTheme.java b/org.adempiere.ui.swing/src/org/compiere/swing/ExtendedTheme.java deleted file mode 100644 index f77b18b7ff..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/ExtendedTheme.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.compiere.swing; - -import java.util.Map; - -import javax.swing.plaf.ColorUIResource; - -public interface ExtendedTheme { - - public ColorUIResource getWhite(); - public ColorUIResource getBlack(); - public ColorUIResource getErrorForeground(); - public ColorUIResource getErrorBackground(); - public ColorUIResource getInactiveBackground(); - public ColorUIResource getMandatoryBackground(); - public ColorUIResource getInfoBackground(); - - public final static ColorUIResource DEFAULT_MANDATORY_BG = new ColorUIResource(224, 224, 255); // blue-isch - public final static ColorUIResource DEFAULT_ERROR_BG = new ColorUIResource(255, 204, 204); // red-isch - public final static ColorUIResource DEFAULT_ERROR_FG = new ColorUIResource(204, 0, 0); // dark red - public final static ColorUIResource DEFAULT_INACTIVE_BG = new ColorUIResource(234, 234, 234); // light gray - public final static ColorUIResource DEFAULT_INFO_BG = new ColorUIResource(253, 237, 207); // light yellow - public final static ColorUIResource DEFAULT_SELECTED_BG = new ColorUIResource(240, 248, 255); // light gray - public final static ColorUIResource DEFAULT_READONLY_BG = new ColorUIResource(255, 245, 238); // light yellow - - public void setUIProperties(Map propertyMap); - - public final static String ERROR_BG_KEY = "TextField.errorBackground"; - public final static String ERROR_FG_KEY = "TextField.errorForeground"; - public final static String MANDATORY_BG_KEY = "TextField.mandatoryBackground"; - public final static String INACTIVE_BG_KEY = "TextField.inactiveBackground"; - public final static String INFO_BG_KEY = "Info.background"; - public final static String SELECTED_BG_KEY = "TextField.selectedBackground"; - public final static String READONLY_BG_KEY = "TextField.readonlyBackground"; -} diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/FontChooser.java b/org.adempiere.ui.swing/src/org/compiere/swing/FontChooser.java deleted file mode 100644 index c553c9cef5..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/FontChooser.java +++ /dev/null @@ -1,324 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.BorderLayout; -import java.awt.Dialog; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.GraphicsEnvironment; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.Arrays; -import java.util.ResourceBundle; - -import javax.swing.BorderFactory; -import javax.swing.JTextArea; - -import org.adempiere.plaf.AdempierePLAF; - -/** - * Font Chooser Dialog - * - * @author Jorg Janke - * @version $Id: FontChooser.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $ - */ -public class FontChooser extends CDialog - implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -755094979517882166L; - - /** - * Show Dialog with initial font and return selected font - * @param owner Base window - * @param title Chooser Title - * @param initFont initial font - * @return selected font - */ - public static Font showDialog (Dialog owner, String title, Font initFont) - { - Font retValue = initFont; - FontChooser fc = new FontChooser(owner, title, initFont); - retValue = fc.getFont(); - fc = null; - return retValue; - } // showDialog - - - /************************************************************************** - * Constructor - * - * @param owner Base window - * @param title Chooser Title - * @param initFont Initial Font - */ - public FontChooser(Dialog owner, String title, Font initFont) - { - super(owner, title, true); - try - { - jbInit(); - dynInit(); - setFont(initFont); - AdempierePLAF.showCenterScreen(this); - } - catch(Exception ex) - { - System.err.println ("FontChooser"); - ex.printStackTrace(); - } - } // FontChooser - - /** - * IDE Constructor - */ - public FontChooser() - { - this (null, s_res.getString("FontChooser"), null); - } // FontChooser - - static ResourceBundle s_res = ResourceBundle.getBundle("org.compiere.plaf.PlafRes"); - - /** Static list of Styles */ - public static FontStyle[] s_list = { - new FontStyle(s_res.getString("Plain"), Font.PLAIN), - new FontStyle(s_res.getString("Italic"), Font.ITALIC), - new FontStyle(s_res.getString("Bold"), Font.BOLD), - new FontStyle(s_res.getString("BoldItalic"), Font.BOLD|Font.ITALIC)}; - - private Font m_font = super.getFont(); - private Font m_retFont = null; - - private boolean m_setting = false; - - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private CPanel selectPanel = new CPanel(); - private CLabel nameLabel = new CLabel(); - private CComboBoxfontName = new CComboBox(); - private CLabel sizeLabel = new CLabel(); - private CLabel styleLabel = new CLabel(); - private CComboBoxfontStyle = new CComboBox(); - private CComboBoxfontSize = new CComboBox(); - private JTextArea fontTest = new JTextArea(); - private JTextArea fontInfo = new JTextArea(); - private GridBagLayout selectLayout = new GridBagLayout(); - private CPanel confirmPanel = new CPanel(); - private CButton bCancel = AdempierePLAF.getCancelButton(); - private CButton bOK = AdempierePLAF.getOKButton(); - private FlowLayout confirmLayout = new FlowLayout(); - - /** - * Static Layout - * @throws Exception - */ - private void jbInit() throws Exception - { - mainPanel.setLayout(mainLayout); - nameLabel.setText(s_res.getString("Name")); - selectPanel.setLayout(selectLayout); - sizeLabel.setText(s_res.getString("Size")); - styleLabel.setText(s_res.getString("Style")); - fontTest.setText(s_res.getString("TestString")); - fontTest.setLineWrap(true); - fontTest.setWrapStyleWord(true); - fontTest.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - fontTest.setBorder(BorderFactory.createLoweredBevelBorder()); - fontTest.setPreferredSize(new Dimension(220, 100)); - fontInfo.setText(s_res.getString("FontString")); - fontInfo.setLineWrap(true); - fontInfo.setWrapStyleWord(true); - fontInfo.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - fontInfo.setOpaque(false); - fontInfo.setEditable(false); - confirmPanel.setLayout(confirmLayout); - confirmLayout.setAlignment(FlowLayout.RIGHT); - confirmPanel.setOpaque(false); - selectPanel.setOpaque(false); - getContentPane().add(mainPanel); - mainPanel.add(selectPanel, BorderLayout.CENTER); - selectPanel.add(nameLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - selectPanel.add(fontName, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - selectPanel.add(sizeLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - selectPanel.add(styleLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - selectPanel.add(fontStyle, new GridBagConstraints(1, 2, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - selectPanel.add(fontSize, new GridBagConstraints(1, 1, 2, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); - selectPanel.add(fontTest, new GridBagConstraints(0, 3, 2, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(20, 5, 5, 5), 0, 0)); - selectPanel.add(fontInfo, new GridBagConstraints(0, 4, 2, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(10, 5, 10, 5), 0, 0)); - // - mainPanel.add(confirmPanel, BorderLayout.SOUTH); - confirmPanel.add(bCancel, null); - confirmPanel.add(bOK, null); - bCancel.addActionListener(this); - bOK.addActionListener(this); - } // jbInit - - /** - * Dynamic Init - */ - private void dynInit() - { - String[] names = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); - Arrays.sort(names); - for (int i = 0; i < names.length; i++) - fontName.addItem(names[i]); - fontName.addActionListener(this); - // - for (int i = 6; i < 32; i++) - fontSize.addItem(String.valueOf(i)); - fontSize.addActionListener(this); - // - for (int i = 0; i < s_list.length; i++) - fontStyle.addItem(s_list[i]); - fontStyle.addActionListener(this); - } // dynInit - - /** - * Set Font - sets font for chooser - not the component font - * @param font - */ - public void setFont(Font font) - { - if (font == null) - return; - // Log.trace("FontChooser.setFont - " + font.toString()); - if (m_retFont == null) - m_retFont = font; - // - fontTest.setFont(font); - fontInfo.setFont(font); - fontInfo.setText(font.toString()); - // - m_setting = true; - fontName.setSelectedItem(font.getName()); - if (!fontName.getSelectedItem().equals(font.getName())) - System.err.println("FontChooser.setFont" + fontName.getSelectedItem().toString() + " <> " + font.getName()); - // - fontSize.setSelectedItem(String.valueOf(font.getSize())); - if (!fontSize.getSelectedItem().equals(String.valueOf(font.getSize()))) - System.err.println("FontChooser.setFont" + fontSize.getSelectedItem() + " <> " + font.getSize()); - // find style - for (int i = 0; i < s_list.length; i++) - if (s_list[i].getID() == font.getStyle()) - fontStyle.setSelectedItem(s_list[i]); - if (((FontStyle)fontStyle.getSelectedItem()).getID() != font.getStyle()) - System.err.println("FontChooser.setFont" + ((FontStyle)fontStyle.getSelectedItem()).getID() + " <> " + font.getStyle()); - // - m_font = font; - this.pack(); - m_setting = false; - } // setFont - - /** - * Return selected font - * @return font - */ - public Font getFont() - { - return m_retFont; - } // getFont - - /** - * ActionListener - * @param e - */ - public void actionPerformed(ActionEvent e) - { - if (m_setting) - return; - - if (e.getSource() == bOK) - { - m_retFont = m_font; - dispose(); - } - - else if (e.getSource() == bCancel) - dispose(); - - else if (e.getSource() == fontName) - { - String s = fontName.getSelectedItem().toString(); - m_font = new Font(s, m_font.getStyle(), m_font.getSize()); - } - else if (e.getSource() == fontSize) - { - String s = fontSize.getSelectedItem().toString(); - m_font = new Font(m_font.getName(), m_font.getStyle(), Integer.parseInt(s)); - } - else if (e.getSource() == fontStyle) - { - FontStyle fs = (FontStyle)fontStyle.getSelectedItem(); - m_font = new Font(m_font.getName(), fs.getID(), m_font.getSize()); - } - // System.out.println("NewFont - " + m_font.toString()); - setFont(m_font); - } // actionPerformed -} // FontChooser - -/** - * Font Style Value Object - */ -class FontStyle -{ - /** - * Create FontStyle - * @param name - * @param id - */ - public FontStyle(String name, int id) - { - m_name = name; - m_id = id; - } // FontStyle - - private String m_name; - private int m_id; - - /** - * Get Name - * @return name - */ - public String toString() - { - return m_name; - } // getName - - /** - * Get int value of Font Style - * @return id - */ - public int getID() - { - return m_id; - } // getID -} // FontStyle diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/ShadowBorder.java b/org.adempiere.ui.swing/src/org/compiere/swing/ShadowBorder.java deleted file mode 100644 index 17444ae62e..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/ShadowBorder.java +++ /dev/null @@ -1,77 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Graphics; -import java.awt.Insets; - -import javax.swing.UIManager; -import javax.swing.border.AbstractBorder; - -/** - * A border with a drop shadow. - * Extracted from JGoodies look demo. - * @author Low Heng Sin - * @version 2006-11-24 - */ -public class ShadowBorder extends AbstractBorder { - - /** - * - */ - private static final long serialVersionUID = 4027643023639628783L; - private static final Insets INSETS = new Insets(1, 1, 3, 3); - - public Insets getBorderInsets(Component c) { return INSETS; } - - public void paintBorder(Component c, Graphics g, - int x, int y, int w, int h) { - - Color shadow = UIManager.getColor("controlShadow"); - if (shadow == null) { - shadow = Color.GRAY; - } - Color lightShadow = new Color(shadow.getRed(), - shadow.getGreen(), - shadow.getBlue(), - 170); - Color lighterShadow = new Color(shadow.getRed(), - shadow.getGreen(), - shadow.getBlue(), - 70); - g.translate(x, y); - - g.setColor(shadow); - g.fillRect(0, 0, w - 3, 1); - g.fillRect(0, 0, 1, h - 3); - g.fillRect(w - 3, 1, 1, h - 3); - g.fillRect(1, h - 3, w - 3, 1); - // Shadow line 1 - g.setColor(lightShadow); - g.fillRect(w - 3, 0, 1, 1); - g.fillRect(0, h - 3, 1, 1); - g.fillRect(w - 2, 1, 1, h - 3); - g.fillRect(1, h - 2, w - 3, 1); - // Shadow line2 - g.setColor(lighterShadow); - g.fillRect(w - 2, 0, 1, 1); - g.fillRect(0, h - 2, 1, 1); - g.fillRect(w-2, h-2, 1, 1); - g.fillRect(w - 1, 1, 1, h - 2); - g.fillRect(1, h - 1, w - 2, 1); - g.translate(-x, -y); - } -} diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/StackedBox.java b/org.adempiere.ui.swing/src/org/compiere/swing/StackedBox.java deleted file mode 100644 index 9dfc051ce1..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/StackedBox.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * $Id: StackedBox.java.txt,v 1.1 2006/03/09 20:48:47 rbair Exp $ - * - * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle, - * Santa Clara, California 95054, U.S.A. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -package org.compiere.swing; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Insets; -import java.awt.Rectangle; - -import javax.swing.Action; -import javax.swing.BorderFactory; -import javax.swing.JPanel; -import javax.swing.JViewport; -import javax.swing.Scrollable; -import javax.swing.UIManager; -import javax.swing.border.Border; -import javax.swing.border.CompoundBorder; - -import org.jdesktop.swingx.JXCollapsiblePane; -import org.jdesktop.swingx.JXHyperlink; -import org.jdesktop.swingx.VerticalLayout; - -/** - * Stacks components vertically in boxes. Each box is created with a title and a - * component.
    - * - *

    - * The StackedBox can be added to a - * {@link javax.swing.JScrollPane}. - * - *

    - * - * @author Frederic Lavigne - */ -public class StackedBox extends JPanel implements Scrollable { - - /** - * - */ - private static final long serialVersionUID = -8233461475245242991L; -private Color titleBackgroundColor; - private Color titleForegroundColor; - private Color separatorColor; - private Border separatorBorder; - - public StackedBox() { - setLayout(new VerticalLayout()); - setOpaque(true); - setBackground(Color.WHITE); - - separatorBorder = new SeparatorBorder(); - setTitleForegroundColor(Color.BLACK); - setTitleBackgroundColor(new Color(248, 248, 248)); - setSeparatorColor(new Color(214, 223, 247)); - } - - public Color getSeparatorColor() { - return separatorColor; - } - - public void setSeparatorColor(Color separatorColor) { - this.separatorColor = separatorColor; - } - - public Color getTitleForegroundColor() { - return titleForegroundColor; - } - - public void setTitleForegroundColor(Color titleForegroundColor) { - this.titleForegroundColor = titleForegroundColor; - } - - public Color getTitleBackgroundColor() { - return titleBackgroundColor; - } - - public void setTitleBackgroundColor(Color titleBackgroundColor) { - this.titleBackgroundColor = titleBackgroundColor; - } - - /** - * Adds a new component to this StackedBox - * - * @param title - * @param component - */ - public void addBox(String title, Component component) { - final JXCollapsiblePane collapsible = new JXCollapsiblePane(); - collapsible.getContentPane().setBackground(Color.WHITE); - collapsible.add(component); - collapsible.setBorder(new CompoundBorder(separatorBorder, collapsible - .getBorder())); - - Action toggleAction = collapsible.getActionMap().get( - JXCollapsiblePane.TOGGLE_ACTION); - // use the collapse/expand icons from the JTree UI - toggleAction.putValue(JXCollapsiblePane.COLLAPSE_ICON, UIManager - .getIcon("Tree.expandedIcon")); - toggleAction.putValue(JXCollapsiblePane.EXPAND_ICON, UIManager - .getIcon("Tree.collapsedIcon")); - - JXHyperlink link = new JXHyperlink(toggleAction); - link.setText(title); - link.setFont(link.getFont().deriveFont(Font.BOLD)); - link.setOpaque(true); - link.setBackground(getTitleBackgroundColor()); - link.setFocusPainted(false); - - link.setUnclickedColor(getTitleForegroundColor()); - link.setClickedColor(getTitleForegroundColor()); - - link.setBorder(new CompoundBorder(separatorBorder, BorderFactory - .createEmptyBorder(2, 4, 2, 4))); - link.setBorderPainted(true); - - add(link); - add(collapsible); - } - - /** - * @see Scrollable#getPreferredScrollableViewportSize() - */ - public Dimension getPreferredScrollableViewportSize() { - return getPreferredSize(); - } - - /** - * @see Scrollable#getScrollableBlockIncrement(java.awt.Rectangle, int, int) - */ - public int getScrollableBlockIncrement(Rectangle visibleRect, - int orientation, int direction) { - return 10; - } - - /** - * @see Scrollable#getScrollableTracksViewportHeight() - */ - public boolean getScrollableTracksViewportHeight() { - if (getParent() instanceof JViewport) { - return (((JViewport)getParent()).getHeight() > getPreferredSize().height); - } else { - return false; - } - } - - /** - * @see Scrollable#getScrollableTracksViewportWidth() - */ - public boolean getScrollableTracksViewportWidth() { - return true; - } - - /** - * @see Scrollable#getScrollableUnitIncrement(java.awt.Rectangle, int, int) - */ - public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, - int direction) { - return 10; - } - - /** - * The border between the stack components. It separates each component with a - * fine line border. - */ - class SeparatorBorder implements Border { - - boolean isFirst(Component c) { - return c.getParent() == null || c.getParent().getComponent(0) == c; - } - - public Insets getBorderInsets(Component c) { - // if the collapsible is collapsed, we do not want its border to be - // painted. - if (c instanceof JXCollapsiblePane) { - if (((JXCollapsiblePane)c).isCollapsed()) { return new Insets(0, 0, 0, - 0); } - } - return new Insets(isFirst(c)?4:1, 0, 1, 0); - } - - public boolean isBorderOpaque() { - return true; - } - - public void paintBorder(Component c, Graphics g, int x, int y, int width, - int height) { - g.setColor(getSeparatorColor()); - if (isFirst(c)) { - g.drawLine(x, y + 2, x + width, y + 2); - } - g.drawLine(x, y + height - 1, x + width, y + height - 1); - } - } - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/TableCellNone.java b/org.adempiere.ui.swing/src/org/compiere/swing/TableCellNone.java deleted file mode 100644 index 76dbf00034..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/TableCellNone.java +++ /dev/null @@ -1,76 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2007 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.compiere.swing; - -import java.awt.Component; -import java.util.EventObject; - -import javax.swing.JTable; -import javax.swing.event.CellEditorListener; -import javax.swing.table.TableCellEditor; -import javax.swing.table.TableCellRenderer; - -/** - * Dummy editor and renderer use for invisible column - * @author Low Heng Sin - * - */ -public class TableCellNone implements TableCellEditor, TableCellRenderer { - - private Object m_value; - @SuppressWarnings("unused") - private String m_columnName; - - public TableCellNone(String columnName) { - m_columnName = columnName; - } - - public Component getTableCellEditorComponent(JTable table, Object value, - boolean isSelected, int row, int column) { - m_value = value; - return null; - } - - public void addCellEditorListener(CellEditorListener l) { - } - - public void cancelCellEditing() { - } - - public Object getCellEditorValue() { - return m_value; - } - - public boolean isCellEditable(EventObject anEvent) { - return false; - } - - public void removeCellEditorListener(CellEditorListener l) { - } - - public boolean shouldSelectCell(EventObject anEvent) { - return false; - } - - public boolean stopCellEditing() { - return true; - } - - public Component getTableCellRendererComponent(JTable table, Object value, - boolean isSelected, boolean hasFocus, int row, int column) { - m_value = value; - return null; - } - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/ThemeUtils.java b/org.adempiere.ui.swing/src/org/compiere/swing/ThemeUtils.java deleted file mode 100644 index fac8b60144..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/ThemeUtils.java +++ /dev/null @@ -1,221 +0,0 @@ -package org.compiere.swing; - -import java.awt.Color; -import java.awt.Font; -import java.awt.SystemColor; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.swing.plaf.ColorUIResource; -import javax.swing.plaf.FontUIResource; -import javax.swing.plaf.metal.MetalTheme; - -import org.compiere.plaf.CompiereColor; - -public final class ThemeUtils { - - /** Logger */ - private static Logger log = Logger.getLogger(ThemeUtils.class.getName()); - - /** - * Parses Color into String representation. - * Required as SystemColors and Alpha Colors have different formats - * @param c Color - * @return [r=102,g=102,b=153,a=255] - * @see #parseColor - */ - public static String getColorAsString (Color c) - { - if (c == null) - c = SystemColor.control; - StringBuffer sb = new StringBuffer("[r=").append(c.getRed()) - .append(",g=").append(c.getGreen()) - .append(",b=").append(c.getBlue()) - .append(",a=").append(c.getAlpha()) - .append("]"); - // System.out.println(sb.toString()); - return sb.toString(); - } // getColorAsString - - /** - * Parse Color. - *

    - * Color - [r=102,g=102,b=153,a=0] - * - * @param information string information to be parsed - * @param stdColor color used if info cannot parsed - * @return color - * @see #getColorAsString - */ - public static ColorUIResource parseColor (String information, ColorUIResource stdColor) - { - if (information == null - || information.length() == 0 - || information.trim().length() == 0) - return stdColor; - // System.out.print("ParseColor=" + info); - try - { - int r = Integer.parseInt(information.substring(information.indexOf("r=")+2, information.indexOf(",g="))); - int g = Integer.parseInt(information.substring(information.indexOf("g=")+2, information.indexOf(",b="))); - int b = 0; - int a = 255; - if (information.indexOf("a=") == -1) - b = Integer.parseInt(information.substring(information.indexOf("b=")+2, information.indexOf(']'))); - else - { - b = Integer.parseInt(information.substring(information.indexOf("b=")+2, information.indexOf(",a="))); - a = Integer.parseInt(information.substring(information.indexOf("a=")+2, information.indexOf(']'))); - } - ColorUIResource retValue = new ColorUIResource(new Color(r, g, b, a)); - // System.out.println(" - " + retValue.toString()); - return retValue; - } - catch (Exception e) - { - if (log.isLoggable(Level.CONFIG)) log.config(information + " - cannot parse: " + e.toString()); - } - return stdColor; - } // parseColor - - /** - * Parse Font - *

    - * javax.swing.plaf.FontUIResource[family=dialog.bold,name=Dialog,style=bold,size=12] - * - * @param information string information to be parsed - * @param stdFont font used if info cannot be parsed - * @return font - */ - public static FontUIResource parseFont(String information, FontUIResource stdFont) - { - if (information == null - || information.length() == 0 - || information.trim().length() == 0) - return stdFont; - // System.out.print("ParseFont=" + info); - try - { - String name = information.substring(information.indexOf("name=")+5, information.indexOf(",style=")); - String s = information.substring(information.indexOf("style=")+6, information.indexOf(",size=")); - int style = Font.PLAIN; - if (s.equals("bold")) - style = Font.BOLD; - else if (s.equals("italic")) - style = Font.ITALIC; - else if (s.equals("bolditalic")) - style = Font.BOLD | Font.ITALIC; - int size = Integer.parseInt(information.substring(information.indexOf(",size=")+6, information.lastIndexOf(']'))); - FontUIResource retValue = new FontUIResource(name,style,size); - // System.out.println(" - " + retValue.toString()); - return retValue; - } - catch (Exception e) - { - if (log.isLoggable(Level.CONFIG)) log.config(information + " - cannot parse: " + e.toString()); - } - return stdFont; - } // parseFont - - // Static property info - public static final String P_Primary1 = "#ColorPrimary1"; - public static final String P_Primary2 = "#ColorPrimary2"; - public static final String P_Primary3 = "#ColorPrimary3"; - public static final String P_Secondary1 = "#ColorSecondary1"; - public static final String P_Secondary2 = "#ColorSecondary2"; - public static final String P_Secondary3 = "#ColorSecondary3"; - public static final String P_Black = "#ColorBlack"; - public static final String P_White = "#ColorWhite"; - public static final String P_Error = "#ColorError"; - public static final String P_Info = "#ColorInfo"; - public static final String P_Mandatory = "#ColorMandatory"; - public static final String P_Inactive = "#ColorInactive"; - public static final String P_Txt_OK = "#ColorTextOK"; - public static final String P_Txt_Error = "#ColorTextError"; - // - public static final String P_Control = "#FontControl"; - public static final String P_System = "#FontSystem"; - public static final String P_User = "#FontUser"; - public static final String P_Small = "#FontSmall"; - public static final String P_Window = "#FontWindow"; - public static final String P_Menu = "#FontMenu"; - - /** - * Save information in Properties - */ - public static void save (Properties properties, MetalTheme theme) - { - if (log.isLoggable(Level.CONFIG)) log.config(CompiereColor.getDefaultBackground().toString()); - // - properties.setProperty(P_Primary1, getColorAsString(theme.getPrimaryControlDarkShadow())); - properties.setProperty(P_Primary2, getColorAsString(theme.getPrimaryControlShadow())); - properties.setProperty(P_Primary3, getColorAsString(theme.getPrimaryControl())); - properties.setProperty(P_Secondary1, getColorAsString(theme.getControlDarkShadow())); - properties.setProperty(P_Secondary2, getColorAsString(theme.getControlShadow())); - properties.setProperty(P_Secondary3, getColorAsString(theme.getControl())); - properties.setProperty(P_Txt_OK, getColorAsString(theme.getUserTextColor())); - - if ( theme instanceof ExtendedTheme ) { - ExtendedTheme e = (ExtendedTheme)theme; - properties.setProperty(P_Error, getColorAsString(e.getErrorBackground())); - properties.setProperty(P_Txt_Error, getColorAsString(e.getErrorForeground())); - properties.setProperty(P_Mandatory, getColorAsString(e.getMandatoryBackground())); - properties.setProperty(P_Inactive, getColorAsString(e.getInactiveBackground())); - properties.setProperty(P_White, getColorAsString(e.getWhite())); - properties.setProperty(P_Black, getColorAsString(e.getBlack())); - properties.setProperty(P_Info, getColorAsString(e.getInfoBackground())); - } else { - properties.setProperty(P_White, getColorAsString(Color.white)); - properties.setProperty(P_Black, getColorAsString(Color.black)); - properties.setProperty(P_Error, getColorAsString(ExtendedTheme.DEFAULT_ERROR_BG)); - properties.setProperty(P_Txt_Error, getColorAsString(ExtendedTheme.DEFAULT_ERROR_FG)); - properties.setProperty(P_Mandatory, getColorAsString(ExtendedTheme.DEFAULT_MANDATORY_BG)); - properties.setProperty(P_Inactive, getColorAsString(ExtendedTheme.DEFAULT_INACTIVE_BG)); - properties.setProperty(P_Info, getColorAsString(theme.getPrimaryControl())); - } - - // - properties.setProperty(P_Control, (theme.getControlTextFont()).toString()); - properties.setProperty(P_System, (theme.getSystemTextFont()).toString()); - properties.setProperty(P_User, (theme.getUserTextFont()).toString()); - properties.setProperty(P_Small, (theme.getSubTextFont()).toString()); - properties.setProperty(P_Window, (theme.getWindowTitleFont()).toString()); - properties.setProperty(P_Menu, (theme.getMenuTextFont()).toString()); - - } // save - - - /** - * Load Properties from properties - */ - public static void load (Properties properties, ExtendedTheme theme) - { - Map p = new HashMap(); - p.put(P_Primary1, parseColor (properties.getProperty(P_Primary1),null)); - p.put(P_Primary2, parseColor (properties.getProperty(P_Primary2),null)); - p.put(P_Primary3, parseColor (properties.getProperty(P_Primary3), null)); - p.put(P_Secondary1, parseColor (properties.getProperty(P_Secondary1), null)); - p.put(P_Secondary2, parseColor (properties.getProperty(P_Secondary2), null)); - p.put(P_Secondary3, parseColor (properties.getProperty(P_Secondary3), null)); - p.put(P_Error, parseColor(properties.getProperty(P_Error), null)); - p.put(P_Info, parseColor(properties.getProperty(P_Info), null)); - p.put(P_Mandatory, parseColor(properties.getProperty(P_Mandatory), null)); - p.put(P_Inactive, parseColor(properties.getProperty(P_Inactive), null)); - p.put(P_White,parseColor(properties.getProperty(P_White), null)); - p.put(P_Black, parseColor(properties.getProperty(P_Black), null)); - p.put(P_Txt_OK, parseColor(properties.getProperty(P_Txt_OK), null)); - p.put(P_Txt_Error,parseColor(properties.getProperty(P_Txt_Error), null)); - // - p.put(P_Control, parseFont(properties.getProperty(P_Control), null)); - p.put(P_System, parseFont(properties.getProperty(P_System), null)); - p.put(P_User, parseFont(properties.getProperty(P_User), null)); - p.put(P_Small, parseFont(properties.getProperty(P_Small), null)); - p.put(P_Window, parseFont(properties.getProperty(P_Window), null)); - p.put(P_Menu, parseFont(properties.getProperty(P_Menu), null)); - // - theme.setUIProperties(p); - } // load -} diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/package.html b/org.adempiere.ui.swing/src/org/compiere/swing/package.html deleted file mode 100644 index 46380c5000..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/swing/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - -

    -Provides Swing components to utilize the Adempiere Looks. -

    -

    Package Specification

    -

    -In the standard implementation, panels and panes are opaque. -Adempiere Looks sets opaque to false for JViewport, JScrollPane, JSplitPane and JTabbedPane -but not for JPanel and JButton. -

    -The Adempiere Swing extensions like CPanel, CButton are not opaque. -

    -

    Related Documentation

    -

    For overviews, tutorials, examples, guides, and tool documentation, please - see: http://www.adempiere.org/looks

    -

    - -

    - - diff --git a/org.adempiere.ui.swing/src/org/compiere/util/IniDialog.java b/org.adempiere.ui.swing/src/org/compiere/util/IniDialog.java deleted file mode 100644 index 81ae3d535c..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/util/IniDialog.java +++ /dev/null @@ -1,196 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.util; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.net.URL; -import java.util.ResourceBundle; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JEditorPane; -import javax.swing.JLabel; -import javax.swing.JScrollPane; - -import org.adempiere.plaf.AdempierePLAF; -import org.compiere.swing.CPanel; - -/** - * Init Dialog - * - * @author Jorg Janke - * @version $Id: IniDialog.java,v 1.3 2006/10/12 00:58:32 jjanke Exp $ - */ -public final class IniDialog extends JDialog implements ActionListener -{ - /** - * - */ - private static final long serialVersionUID = -1469122685638342569L; - - /** - * Constructor - */ - public IniDialog() - { - super(); - try - { - jbInit(); - String where = "org/compiere/license.html"; - URL url = null; - ClassLoader cl = getClass().getClassLoader(); - if (cl != null) // Bootstrap - url = cl.getResource(where); - if (url == null) - { - log.warning("No license in resource "); - url = new URL("http://www.adempiere.org/license.htm"); - } - //if (url == null) - //cmd_reject(); - // - licensePane.setPage(url); - AdempierePLAF.showCenterScreen(this); - } - catch (Exception ex) - { - log.log(Level.SEVERE, "init", ex); - cmd_reject(); - } - } // IniDialog - - /** Translation */ - static ResourceBundle s_res = ResourceBundle.getBundle("org.compiere.util.IniRes"); - private boolean m_accept = false; - /** Logger */ - private static Logger log = Logger.getLogger (IniDialog.class.getName()); - - - private CPanel mainPanel = new CPanel(); - private BorderLayout mainLayout = new BorderLayout(); - private JScrollPane scrollPane = new JScrollPane(); - private CPanel southPanel = new CPanel(); - private JButton bReject = AdempierePLAF.getCancelButton(); - private JButton bAccept = AdempierePLAF.getOKButton(); - private FlowLayout southLayout = new FlowLayout(); - private JLabel southLabel = new JLabel(); - private JEditorPane licensePane = new JEditorPane(); - - /** - * Static Layout - * @throws Exception - */ - private void jbInit() throws Exception - { - setTitle("Adempiere - " + s_res.getString("Adempiere_License")); - southLabel.setText(s_res.getString("Do_you_accept")); - bReject.setText(s_res.getString("No")); - bAccept.setText(s_res.getString("Yes_I_Understand")); - // - setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - setModal(true); - // - mainPanel.setLayout(mainLayout); - bReject.setForeground(Color.red); - bReject.addActionListener(this); - bAccept.addActionListener(this); - southPanel.setLayout(southLayout); - southLayout.setAlignment(FlowLayout.RIGHT); - licensePane.setEditable(false); - licensePane.setContentType("text/html"); - scrollPane.setPreferredSize(new Dimension(700, 400)); - southPanel.add(southLabel, null); - getContentPane().add(mainPanel); - mainPanel.add(scrollPane, BorderLayout.CENTER); - scrollPane.getViewport().add(licensePane, null); - mainPanel.add(southPanel, BorderLayout.SOUTH); - southPanel.add(bReject, null); - southPanel.add(bAccept, null); - } // jbInit - - /** - * ActionListener - * @param e event - */ - public final void actionPerformed(ActionEvent e) - { - if (e.getSource() == bAccept) - m_accept = true; - dispose(); - } // actionPerformed - - /** - * Dispose - */ - public final void dispose() - { - super.dispose(); - if (!m_accept) - cmd_reject(); - } // dispose - - /** - * Is Accepted - * @return true if accepted - */ - public final boolean isAccepted() - { - return m_accept; - } // isAccepted - - /** - * Reject License - */ - public final void cmd_reject() - { - String info = "License rejected or expired"; - try - { - info = s_res.getString("License_rejected"); - } - catch (Exception e) - { - } - log.severe(info); - System.exit(10); - } // cmd_reject - - /** - * Display License and exit if rejected - * @return true if acceptes - */ - public static final boolean accept() - { - IniDialog id = new IniDialog(); - if (id.isAccepted()) - { - log.info("License Accepted"); - return true; - } - System.exit(10); - return false; // never executed. - } // accpept - -} // IniDialog diff --git a/org.adempiere.ui.swing/src/org/compiere/util/MiniBrowser.java b/org.adempiere.ui.swing/src/org/compiere/util/MiniBrowser.java deleted file mode 100644 index 7cf4e8dd72..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/util/MiniBrowser.java +++ /dev/null @@ -1,118 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.util; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.net.URL; - -import javax.swing.JDialog; -import javax.swing.JEditorPane; -import javax.swing.JScrollPane; - -import org.adempiere.plaf.AdempierePLAF; - - -/** - * Mini Browser - * - * @author Jorg Janke - * @version $Id: MiniBrowser.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $ - */ -public class MiniBrowser extends JDialog -{ - /** - * - */ - private static final long serialVersionUID = 9084820549169098075L; - - /** - * Default Constructor - */ - public MiniBrowser() - { - this (null); - } // MiniBrowser - - /** - * Create MiniBrowser with URL - * @param url - */ - public MiniBrowser(String url) - { - this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - try - { - jbInit(); - } - catch(Exception e) - { - e.printStackTrace(); - } - setURL (url); - AdempierePLAF.showCenterScreen(this); - } // MiniBrowser - - private JScrollPane scrollPane = new JScrollPane(); - private JEditorPane editorPane = new JEditorPane(); - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - scrollPane.setPreferredSize(new Dimension(500, 500)); - this.getContentPane().add(scrollPane, BorderLayout.CENTER); - scrollPane.getViewport().add(editorPane, null); - } // jbInit - - /** - * Set URL - * @param url - */ - private void setURL (String url) - { - String myURL = url; - if (url == null) - myURL = "http://www.adempiere.org"; - this.setTitle(myURL); - - // Set URL - URL realURL = null; - try - { - realURL = new URL(myURL); - } - catch (Exception e) - { - System.err.println("MiniBrowser.setURL (set) - " + e.toString()); - } - if (realURL == null) - return; - - // Open - try - { - editorPane.setPage(realURL); - } - catch (Exception e) - { - System.err.println("MiniBrowser.setURL (open) - " + e.toString()); - } - } // setURL -} // MiniBrowser diff --git a/org.adempiere.ui.swing/src/org/compiere/util/ResourceFinder.java b/org.adempiere.ui.swing/src/org/compiere/util/ResourceFinder.java deleted file mode 100644 index 2a613bf290..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/util/ResourceFinder.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.compiere.util; - -import java.net.URL; - -import org.adempiere.base.IResourceFinder; -import org.compiere.AdempiereClient; - -public class ResourceFinder implements IResourceFinder { - - public ResourceFinder() { - } - - public URL getResource(String name) { - URL resource = AdempiereClient.class.getResource(name); - return resource; - } - -} diff --git a/org.adempiere.ui.swing/src/org/compiere/util/Splash.java b/org.adempiere.ui.swing/src/org/compiere/util/Splash.java deleted file mode 100644 index 022a6a0356..0000000000 --- a/org.adempiere.ui.swing/src/org/compiere/util/Splash.java +++ /dev/null @@ -1,327 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.util; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.Graphics; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Image; -import java.awt.Insets; -import java.awt.Label; -import java.awt.MediaTracker; -import java.awt.Panel; -import java.awt.Rectangle; -import java.awt.SystemColor; -import java.awt.Toolkit; -import java.net.URL; -import java.util.Locale; - -import org.compiere.Adempiere; - -/** - * Splash Screen. - * - don't use environment as not set up yet - - * - * Splash splash = new Splash("Processing"); - * .. do something here - * splash.dispose(); - * splash = null; - * - * @author Jorg Janke - * @version $Id: Splash.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $ - */ -public class Splash extends Frame -{ - /** - * - */ - private static final long serialVersionUID = 7671371032359729541L; - - /** - * Get Splash Screen - * @return Splash Screen - */ - public static Splash getSplash () - { - String msg; - if (Locale.getDefault().getLanguage().equals("es")) // espaƄol - globalqss - msg = new String("Cargando..."); - else - // Default english - msg = new String("Loading..."); - return getSplash (msg); - } // getSplash - - /** - * Get Splash Screen - * @param text splash text - * @return Splash Screen - */ - public static Splash getSplash (String text) - { - if (s_splash == null) - s_splash = new Splash (text); - else - s_splash.setText(text); - return s_splash; - } // getSplash - - private static Splash s_splash = null; - - /************************************************************************** - * Standard constructor - * @param text clear text - */ - public Splash (String text) - { - super("iDempiere"); - System.out.println(text); - message.setText(text); - try - { - jbInit(); - } - catch(Exception e) - { - System.out.println("Splash"); - e.printStackTrace(); - } - display(); - } // Splash - - /** Tracker */ - private MediaTracker tracker = new MediaTracker(this); - // - private CImage cImage = new CImage(); - private AImage aImage = new AImage(); - // - private Label productLabel = new Label(); - private Panel contentPanel = new Panel(); - private GridBagLayout contentLayout = new GridBagLayout(); - private Label message = new Label(); - - /** - * Static Init - * @throws Exception - */ - private void jbInit() throws Exception - { - this.setBackground(Color.white); - this.setName("splash"); - this.setUndecorated(true); - // - productLabel.setAlignment(Label.CENTER); - message.setFont(new java.awt.Font("Serif", 3, 20)); // italic bold 20 pt - message.setForeground(SystemColor.activeCaption); - message.setAlignment(Label.CENTER); - contentPanel.setLayout(contentLayout); - contentPanel.setName("splashContent"); - contentPanel.setBackground(Color.white); - // - productLabel.setFont(new java.awt.Font("Serif", 2, 10)); - productLabel.setForeground(Color.blue); - productLabel.setText(Adempiere.getSubtitle()); - // productLabel.setToolTipText(Adempiere.getURL()); - // - contentPanel.add(cImage, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(10, 5, 0, 10), 0, 0)); - contentPanel.add(productLabel, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 5, 0, 10), 0, 0)); - contentPanel.add(message, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 - ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 10, 10), 0, 0)); - // - this.add(aImage, BorderLayout.WEST); - this.add(contentPanel, BorderLayout.EAST); - } // jbInit - - /** - * Set Text (20 pt) - * @param text translated text to display - */ - public void setText (String text) - { - message.setText(text); - display(); - } // setText - - /** - * Show Window - * @param visible true if visible - */ - public void setVisible (boolean visible) - { - super.setVisible(visible); - if (visible) - toFront(); - } // setVisible - - /** - * Calculate size and display - */ - private void display() - { - pack(); - Dimension ss = Toolkit.getDefaultToolkit().getScreenSize(); - Rectangle bounds = getBounds(); - setBounds((ss.width - bounds.width) / 2, (ss.height - bounds.height) / 2, - bounds.width, bounds.height); - setVisible(true); - } // display - - /** - * Dispose Splash - */ - public void dispose() - { - super.dispose(); - s_splash = null; - } // dispose - - - /************************************************************************** - * Adempiere Image - */ - private class CImage extends Component - { - /** - * - */ - private static final long serialVersionUID = -4980770762959724071L; - - /** - * Adempiere Image - */ - public CImage () - { - m_image = Adempiere.getImageLogo(); - tracker.addImage(m_image, 0); - } - /** The Image */ - private Image m_image = null; - /* The Dimension */ - private Dimension m_dim = null; - - /** - * Calculate Size - * @return size - */ - public Dimension getPreferredSize() - { - try - { - tracker.waitForID(0); - } - catch (Exception e) - { - System.err.println("Splash.CImage"); - e.printStackTrace(); - } - m_dim = new Dimension (m_image.getWidth(this), m_image.getHeight(this)); - return m_dim; - } // getPreferredSize - - /** - * Paint - * @param g Graphics - */ - public void paint(Graphics g) - { - if (tracker.checkID(0)) - g.drawImage(m_image, 0, 0, this); - } // paint - - } // CImage - - /** - * Animation Image - * @author jjanke - * @version $Id: Splash.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $ - */ - private class AImage extends Component - { - /** - * - */ - private static final long serialVersionUID = -3003967119777877704L; - - /** - * Animation Image - */ - public AImage() - { - super(); - URL url = org.compiere.AdempiereClient.class.getResource("images/Java_anim.gif"); - if (url == null) - url = org.compiere.AdempiereClient.class.getResource("images/Java_logo.gif"); - if (url != null) - { - m_image = Toolkit.getDefaultToolkit().getImage(url); - tracker.addImage(m_image, 1); - } - } // AImage - - /** The image */ - private Image m_image = null; - /** The dimension */ - private Dimension m_dim = null; - - /** - * Calculate Size - * @return size - */ - public Dimension getPreferredSize() - { - try - { - tracker.waitForID(1); - } - catch (Exception e) - { - System.err.println("Splash.AImage"); - e.printStackTrace(); - } - m_dim = new Dimension (m_image.getWidth(this)+15, m_image.getHeight(this)+15); - return m_dim; - } // getPreferredSize - - /** - * Paint - * @param g Graphics - */ - public void paint (Graphics g) - { - if (tracker.checkID(1)) - g.drawImage(m_image, 10, 10, this); - } // paint - - /** - * Update - * @param g Graphics - */ - public void update (Graphics g) - { - paint(g); - } // update - - } // AImage - -} // Splash diff --git a/org.adempiere.ui.swing/src/org/eevolution/form/VInOutInvoiceGen.java b/org.adempiere.ui.swing/src/org/eevolution/form/VInOutInvoiceGen.java deleted file mode 100755 index a652320835..0000000000 --- a/org.adempiere.ui.swing/src/org/eevolution/form/VInOutInvoiceGen.java +++ /dev/null @@ -1,933 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * Contributor(s): Victor Perez www.e-evolution.com * - * Copyright (C) 2003-2007 e-Evolution,SC. All Rights Reserved. * - *****************************************************************************/ -package org.eevolution.form; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.VetoableChangeListener; -import java.io.File; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.swing.JOptionPane; -import javax.swing.JScrollPane; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.event.TableModelEvent; -import javax.swing.event.TableModelListener; - -import org.adempiere.plaf.AdempierePLAF; -import org.adempiere.util.Callback; -import org.adempiere.util.IProcessUI; -import org.compiere.apps.ADialog; -import org.compiere.apps.ADialogDialog; -import org.compiere.apps.AEnv; -import org.compiere.apps.ConfirmPanel; -import org.compiere.apps.ProcessCtl; -import org.compiere.apps.StatusBar; -import org.compiere.apps.form.FormFrame; -import org.compiere.apps.form.FormPanel; -import org.compiere.grid.ed.VComboBox; -import org.compiere.grid.ed.VLookup; -import org.compiere.minigrid.IDColumn; -import org.compiere.minigrid.MiniTable; -import org.compiere.model.MLookup; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MOrder; -import org.compiere.model.MPInstance; -import org.compiere.model.MPInstancePara; -import org.compiere.model.MPrivateAccess; -import org.compiere.model.MRMA; -import static org.compiere.model.SystemIDs.*; -import org.compiere.plaf.CompiereColor; -import org.compiere.print.ReportCtl; -import org.compiere.print.ReportEngine; -import org.compiere.process.ProcessInfo; -import org.compiere.process.ProcessInfoUtil; -import org.compiere.swing.CLabel; -import org.compiere.swing.CPanel; -import org.compiere.swing.CTabbedPane; -import org.compiere.swing.CTextPane; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; -import org.compiere.util.Trx; - -/** - * Manual Shipment Selection - * - * @author victor.perez@e-evolution.com - * @version $Id: VInOutInvoiceGen.java - */ -public class VInOutInvoiceGen extends CPanel - implements FormPanel, ActionListener, VetoableChangeListener, - ChangeListener, TableModelListener, IProcessUI -{ - /** - * - */ - private static final long serialVersionUID = -2327667535691916715L; - - /** - * Initialize Panel - * @param WindowNo window - * @param frame frame - */ - public void init (int WindowNo, FormFrame frame) - { - log.info(""); - m_WindowNo = WindowNo; - m_frame = frame; - Env.setContext(Env.getCtx(), m_WindowNo, "IsSOTrx", "Y"); - try - { - fillPicks(); - jbInit(); - dynInit(); - frame.getContentPane().add(tabbedPane, BorderLayout.CENTER); - frame.getContentPane().add(statusBar, BorderLayout.SOUTH); - } - catch(Exception ex) - { - log.log(Level.SEVERE, "init", ex); - } - } // init - - /** Window No */ - private int m_WindowNo = 0; - /** FormFrame */ - private FormFrame m_frame; - - private boolean m_selectionActive = true; - private Object m_M_Warehouse_ID = null; - private Object m_C_BPartner_ID = null; - /** Logger */ - private static CLogger log = CLogger.getCLogger(VInOutInvoiceGen.class); - // - private CTabbedPane tabbedPane = new CTabbedPane(); - private CPanel selPanel = new CPanel(); - private CPanel selNorthPanel = new CPanel(); - private BorderLayout selPanelLayout = new BorderLayout(); - private CLabel lWarehouse = new CLabel(); - private VLookup fWarehouse; - private CLabel lBPartner = new CLabel(); - private VLookup fBPartner; - private FlowLayout northPanelLayout = new FlowLayout(); - private ConfirmPanel confirmPanelSel = new ConfirmPanel(true); - private ConfirmPanel confirmPanelGen = new ConfirmPanel(false, true, false, false, false, false, true); - private StatusBar statusBar = new StatusBar(); - private CPanel genPanel = new CPanel(); - private BorderLayout genLayout = new BorderLayout(); - private CTextPane info = new CTextPane(); - private JScrollPane scrollPane = new JScrollPane(); - private MiniTable miniTable = new MiniTable(); - - private CLabel lDocType = new CLabel(); - private VComboBox cmbDocType = new VComboBox(); - - /** User selection */ - private ArrayList selection = null; - private StringBuffer iText = new StringBuffer(); - - - /** - * Static Init. - *
    -	 *  selPanel (tabbed)
    -	 *      fOrg, fBPartner
    -	 *      scrollPane & miniTable
    -	 *  genPanel
    -	 *      info
    -	 *  
    - * @throws Exception - */ - void jbInit() throws Exception - { - CompiereColor.setBackground(this); - // - selPanel.setLayout(selPanelLayout); - lWarehouse.setLabelFor(fWarehouse); - lBPartner.setLabelFor(fBPartner); - lBPartner.setText("BPartner"); - selNorthPanel.setLayout(northPanelLayout); - northPanelLayout.setAlignment(FlowLayout.LEFT); - tabbedPane.add(selPanel, Msg.getMsg(Env.getCtx(), "Select")); - selPanel.add(selNorthPanel, BorderLayout.NORTH); - selNorthPanel.add(lWarehouse, null); - selNorthPanel.add(fWarehouse, null); - selNorthPanel.add(lBPartner, null); - selNorthPanel.add(fBPartner, null); - selPanel.setName("selPanel"); - selPanel.add(confirmPanelSel, BorderLayout.SOUTH); - selPanel.add(scrollPane, BorderLayout.CENTER); - scrollPane.getViewport().add(miniTable, null); - confirmPanelSel.addActionListener(this); - // - tabbedPane.add(genPanel, Msg.getMsg(Env.getCtx(), "Generate")); - genPanel.setLayout(genLayout); - genPanel.add(info, BorderLayout.CENTER); - genPanel.setEnabled(false); - info.setBackground(AdempierePLAF.getFieldBackground_Inactive()); - info.setEditable(false); - genPanel.add(confirmPanelGen, BorderLayout.SOUTH); - confirmPanelGen.addActionListener(this); - - lDocType.setLabelFor(cmbDocType); - selNorthPanel.add(lDocType, null); - selNorthPanel.add(cmbDocType, null); - } // jbInit - - /** - * Fill Picks. - * Column_ID from C_Order - * @throws Exception if Lookups cannot be initialized - */ - private void fillPicks() throws Exception - { - // C_OrderLine.M_Warehouse_ID - MLookup orgL = MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, 2223, DisplayType.TableDir); - fWarehouse = new VLookup ("M_Warehouse_ID", true, false, true, orgL); - lWarehouse.setText(Msg.translate(Env.getCtx(), "M_Warehouse_ID")); - fWarehouse.addVetoableChangeListener(this); - m_M_Warehouse_ID = fWarehouse.getValue(); - // C_Order.C_BPartner_ID - MLookup bpL = MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, 2762, DisplayType.Search); - fBPartner = new VLookup ("C_BPartner_ID", false, false, true, bpL); - lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID")); - fBPartner.addVetoableChangeListener(this); - //Document Type Sales Order/Vendor RMA - lDocType.setText(Msg.translate(Env.getCtx(), "C_DocType_ID")); - cmbDocType.addItem(new KeyNamePair(MOrder.Table_ID, Msg.translate(Env.getCtx(), "Order"))); - cmbDocType.addItem(new KeyNamePair(MRMA.Table_ID, Msg.translate(Env.getCtx(), "VendorRMA"))); - cmbDocType.addActionListener(this); - } // fillPicks - - /** - * Dynamic Init. - * - Create GridController & Panel - * - AD_Column_ID from C_Order - */ - private void dynInit() - { - // create Columns - miniTable.addColumn("C_Order_ID"); - miniTable.addColumn("AD_Org_ID"); - miniTable.addColumn("C_DocType_ID"); - miniTable.addColumn("DocumentNo"); - miniTable.addColumn("C_BPartner_ID"); - miniTable.addColumn("DateOrdered"); - miniTable.addColumn("TotalLines"); - // - miniTable.setMultiSelection(true); - miniTable.setRowSelectionAllowed(true); - // set details - miniTable.setColumnClass(0, IDColumn.class, false, " "); - miniTable.setColumnClass(1, String.class, true, Msg.translate(Env.getCtx(), "AD_Org_ID")); - miniTable.setColumnClass(2, String.class, true, Msg.translate(Env.getCtx(), "C_DocType_ID")); - miniTable.setColumnClass(3, String.class, true, Msg.translate(Env.getCtx(), "DocumentNo")); - miniTable.setColumnClass(4, String.class, true, Msg.translate(Env.getCtx(), "C_BPartner_ID")); - miniTable.setColumnClass(5, Timestamp.class, true, Msg.translate(Env.getCtx(), "DateOrdered")); - miniTable.setColumnClass(6, BigDecimal.class, true, Msg.translate(Env.getCtx(), "TotalLines")); - // - miniTable.autoSize(); - miniTable.getModel().addTableModelListener(this); - // Info - statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), "InOutGenerateSel"));//@@ - statusBar.setStatusDB(" "); - // Tabbed Pane Listener - tabbedPane.addChangeListener(this); - } // dynInit - - /** - * Get SQL for Orders that needs to be shipped - * @return sql - */ - private String getOrderSQL() - { - // Create SQL - StringBuilder sql = new StringBuilder( - "SELECT C_Order_ID, o.Name, dt.Name, DocumentNo, bp.Name, DateOrdered, TotalLines " - + "FROM M_InOut_Candidate_v ic, AD_Org o, C_BPartner bp, C_DocType dt " - + "WHERE ic.AD_Org_ID=o.AD_Org_ID" - + " AND ic.C_BPartner_ID=bp.C_BPartner_ID" - + " AND ic.C_DocType_ID=dt.C_DocType_ID" - + " AND ic.AD_Client_ID=?"); - - if (m_M_Warehouse_ID != null) - sql.append(" AND ic.M_Warehouse_ID=").append(m_M_Warehouse_ID); - if (m_C_BPartner_ID != null) - sql.append(" AND ic.C_BPartner_ID=").append(m_C_BPartner_ID); - - // bug - [ 1713317 ] Generate Shipments (manual) show locked records - /* begin - Exclude locked records; @Trifon */ - int AD_User_ID = Env.getContextAsInt(Env.getCtx(), "#AD_User_ID"); - String lockedIDs = MPrivateAccess.getLockedRecordWhere(MOrder.Table_ID, AD_User_ID); - if (lockedIDs != null) - { - if (sql.length() > 0) - sql.append(" AND "); - sql.append("C_Order_ID").append(lockedIDs); - } - /* eng - Exclude locked records; @Trifon */ - - // - sql.append(" ORDER BY o.Name,bp.Name,DateOrdered"); - - return sql.toString(); - } - - /** - * Get SQL for Vendor RMA that need to be shipped - * @return sql - */ - private String getRMASql() - { - StringBuilder sql = new StringBuilder(); - - sql.append("SELECT rma.M_RMA_ID, org.Name, dt.Name, rma.DocumentNo, bp.Name, rma.Created, rma.Amt "); - sql.append("FROM M_RMA rma INNER JOIN AD_Org org ON rma.AD_Org_ID=org.AD_Org_ID "); - sql.append("INNER JOIN C_DocType dt ON rma.C_DocType_ID=dt.C_DocType_ID "); - sql.append("INNER JOIN C_BPartner bp ON rma.C_BPartner_ID=bp.C_BPartner_ID "); - sql.append("INNER JOIN M_InOut io ON rma.InOut_ID=io.M_InOut_ID "); - sql.append("WHERE rma.DocStatus='CO' "); - sql.append("AND dt.DocBaseType = 'POO' "); - sql.append("AND EXISTS (SELECT * FROM M_RMA r INNER JOIN M_RMALine rl "); - sql.append("ON r.M_RMA_ID=rl.M_RMA_ID WHERE r.M_RMA_ID=rma.M_RMA_ID "); - sql.append("AND rl.IsActive='Y' AND rl.M_InOutLine_ID > 0 AND rl.QtyDelivered < rl.Qty) "); - sql.append("AND NOT EXISTS (SELECT * FROM M_InOut oio WHERE oio.M_RMA_ID=rma.M_RMA_ID "); - sql.append("AND oio.DocStatus IN ('IP', 'CO', 'CL')) " ); - sql.append("AND rma.AD_Client_ID=?"); - - if (m_M_Warehouse_ID != null) - sql.append(" AND io.M_Warehouse_ID=").append(m_M_Warehouse_ID); - if (m_C_BPartner_ID != null) - sql.append(" AND bp.C_BPartner_ID=").append(m_C_BPartner_ID); - - int AD_User_ID = Env.getContextAsInt(Env.getCtx(), "#AD_User_ID"); - String lockedIDs = MPrivateAccess.getLockedRecordWhere(MRMA.Table_ID, AD_User_ID); - if (lockedIDs != null) - { - sql.append(" AND rma.M_RMA_ID").append(lockedIDs); - } - - sql.append(" ORDER BY org.Name, bp.Name, rma.Created "); - - return sql.toString(); - } - - /** - * Query Info - */ - private void executeQuery() - { - log.info(""); - int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); - - String sql = ""; - - KeyNamePair docTypeKNPair = (KeyNamePair)cmbDocType.getSelectedItem(); - - if (docTypeKNPair.getKey() == MRMA.Table_ID) - { - sql = getRMASql(); - } - else - { - sql = getOrderSQL(); - } - - log.fine(sql); - // reset table - int row = 0; - miniTable.setRowCount(row); - // Execute - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql.toString(), null); - pstmt.setInt(1, AD_Client_ID); - rs = pstmt.executeQuery(); - // - while (rs.next()) - { - // extend table - miniTable.setRowCount(row+1); - // set values - miniTable.setValueAt(new IDColumn(rs.getInt(1)), row, 0); // C_Order_ID - miniTable.setValueAt(rs.getString(2), row, 1); // Org - miniTable.setValueAt(rs.getString(3), row, 2); // DocType - miniTable.setValueAt(rs.getString(4), row, 3); // Doc No - miniTable.setValueAt(rs.getString(5), row, 4); // BPartner - miniTable.setValueAt(rs.getTimestamp(6), row, 5); // DateOrdered - miniTable.setValueAt(rs.getBigDecimal(7), row, 6); // TotalLines - // prepare next - row++; - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql.toString(), e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - // - miniTable.autoSize(); - // statusBar.setStatusDB(String.valueOf(miniTable.getRowCount())); - } // executeQuery - - /** - * Dispose - */ - public void dispose() - { - if (m_frame != null) - m_frame.dispose(); - m_frame = null; - } // dispose - - /** - * Action Listener - * @param e event - */ - public void actionPerformed (ActionEvent e) - { - if (log.isLoggable(Level.INFO)) log.info("Cmd=" + e.getActionCommand()); - // - if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) - { - dispose(); - return; - } - if (cmbDocType.equals(e.getSource())) - { - executeQuery(); - return; - } - // - saveSelection(); - if (selection != null - && selection.size() > 0 - && m_selectionActive // on selection tab - && m_M_Warehouse_ID != null) - { - generateShipments (); - - } - else - dispose(); - } // actionPerformed - - /** - * Vetoable Change Listener - requery - * @param e event - */ - public void vetoableChange(PropertyChangeEvent e) - { - if (log.isLoggable(Level.INFO)) log.info(e.getPropertyName() + "=" + e.getNewValue()); - if (e.getPropertyName().equals("M_Warehouse_ID")) - m_M_Warehouse_ID = e.getNewValue(); - if (e.getPropertyName().equals("C_BPartner_ID")) - { - m_C_BPartner_ID = e.getNewValue(); - fBPartner.setValue(m_C_BPartner_ID); // display value - } - executeQuery(); - } // vetoableChange - - /** - * Change Listener (Tab changed) - * @param e event - */ - public void stateChanged (ChangeEvent e) - { - int index = tabbedPane.getSelectedIndex(); - m_selectionActive = (index == 0); - } // stateChanged - - /** - * Table Model Listener - * @param e event - */ - public void tableChanged(TableModelEvent e) - { - int rowsSelected = 0; - int rows = miniTable.getRowCount(); - for (int i = 0; i < rows; i++) - { - IDColumn id = (IDColumn)miniTable.getValueAt(i, 0); // ID in column 0 - if (id != null && id.isSelected()) - rowsSelected++; - } - statusBar.setStatusDB(" " + rowsSelected + " "); - } // tableChanged - - /** - * Save Selection & return selecion Query or "" - * @return where clause like C_Order_ID IN (...) - */ - private void saveSelection() - { - log.info(""); - // ID selection may be pending - miniTable.editingStopped(new ChangeEvent(this)); - // Array of Integers - ArrayList results = new ArrayList(); - selection = null; - - // Get selected entries - int rows = miniTable.getRowCount(); - for (int i = 0; i < rows; i++) - { - IDColumn id = (IDColumn)miniTable.getValueAt(i, 0); // ID in column 0 - // log.fine( "Row=" + i + " - " + id); - if (id != null && id.isSelected()) - results.add(id.getRecord_ID()); - } - - if (results.size() == 0) - return; - if (log.isLoggable(Level.CONFIG)) log.config("Selected #" + results.size()); - selection = results; - - } // saveSelection - - - /************************************************************************** - * Generate Shipments - */ - private void generateShipments () - { - if (log.isLoggable(Level.INFO)) log.info("M_Warehouse_ID=" + m_M_Warehouse_ID); - String trxName = Trx.createTrxName("IOG"); - Trx trx = Trx.get(trxName, true); //trx needs to be committed too - //String trxName = null; - //Trx trx = null; - - m_selectionActive = false; // prevents from being called twice - statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), "InOutGenerateGen")); - statusBar.setStatusDB(String.valueOf(selection.size())); - - // Prepare Process - int AD_Process_ID = 0; - KeyNamePair docTypeKNPair = (KeyNamePair)cmbDocType.getSelectedItem(); - - if (docTypeKNPair.getKey() == MRMA.Table_ID) - { - AD_Process_ID = PROCESS_M_INOUT_GENERATERMA_MANUAL; // M_InOut_GenerateRMA - org.adempiere.process.InOutGenerateRMA - } - else - { - AD_Process_ID = PROCESS_M_INOUT_GENERATE_MANUAL; // M_InOut_Generate - org.compiere.process.InOutGenerate - } - - MPInstance instance = new MPInstance(Env.getCtx(), AD_Process_ID, 0); - if (!instance.save()) - { - info.setText(Msg.getMsg(Env.getCtx(), "ProcessNoInstance")); - return; - } - - //insert selection - StringBuilder insert = new StringBuilder(); - insert.append("INSERT INTO T_SELECTION(AD_PINSTANCE_ID, T_SELECTION_ID) "); - int counter = 0; - for(Integer selectedId : selection) - { - counter++; - if (counter > 1) - insert.append(" UNION "); - insert.append("SELECT "); - insert.append(instance.getAD_PInstance_ID()); - insert.append(", "); - insert.append(selectedId); - insert.append(" FROM DUAL "); - - if (counter == 1000) - { - if ( DB.executeUpdate(insert.toString(), trxName) < 0 ) - { - String msg = "No Shipments"; // not translated! - log.config(msg); - info.setText(msg); - trx.rollback(); - return; - } - insert = new StringBuilder(); - insert.append("INSERT INTO T_SELECTION(AD_PINSTANCE_ID, T_SELECTION_ID) "); - counter = 0; - } - } - if (counter > 0) - { - if ( DB.executeUpdate(insert.toString(), trxName) < 0 ) - { - String msg = "No Shipments"; // not translated! - log.config(msg); - info.setText(msg); - trx.rollback(); - return; - } - } - - //call process - ProcessInfo pi = new ProcessInfo ("VInOutGen", AD_Process_ID); - pi.setAD_PInstance_ID (instance.getAD_PInstance_ID()); - - // Add Parameter - Selection=Y - MPInstancePara ip = new MPInstancePara(instance, 10); - ip.setParameter("Selection","Y"); - if (!ip.save()) - { - String msg = "No Parameter added"; // not translated - info.setText(msg); - log.log(Level.SEVERE, msg); - return; - } - // Add Parameter - M_Warehouse_ID=x - ip = new MPInstancePara(instance, 20); - ip.setParameter("M_Warehouse_ID", Integer.parseInt(m_M_Warehouse_ID.toString())); - if (!ip.save()) - { - String msg = "No Parameter added"; // not translated - info.setText(msg); - log.log(Level.SEVERE, msg); - return; - } - - // Execute Process - ProcessCtl worker = new ProcessCtl(this, AEnv.getWindowNo(this), pi, trx); - worker.start(); // complete tasks in unlockUI / generateShipments_complete - // - } // generateShipments - - /** - * Complete generating shipments. - * Called from Unlock UI - * @param pi process info - */ - private void generateShipments_complete (ProcessInfo pi) - { - // Switch Tabs - tabbedPane.setSelectedIndex(1); - // - ProcessInfoUtil.setLogFromDB(pi); - //StringBuffer iText = new StringBuffer(); - iText.append("").append(pi.getSummary()) - .append("
    (") - .append(Msg.getMsg(Env.getCtx(), "InOutGenerateInfo")) - // Shipments are generated depending on the Delivery Rule selection in the Order - .append(")
    ") - .append(pi.getLogInfo(true)); - info.setText(iText.toString()); - - // Reset Selection - /* - String sql = "UPDATE C_Order SET IsSelected='N' WHERE " + m_whereClause; - int no = DB.executeUpdate(sql, null); - log.config("Reset=" + no);*/ - - // Get results - int[] ids = pi.getIDs(); - if (ids == null || ids.length == 0) - return; - if (log.isLoggable(Level.CONFIG)) log.config("PrintItems=" + ids.length); - - confirmPanelGen.getOKButton().setEnabled(false); - // OK to print shipments - if (ADialog.ask(m_WindowNo, this, "PrintShipments")) - { - // info.append("\n\n" + Msg.getMsg(Env.getCtx(), "PrintShipments")); - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - int retValue = ADialogDialog.A_CANCEL; // see also ProcessDialog.printShipments/Invoices - do - { - // Loop through all items - for (int i = 0; i < ids.length; i++) - { - int M_InOut_ID = ids[i]; - ReportCtl.startDocumentPrint(ReportEngine.SHIPMENT, M_InOut_ID, this, AEnv.getWindowNo(this), true); - } - ADialogDialog d = new ADialogDialog (m_frame, - Env.getHeader(Env.getCtx(), m_WindowNo), - Msg.getMsg(Env.getCtx(), "PrintoutOK?"), - JOptionPane.QUESTION_MESSAGE); - retValue = d.getReturnCode(); - } - while (retValue == ADialogDialog.A_CANCEL); - setCursor(Cursor.getDefaultCursor()); - } // OK to print shipments - - // - confirmPanelGen.getOKButton().setEnabled(true); - } // generateShipments_complete - - /************************************************************************** - * Generate Invoices - */ - private void generateInvoices () - { - String trxName = Trx.createTrxName("IVG"); - Trx trx = Trx.get(trxName, true); //trx needs to be committed too - //String trxName = null; - //Trx trx = null; - - m_selectionActive = false; // prevents from being called twice - statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), "InvGenerateGen")); - statusBar.setStatusDB(String.valueOf(selection.size())); - - // Prepare Process - int AD_Process_ID = 0; - KeyNamePair docTypeKNPair = (KeyNamePair)cmbDocType.getSelectedItem(); - - if (docTypeKNPair.getKey() == MRMA.Table_ID) - { - AD_Process_ID = PROCESS_C_INVOICE_GENERATERMA_MANUAL; // C_Invoice_GenerateRMA - org.adempiere.process.InvoiceGenerateRMA - } - else - { - AD_Process_ID = PROCESS_C_INVOICE_GENERATE_MANUAL; // HARDCODED C_InvoiceCreate - } - MPInstance instance = new MPInstance(Env.getCtx(), AD_Process_ID, 0); - if (!instance.save()) - { - info.setText(Msg.getMsg(Env.getCtx(), "ProcessNoInstance")); - return; - } - - //insert selection - /*Selection exist from shipment*/ - StringBuilder insert = new StringBuilder(); - insert.append("INSERT INTO T_SELECTION(AD_PINSTANCE_ID, T_SELECTION_ID) "); - int counter = 0; - for(Integer selectedId : selection) - { - counter++; - if (counter > 1) - insert.append(" UNION "); - insert.append("SELECT "); - insert.append(instance.getAD_PInstance_ID()); - insert.append(", "); - insert.append(selectedId); - insert.append(" FROM DUAL "); - - if (counter == 1000) - { - if ( DB.executeUpdate(insert.toString(), trxName) < 0 ) - { - String msg = "No Shipments"; // not translated! - log.config(msg); - info.setText(msg); - trx.rollback(); - return; - } - insert = new StringBuilder(); - insert.append("INSERT INTO T_SELECTION(AD_PINSTANCE_ID, T_SELECTION_ID) "); - counter = 0; - } - } - if (counter > 0) - { - if ( DB.executeUpdate(insert.toString(), trxName) < 0 ) - { - String msg = "No Shipments"; // not translated! - log.config(msg); - info.setText(msg); - trx.rollback(); - return; - } - } - - ProcessInfo pi = new ProcessInfo ("", AD_Process_ID); - pi.setAD_PInstance_ID (instance.getAD_PInstance_ID()); - - // Add Parameters - MPInstancePara para = new MPInstancePara(instance, 10); - para.setParameter("Selection", "Y"); - if (!para.save()) - { - String msg = "No Selection Parameter added"; // not translated - info.setText(msg); - log.log(Level.SEVERE, msg); - return; - } - para = new MPInstancePara(instance, 20); - para.setParameter("DocAction", "CO"); - if (!para.save()) - { - String msg = "No DocAction Parameter added"; // not translated - info.setText(msg); - log.log(Level.SEVERE, msg); - return; - } - - // Execute Process - ProcessCtl worker = new ProcessCtl(this, AEnv.getWindowNo(this), pi, trx); - worker.start(); // complete tasks in unlockUI / generateInvoice_complete - } // generateInvoices - - /** - * Complete generating invoices. - * Called from Unlock UI - * @param pi process info - */ - private void generateInvoice_complete (ProcessInfo pi) - { - // Switch Tabs - tabbedPane.setSelectedIndex(1); - // - ProcessInfoUtil.setLogFromDB(pi); - //StringBuffer iText = new StringBuffer(); - iText.append("").append(pi.getSummary()) - .append("
    (") - .append(Msg.getMsg(Env.getCtx(), "InvGenerateInfo")) - //Invoices are generated depending on the Invoicing Rule selection in the Order - .append(")
    ") - .append(pi.getLogInfo(true)); - info.setText(iText.toString()); - - // Reset Selection - /* - String sql = "UPDATE C_Order SET IsSelected = 'N' WHERE " + m_whereClause; - int no = DB.executeUpdate(sql, null); - log.config("Reset=" + no);*/ - - // Get results - int[] ids = pi.getIDs(); - if (ids == null || ids.length == 0) - return; - - confirmPanelGen.getOKButton().setEnabled(false); - // OK to print invoices - if (ADialog.ask(m_WindowNo, this, "PrintInvoices")) - { - // info.append("\n\n" + Msg.getMsg(Env.getCtx(), "PrintInvoices")); - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - int retValue = ADialogDialog.A_CANCEL; - do - { - // Loop through all items - for (int i = 0; i < ids.length; i++) - { - int C_Invoice_ID = ids[i]; - ReportCtl.startDocumentPrint(ReportEngine.INVOICE, C_Invoice_ID, this, AEnv.getWindowNo(this), true); - } - ADialogDialog d = new ADialogDialog (m_frame, - Env.getHeader(Env.getCtx(), m_WindowNo), - Msg.getMsg(Env.getCtx(), "PrintoutOK?"), - JOptionPane.QUESTION_MESSAGE); - retValue = d.getReturnCode(); - } - while (retValue == ADialogDialog.A_CANCEL); - setCursor(Cursor.getDefaultCursor()); - } // OK to print invoices - - // - confirmPanelGen.getOKButton().setEnabled(true); - } // generateInvoices_complete - /************************************************************************** - * Lock User Interface. - * Called from the Worker before processing - * @param pi process info - */ - public void lockUI (ProcessInfo pi) - { - this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - this.setEnabled(false); - } // lockUI - - /** - * Unlock User Interface. - * Called from the Worker when processing is done - * @param pi result of execute ASync call - */ - public void unlockUI (ProcessInfo pi) - { - // - if(pi.getAD_Process_ID() == PROCESS_M_INOUT_GENERATE_MANUAL) - { - generateShipments_complete(pi); - generateInvoices (); - } - if(pi.getAD_Process_ID() == PROCESS_C_INVOICE_GENERATE_MANUAL) - { - generateInvoice_complete(pi); - this.setEnabled(true); - this.setCursor(Cursor.getDefaultCursor()); - } - - } // unlockUI - - /** - * Is the UI locked (Internal method) - * @return true, if UI is locked - */ - public boolean isUILocked() - { - return this.isEnabled(); - } // isUILocked - - /** - * Method to be executed async. - * Called from the Worker - * @param pi ProcessInfo - */ - public void executeASync (ProcessInfo pi) - { - } // executeASync - - @Override - public void statusUpdate(String message) { - statusBar.setStatusLine(message); - } - - @Override - public void ask(String message, Callback callback) { - boolean b = ADialog.ask(m_WindowNo, this, message); - if (callback != null) { - callback.onCallback(b); - } - } - - @Override - public void download(File file) { - // TODO Auto-generated method stub - - } - - @Override - public void askForInput(String message, Callback callback) { - String s = ADialog.askForInput(m_WindowNo, this, message); - if(callback != null) - callback.onCallback(s); - } -} // VInOutGen diff --git a/org.adempiere.ui.swing/swing.properties b/org.adempiere.ui.swing/swing.properties deleted file mode 100644 index a3738c106e..0000000000 --- a/org.adempiere.ui.swing/swing.properties +++ /dev/null @@ -1,10 +0,0 @@ -swing.defaultlaf=org.adempiere.plaf.AdempiereLookAndFeel -swing.installedlafs=Metal,Motif,Windows,Adempiere -swing.installedlaf.Metal.class=javax.swing.plaf.metal.MetalLookAndFeel -swing.installedlaf.Metal.name=Metal -swing.installedlaf.Motif.class=com.sun.java.swing.plaf.motif.MotifLookAndFeel -swing.installedlaf.Motif.name=CDE/Motif -swing.installedlaf.Windows.class=com.sun.java.swing.plaf.windows.WindowsLookAndFeel -swing.installedlaf.Windows.name=MS Windows -swing.installedlaf.Adempiere.class=org.compiere.plaf.AdempiereLookAndFeel -swing.installedlaf.Adempiere.name=Adempiere diff --git a/org.idempiere.javadoc/build.properties b/org.idempiere.javadoc/build.properties index 7da1847b76..57b476f569 100644 --- a/org.idempiere.javadoc/build.properties +++ b/org.idempiere.javadoc/build.properties @@ -18,7 +18,6 @@ jars.extra.classpath = platform:/plugin/org.adempiere.base/,\ platform:/plugin/org.adempiere.server/src/main/servlet/,\ platform:/plugin/org.adempiere.server/src/main/home/,\ platform:/plugin/org.adempiere.ui/,\ - platform:/plugin/org.adempiere.ui.swing/,\ platform:/plugin/org.adempiere.ui.zk/,\ platform:/plugin/org.adempiere.webstore/,\ platform:/plugin/org.adempiere.webstore.resource/,\ diff --git a/pom.xml b/pom.xml index 9624c2af21..b7da28d8dd 100644 --- a/pom.xml +++ b/pom.xml @@ -26,10 +26,8 @@ org.adempiere.replication.server org.adempiere.report.jasper.library org.adempiere.report.jasper - org.adempiere.report.jasper.swing org.adempiere.report.jasper.webapp - org.adempiere.server - org.adempiere.ui.swing + org.adempiere.server org.adempiere.ui org.adempiere.ui.zk org.adempiere.webstore @@ -49,8 +47,7 @@ org.adempiere.pipo-feature org.adempiere.replication.server-feature org.adempiere.server-feature - org.adempiere.target.platform-feature - org.adempiere.ui.swing-feature + org.adempiere.target.platform-feature org.adempiere.ui.zk-feature org.adempiere.webstore-feature org.compiere.db.provider-feature