1 Mobile Tools for the Java Platform Coding Examples Version 0.3.

Презентация:



Advertisements
Похожие презентации
Copyright (c) 2006 IBM, released under EPL version 1.0 RSE David McKnight.
Advertisements

1 Mobile Tools for Java Platform The goal of the Mobile Tools for Java project is to extend existing Eclipse frameworks to support mobile device Java application.
Copyright © 2006 Intel Corporation, released under EPL version /20061 Eclipse DSDP-TM Target Connection Adapters Peter Lachner WW0806 rev 1.0.
© 2005 by IBM; made available under the EPL v1.0 | March 1, 2005 Tim deBoer Gorkem Ercan Extend WTP Server Tools for your.
© 2006 Cisco Systems, Inc. All rights reserved. HIPS v Configuring Groups and Policies Managing Hosts and Deploying Software Updates.
© 2004 Cisco Systems, Inc. All rights reserved. IPTT v AVVID Troubleshooting Tools Applying Cisco CallManager and Operating System Troubleshooting.
© 2006 Cisco Systems, Inc. All rights reserved. HIPS v Using CSA Analysis Configuring Application Deployment Investigation.
© 2006 Cisco Systems, Inc. All rights reserved.BSCI v Describing Network Requirements Network Requirements.
© 2006 Cisco Systems, Inc. All rights reserved. HIPS v Using CSA Analysis Generating Application Deployment Reports.
WS10a-1 WORKSHOP 10A MODAL ANALYSIS OF A CIRCUIT BOARD NAS122, Workshop 10a, August 2005 Copyright 2005 MSC.Software Corporation.
© 2005 Cisco Systems, Inc. All rights reserved.INTRO v Managing Your Network Environment Discovering Neighbors on the Network.
1 Top OpenEdge Architect ® FAQs Sunil Belgaonkar Architect Session 129.
© 2002 IBM Corporation Confidential | Date | Other Information, if necessary © Wind River Systems, released under EPL 1.0. All logos are TM of their respective.
© 2006 IBM Corporation Made available under the EPL v WebSphere Services Technical Conference world class skill building and technical enablement.
© 2006 Cisco Systems, Inc. All rights reserved. HIPS v Using CSA Analysis Configuring Application Behavior Investigation.
Designing Network Management Services © 2004 Cisco Systems, Inc. All rights reserved. Designing the Network Management Architecture ARCH v
© 2005 Cisco Systems, Inc. All rights reserved. IPTX v Configuring Additional Cisco CallManager Express Features Configuring Cisco CallManager Express.
Evgeniy Krivosheev Andrey Stukalenko Vyacheslav Yakovenko Last update: Nov, 2013 Spring Framework Module 1 - Introduction.
The waterfall model is a popular version of the systems development life cycle model for software engineering. Often considered the classic approach to.
1/13 Chapter 06- Implementing Operators in a class.
Транксрипт:

1 Mobile Tools for the Java Platform Coding Examples Version 0.3

Get Extension Implementation import org.eclipse.mtj.api.extension.DeviceManagement; import org.eclipse.mtj.api.enumerations.ExtensionType; import org.eclipse.mtj.api.extension.MtjExtension; import org.eclipse.mtj.core.MtjServices;... String version = null; String vendor = null; boolean onlyActive = true; MtjExtension[] list = MtjServices.getInstance().getImplementations( ExtensionType.DEVICE_MANAGEMENT_LITERAL, version, vendor, onlyActive); DeviceManagement deviceManagement = (DeviceManagement ) list[0];

Get DevicePlatform, Device and RuntimePlatform DevicePlatforms, that are defined by DevicePlatformProviders, define their content with specific data model. The model right describes the main parts of the object model structure of the DevicePlatform –definition.

Get DevicePlatform, Device and RuntimePlatform (cont.) import org.eclipse.mtj.api.extension.DeviceManagement; import org.eclipse.mtj.api.enumerations.ExtensionType; import org.eclipse.mtj.api.extension.MtjExtension; import org.eclipse.mtj.core.MtjServices; import org.eclipse.mtj.api.devices.Device; import org.eclipse.mtj.api.devices.DevicePlatform; import org.eclipse.mtj.api.runtimes.RuntimePlatformDefinition;... DeviceManagement deviceManagement = (DeviceManagement) MtjServices.getInstance().getImplementations( ExtensionType.DEVICE_MANAGEMENT_LITERAL,null,null)[0]; DevicePlatform[] devicePlatform = deviceManagement.getDevicePlatforms()[0]; Device device = devicePlatform.getDevices().get(1); RuntimePlatformDefinition runtimePlatformDefinition = device.getRuntimePlatformDefinitions().get(1);

Modify Project Data Projects, that have Mtj Nature, contains Mtj specific descriptions. Next example shows, how to access Projects descriptions and how to modify them. The model right describes the object model structure of the Project –definitions.

Modify Project Data (cont.) import org.eclipse.jdt.core.IJavaProject; import org.eclipse.mtj.api.model.IMtjProject; import org.eclipse.mtj.core.project.MtjProject; import org.eclipse.mtj.api.project.Project;... IJavaProject javaProject;... IMtjProject mtjProject = MtjProject.getMtjProject(javaProject); Project project = mtjProject.getProjectData(); ObfuscationDetail obfuscationDetail = new ObfuscationDetail(); obfuscationDetail.setLevel(1); project.setObfuscationDetail(obfuscationDetail); mtjProject.setProjectData(project);

Add Runtime Platform Definition To Project import org.eclipse.mtj.api.devices.Device; import org.eclipse.mtj.api.devices.DevicePlatform; import org.eclipse.mtj.api.runtimes.RuntimePlatformDefinition; import org.eclipse.mtj.api.project.Project; import org.eclipse.mtj.api.project.ProjectFactory; import org.eclipse.mtj.api.project.TargetDevice; import org.eclipse.mtj.core.util.MtjEmfUtil;... Project project; DevicePlatform devicePlatform; Device device; RuntimePlatformDefinition runtimePlatformDefinition;... TargetDevice targetDevice = ProjectFactory.eINSTANCE.createTargetDevice(); targetDevice.setName(Nokia S80 Device); targetDevice.setDevicePlatformName(devicePlatform.getName()); targetDevice.setDeviceName(device.getName()); // create a project specific copy of the RuntimePlatformDefinition RuntimePlatformDefinition copyRPD = MtjEmfUtil.clone(runtimePlatformDefinition); targetDevice.setRuntimePlatform(copyRPD); mtjProject.setProjectData(project);

Get Projects Default Targets import org.eclipse.jdt.core.IJavaProject; import org.eclipse.mtj.api.model.IMtjProject; import org.eclipse.mtj.core.project.MtjProject; import org.eclipse.mtj.api.project.Project; import org.eclipse.mtj.api.devices.Device; import org.eclipse.mtj.api.devices.DevicePlatform; import org.eclipse.mtj.api.runtimes.RuntimePlatformDefinition;... IJavaProject javaProject;... IMtjProject mtjProject = MtjProject.getMtjProject(javaProject); DevicePlatform devicePlatform = mtjProject.getPlatformDefinition(); Device device = mtjProject.getDefaultDevice(); RuntimePlatformDefinition runtimePlatformDefinition = mtjProject.getProjectData().getDefaultTargetDevice().getRuntimePlatform();

Deploy Projects Data import org.eclipse.mtj.api.model.IMtjProject; import org.eclipse.mtj.api.devices.Device; import org.eclipse.mtj.api.extension. DeploymentManagement ; import org.eclipse.mtj.api.runtimes.RuntimePlatformDefinition; import org.eclipse.mtj.api.enumerations.DeviceCommunicationProtocol; import org.eclipse.core.runtime.IProgressMonitor;... IMtjProject mtjProject;... RuntimePlatformDefinition runtimePlatformDefinition = mtjProject.getProjectData().getDefaultTargetDevice().getRuntimePlatform(); DeploymentManagement deploymentManagement = (DeploymentManagement)MtjServices.getInstance().getImplementations(ExtensionType.DEPLOYMENT_MANAGEMENT_LITERAL,null,null)[0]; Device[] devices = deploymentManagement.getTargetDevices(runtimePlatformDefinition); DeviceCommunicationProtocol[] transferProtocols = null; IProgressMonitor monitor = null; deploymentManagement.deploy(mtjProject. getDeployment(), devices, transferProtocols, monitor);

Persistent Store Usage & RuntimePlatforms RuntimePlatforms, that are stored by the Workspaces, are stored with the PersistentStorageProvider – plugin. Next example shows, how to access the stored definitions and how to modify them. The model right describes the object model structure of the RuntimePlatform –definitions.

Persistent Store Usage & RuntimePlatforms (cont.) import org.eclipse.mtj.api.extension.PersistentStoreProvider; import org.eclipse.mtj.api.enumerations.ExtensionType; import org.eclipse.mtj.api.runtimes.RuntimePlatform;... PersistentStoreProvider pstore = (PersistentStoreProvider)MtjServices.getInstance().getImplementations(ExtensionType.PERSISTENT_STORE_PROVIDER_LITERAL,null,null)[0]; String dataExtension = runtimes; String projectName = "org.eclipse.mtj.extension.rpm.ui"; String key = MtjRuntimePlatforms; EList runtimePlatforms = (EList)pstore.get(PersistentStoreProvider.DATA_TYPE_EMF, dataExtension, projectName, key); RuntimePlatform runtimePlatform= (RuntimePlatform) runtimePlatforms.get(0);

Persistent Store Usage & RuntimePlatforms (cont.) import org.eclipse.mtj.api.extension.PersistentStoreProvider; import org.eclipse.mtj.api.enumerations.ExtensionType; import org.eclipse.mtj.api.runtimes.RuntimePlatform;... PersistentStoreProvider pstore; Elist runtimePlatforms; RuntimePlatform newRuntimePlatform;... runtimePlatforms.add(newRuntimePlatform); String dataExtension = runtimes; String projectName = "org.eclipse.mtj.extension.rpm.ui"; String key = MtjRuntimePlatforms; pstore.store( runtimePlatforms, PersistentStoreProvider.DATA_TYPE_EMF, dataExtension, projectName, key);

Get Admin GUI import org.eclipse.mtj.api.extension.DeviceManagement; import org.eclipse.mtj.api.enumerations.ExtensionType; import org.eclipse.mtj.api.extension.MtjExtension; import org.eclipse.mtj.core.MtjServices; import org.eclipse.swt.widgets.Composite; import org.eclipse.SWT;... DeviceManagement mtjExtension = null; Composite composite; AdminGuiProvider adminGuiProvider = MtjServices.getInstance().getCorrespondingAdminGuiProvider(MtjExtension extension); Composite composite = adminGuiProvider.create(Composite composite, SWT.NONE);