Can I develop Enabler apps in Java using Eclipse?The simple answer is, "Yes you can". But the solution is Windows ONLY We have tried COM plugin for Eclipse. We found this achieved the tasks we needed it too and wasn't too difficult to use. The Help document and example software use this bridge Adding ActiveX Controls to a Java Eclipse Solution using COM plugin for EclipseThis bridge was very easy to use, to setup the application, and came with samples. (see their website for more on the samples) It generates two packages for each of the components the application needs. Each component needs to be created separatly and in separate projects Then you can add all the packages together once they are created into one project that will contain the application. To do this follow the instructions below for creating the packages
Now there should be a project with all the COM components needed. Methods can be used to create an instance of EnbSessionX2 and EnbPumpX2 with GUI components
Creating a Session and making it invisible EnbSessionX2Composite SessionComposite = new EnbSessionX2Composite(shell, SWT.NONE); Session = SessionComposite.getEnbSessionX2Automation(); SessionComposite.oleShow(); SessionComposite.setVisible(false); Creating a Pump and assigning variables EnbPumpX2Composite PumpComposite = new EnbPumpX2Composite(shell, SWT.NONE); Pump = PumpComposite.getEnbPumpX2Automation(); PumpComposite.oleShow(); Pump.setSession(Session); Pump.setNumber(int Number); Unfortunately this package doesn't have very good support for the objects Delivery, Hose, Grade, and Tank. As some methods return IAutomationObjects and you can't cast between the two Therefore methods on those objects must be done on an IAutomationObject where you use the method "getproperty", "setproperty", or "invoke". Calling each of these with the parameter of the dispatch ID which can found in the class called I(name_of_object) in the package called (component_name) for example IDelivery contains the dispatch IDs for Delivery and is in (package name).psrvrlib The help document has example code for how to do this An example for Pump returning a Delivery and then using Delivery to return the Delivery Type Private IAutomationObject Delivery; Private Variant DeliveryType; Delivery = Pump.getCurrentDelivery(); DeliveryType = Delivery.getProperty(IDelivery.DISPID_FUNC_GET_TYPE); DelvieryType.getInt(); NotesThe Java sample code is provided as a guide only. GetSummaryWe have found that the GetSummary methods do not work correctly through the bridge. However the data returned by these functions is available using the Delivery, Hose and Grade objects. Sample CodeIf you want to use Eclipse and Java to develop your Enabler application we suggest you download our Eclipse Java pumpdemo sample. The sample code is provided to show how you can dynamically create the Pump controls, get delivery details, call methods, and implement event handlers. EnbOptXIf you are using Enabler V3.0 or later, the EnbOPTX control is also available. You will need to generate this control if you plan to use the OPT interface. Control VersionsThis sample application was created using the Enabler V3.0 ActiveX controls. If you are using an older version of Enabler your ActiveX control may not have some of the methods used in the sample code. For example .QuickAuthorise() and .QuickSaleSelect(). Troubleshooting
©2009 Integration Technologies Limited Last revised Wednesday, 04-Nov-2009 18:41:56 EST |