From 554f3ac1115febefdb1c9930e4c053c7c623ade6 Mon Sep 17 00:00:00 2001 From: jihye kim Date: Thu, 10 May 2012 15:36:29 +0900 Subject: [PATCH] [Title] add packages(control, model) [Type] work [Module] event injector [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- org.tizen.injector/META-INF/MANIFEST.MF | 4 +- .../injector/control/TableViewCellModifier.java | 140 ++++++++++++++++ .../injector/control/TableViewColumnSorter.java | 160 ++++++++++++++++++ .../injector/control/TableViewContentProvider.java | 52 ++++++ .../injector/control/TableViewLabelProvider.java | 128 +++++++++++++++ .../tizen/injector/model/AbstractTableModel.java | 182 +++++++++++++++++++++ .../org/tizen/injector/model/AbstractTableVO.java | 82 ++++++++++ .../tizen/injector/model/DefaultTableModel.java | 45 +++++ .../src/org/tizen/injector/model/ITableModel.java | 47 ++++++ .../src/org/tizen/injector/model/ITableVO.java | 37 +++++ .../src/org/tizen/injector/model/IVO.java | 31 ++++ .../src/org/tizen/injector/util/FormPageUtil.java | 2 - .../location/core/injector/LocationInjector.java | 3 +- .../tizen/location/core/model/GeoLocationVO.java | 2 +- .../src/org/tizen/location/map/Map.java | 2 +- .../src/org/tizen/location/map/page/MapImage.java | 8 +- 16 files changed, 914 insertions(+), 11 deletions(-) create mode 100644 org.tizen.injector/src/org/tizen/injector/control/TableViewCellModifier.java create mode 100644 org.tizen.injector/src/org/tizen/injector/control/TableViewColumnSorter.java create mode 100644 org.tizen.injector/src/org/tizen/injector/control/TableViewContentProvider.java create mode 100644 org.tizen.injector/src/org/tizen/injector/control/TableViewLabelProvider.java create mode 100644 org.tizen.injector/src/org/tizen/injector/model/AbstractTableModel.java create mode 100644 org.tizen.injector/src/org/tizen/injector/model/AbstractTableVO.java create mode 100644 org.tizen.injector/src/org/tizen/injector/model/DefaultTableModel.java create mode 100644 org.tizen.injector/src/org/tizen/injector/model/ITableModel.java create mode 100644 org.tizen.injector/src/org/tizen/injector/model/ITableVO.java create mode 100644 org.tizen.injector/src/org/tizen/injector/model/IVO.java diff --git a/org.tizen.injector/META-INF/MANIFEST.MF b/org.tizen.injector/META-INF/MANIFEST.MF index 538a4e3..7423db5 100644 --- a/org.tizen.injector/META-INF/MANIFEST.MF +++ b/org.tizen.injector/META-INF/MANIFEST.MF @@ -13,7 +13,9 @@ Require-Bundle: org.eclipse.ui, org.eclipse.ui.forms;bundle-version="3.3.103" Bundle-ActivationPolicy: lazy Bundle-Activator: org.tizen.injector.Injector -Export-Package: org.tizen.injector.protocol, +Export-Package: org.tizen.injector.control, + org.tizen.injector.model, + org.tizen.injector.protocol, org.tizen.injector.protocol.sensor, org.tizen.injector.provider, org.tizen.injector.receiver, diff --git a/org.tizen.injector/src/org/tizen/injector/control/TableViewCellModifier.java b/org.tizen.injector/src/org/tizen/injector/control/TableViewCellModifier.java new file mode 100644 index 0000000..b37c30a --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/control/TableViewCellModifier.java @@ -0,0 +1,140 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * Jihye Kim + * + * 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.control; +import org.eclipse.jface.viewers.CellEditor; +import org.eclipse.jface.viewers.ComboBoxCellEditor; +import org.eclipse.jface.viewers.ICellModifier; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.TextCellEditor; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.TableItem; +import org.tizen.injector.model.ITableVO; + + +/** + * This class implements an ICellModifier + * An ICellModifier is called when the user modifes a cell in the + * tableViewer + */ + +public class TableViewCellModifier implements ICellModifier { + private TableViewer viewer; + private String[] columnNames; + CellEditor[] cellEditors; + /** + * Constructor + * @param TableViewerExample an instance of a TableViewerExample + */ + public TableViewCellModifier(TableViewer viewer) { + super(); + this.viewer = viewer; + this.columnNames = getColumnNames(); + this.viewer.setColumnProperties(columnNames); + } + + private String[] getColumnNames() { + TableColumn[] columns = viewer.getTable().getColumns(); + String[] columnNames = new String[columns.length]; + for(int i=0;i + * YeongKyoon Lee + * Jihye Kim + * + * 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.control; + +import java.util.Comparator; + +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerSorter; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Cursor; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.tizen.injector.model.ITableVO; + + +/** + * A viewer sorter is used by a structured viewer to reorder the elements + * provided by its content provider. In addition, the TableViewColumnSorter + * listens for mouse clicks in the column headers and resorts the table content + * based on the column that was selected. Clicking on a column a second time + * toggles the sort order. + */ +public class TableViewColumnSorter extends ViewerSorter { + private static final String COLUMN_INDEX_KEY = "COLUMN_INDEX"; //$NON-NLS-1$ + private static final String HEADER_TEXT_KEY = "HEADER_TEXT"; //$NON-NLS-1$ + private static final String TAG_DESCENDING = "\u25b2"; // up-pointing triangle + private static final String TAG_ASCENDING = "\u25bc"; // down-pointing triangle + + private TableViewer viewer; + private Table table; + private TableColumn[] columns; + Cursor waitCursor; + + private Comparator stringComparator = new Comparator(){ + @Override + public int compare(String str1, String str2) { + str1=str1==null?"":str1; //$NON-NLS-1$ + str2=str2==null?"":str2; //$NON-NLS-1$ + return str1.compareTo(str2); + } + }; + + private Comparator numberComparator = new Comparator(){ + @Override + public int compare(Integer num1, Integer num2) { + return num1>num2?1:(num1==num2?0:-1); + } + }; + + public TableViewColumnSorter(TableViewer viewer) { + this.viewer = viewer; + this.table = viewer.getTable(); + this.columns = viewer.getTable().getColumns(); + + createCursor(); + createSelectionListener(columns); + } + + private void createCursor(){ + waitCursor = Display.getCurrent().getSystemCursor(SWT.CURSOR_WAIT); + } + + public int compare(Viewer viewer, Object object1, Object object2) { + TableColumn column = table.getSortColumn(); + + int index = -1; + if(column==null){ + return 0; + }else{ + index = (Integer)column.getData(COLUMN_INDEX_KEY); + } + + Object target1 = ((ITableVO)object1).getColumnValue(index); + Object target2 = ((ITableVO)object2).getColumnValue(index); + + int result = compare(target1, target2); + + if(table.getSortDirection()==SWT.UP) + return result; + else + return -result; + } + + public int compare(Object object1, Object object2){ + if(object1 instanceof Integer){ + return numberComparator.compare((Integer)object1, (Integer)object2); + }else{ + return stringComparator.compare(object1.toString(), object2.toString()); + } + } + + private void createSelectionListener(TableColumn[] columns) { + for (int i = 0; i < columns.length; i++) { + columns[i].setData(COLUMN_INDEX_KEY,i); + columns[i].setData(HEADER_TEXT_KEY,columns[i].getText()); + columns[i].addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + TableColumn column = (TableColumn)e.getSource(); + clearColumnHeader(column); + renderColumnHeader(column); + + table.setCursor(waitCursor); + viewer.refresh(); + table.setCursor(null); + } + }); + } + } + + private void renderColumnHeader(TableColumn column){ + int direction = table.getSortDirection()==SWT.UP?SWT.DOWN:SWT.UP; + table.setSortDirection(direction); + table.setSortColumn(column); + + String title = (String)column.getData(HEADER_TEXT_KEY); + String directionShape = direction==SWT.UP?TAG_DESCENDING:TAG_ASCENDING; + column.setText(title+" "+directionShape); //$NON-NLS-1$ + } + + private void clearColumnHeader(TableColumn column){ + TableColumn prevColumn = table.getSortColumn(); + + if(prevColumn==null){ + return; + }else{ + prevColumn.setText((String)prevColumn.getData(HEADER_TEXT_KEY)); + } + } + +} \ No newline at end of file diff --git a/org.tizen.injector/src/org/tizen/injector/control/TableViewContentProvider.java b/org.tizen.injector/src/org/tizen/injector/control/TableViewContentProvider.java new file mode 100644 index 0000000..adc2324 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/control/TableViewContentProvider.java @@ -0,0 +1,52 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * Jihye Kim + * + * 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.control; + +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.Viewer; +import org.tizen.injector.model.ITableModel; + + +public class TableViewContentProvider implements IStructuredContentProvider { + + public TableViewContentProvider() { + } + + public Object[] getElements(Object model) { + return ((ITableModel)model).getDatas(); + } + + public void dispose() { + + } + + public void inputChanged(Viewer viewer, Object obj, Object obj1) { + + } + +} diff --git a/org.tizen.injector/src/org/tizen/injector/control/TableViewLabelProvider.java b/org.tizen.injector/src/org/tizen/injector/control/TableViewLabelProvider.java new file mode 100644 index 0000000..063d0c6 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/control/TableViewLabelProvider.java @@ -0,0 +1,128 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * Jihye Kim + * + * 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.control; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +import org.eclipse.jface.viewers.CellEditor; +import org.eclipse.jface.viewers.ColumnLabelProvider; +import org.eclipse.jface.viewers.ComboBoxCellEditor; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.swt.graphics.Image; +import org.tizen.injector.model.ITableVO; + + +public class TableViewLabelProvider extends ColumnLabelProvider implements ITableLabelProvider { + + public TableViewLabelProvider() { + } + + private TableViewer viewer; + CellEditor[] cellEditors; + + public TableViewLabelProvider(TableViewer viewer) { + this.setViewer(viewer); + this.cellEditors = viewer.getCellEditors(); + } + + private Field[] fields; + + private int getColumnIndex(int columnIndex){ + return fields.length>columnIndex?columnIndex:fields.length; + } + + public Image getColumnImage(Object element, int columnIndex) { + return null; + } + +// private void hasCellEditor(){ +// if(this.cellEditors==null) +// this.cellEditors = viewer.getCellEditors(); +// } + + private CellEditor getCellEditor(int idx) { + if(this.cellEditors==null) + return null; + else + return this.cellEditors[idx]; + } + + public String getColumnText(Object element, int columnIndex) { + Object obj = null; + + if(element instanceof ITableVO){ + ITableVO data = (ITableVO)element; + if(this.cellEditors != null){ + CellEditor ce = getCellEditor(columnIndex); + if(ce instanceof ComboBoxCellEditor){ + ComboBoxCellEditor editor = (ComboBoxCellEditor)ce; + String items[] = editor.getItems(); + int idx = (Integer) data.getColumnValue(columnIndex); + if(idx<0) + obj = null; + else if(idx>items.length) + obj = items[0]; + else + obj = items[idx]; + }else{ + obj = data.getColumnValue(columnIndex); + } + }else{ + obj = data.getColumnValue(columnIndex); + } + }else{ + if(fields==null) + fields = element.getClass().getDeclaredFields(); + + int idx = getColumnIndex(columnIndex); + String fieldName = fields[idx].getName().substring(0, 1).toUpperCase() + + fields[idx].getName().substring(1,fields[idx].getName().length()); + + try{ + Method method = element.getClass().getMethod("get" + fieldName, new Class[] {}); //$NON-NLS-1$ + obj = method.invoke(element, new Object[] {}); + }catch(Exception e){ + return ""; //$NON-NLS-1$ + } + } + + return obj==null?"":String.valueOf(obj); //$NON-NLS-1$ + } + + public TableViewer getViewer() { + return viewer; + } + + public void setViewer(TableViewer viewer) { + this.viewer = viewer; + } + + +} diff --git a/org.tizen.injector/src/org/tizen/injector/model/AbstractTableModel.java b/org.tizen.injector/src/org/tizen/injector/model/AbstractTableModel.java new file mode 100644 index 0000000..95e9307 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/model/AbstractTableModel.java @@ -0,0 +1,182 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * Jihye Kim + * + * 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.model; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; + +import org.eclipse.ui.IMemento; +import org.eclipse.ui.XMLMemento; + +public abstract class AbstractTableModel implements ITableModel { + private static final String TAG_ROOT = "root"; //$NON-NLS-1$ + + private Collection inventory = new ArrayList(); + protected AbstractTableVO source; + private boolean isDirty = false; + + public AbstractTableModel(AbstractTableVO source) { + this.source = source; + + } + + + + public ITableVO[] getDatas() { + if (inventory == null) + return null; + + return inventory.toArray(new AbstractTableVO[inventory.size()]); + } + + public void add(Collection datas) { + if (datas == null) + return; + + inventory.addAll(datas); + } + + public int size(){ + return inventory.size(); + } + + public void add(AbstractTableVO data) { + inventory.add(data); + } + + public void remove(Collection datas) { + if (datas == null) + return; + + inventory.removeAll(datas); + } + + public void remove(AbstractTableVO data) { + inventory.remove(data); + } + + public void clear() { + inventory.clear(); + } + + public void load(String fileName) { + if (inventory==null||source==null) + return; + + FileReader reader = null; + try { + reader = new FileReader(new File(fileName)); + load(XMLMemento.createReadRoot(reader)); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + if (reader != null) + reader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + private void load(XMLMemento memento) { + IMemento[] children = memento.getChildren(getSourceName()); + AbstractTableVO data = null; + String[] fields = source.getColumnNames(); + for (int i = 0; i < children.length; i++) { + data = source.clone(); + for (int j = 0; j < fields.length; j++) { + data.setColumnValue(j, children[i].getString(fields[j])); + } + add(data); + } + } + + public void save(String fileName) { + if (inventory == null || source == null) + return; + + XMLMemento memento = XMLMemento.createWriteRoot(TAG_ROOT); + save(memento); + FileWriter writer = null; + try { + writer = new FileWriter(fileName); + memento.save(writer); + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + if (writer != null) + writer.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + private void save(XMLMemento memento) { + Iterator iter = inventory.iterator(); + AbstractTableVO data = null; + String[] fields = null; + + while (iter.hasNext()) { + data = iter.next(); + fields = data.getColumnNames(); + IMemento child = memento.createChild(getSourceName()); + for (int j = 0; j < fields.length; j++) { + child.putString( + fields[j], + String.valueOf(data.getColumnValue(j))); + } + } + + } + + public String getSourceName() { + return this.source.getClass().getSimpleName(); + } + + public boolean isDirty(){ + return this.isDirty; + } + + public synchronized void setDirty(boolean isDirty){ + this.isDirty = isDirty; + } + +} + + diff --git a/org.tizen.injector/src/org/tizen/injector/model/AbstractTableVO.java b/org.tizen.injector/src/org/tizen/injector/model/AbstractTableVO.java new file mode 100644 index 0000000..e575c5d --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/model/AbstractTableVO.java @@ -0,0 +1,82 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * Jihye Kim + * + * 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.model; + +public abstract class AbstractTableVO implements ITableVO{ + public abstract String[] getColumnNames(); + public abstract Object getColumnValue(int index); + public abstract void setColumnValue(int index, Object value); + + public AbstractTableVO clone(){ + Object obj = null; + try{ + obj = super.clone(); + }catch(CloneNotSupportedException e){ + + } + return (AbstractTableVO)obj; + } + + public Object getColumnValue(String columnName){ + return getColumnValue(getColumnIndex(columnName)); + } + + public String getColumnName(int index){ + String[] columnNames = getColumnNames(); + if(index<0||index>columnNames.length) + return null; + else + return columnNames[index]; + } + + public int getColumnIndex(String columnName){ + String[] columnNames = getColumnNames(); + int index =-1; + for(int i=0;i + * YeongKyoon Lee + * Jihye Kim + * + * 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.model; + + +public class DefaultTableModel extends AbstractTableModel { + + public DefaultTableModel(AbstractTableVO source) { + super(source); + } + + public String getSourceName() { + String str = this.source.getClass().getSimpleName(); + if(str.endsWith("VO")) //$NON-NLS-1$ + str = str.substring(0,str.length()-2); + return str; + } +} + + diff --git a/org.tizen.injector/src/org/tizen/injector/model/ITableModel.java b/org.tizen.injector/src/org/tizen/injector/model/ITableModel.java new file mode 100644 index 0000000..b54da54 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/model/ITableModel.java @@ -0,0 +1,47 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * Jihye Kim + * + * 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.model; + +import java.util.Collection; + + +public interface ITableModel +{ + public void add(AbstractTableVO datas); + public void add(Collection datas); + public void remove(AbstractTableVO datas); + public void remove(Collection datas); + public ITableVO[] getDatas(); + public void load(String fileName); + public void save(String fileName); + public void clear(); + public int size(); + public String getSourceName(); + public boolean isDirty(); + public void setDirty(boolean isDirty); +} diff --git a/org.tizen.injector/src/org/tizen/injector/model/ITableVO.java b/org.tizen.injector/src/org/tizen/injector/model/ITableVO.java new file mode 100644 index 0000000..fa39cbe --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/model/ITableVO.java @@ -0,0 +1,37 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * Jihye Kim + * + * 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.model; + +public interface ITableVO extends IVO{ + public String[] getColumnNames(); + public Object getColumnValue(int index); + public Object getColumnValue(String columnName); + public int getColumnIndex(String columnName); + public String getColumnName(int index); + public void setColumnValue(int index, Object value); +} diff --git a/org.tizen.injector/src/org/tizen/injector/model/IVO.java b/org.tizen.injector/src/org/tizen/injector/model/IVO.java new file mode 100644 index 0000000..c653ffc --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/model/IVO.java @@ -0,0 +1,31 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * Jihye Kim + * + * 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.model; + +public interface IVO extends Cloneable{ +} diff --git a/org.tizen.injector/src/org/tizen/injector/util/FormPageUtil.java b/org.tizen.injector/src/org/tizen/injector/util/FormPageUtil.java index b387fa7..dec1c7f 100644 --- a/org.tizen.injector/src/org/tizen/injector/util/FormPageUtil.java +++ b/org.tizen.injector/src/org/tizen/injector/util/FormPageUtil.java @@ -27,8 +27,6 @@ package org.tizen.injector.util; -import java.awt.TextArea; - import org.eclipse.jface.viewers.TableViewer; import org.eclipse.swt.SWT; import org.eclipse.swt.browser.Browser; diff --git a/org.tizen.location.core/src/org/tizen/location/core/injector/LocationInjector.java b/org.tizen.location.core/src/org/tizen/location/core/injector/LocationInjector.java index e323f2b..5096b1a 100644 --- a/org.tizen.location.core/src/org/tizen/location/core/injector/LocationInjector.java +++ b/org.tizen.location.core/src/org/tizen/location/core/injector/LocationInjector.java @@ -35,9 +35,8 @@ import org.eclipse.core.runtime.NullProgressMonitor; import org.tizen.common.connection.ConnectionPlugin; import org.tizen.common.connection.ConnectionPlugin.ISelectionListener; -import org.tizen.common.model.ITableVO; +import org.tizen.injector.model.ITableVO; import org.tizen.sdblib.FileListingService.FileEntry; -import org.tizen.sdblib.IDevice; import org.tizen.sdblib.SyncService; import org.tizen.sdblib.SyncService.SyncResult; //import org.tizen.location.core.injector.DebugLog; diff --git a/org.tizen.location.core/src/org/tizen/location/core/model/GeoLocationVO.java b/org.tizen.location.core/src/org/tizen/location/core/model/GeoLocationVO.java index 713c0bf..ea3bd84 100644 --- a/org.tizen.location.core/src/org/tizen/location/core/model/GeoLocationVO.java +++ b/org.tizen.location.core/src/org/tizen/location/core/model/GeoLocationVO.java @@ -27,7 +27,7 @@ package org.tizen.location.core.model; -import org.tizen.common.model.AbstractTableVO; +import org.tizen.injector.model.AbstractTableVO; import org.tizen.location.core.protocol.GeoLocation; public class GeoLocationVO extends AbstractTableVO { 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 82d88a2..9f72cf0 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 @@ -36,7 +36,7 @@ import org.eclipse.jface.viewers.TableViewer; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.forms.widgets.Section; -import org.tizen.common.model.DefaultTableModel; +import org.tizen.injector.model.DefaultTableModel; import org.tizen.injector.provider.AbstractInjectorItem; //import org.tizen.location.core.injector.DebugLog; import org.tizen.location.core.model.GeoLocationVO; 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 b97829c..1f4134f 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 @@ -59,10 +59,10 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; -import org.tizen.common.control.TableViewContentProvider; -import org.tizen.common.control.TableViewLabelProvider; -import org.tizen.common.model.DefaultTableModel; -import org.tizen.common.model.ITableVO; +import org.tizen.injector.control.TableViewContentProvider; +import org.tizen.injector.control.TableViewLabelProvider; +import org.tizen.injector.model.DefaultTableModel; +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; -- 2.7.4