/*
* org.tizen.nfc.tag.page
- *
+ *
* Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
* Jihye kim <jihye1128.kim@samsung.com>
* Sungmin Ha <sungmin82.ha@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
+ * Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
*
- * This program and the accompanying materials are made available
- * under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
* Contributors:
* - S-Core Co., Ltd
- *
*/
package org.tizen.nfc.page;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-
-import org.tizen.injector.provider.AbstractInjectorItem;
-import org.tizen.injector.provider.AbstractInjectorPage;
import org.tizen.common.connection.ConnectionPlugin;
import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
import org.tizen.common.connection.ui.TizenRemoteFileDialog;
import org.tizen.common.connection.ui.TizenRemoteFileDialog.TizenRemoteFileDialogResult;
+import org.tizen.injector.provider.AbstractInjectorItem;
+import org.tizen.injector.provider.AbstractInjectorPage;
+import org.tizen.injector.view.InjectorView;
import org.tizen.sdblib.FileListingService.FileEntry;
import org.tizen.sdblib.IDevice;
import org.tizen.sdblib.MultiLineReceiver;
@Override
protected void createContents()
{
+ InjectorView.getDefault().addSelectionListener(this);
currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
- ConnectionPlugin.getDefault().addSelectionListener(this);
shell = parent.getShell();
private void Selected(SelectionEvent e) {
int i = cmbRecordFormat.getSelectionIndex();
if (i != -1) {
- checkRecordFormat(i);
+ checkRecordFormat(i + 1);
txtRecordTypeName.setText("");
cmbRecordTypeName.select(0);
txtRecordID.setText("");
if (i != -1) {
NDEFRecord record = RecordList.get(i);
checkRecordFormat(record.getFormat());
- cmbRecordFormat.select(record.getFormat());
+ cmbRecordFormat.select(record.getFormat() - 1);
if (record.getFormat() == 1) {
if (record.getTypeName().compareTo("U") == 0)
{
cmbRecordFormat.setEnabled(true);
- checkRecordFormat(cmbRecordFormat.getSelectionIndex());
+ checkRecordFormat(cmbRecordFormat.getSelectionIndex() + 1);
txtRecordTypeName.setText("");
cmbRecordTypeName.select(0);
txtRecordID.setText("");
{
cmbRecordFormat.setEnabled(true);
- checkRecordFormat(cmbRecordFormat.getSelectionIndex());
+ checkRecordFormat(cmbRecordFormat.getSelectionIndex() + 1);
txtRecordTypeName.setText("");
cmbRecordTypeName.select(0);
txtRecordID.setText("");
break;
case 2: // NDEF_TNF_MIME_MEDIA
cmbRecordTypeName.setEnabled(false);
- txtRecordTypeName.setEnabled(true);
+ txtRecordTypeName.setEnabled(false);
txtRecordTypeName.setEditable(false);
txtRecordID.setEnabled(true);
- txtRecordPayload.setEnabled(true);
+ txtRecordPayload.setEnabled(false);
txtRecordPayload.setEditable(false);
butSelectMediaFile.setEnabled(true);
break;
private void setRecordValue(NDEFRecord record)
{
- record.setFormat(cmbRecordFormat.getSelectionIndex());
+ record.setFormat(cmbRecordFormat.getSelectionIndex() + 1);
- if (cmbRecordFormat.getSelectionIndex() == 1) {
+ if ((cmbRecordFormat.getSelectionIndex() + 1) == 1) {
record.setTypeName(TypeNameList[cmbRecordTypeName.getSelectionIndex()]);
} else {
if (txtRecordTypeName.getText().isEmpty() == true)
return;
}
if (checkFileSize(MediaFilePath) == false) {
- NfcDialog.openErrorDialog(shell, "Size of selected file is too big. Available file size is under of 10.\n");
+ NfcDialog.openErrorDialog(shell, "Size of selected file is too big. Available file size is under of 10KB.\n");
return;
}
txtRecordTypeName.setEnabled(true);
@Override
protected void finalize() throws Throwable
{
- ConnectionPlugin.getDefault().removeSelectionListener(this);
+ InjectorView.getDefault().removeSelectionListener(this);
// TargetConnectionControl.removeTargetConnectionListener(this);
super.finalize();
}
.isEmulator())
return;
- if (currentDevice == null && selectedEntry.getName() != null)
+ if(currentDevice == null && selectedEntry.getName() != null) {
connect();
- else if (currentDevice == null && selectedEntry.getName() == null)
+ } else if(currentDevice == null && selectedEntry.getName() == null) {
return;
- else if (currentDevice.getSerialNumber() != selectedEntry.getName()) {
+ } else if (currentDevice.getSerialNumber() != selectedEntry.getName()) {
disconnect();
connect();
}