From 912dcfc72fad129cb00ef957fd23ee34688315e2 Mon Sep 17 00:00:00 2001 From: sungmin ha Date: Tue, 31 Jul 2012 15:54:57 +0900 Subject: [PATCH] [Title]merge for public build system [Type]Enhancement [Module]eventinjector-eplugin [Priority]Major [Jira#] // Jira Issue Number [Redmine#] // Redmine Isuue Number [Problem] // Problem Description [Cause] // Cause Description [Solution] // Solution Description [TestCase] // Executed the test-target (How to) --- org.tizen.device/META-INF/MANIFEST.MF | 2 +- .../org/tizen/device/battery/page/BatteryPage.java | 14 +- .../org/tizen/device/sdcard/page/SdcardPage.java | 12 +- org.tizen.injector/META-INF/MANIFEST.MF | 3 +- .../src/org/tizen/injector/InjectorDialog.java | 100 +++++++ .../org/tizen/injector/socket/SDcardSocket.java | 2 +- org.tizen.location.core/META-INF/MANIFEST.MF | 2 +- org.tizen.location.log/META-INF/MANIFEST.MF | 2 +- org.tizen.location.manual/META-INF/MANIFEST.MF | 2 +- org.tizen.location.map/META-INF/MANIFEST.MF | 2 +- .../src/org/tizen/location/map/Map.java | 19 +- .../src/org/tizen/location/map/page/DebugLog.java | 123 +++++++++ .../src/org/tizen/location/map/page/MapImage.java | 154 +++++++---- org.tizen.nfc/META-INF/MANIFEST.MF | 2 +- .../META-INF/MANIFEST.MF | 2 +- .../org/tizen/sensor/accelerometer/FileListVO.java | 77 ++++++ .../sensor/accelerometer/SensorConstants.java | 4 + .../accelerometer/page/ManualInputAccel.java | 296 +++++++++++++++++++- .../sensor/accelerometer/page/ManualInputGyro.java | 296 +++++++++++++++++++- .../accelerometer/page/ManualInputMagnetic.java | 297 ++++++++++++++++++++- .../sensor/accelerometer/page/ManualInputTilt.java | 12 +- org.tizen.sensor.light/META-INF/MANIFEST.MF | 2 +- .../src/org/tizen/sensor/light/page/LightPage.java | 6 +- org.tizen.sensor.motion/META-INF/MANIFEST.MF | 2 +- org.tizen.sensor.proximity/META-INF/MANIFEST.MF | 2 +- org.tizen.telephony.call/META-INF/MANIFEST.MF | 2 +- .../org/tizen/telephony/call/page/MOMTCall.java | 23 +- org.tizen.telephony.sms/META-INF/MANIFEST.MF | 2 +- .../src/org/tizen/telephony/sms/page/SMS.java | 13 +- package/build.linux | 34 ++- package/build.windows | 296 -------------------- package/pkginfo.manifest | 47 +++- 32 files changed, 1416 insertions(+), 436 deletions(-) create mode 100644 org.tizen.injector/src/org/tizen/injector/InjectorDialog.java create mode 100644 org.tizen.location.map/src/org/tizen/location/map/page/DebugLog.java create mode 100644 org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/FileListVO.java delete mode 100755 package/build.windows diff --git a/org.tizen.device/META-INF/MANIFEST.MF b/org.tizen.device/META-INF/MANIFEST.MF index f2dc989..150bb4a 100644 --- a/org.tizen.device/META-INF/MANIFEST.MF +++ b/org.tizen.device/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Tizen Event Injector Device Bundle-SymbolicName: org.tizen.device;singleton:=true Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: Samsung +Bundle-Vendor: Samsung Electronics Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Require-Bundle: org.tizen.injector, org.tizen.telephony.call, diff --git a/org.tizen.device/src/org/tizen/device/battery/page/BatteryPage.java b/org.tizen.device/src/org/tizen/device/battery/page/BatteryPage.java index e1fd182..8f75425 100644 --- a/org.tizen.device/src/org/tizen/device/battery/page/BatteryPage.java +++ b/org.tizen.device/src/org/tizen/device/battery/page/BatteryPage.java @@ -116,7 +116,6 @@ public class BatteryPage extends AbstractInjectorPage implements ISelectionListe public void mouseUp(MouseEvent e) { // TODO Auto-generated method stub sendMessage(1, sendData); - sendMessage(2, sensorOn); } }); @@ -128,9 +127,9 @@ public class BatteryPage extends AbstractInjectorPage implements ISelectionListe @Override public void keyReleased(KeyEvent e) { // TODO Auto-generated method stub - if(e.keyCode == 13) // enter + if(e.keyCode == 13 || e.keyCode == 16777296) // enter { - radioButton[0].setFocus(); + sendMessage(1, sendData); } } }); @@ -217,7 +216,7 @@ public class BatteryPage extends AbstractInjectorPage implements ISelectionListe } public void sendMessage(int id, int data) { - if(id == 1 && preSendData == sendData) + if(id == 1 && preSendData == data) // level return; TestSensorMessage msg = new TestSensorMessage(id, data); @@ -228,8 +227,11 @@ public class BatteryPage extends AbstractInjectorPage implements ISelectionListe // TODO Auto-generated catch block e1.printStackTrace(); } - preSendData = sendData; - preSensorOn = sensorOn; + + if(id == 1) // level + preSendData = data; + else if(id == 2) // charger + preSensorOn = data; } // @Override diff --git a/org.tizen.device/src/org/tizen/device/sdcard/page/SdcardPage.java b/org.tizen.device/src/org/tizen/device/sdcard/page/SdcardPage.java index 5eccdcf..0f0489b 100644 --- a/org.tizen.device/src/org/tizen/device/sdcard/page/SdcardPage.java +++ b/org.tizen.device/src/org/tizen/device/sdcard/page/SdcardPage.java @@ -39,15 +39,16 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.SWT; import org.tizen.common.connection.ConnectionPlugin; import org.tizen.common.connection.ConnectionPlugin.ISelectionListener; -import org.tizen.common.util.DialogUtil; import org.tizen.sdblib.FileListingService.FileEntry; import org.tizen.sdblib.IDevice; +import org.tizen.injector.InjectorDialog; import org.tizen.injector.provider.AbstractInjectorItem; import org.tizen.injector.provider.AbstractInjectorPage; import org.tizen.injector.socket.SDcardSocket; @@ -95,7 +96,8 @@ public class SdcardPage extends AbstractInjectorPage implements ISelectionListen if(SDcardSocket.getInstance().SDpath_set.contains(cmbRecordFormat.getText())) { // sdcard is already mounted from other emulator. - DialogUtil.openMessageDialog("This is device message.\n" + cmbRecordFormat.getText() + " is already mounted from other emulator.\nPlease try again later."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, cmbRecordFormat.getText() + " is already mounted from other emulator.\nPlease try again later."); return; } else @@ -178,7 +180,8 @@ public class SdcardPage extends AbstractInjectorPage implements ISelectionListen if(!umountOk) { // sdcard is already mounted from other emulator. - DialogUtil.openMessageDialog("This is sdcard message.\nDevice or resouece is busy.\nPlease try again later."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Device or resouece is busy.\nPlease try again later."); mntButtonClick(); SDcardSocket.getInstance().umountOk = true; } @@ -241,12 +244,11 @@ public class SdcardPage extends AbstractInjectorPage implements ISelectionListen while(sdsock.isDataWaiting) { - if(sleepCnt > 100) + if(sleepCnt > 200) { sleepCnt = 0; sdsock.isDataWaiting = false; isOldEmul = true; - DialogUtil.openMessageDialog("This is Event Injector message.\n" + "You are not available SD Card.\nPlease upgrade version of emulator."); } else isOldEmul = false; diff --git a/org.tizen.injector/META-INF/MANIFEST.MF b/org.tizen.injector/META-INF/MANIFEST.MF index 7423db5..5e8b8ec 100644 --- a/org.tizen.injector/META-INF/MANIFEST.MF +++ b/org.tizen.injector/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Tizen Event Injector Injector Bundle-SymbolicName: org.tizen.injector;singleton:=true Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: Samsung +Bundle-Vendor: Samsung Electronics Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.ui.ide, @@ -14,6 +14,7 @@ Require-Bundle: org.eclipse.ui, Bundle-ActivationPolicy: lazy Bundle-Activator: org.tizen.injector.Injector Export-Package: org.tizen.injector.control, + org.tizen.injector, org.tizen.injector.model, org.tizen.injector.protocol, org.tizen.injector.protocol.sensor, diff --git a/org.tizen.injector/src/org/tizen/injector/InjectorDialog.java b/org.tizen.injector/src/org/tizen/injector/InjectorDialog.java new file mode 100644 index 0000000..50bf585 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/InjectorDialog.java @@ -0,0 +1,100 @@ +/* + * org.tizen.nfc.tag.page + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Jihye kim + * Sungmin Ha + * Yeongkyoon Lee + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + */ + +package org.tizen.injector; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.MessageBox; +import org.eclipse.swt.widgets.Shell; + +public abstract class InjectorDialog +{ + public static String TITLE = "Event Injector"; + + public static void openInfoDialog(String message) { + openInfoDialog(new Shell(), message); + } + + public static void openInfoDialog(final Shell shell, final String message) { + Shell s; + if (shell == null) { + s = new Shell(); + } else { + s = shell; + } + openInfoDialog(s, "Info", message); + } + + public static void openInfoDialog(final Shell shell, final String title, final String message) { + final Shell s; + if (shell == null) { + s = new Shell(); + } else { + s = shell; + } + + Display.getDefault().syncExec(new Runnable() { + public void run() { + MessageBox dialog = new MessageBox(s, SWT.OK | SWT.MODELESS | SWT.ICON_INFORMATION); + dialog.setText(title); + dialog.setMessage(message); + dialog.open(); + } + }); + } + + public static void openErrorDialog(String message) { + openErrorDialog(new Shell(), message); + } + + public static void openErrorDialog(final Shell shell, final String message) { + Shell s; + if (shell == null) { + s = new Shell(); + } else { + s = shell; + } + openErrorDialog(s, "Error", message); + } + + public static void openErrorDialog(final Shell shell, final String title, final String message) { + final Shell s; + if (shell == null) { + s = new Shell(); + } else { + s = shell; + } + Display.getDefault().syncExec(new Runnable() { + public void run() { + MessageBox dialog = new MessageBox(s, SWT.OK | SWT.MODELESS | SWT.ICON_ERROR); + dialog.setText(title); + dialog.setMessage(message); + dialog.open(); + } + }); + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/socket/SDcardSocket.java b/org.tizen.injector/src/org/tizen/injector/socket/SDcardSocket.java index 93bdef0..ea9b488 100644 --- a/org.tizen.injector/src/org/tizen/injector/socket/SDcardSocket.java +++ b/org.tizen.injector/src/org/tizen/injector/socket/SDcardSocket.java @@ -125,7 +125,7 @@ public class SDcardSocket { while(isDataWaiting) { - if(sleepCnt > 100) + if(sleepCnt > 200) { sleepCnt = 0; isDataWaiting = false; diff --git a/org.tizen.location.core/META-INF/MANIFEST.MF b/org.tizen.location.core/META-INF/MANIFEST.MF index 2d35e0b..89dda5f 100644 --- a/org.tizen.location.core/META-INF/MANIFEST.MF +++ b/org.tizen.location.core/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Tizen Event Injector Location Core Bundle-SymbolicName: org.tizen.location.core;singleton:=true Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: Samsung +Bundle-Vendor: Samsung Electronics Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Export-Package: org.tizen.location.core.injector, org.tizen.location.core.model, diff --git a/org.tizen.location.log/META-INF/MANIFEST.MF b/org.tizen.location.log/META-INF/MANIFEST.MF index 23aabdb..20e02d5 100644 --- a/org.tizen.location.log/META-INF/MANIFEST.MF +++ b/org.tizen.location.log/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Tizen Event Injector Location Log Bundle-SymbolicName: org.tizen.location.log;singleton:=true Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: Samsung +Bundle-Vendor: Samsung Electronics Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.ui.forms;bundle-version="3.3.103", diff --git a/org.tizen.location.manual/META-INF/MANIFEST.MF b/org.tizen.location.manual/META-INF/MANIFEST.MF index bc1fac1..6966a25 100644 --- a/org.tizen.location.manual/META-INF/MANIFEST.MF +++ b/org.tizen.location.manual/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Tizen Event Injector Location Manual Bundle-SymbolicName: org.tizen.location.manual;singleton:=true Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: Samsung +Bundle-Vendor: Samsung Electronics Require-Bundle: org.eclipse.ui, org.eclipse.ui.forms, org.eclipse.core.runtime, diff --git a/org.tizen.location.map/META-INF/MANIFEST.MF b/org.tizen.location.map/META-INF/MANIFEST.MF index 5b16c6b..f3da5dc 100644 --- a/org.tizen.location.map/META-INF/MANIFEST.MF +++ b/org.tizen.location.map/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Tizen Event Injector Location Map Bundle-SymbolicName: org.tizen.location.map;singleton:=true Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: Samsung +Bundle-Vendor: Samsung Electronics Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.core.net;bundle-version="1.2.1", diff --git a/org.tizen.location.map/src/org/tizen/location/map/Map.java b/org.tizen.location.map/src/org/tizen/location/map/Map.java index 9f72cf0..30554d8 100644 --- a/org.tizen.location.map/src/org/tizen/location/map/Map.java +++ b/org.tizen.location.map/src/org/tizen/location/map/Map.java @@ -29,9 +29,9 @@ package org.tizen.location.map; import java.util.ArrayList; -import org.eclipse.core.internal.net.ProxyManager; -import org.eclipse.core.net.proxy.IProxyData; -import org.eclipse.core.net.proxy.IProxyService; +//import org.eclipse.core.internal.net.ProxyManager; +//import org.eclipse.core.net.proxy.IProxyData; +//import org.eclipse.core.net.proxy.IProxyService; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.forms.widgets.Section; @@ -42,20 +42,21 @@ import org.tizen.injector.provider.AbstractInjectorItem; import org.tizen.location.core.model.GeoLocationVO; import org.tizen.location.map.page.MapImage; -@SuppressWarnings("restriction") +//@SuppressWarnings("restriction") public class Map extends AbstractInjectorItem { private static String LABEL = Messages.Map_0; private DefaultTableModel model = new DefaultTableModel(new GeoLocationVO()); private ArrayList viewerList = new ArrayList(); - public static String host = null; - public static int port = -1; + //public static String host = null; + //public static int port = -1; @Override protected void addPages() { - init(); + //init(); addPage(new MapImage(this, Messages.Map_1, model)); } - + + /* private void init() { // Get Preferences - General - Network Connections IProxyService proxyManager = ProxyManager.getProxyManager(); @@ -85,7 +86,7 @@ public class Map extends AbstractInjectorItem { // DebugLog.log("[Activator] proxy initiate...." + System.getProperty("network.proxy_host") + " : " + //$NON-NLS-3$ // System.getProperty("network.proxy_port")); //$NON-NLS-1$ } - + */ public void addViewer(TableViewer viewer){ viewerList.add(viewer); } diff --git a/org.tizen.location.map/src/org/tizen/location/map/page/DebugLog.java b/org.tizen.location.map/src/org/tizen/location/map/page/DebugLog.java new file mode 100644 index 0000000..d162717 --- /dev/null +++ b/org.tizen.location.map/src/org/tizen/location/map/page/DebugLog.java @@ -0,0 +1,123 @@ +/* + * org.tizen.location.core + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.map.page; + +import java.util.Calendar; +import java.util.logging.FileHandler; +import java.util.logging.Formatter; +import java.util.logging.Handler; +import java.util.logging.Level; +import java.util.logging.LogRecord; +import java.util.logging.Logger; + +public class DebugLog { + private static final String LOG_FILE_NAME = "injector.log"; + private static Logger logger; + + static { + synchronized(DebugLog.class) { + init(); + } + } + + private static void init() { + logger = Logger.getLogger("Event Injector"); + logger.setUseParentHandlers(false); + //File logFolder; + Handler logFileHandler; + try { + /* + logFolder = new File(FilePath.getInstance().getTizenVmsArchPath()); + if (!logFolder.exists()) { + logFolder.mkdirs(); + } + */ + logFileHandler = new FileHandler(/*logFolder.getAbsolutePath() + File.separator + */LOG_FILE_NAME); + + logger.setLevel(Level.ALL); + logFileHandler.setLevel(Level.INFO); + + logFileHandler.setFormatter(new LoggerFormatter()); + logger.addHandler(logFileHandler); + } catch (Exception e) { + logger.setLevel(Level.OFF); + e.getMessage(); + } + } + + public static void log(String msg) { + logger.info(msg); + } +} + +class LoggerFormatter extends Formatter { + public String format(LogRecord record) { + StringBuffer sb = new StringBuffer(); + Calendar cal = Calendar.getInstance(); + cal.setTimeInMillis(record.getMillis()); + + // [YYYY.MM.DD HH:MM:SS][LEVEL][CLASS.METHOD] MESSAGE + sb.append('['); + sb.append(cal.get(Calendar.YEAR)); + sb.append('.'); + sb.append(cal.get(Calendar.MONTH)); + sb.append('.'); + sb.append(cal.get(Calendar.DAY_OF_MONTH)); + sb.append(' '); + sb.append(cal.get(Calendar.HOUR_OF_DAY)); + sb.append(':'); + sb.append(cal.get(Calendar.MINUTE)); + sb.append(':'); + sb.append(cal.get(Calendar.SECOND)); + sb.append(']'); + sb.append('['); + sb.append(record.getLevel()); + sb.append(']'); + sb.append('['); + sb.append(record.getSourceClassName().substring(record.getSourceClassName().lastIndexOf(".") + 1)); + sb.append('.'); + sb.append(record.getSourceMethodName()); + sb.append("] "); + sb.append(record.getMessage()); + + // in case when called Logger.throwing() + Throwable t = record.getThrown(); + if (t != null) { + StackTraceElement[] stacks = t.getStackTrace(); + sb.append('\n'); + sb.append(t.toString()); + for (int i = 0; i < stacks.length; i++) { + sb.append('\n'); + sb.append(stacks[i].toString()); + } + } + sb.append('\n'); + return sb.toString(); + } +} + diff --git a/org.tizen.location.map/src/org/tizen/location/map/page/MapImage.java b/org.tizen.location.map/src/org/tizen/location/map/page/MapImage.java index 7fe49da..9ba624e 100644 --- a/org.tizen.location.map/src/org/tizen/location/map/page/MapImage.java +++ b/org.tizen.location.map/src/org/tizen/location/map/page/MapImage.java @@ -31,8 +31,13 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.ProxySelector; +import java.net.URI; import java.net.URL; import java.net.UnknownHostException; +import java.util.List; //import java.util.ArrayList; //import java.util.List; @@ -66,7 +71,7 @@ import org.tizen.injector.model.ITableVO; import org.tizen.injector.provider.AbstractInjectorItem; import org.tizen.injector.provider.AbstractInjectorPage; //import org.tizen.location.core.injector.AbstractLocationInjector; -import org.tizen.location.core.injector.DebugLog; +//import org.tizen.location.core.injector.DebugLog; import org.tizen.location.core.injector.LocationInjector; import org.tizen.location.core.model.GeoLocationVO; import org.tizen.location.core.protocol.GeoLocation; @@ -109,60 +114,109 @@ public class MapImage extends AbstractInjectorPage { } - private void createGoogleMapScript() { - if(Map.host == null && Map.port == -1) - { - try { - //make a URL to a known source - URL url = new URL("http://www.google.com"); - - //open a connection to that source - HttpURLConnection urlConnect = (HttpURLConnection)url.openConnection(); - //trying to retrieve data from the source. If there - //is no connection, this line will fail - urlConnect.connect(); - boolean isLoading = false; - if (urlConnect.getResponseCode() != -1) { - // parsing title - BufferedReader in = new BufferedReader (new InputStreamReader(urlConnect.getInputStream())); - String line; - String pre = ""; - String tail = ""; - - boolean isNextLine = false; - while((line = in.readLine()) != null) { - if (line.contains(pre) || isNextLine) { - if (line.contains("google")) { - isLoading = true; - } - if (!isLoading && !line.contains(tail)) { - isNextLine = true; - continue; - } - break; + private boolean checkGoogle() { + try { + //make a URL to a known source + URL url = new URL("http://www.google.com"); + + //open a connection to that source + HttpURLConnection urlConnect = (HttpURLConnection)url.openConnection(); + //trying to retrieve data from the source. If there + //is no connection, this line will fail + urlConnect.connect(); + boolean isLoading = false; + if (urlConnect.getResponseCode() != -1) { + // parsing title + BufferedReader in = new BufferedReader (new InputStreamReader(urlConnect.getInputStream())); + String line; + String pre = ""; + String tail = ""; + + boolean isNextLine = false; + while((line = in.readLine()) != null) { + if (line.contains(pre) || isNextLine) { + if (line.contains("google")) { + isLoading = true; } + if (!isLoading && !line.contains(tail)) { + isNextLine = true; + continue; + } + break; } - in.close(); } + in.close(); + } + + if (!isLoading) { + this.googleMapScript = "



" + + "
Failed to load the map.
Please check the network status!
"; + return false; + } + urlConnect.disconnect(); + } catch (UnknownHostException e) { + // TODO Auto-generated catch block + //e.printStackTrace(); + this.googleMapScript = "



Can't connect to network.
"; + return false; + } + catch (IOException e) { + // TODO Auto-generated catch block + //e.printStackTrace(); + this.googleMapScript = "



" + + "
Failed to load the map.
" + e.getMessage() + + "
"; + return false; + } + + return true; + } + + private String host = null; + private int port = -1; + private boolean checkProxy() { + System.setProperty("java.net.useSystemProxies","true"); + try { + List l = ProxySelector.getDefault().select(new URI("http://www.google.com/")); + for (Proxy proxy : l ) { + DebugLog.log("proxy hostname : " + proxy.type()); + InetSocketAddress addr = (InetSocketAddress)proxy.address(); + if(addr == null) { + DebugLog.log("no proxy"); + return false; + } else { + host = addr.getHostName(); + port = addr.getPort(); + DebugLog.log("proxy hostname : " + host); + DebugLog.log("proxy port : " + port); + return true; + } + } + } catch (Exception e) { + DebugLog.log("checkProxy() : " + e.getMessage()); + } + return false; + } - if (!isLoading) { - this.googleMapScript = "



" + - "
Failed to load the map.
Please check the network status!
"; - return; + private void createGoogleMapScript() { + if (checkProxy()) { + DebugLog.log("System proxy is used."); + if (checkGoogle()) { + if (host != null) { + System.setProperty("network.proxy_host", host); + if (port != -1) { + System.setProperty("network.proxy_port", "" + port); + } } - urlConnect.disconnect(); - } catch (UnknownHostException e) { - // TODO Auto-generated catch block - //e.printStackTrace(); - this.googleMapScript = "



Can't connect to network.
"; + } else { + DebugLog.log("Failure to access the site using system proxy."); + //System.setProperty("java.net.useSystemProxies", "false"); return; - } - catch (IOException e) { - // TODO Auto-generated catch block - //e.printStackTrace(); - this.googleMapScript = "



" + - "
Failed to load the map.
" + e.getMessage() + - "
"; + } + } else { + System.setProperty("java.net.useSystemProxies", "false"); + DebugLog.log("System proxy is not used."); + if (!checkGoogle()) { return; } } @@ -228,7 +282,7 @@ public class MapImage extends AbstractInjectorPage { @Override public void completed(ProgressEvent event) { -// DebugLog.log("[Map] Map Loading: Compelete"); + DebugLog.log("[Map] Map Loading: Compelete"); } @Override diff --git a/org.tizen.nfc/META-INF/MANIFEST.MF b/org.tizen.nfc/META-INF/MANIFEST.MF index 08695a4..10ac2c3 100644 --- a/org.tizen.nfc/META-INF/MANIFEST.MF +++ b/org.tizen.nfc/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Tizen Event Injector Nfc Bundle-SymbolicName: org.tizen.nfc;singleton:=true Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: Samsung +Bundle-Vendor: Samsung Electronics Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Require-Bundle: org.tizen.injector, org.eclipse.swt;bundle-version="3.6.2", diff --git a/org.tizen.sensor.accelerometer/META-INF/MANIFEST.MF b/org.tizen.sensor.accelerometer/META-INF/MANIFEST.MF index bdf9d3e..30b3ddb 100644 --- a/org.tizen.sensor.accelerometer/META-INF/MANIFEST.MF +++ b/org.tizen.sensor.accelerometer/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Tizen Event Injector Sensor Accelerometer Bundle-SymbolicName: org.tizen.sensor.accelerometer;singleton:=true Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: Samsung +Bundle-Vendor: Samsung Electronics Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Require-Bundle: org.eclipse.ui;bundle-version="3.5.2", org.tizen.injector, diff --git a/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/FileListVO.java b/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/FileListVO.java new file mode 100644 index 0000000..aebfef1 --- /dev/null +++ b/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/FileListVO.java @@ -0,0 +1,77 @@ +/* + * org.tizen.telephony.call + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.sensor.accelerometer; + +import org.tizen.injector.model.AbstractTableVO; + +public class FileListVO extends AbstractTableVO { + private int num; + private String filePath; + + public String getFilePath() { + return filePath; + } + + public void setFilePath(String filePath) { + this.filePath = filePath; + } + + public int getNum() { + return this.num; + } + + public void setNum(int number) { + this.num = number; + } + + @Override + public String[] getColumnNames() { + return null; + } + + @Override + public Object getColumnValue(int index) { + Object obj = null; + switch (index) { + case 0: + obj = getNum(); + break; + case 1: + obj = getFilePath(); + break; + default: + break; + } + return obj; + } + + @Override + public void setColumnValue(int index, Object value) { + + } +} diff --git a/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/SensorConstants.java b/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/SensorConstants.java index ec70666..0dfb2c6 100644 --- a/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/SensorConstants.java +++ b/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/SensorConstants.java @@ -32,4 +32,8 @@ public class SensorConstants { public static final String GEO_ID = "5\n"; public static final String TILT_ID = "12\n"; public static final String MAGNETIC_ID = "13\n"; + + public static final String FILE_ACCEL_ID = "14\n"; + public static final String FILE_MAGNETIC_ID = "15\n"; + public static final String FILE_GYRO_ID = "16\n"; } diff --git a/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/page/ManualInputAccel.java b/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/page/ManualInputAccel.java index 3079706..eeb54c3 100644 --- a/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/page/ManualInputAccel.java +++ b/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/page/ManualInputAccel.java @@ -27,8 +27,12 @@ package org.tizen.sensor.accelerometer.page; +import java.io.File; import java.text.DecimalFormat; +import java.util.ArrayList; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.TableViewer; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; @@ -37,16 +41,27 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Slider; import org.eclipse.swt.widgets.Text; -import org.tizen.common.util.DialogUtil; +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.injector.InjectorDialog; +import org.tizen.injector.control.TableViewContentProvider; +import org.tizen.injector.control.TableViewLabelProvider; +import org.tizen.injector.model.DefaultTableModel; import org.tizen.injector.protocol.sensor.TestSensorMessage; import org.tizen.injector.provider.AbstractInjectorItem; import org.tizen.injector.provider.AbstractInjectorPage; +import org.tizen.sdblib.SyncService; +import org.tizen.sdblib.SyncService.SyncResult; +import org.tizen.sensor.accelerometer.FileListVO; import org.tizen.sensor.accelerometer.SensorConstants; public class ManualInputAccel extends AbstractInjectorPage { + private String logFileName = null; + private String remoteFilePath = "/opt/sensor/accel/InputFiles/"; Slider accel_xSlider, accel_ySlider, accel_zSlider; private Text accel_xText, accel_yText, accel_zText; double accel_xValue, accel_yValue, accel_zValue; @@ -54,6 +69,15 @@ public class ManualInputAccel extends AbstractInjectorPage { int accel_forSliderVal = 200; DecimalFormat df = new DecimalFormat("0.##"); + private Text filenameText, repeatText; + private Button startButton, stopButton, deleteButton; + private Button addButton; + + private TableViewer viewer; + private DefaultTableModel model = new DefaultTableModel(new FileListVO()); + private ArrayList viewerList = new ArrayList(); + public int repeatCount = 1, fileCnt = 0; + public ManualInputAccel(AbstractInjectorItem item, String name) { super(item, name); @@ -128,7 +152,8 @@ public class ManualInputAccel extends AbstractInjectorPage { if(!isNumeric(number) || Double.parseDouble(number) < -2 || Double.parseDouble(number) > 2) throw null; } catch (Exception err) { - DialogUtil.openMessageDialog("Please enter the correct value.\nX value can be entered in the range of -2 to 2."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nX value can be entered in the range of -2 to 2."); accel_xText.setText(df.format(accel_xValue)); return; } @@ -186,7 +211,8 @@ public class ManualInputAccel extends AbstractInjectorPage { if(!isNumeric(number) || Double.parseDouble(number) < -2 || Double.parseDouble(number) > 2) throw null; } catch (Exception err) { - DialogUtil.openMessageDialog("Please enter the correct value.\nY value can be entered in the range of -2 to 2."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nY value can be entered in the range of -2 to 2."); accel_yText.setText(df.format(accel_yValue)); return; } @@ -245,7 +271,8 @@ public class ManualInputAccel extends AbstractInjectorPage { if(!isNumeric(number) || Double.parseDouble(number) < -2 || Double.parseDouble(number) > 2) throw null; } catch (Exception err) { - DialogUtil.openMessageDialog("Please enter the correct value.\nZ value can be entered in the range of -2 to 2."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nZ value can be entered in the range of -2 to 2."); accel_zText.setText(df.format(accel_zValue)); return; } @@ -292,6 +319,247 @@ public class ManualInputAccel extends AbstractInjectorPage { // TODO Auto-generated method stub } }); + +/////////////////// File Input //////////////////////////////////// + + Composite client2 = formUtil.createSection(parent, "File input"); + Composite fileComposite = formUtil.createComposite(client2, 4); + gd = new GridData(GridData.FILL, GridData.FILL, false, true); + gd.widthHint = 560; + fileComposite.setLayoutData(gd); + filenameText = formUtil.createText(fileComposite, ""); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 320; + filenameText.setLayoutData(gd); + filenameText.setEditable(false); + Button browserButton = formUtil.createButton(fileComposite, "Browse", SWT.PUSH); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 100; + browserButton.setLayoutData(gd); + browserButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + String filename = ""; + FileDialog dialog = new FileDialog(new Shell()); + filename = dialog.open(); + + if(filename == null) + return; + + filenameText.setText(filename); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + addButton = formUtil.createButton(fileComposite, "Add", SWT.PUSH); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 100; + addButton.setLayoutData(gd); + addButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + if(model.size() == 5) + { + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "The maximum number of files is 5."); + return; + } + + FileListVO fl = new FileListVO(); + fl.setNum(++fileCnt); + fl.setFilePath(filenameText.getText()); + model.add(fl); + viewer.refresh(); + + startButton.setEnabled(true); + deleteButton.setEnabled(true); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + Composite listComposite = formUtil.createComposite(client2, 1); + String[] columnNames = { + "No.", + "File path" + }; + + viewer = formUtil.createTableViewer(listComposite, columnNames); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 540; + gd.heightHint = 76; + viewer.getControl().setLayoutData(gd); + + viewer.setContentProvider(new TableViewContentProvider()); + viewer.setLabelProvider(new TableViewLabelProvider(viewer)); + viewer.setInput(model); + + Composite fileComposite2 = formUtil.createComposite(client2, 8); + formUtil.createLabel(fileComposite2, "Repeat : "); + + Button leftButton = formUtil.createButton(fileComposite2, "<", SWT.PUSH); + leftButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + if(repeatCount != 1) + repeatCount -= 1; + + repeatText.setText(String.format("%d", repeatCount)); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + repeatText = formUtil.createText(fileComposite2, String.format("%d", repeatCount)); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 8; + repeatText.setLayoutData(gd); + repeatText.setEditable(false); + + Button rightButton = formUtil.createButton(fileComposite2, ">", SWT.PUSH); + rightButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + if(repeatCount != 9) + repeatCount += 1; + + repeatText.setText(String.format("%d", repeatCount)); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + formUtil.createLabel(fileComposite2, " "); + + startButton = formUtil.createButton(fileComposite2, "Start", SWT.PUSH); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 100; + startButton.setLayoutData(gd); + startButton.setEnabled(false); + startButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + // PUSH FILE TO EMULATOR + Object[] obj = model.getDatas(); + String files = ""; + for(int i = 0; i < model.size(); i++) + { + FileListVO fl = (FileListVO)obj[i]; + File file = new File(fl.getFilePath()); + if (file.exists()) { + SyncService sync; + @SuppressWarnings("unused") + SyncResult result; + try { + sync = ConnectionPlugin.getDefault().getCurrentDevice().getSyncService(); + if (sync != null) + { + logFileName = file.getName(); + files += logFileName + "\n"; + result = sync.pushFile(file.getPath(), remoteFilePath + logFileName, SyncService.getNullProgressMonitor()); + } + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + } + + startButton.setEnabled(false); + stopButton.setEnabled(true); + deleteButton.setEnabled(false); + addButton.setEnabled(false); + sendFileMessage(files); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + stopButton = formUtil.createButton(fileComposite2, "Stop", SWT.PUSH); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 100; + stopButton.setLayoutData(gd); + stopButton.setEnabled(false); + stopButton.addSelectionListener(new SelectionListener () { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + sendFileStop(); + stopButton.setEnabled(false); + startButton.setEnabled(true); + deleteButton.setEnabled(true); + addButton.setEnabled(true); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + deleteButton = formUtil.createButton(fileComposite2, "Delete", SWT.PUSH); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 100; + deleteButton.setLayoutData(gd); + deleteButton.setEnabled(false); + deleteButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + IStructuredSelection selection = (IStructuredSelection)viewer.getSelection(); + Object [] objs = selection.toArray(); + for (int i = 0; i < objs.length; i++) + { + FileListVO fl = ((FileListVO)objs[i]); + model.remove(fl); + fileCnt--; + } + + Object[] obj = model.getDatas(); + for (int i = 0; i < model.size(); i++) + { + FileListVO fl = (FileListVO)obj[i]; + fl.setNum(i+1); + } + + viewer.refresh(); + + if(fileCnt == 0) + { + startButton.setEnabled(false); + deleteButton.setEnabled(false); + } + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + } + + public void addViewer(TableViewer viewer){ + viewerList.add(viewer); + } + + public void refresh(){ + for(int i=1;i viewerList = new ArrayList(); + public int repeatCount = 1, fileCnt = 0; + public ManualInputGyro(AbstractInjectorItem item, String name) { super(item, name); @@ -128,7 +152,8 @@ public class ManualInputGyro extends AbstractInjectorPage { if(!isNumeric(number) || Double.parseDouble(number) < -10 || Double.parseDouble(number) > 10) throw null; } catch (Exception err) { - DialogUtil.openMessageDialog("Please enter the correct value.\nX value can be entered in the range of -10 to 10."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nX value can be entered in the range of -10 to 10."); gyro_xText.setText(df.format(gyro_xValue)); return; } @@ -187,7 +212,8 @@ public class ManualInputGyro extends AbstractInjectorPage { if(!isNumeric(number) || Double.parseDouble(number) < -10 || Double.parseDouble(number) > 10) throw null; } catch (Exception err) { - DialogUtil.openMessageDialog("Please enter the correct value.\nY value can be entered in the range of -10 to 10."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nY value can be entered in the range of -10 to 10."); gyro_yText.setText(df.format(gyro_yValue)); return; } @@ -248,7 +274,8 @@ public class ManualInputGyro extends AbstractInjectorPage { if(!isNumeric(number) || Double.parseDouble(number) < -10 || Double.parseDouble(number) > 10) throw null; } catch (Exception err) { - DialogUtil.openMessageDialog("Please enter the correct value.\nZ value can be entered in the range of -10 to 10."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nZ value can be entered in the range of -10 to 10."); gyro_zText.setText(df.format(gyro_zValue)); return; } @@ -295,6 +322,247 @@ public class ManualInputGyro extends AbstractInjectorPage { // TODO Auto-generated method stub } }); + + /////////////////// File Input //////////////////////////////////// + + Composite client2 = formUtil.createSection(parent, "File input"); + Composite fileComposite = formUtil.createComposite(client2, 4); + gd = new GridData(GridData.FILL, GridData.FILL, false, true); + gd.widthHint = 560; + fileComposite.setLayoutData(gd); + filenameText = formUtil.createText(fileComposite, ""); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 320; + filenameText.setLayoutData(gd); + filenameText.setEditable(false); + Button browserButton = formUtil.createButton(fileComposite, "Browse", SWT.PUSH); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 100; + browserButton.setLayoutData(gd); + browserButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + String filename = ""; + FileDialog dialog = new FileDialog(new Shell()); + filename = dialog.open(); + + if(filename == null) + return; + + filenameText.setText(filename); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + addButton = formUtil.createButton(fileComposite, "Add", SWT.PUSH); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 100; + addButton.setLayoutData(gd); + addButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + if(model.size() == 5) + { + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "The maximum number of files is 5."); + return; + } + + FileListVO fl = new FileListVO(); + fl.setNum(++fileCnt); + fl.setFilePath(filenameText.getText()); + model.add(fl); + viewer.refresh(); + + startButton.setEnabled(true); + deleteButton.setEnabled(true); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + Composite listComposite = formUtil.createComposite(client2, 1); + String[] columnNames = { + "No.", + "File path" + }; + + viewer = formUtil.createTableViewer(listComposite, columnNames); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 540; + gd.heightHint = 76; + viewer.getControl().setLayoutData(gd); + + viewer.setContentProvider(new TableViewContentProvider()); + viewer.setLabelProvider(new TableViewLabelProvider(viewer)); + viewer.setInput(model); + + Composite fileComposite2 = formUtil.createComposite(client2, 8); + formUtil.createLabel(fileComposite2, "Repeat : "); + + Button leftButton = formUtil.createButton(fileComposite2, "<", SWT.PUSH); + leftButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + if(repeatCount != 1) + repeatCount -= 1; + + repeatText.setText(String.format("%d", repeatCount)); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + repeatText = formUtil.createText(fileComposite2, String.format("%d", repeatCount)); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 8; + repeatText.setLayoutData(gd); + repeatText.setEditable(false); + + Button rightButton = formUtil.createButton(fileComposite2, ">", SWT.PUSH); + rightButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + if(repeatCount != 9) + repeatCount += 1; + + repeatText.setText(String.format("%d", repeatCount)); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + formUtil.createLabel(fileComposite2, " "); + + startButton = formUtil.createButton(fileComposite2, "Start", SWT.PUSH); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 100; + startButton.setLayoutData(gd); + startButton.setEnabled(false); + startButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + // PUSH FILE TO EMULATOR + Object[] obj = model.getDatas(); + String files = ""; + for(int i = 0; i < model.size(); i++) + { + FileListVO fl = (FileListVO)obj[i]; + File file = new File(fl.getFilePath()); + if (file.exists()) { + SyncService sync; + @SuppressWarnings("unused") + SyncResult result; + try { + sync = ConnectionPlugin.getDefault().getCurrentDevice().getSyncService(); + if (sync != null) + { + logFileName = file.getName(); + files += logFileName + "\n"; + result = sync.pushFile(file.getPath(), remoteFilePath + logFileName, SyncService.getNullProgressMonitor()); + } + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + } + + startButton.setEnabled(false); + stopButton.setEnabled(true); + deleteButton.setEnabled(false); + addButton.setEnabled(false); + sendFileMessage(files); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + stopButton = formUtil.createButton(fileComposite2, "Stop", SWT.PUSH); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 100; + stopButton.setLayoutData(gd); + stopButton.setEnabled(false); + stopButton.addSelectionListener(new SelectionListener () { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + sendFileStop(); + stopButton.setEnabled(false); + startButton.setEnabled(true); + deleteButton.setEnabled(true); + addButton.setEnabled(true); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + deleteButton = formUtil.createButton(fileComposite2, "Delete", SWT.PUSH); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 100; + deleteButton.setLayoutData(gd); + deleteButton.setEnabled(false); + deleteButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + IStructuredSelection selection = (IStructuredSelection)viewer.getSelection(); + Object [] objs = selection.toArray(); + for (int i = 0; i < objs.length; i++) + { + FileListVO fl = ((FileListVO)objs[i]); + model.remove(fl); + fileCnt--; + } + + Object[] obj = model.getDatas(); + for (int i = 0; i < model.size(); i++) + { + FileListVO fl = (FileListVO)obj[i]; + fl.setNum(i+1); + } + + viewer.refresh(); + + if(fileCnt == 0) + { + startButton.setEnabled(false); + deleteButton.setEnabled(false); + } + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + } + + public void addViewer(TableViewer viewer){ + viewerList.add(viewer); + } + + public void refresh(){ + for(int i=1;i viewerList = new ArrayList(); + public int repeatCount = 1, fileCnt = 0; + public ManualInputMagnetic(AbstractInjectorItem item, String name) { super(item, name); @@ -124,7 +149,8 @@ public class ManualInputMagnetic extends AbstractInjectorPage { if(!isNumeric(number) || Integer.parseInt(number) < -2000 || Integer.parseInt(number) > 2000) throw null; } catch (Exception err) { - DialogUtil.openMessageDialog("Please enter an integer number of units.\nX value can be entered in the range of -2000 to 2000."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an integer number of units.\nX value can be entered in the range of -2000 to 2000."); magnetic_xText.setText(Integer.toString(magnetic_xValue)); return; } @@ -183,7 +209,8 @@ public class ManualInputMagnetic extends AbstractInjectorPage { if(!isNumeric(number) || Integer.parseInt(number) < -2000 || Integer.parseInt(number) > 2000) throw null; } catch (Exception err) { - DialogUtil.openMessageDialog("Please enter an integer number of units.\nY value can be entered in the range of -2000 to 2000."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an integer number of units.\nY value can be entered in the range of -2000 to 2000."); magnetic_yText.setText(Integer.toString(magnetic_yValue)); return; } @@ -243,7 +270,8 @@ public class ManualInputMagnetic extends AbstractInjectorPage { if(!isNumeric(number) || Integer.parseInt(number) < -2000 || Integer.parseInt(number) > 2000) throw null; } catch (Exception err) { - DialogUtil.openMessageDialog("Please enter an integer number of units.\nZ value can be entered in the range of -2000 to 2000."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an integer number of units.\nZ value can be entered in the range of -2000 to 2000."); magnetic_zText.setText(Integer.toString(magnetic_zValue)); return; } @@ -290,6 +318,247 @@ public class ManualInputMagnetic extends AbstractInjectorPage { // TODO Auto-generated method stub } }); + + /////////////////// File Input //////////////////////////////////// + + Composite client2 = formUtil.createSection(parent, "File input"); + Composite fileComposite = formUtil.createComposite(client2, 4); + gd = new GridData(GridData.FILL, GridData.FILL, false, true); + gd.widthHint = 560; + fileComposite.setLayoutData(gd); + filenameText = formUtil.createText(fileComposite, ""); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 320; + filenameText.setLayoutData(gd); + filenameText.setEditable(false); + Button browserButton = formUtil.createButton(fileComposite, "Browse", SWT.PUSH); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 100; + browserButton.setLayoutData(gd); + browserButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + String filename = ""; + FileDialog dialog = new FileDialog(new Shell()); + filename = dialog.open(); + + if(filename == null) + return; + + filenameText.setText(filename); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + addButton = formUtil.createButton(fileComposite, "Add", SWT.PUSH); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 100; + addButton.setLayoutData(gd); + addButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + if(model.size() == 5) + { + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "The maximum number of files is 5."); + return; + } + + FileListVO fl = new FileListVO(); + fl.setNum(++fileCnt); + fl.setFilePath(filenameText.getText()); + model.add(fl); + viewer.refresh(); + + startButton.setEnabled(true); + deleteButton.setEnabled(true); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + Composite listComposite = formUtil.createComposite(client2, 1); + String[] columnNames = { + "No.", + "File path" + }; + + viewer = formUtil.createTableViewer(listComposite, columnNames); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 540; + gd.heightHint = 76; + viewer.getControl().setLayoutData(gd); + + viewer.setContentProvider(new TableViewContentProvider()); + viewer.setLabelProvider(new TableViewLabelProvider(viewer)); + viewer.setInput(model); + + Composite fileComposite2 = formUtil.createComposite(client2, 8); + formUtil.createLabel(fileComposite2, "Repeat : "); + + Button leftButton = formUtil.createButton(fileComposite2, "<", SWT.PUSH); + leftButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + if(repeatCount != 1) + repeatCount -= 1; + + repeatText.setText(String.format("%d", repeatCount)); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + repeatText = formUtil.createText(fileComposite2, String.format("%d", repeatCount)); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 8; + repeatText.setLayoutData(gd); + repeatText.setEditable(false); + + Button rightButton = formUtil.createButton(fileComposite2, ">", SWT.PUSH); + rightButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + if(repeatCount != 9) + repeatCount += 1; + + repeatText.setText(String.format("%d", repeatCount)); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + formUtil.createLabel(fileComposite2, " "); + + startButton = formUtil.createButton(fileComposite2, "Start", SWT.PUSH); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 100; + startButton.setLayoutData(gd); + startButton.setEnabled(false); + startButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + // PUSH FILE TO EMULATOR + Object[] obj = model.getDatas(); + String files = ""; + for(int i = 0; i < model.size(); i++) + { + FileListVO fl = (FileListVO)obj[i]; + File file = new File(fl.getFilePath()); + if (file.exists()) { + SyncService sync; + @SuppressWarnings("unused") + SyncResult result; + try { + sync = ConnectionPlugin.getDefault().getCurrentDevice().getSyncService(); + if (sync != null) + { + logFileName = file.getName(); + files += logFileName + "\n"; + result = sync.pushFile(file.getPath(), remoteFilePath + logFileName, SyncService.getNullProgressMonitor()); + } + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + } + + startButton.setEnabled(false); + stopButton.setEnabled(true); + deleteButton.setEnabled(false); + addButton.setEnabled(false); + sendFileMessage(files); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + stopButton = formUtil.createButton(fileComposite2, "Stop", SWT.PUSH); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 100; + stopButton.setLayoutData(gd); + stopButton.setEnabled(false); + stopButton.addSelectionListener(new SelectionListener () { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + sendFileStop(); + stopButton.setEnabled(false); + startButton.setEnabled(true); + deleteButton.setEnabled(true); + addButton.setEnabled(true); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + + deleteButton = formUtil.createButton(fileComposite2, "Delete", SWT.PUSH); + gd = new GridData(SWT.NONE, SWT.NONE, false, true); + gd.widthHint = 100; + deleteButton.setLayoutData(gd); + deleteButton.setEnabled(false); + deleteButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + IStructuredSelection selection = (IStructuredSelection)viewer.getSelection(); + Object [] objs = selection.toArray(); + for (int i = 0; i < objs.length; i++) + { + FileListVO fl = ((FileListVO)objs[i]); + model.remove(fl); + fileCnt--; + } + + Object[] obj = model.getDatas(); + for (int i = 0; i < model.size(); i++) + { + FileListVO fl = (FileListVO)obj[i]; + fl.setNum(i+1); + } + + viewer.refresh(); + + if(fileCnt == 0) + { + startButton.setEnabled(false); + deleteButton.setEnabled(false); + } + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + } + + public void addViewer(TableViewer viewer){ + viewerList.add(viewer); + } + + public void refresh(){ + for(int i=1;i 360) throw null; } catch (Exception err) { - DialogUtil.openMessageDialog("Please enter an positive integer number of units.\nAzimuth value can be entered in the range of 0 to 360."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an positive integer number of units.\nAzimuth value can be entered in the range of 0 to 360."); tilt_xText.setText(Integer.toString(tilt_xValue)); return; } @@ -181,7 +183,8 @@ public class ManualInputTilt extends AbstractInjectorPage { if(!isNumeric(number) || Integer.parseInt(number) < -180 || Integer.parseInt(number) > 180) throw null; } catch (Exception err) { - DialogUtil.openMessageDialog("Please enter an integer number of units.\nPitch value can be entered in the range of -180 to 180."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an integer number of units.\nPitch value can be entered in the range of -180 to 180."); tilt_yText.setText(Integer.toString(tilt_yValue)); return; } @@ -239,7 +242,8 @@ public class ManualInputTilt extends AbstractInjectorPage { if(!isNumeric(number) || Integer.parseInt(number) < -180 || Integer.parseInt(number) > 180) throw null; } catch (Exception err) { - DialogUtil.openMessageDialog("Please enter an integer number of units.\nRoll value can be entered in the range of -180 to 180."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an integer number of units.\nRoll value can be entered in the range of -180 to 180."); tilt_zText.setText(Integer.toString(tilt_zValue)); return; } diff --git a/org.tizen.sensor.light/META-INF/MANIFEST.MF b/org.tizen.sensor.light/META-INF/MANIFEST.MF index adf6082..770ff64 100644 --- a/org.tizen.sensor.light/META-INF/MANIFEST.MF +++ b/org.tizen.sensor.light/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Tizen Event Injector Sensor Light Bundle-SymbolicName: org.tizen.sensor.light;singleton:=true Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: Samsung +Bundle-Vendor: Samsung Electronics Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Import-Package: org.eclipse.swt.widgets, diff --git a/org.tizen.sensor.light/src/org/tizen/sensor/light/page/LightPage.java b/org.tizen.sensor.light/src/org/tizen/sensor/light/page/LightPage.java index 8ca9694..f48697a 100644 --- a/org.tizen.sensor.light/src/org/tizen/sensor/light/page/LightPage.java +++ b/org.tizen.sensor.light/src/org/tizen/sensor/light/page/LightPage.java @@ -38,6 +38,7 @@ import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Slider; import org.eclipse.swt.widgets.Text; import org.eclipse.swt.events.MouseEvent; @@ -45,9 +46,9 @@ import org.eclipse.swt.events.MouseListener; import org.tizen.common.connection.ConnectionPlugin; import org.tizen.common.connection.ConnectionPlugin.ISelectionListener; -import org.tizen.common.util.DialogUtil; import org.tizen.sdblib.FileListingService.FileEntry; import org.tizen.sdblib.IDevice; +import org.tizen.injector.InjectorDialog; import org.tizen.injector.protocol.sensor.TestSensorMessage; import org.tizen.injector.provider.AbstractInjectorItem; import org.tizen.injector.provider.AbstractInjectorPage; @@ -160,7 +161,8 @@ public class LightPage extends AbstractInjectorPage implements ISelectionListene if(checkNumberFormat(number) || Double.parseDouble(number) <= 0 || Double.parseDouble(number) > 65535) throw null; } catch (Exception err) { - DialogUtil.openMessageDialog("Please enter an positive integer number of units.\nLux can be entered in the range of 1 to 65535."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an positive integer number of units.\nLux can be entered in the range of 1 to 65535."); luxText.setText(Integer.toString(luxData)); return; } diff --git a/org.tizen.sensor.motion/META-INF/MANIFEST.MF b/org.tizen.sensor.motion/META-INF/MANIFEST.MF index 3213e9c..085181d 100644 --- a/org.tizen.sensor.motion/META-INF/MANIFEST.MF +++ b/org.tizen.sensor.motion/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Tizen Event Injector Sensor Motion Bundle-SymbolicName: org.tizen.sensor.motion;singleton:=true Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: Samsung +Bundle-Vendor: Samsung Electronics Require-Bundle: org.eclipse.core.runtime, org.eclipse.swt, org.tizen.injector diff --git a/org.tizen.sensor.proximity/META-INF/MANIFEST.MF b/org.tizen.sensor.proximity/META-INF/MANIFEST.MF index 68bd13e..eb0a618 100644 --- a/org.tizen.sensor.proximity/META-INF/MANIFEST.MF +++ b/org.tizen.sensor.proximity/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Tizen Event Injector Sensor Proximity Bundle-SymbolicName: org.tizen.sensor.proximity;singleton:=true Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: Samsung +Bundle-Vendor: Samsung Electronics Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Require-Bundle: org.tizen.injector, org.eclipse.swt, diff --git a/org.tizen.telephony.call/META-INF/MANIFEST.MF b/org.tizen.telephony.call/META-INF/MANIFEST.MF index 465d2ad..47003ee 100644 --- a/org.tizen.telephony.call/META-INF/MANIFEST.MF +++ b/org.tizen.telephony.call/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Tizen Event Injector Telephony Call Bundle-SymbolicName: org.tizen.telephony.call;singleton:=true Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: Samsung +Bundle-Vendor: Samsung Electronics Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.ui.forms;bundle-version="3.3.103", diff --git a/org.tizen.telephony.call/src/org/tizen/telephony/call/page/MOMTCall.java b/org.tizen.telephony.call/src/org/tizen/telephony/call/page/MOMTCall.java index 7774617..bf5ce3f 100644 --- a/org.tizen.telephony.call/src/org/tizen/telephony/call/page/MOMTCall.java +++ b/org.tizen.telephony.call/src/org/tizen/telephony/call/page/MOMTCall.java @@ -45,14 +45,15 @@ import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.tizen.common.connection.ConnectionPlugin; import org.tizen.common.connection.ConnectionPlugin.ISelectionListener; +import org.tizen.injector.InjectorDialog; import org.tizen.injector.control.TableViewContentProvider; import org.tizen.injector.control.TableViewLabelProvider; import org.tizen.injector.model.DefaultTableModel; -import org.tizen.common.util.DialogUtil; import org.tizen.sdblib.FileListingService.FileEntry; import org.tizen.sdblib.IDevice; import org.tizen.injector.protocol.AbstractGA; @@ -422,19 +423,22 @@ ISelectionListener{ private void mtConnecct() { if(!rssiStatus) { - DialogUtil.openMessageDialog("This is telephony message.\nRSSI level is zero.\nPlease try again later."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "RSSI level is zero.\nPlease try again later."); return; } if(incomming == true) { - DialogUtil.openMessageDialog("This is telephony message.\nUser is busy.\nPlease try again later."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "User is busy.\nPlease try again later."); return; } if(TelephonySocket.getInstance().callWaiting == false && calling == true) { - DialogUtil.openMessageDialog("This is telephony message.\nUser is busy.\nCall waiting mode of emulator is off.\nPlease try again later."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "User is busy.\nCall waiting mode of emulator is off.\nPlease try again later."); return; } @@ -444,13 +448,15 @@ ISelectionListener{ if(number.length() > 15) { - DialogUtil.openMessageDialog("This is telephony message.\nThe maximum length of phone number is 15."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "The maximum length of phone number is 15."); return; } if(checkNumberFormat(number)) { - DialogUtil.openMessageDialog("This is telephony message.\nWrong phone number."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Wrong phone number."); return; } @@ -612,7 +618,10 @@ ISelectionListener{ } if(listfull == true) - DialogUtil.openMessageDialog("This is telephony message.\nThere are many pending connections.\nCan't connect anymore."); + { + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "There are many pending connections.\nCan't connect anymore."); + } if(loopCount == 6) listfull = true; diff --git a/org.tizen.telephony.sms/META-INF/MANIFEST.MF b/org.tizen.telephony.sms/META-INF/MANIFEST.MF index cb85cf7..d3a337d 100644 --- a/org.tizen.telephony.sms/META-INF/MANIFEST.MF +++ b/org.tizen.telephony.sms/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Tizen Event Injector Telephony Sms Bundle-SymbolicName: org.tizen.telephony.sms;singleton:=true Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: Samsung +Bundle-Vendor: Samsung Electronics Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.tizen.common, diff --git a/org.tizen.telephony.sms/src/org/tizen/telephony/sms/page/SMS.java b/org.tizen.telephony.sms/src/org/tizen/telephony/sms/page/SMS.java index ad8c048..9858756 100644 --- a/org.tizen.telephony.sms/src/org/tizen/telephony/sms/page/SMS.java +++ b/org.tizen.telephony.sms/src/org/tizen/telephony/sms/page/SMS.java @@ -31,7 +31,6 @@ import java.io.UnsupportedEncodingException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; -import java.util.HashSet; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -43,8 +42,10 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; +import org.tizen.injector.InjectorDialog; import org.tizen.injector.protocol.AbstractGA; import org.tizen.injector.protocol.StructureGA; import org.tizen.injector.provider.AbstractInjectorItem; @@ -64,7 +65,6 @@ import org.tizen.telephony.sms.protocol.G04A01; import org.tizen.telephony.sms.protocol.G04A05; import org.tizen.common.connection.ConnectionPlugin; import org.tizen.common.connection.ConnectionPlugin.ISelectionListener; -import org.tizen.common.util.DialogUtil; import org.tizen.sdblib.IDevice; import org.tizen.sdblib.FileListingService.FileEntry; @@ -300,15 +300,18 @@ ISelectionListener{ String number = cmbMobileTerminateOriginatingAddress.getText().trim(); { if(number==null||number.length()==0) { - DialogUtil.openMessageDialog("Input phone number."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Input phone number."); return; } if(number.length() > 15) { - DialogUtil.openMessageDialog("The maximum length of phone number is 15."); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "The maximum length of phone number is 15."); return; } if(checkNumberFormat(number)) { - DialogUtil.openMessageDialog("This is invalid number. (" + number + ")"); + Shell shell = parent.getShell(); + InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "This is invalid number. (" + number + ")"); return; } } diff --git a/package/build.linux b/package/build.linux index 75215a7..65cbfe5 100755 --- a/package/build.linux +++ b/package/build.linux @@ -9,17 +9,21 @@ __set_parameter() build_result_directory=${build_type}.${build_id} build_result_path="$build_path/$build_result_directory" architecture=x86 - ide_root_path_name=IDE + ide_root_path_name=ide - case ${platform} in - linux) + case ${TARGET_OS} in + ubuntu-32 | ubuntu-64) archive_platform_name=linux windowing=gtk ;; - windows) + windows-32 | windows-64) archive_platform_name=win32 windowing=win32 ;; + macos-64) + archive_platform_name=mac + windowing=gtk + ;; *) echo "${platform} is not support yet." ;; @@ -30,13 +34,16 @@ __set_parameter() __set_build_parameter() { - case ${platform} in - linux) + case ${TARGET_OS} in + ubuntu-32 | ubuntu-64) reference_ide_path=${ROOTDIR}/indigo-pde/eclipse ;; - windows) + windows-32 | windows-64) reference_ide_path=${ROOTDIR}/indigo-winpde/eclipse ;; + macos-64) + reference_ide_path=${ROOTDIR}/indigo-macpde/eclipse + ;; *) echo "${platform} is not support yet." ;; @@ -181,11 +188,14 @@ __unzip_plugin_pack() build_plugins() { - case ${platform} in - linux) + case ${TARGET_OS} in + ubuntu-32 | ubuntu-64) + echo "build plugin for ${platform}" + ;; + windows-32 | windows-64) echo "build plugin for ${platform}" ;; - windows) + macos-64) echo "build plugin for ${platform}" ;; *) @@ -261,7 +271,7 @@ build() package_name=`echo ${pkgname_and_platform} | cut -f1 -d " " | cut -f2 -d ":"` platform=`echo ${pkgname_and_platform} | cut -f2 -d " " | cut -f2 -d ":"` - if [ "x${BUILD_TARGET_OS}" = "x${platform}" ] + if [ "x${TARGET_OS}" = "x${platform}" ] then build_plugins else @@ -281,7 +291,7 @@ install() package_name=`echo ${pkgname_and_platform} | cut -f1 -d " " | cut -f2 -d ":"` platform=`echo ${pkgname_and_platform} | cut -f2 -d " " | cut -f2 -d ":"` - if [ "x${BUILD_TARGET_OS}" = "x${platform}" ] + if [ "x${TARGET_OS}" = "x${platform}" ] then packaging_plugins else diff --git a/package/build.windows b/package/build.windows deleted file mode 100755 index b6eaae3..0000000 --- a/package/build.windows +++ /dev/null @@ -1,296 +0,0 @@ -#!/bin/bash -x - -build_path=${SRCDIR}/build_result - -__set_parameter() -{ - build_id=${package_name} - build_type=N - build_result_directory=${build_type}.${build_id} - build_result_path="$build_path/$build_result_directory" - architecture=x86 - ide_root_path_name=IDE - - case ${platform} in - linux) - archive_platform_name=linux - windowing=gtk - ;; - windows) - archive_platform_name=win32 - windowing=win32 - ;; - *) - echo "${platform} is not support yet." - ;; - esac - - result_archive_file=${build_id}-${archive_platform_name}.${windowing}.${architecture}.zip -} - -__set_build_parameter() -{ - case ${platform} in - linux) - reference_ide_path=${ROOTDIR}/indigo-pde/eclipse - ;; - windows) - reference_ide_path=${ROOTDIR}/indigo-winpde/eclipse - ;; - *) - echo "${platform} is not support yet." - ;; - esac -} - -__set_install_parameter() -{ - INSTALL_DIR=${SRCDIR}/package/${package_name}.package.${platform}/data -} - -__clean_build_environment() -{ - if [ -d $build_path ] - then - echo "Build result directory : [$build_path]" - else - echo "Make build result directory [$build_path]" - mkdir -p $build_path - fi - - echo "Remove legacy build files..." - if [ -d ${build_result_path}/${archive_platform_name}.${windowing}.${architecture} ] - then - rm -rf ${build_result_path}/${archive_platform_name}.${windowing}.${architecture} - fi - if [ -e ${build_result_path}/${result_archive_file} ] - then - rm -rf ${build_result_path}/${result_archive_file} - fi - if [ -d ${build_path}/tmp ] - then - rm -rf ${build_path}/tmp - fi - - if [ -d ${build_path}/buildRepo ] - then - rm -rf ${build_path}/buildRepo - fi - - rm -r ${build_path}/*.xml - rm -r ${build_path}/*.properties - rm -r ${build_path}/*.clean - - - if [ -d $build_path/plugins ] - then - echo "plugins directory recreate..." - rm -rf $build_path/plugins - mkdir $build_path/plugins - else - echo "Make plugins directory..." - mkdir $build_path/plugins - fi - if [ -d $build_path/features/ ] - then - echo "features directory recreate..." - rm -rf $build_path/features - mkdir $build_path/features - else - echo "Make features directory..." - mkdir $build_path/features - fi - -} - -__copy_build_sources() -{ - echo "Copy features from $SRCDIR to $build_path/features" - cp -r $SRCDIR/*.feature $build_path/features - - echo "Copy plugins from $SRCDIR to $build_path/plugins" - cp -r $SRCDIR/* $build_path/plugins - rm -rf $build_path/plugins/*.feature -} - -__copy_dependency_plugins() -{ - dependency_plugin_path=${ROOTDIR}/${ide_root_path_name} - if [ -d ${dependency_plugin_path} ] - then - cp -rf ${dependency_plugin_path}/features/* ${build_path}/features/ - cp -rf ${dependency_plugin_path}/plugins/* ${build_path}/plugins/ - fi -} - -__make_ant_build_properties_file() -{ - builder_path="${SRCDIR}/builder" - parent_path_of_based_eclipse=${reference_ide_path}/.. - - echo "Make build.properties file..." - if [ ! -e $builder_path/build.properties.clean ] ; then - echo "ERROR : \"build.properties.clean\" file does not exist..." - exit 1 - fi - cp $builder_path/build.properties.clean $build_path - cp $builder_path/customTargets.xml $build_path - - if [ -d $reference_ide_path ] - then - sed -e "s;\(^buildDirectory=\).*;\1${build_path};g" \ - -e "s;\(^base=\).*;\1${parent_path_of_based_eclipse};g" \ - -e "s;\(^baseLocation=\).*;\1${reference_ide_path};g" \ - -e "s;\(^configs=\).*;\1${archive_platform_name},${windowing},${architecture};g" \ - -e "s;\(^buildType=\).*;\1${build_type};g" \ - -e "s;\(^buildId=\).*;\1${build_id};g" \ - -e "s;\(^archivePrefix=\).*;\1${build_id};g" \ - < $build_path/build.properties.clean > $build_path/build.properties - - else - echo "ERROR : target eclipse is not exist." - exit 1 - fi -} - -__execute_pde_build() -{ - echo "Execute Product Ant Builder..." - equinox_launcher=`echo org.eclipse.equinox.launcher_*.jar` - pde_build=`echo org.eclipse.pde.build_*` - - java -XX:+UseParNewGC -jar ${reference_ide_path}/plugins/$equinox_launcher -application org.eclipse.ant.core.antRunner -buildfile ${reference_ide_path}/plugins/$pde_build/scripts/productBuild/productBuild.xml -Dbuilder=$build_path -Dosgi.locking=none 2>&1 - - if [ $? != 0 ]; - then - echo "Build failed..." - exit 1 - fi -} - -__unzip_plugin_pack() -{ - echo "unzip to $build_result_path" - unzip -a $build_result_path/${result_archive_file} -d $build_result_path/${archive_platform_name}.${windowing}.${architecture} -} - -build_plugins() -{ - case ${platform} in - linux) - echo "build plugin for ${platform}" - ;; - windows) - echo "build plugin for ${platform}" - ;; - *) - echo "${platform} is not support yet." - exit 1 - ;; - esac - - __set_parameter - __set_build_parameter - __clean_build_environment - __copy_build_sources - __copy_dependency_plugins - __make_ant_build_properties_file - __execute_pde_build - __unzip_plugin_pack - - echo "Build SUCCESS. You will find SDK IDE in \"${build_result_path}\"." -} - -__clean_packaging_environment() -{ - - if [ -d ${INSTALL_DIR} ] - then - rm -rf ${INSTALL_DIR} - else - mkdir -p ${INSTALL_DIR} - fi -} - -__copy_necessary_binaries() -{ - ## 패키징시 필요한 파일이 있으면 여기에 구현하시면 됩니다. - ## 파일을 복사할 위치는 ${INSTALL_DIR} 아래에 원하는 위치로 지정하시면 됩니다. - ## INSTALL_DIR의 값은 "${git repository 위치}/package/${package_name}.package.${platform}/data" 로 되어있습니다. - ## ex) cp -rf ~~~~/file.file ${INSTALL_DIR}/${ide_root_path_name}/ - - echo "add necessary files." -} - -packaging_plugins() -{ - __set_parameter - __set_install_parameter - - __clean_packaging_environment - __copy_necessary_binaries - - install_ide_path=${INSTALL_DIR}/${ide_root_path_name} - - if [ ! -d ${install_ide_path} ] - then - mkdir -p ${install_ide_path} - fi - - cp -rf ${build_result_path}/${archive_platform_name}.${windowing}.${architecture}/${package_name}/* ${install_ide_path}/ -} - -# clean -clean() -{ - echo "=========================================CLEAN============================================" - make clean - rm -rf ${SRCDIR}/*.zip - rm -rf ${SRCDIR}/*.tar.gz - rm -rf ${build_path} -} - -# build -build() -{ - echo "=========================================BUILD============================================" - pkgname_and_platform_list=`awk 'BEGIN{RS="\n\n"; FS="\n"} /Package:/{for(i=1;i, sungmin Ha + +Package:eventinjector-eplugin +OS:ubuntu-32 +Build-host-os:ubuntu-32 Description:EventInjector for emulator -Build-dependency:indigo-pde[linux], common-eplugin[linux] -Install-dependency:common-eplugin[linux], base-ide-product[linux] -Source:eventinjector-eplugin +Build-dependency:indigo-pde[ubuntu-32], common-eplugin[ubuntu-32] +Install-dependency:common-eplugin[ubuntu-32], base-ide-product[ubuntu-32] Package:eventinjector-eplugin -Version:0.2.38 -OS:windows -Build-host-os:linux -Maintainer:yeongkyoon Lee , sungmin Ha +OS:ubuntu-64 +Build-host-os:ubuntu-64 Description:EventInjector for emulator -Build-dependency:indigo-winpde[windows], common-eplugin[linux] -Install-dependency:common-eplugin[windows], base-ide-product[windows] -Source:eventinjector-eplugin +Build-dependency:indigo-pde[ubuntu-64], common-eplugin[ubuntu-64] +Install-dependency:common-eplugin[ubuntu-64], base-ide-product[ubuntu-64] + +Package:eventinjector-eplugin +OS:windows-32 +Build-host-os:ubuntu-32 +Description:EventInjector for emulator +Build-dependency:indigo-winpde[windows-32], common-eplugin[windows-32] +Install-dependency:common-eplugin[windows-32], base-ide-product[windows-32] + +Package:eventinjector-eplugin +OS:windows-64 +Build-host-os:ubuntu-64 +Description:EventInjector for emulator +Build-dependency:indigo-winpde[windows-64], common-eplugin[windows-64] +Install-dependency:common-eplugin[windows-64], base-ide-product[windows-64] + +Package:eventinjector-eplugin +OS:macos-64 +Build-host-os:ubuntu-64 +Description:EventInjector for emulator +Build-dependency:indigo-winpde[macos-64], common-eplugin[macos-64] +Install-dependency:common-eplugin[macos-64], base-ide-product[macos-64] -- 2.7.4