[Title] add features replay editor table
authorHyunjong,park <phjwithyou.park@samsung.com>
Tue, 31 Dec 2013 05:16:35 +0000 (14:16 +0900)
committerHyunjong,park <phjwithyou.park@samsung.com>
Tue, 31 Dec 2013 05:16:35 +0000 (14:16 +0900)
[Desc.] change keyboard input ui
[Issue] -

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditDialogDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditSnapShopTableCellRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableCellRenderer.java

index b79bc96..b1fc654 100644 (file)
@@ -318,10 +318,10 @@ public class OpenTraceDialog extends DAMessageBox {
                                } else {
                                        return;
                                }
-                               
-                                       OpenTraceProgressManager.getInstance().setSavePath(openPath);
-                                       OpenTraceProgressManager.getInstance().startOpenTraceThread();
-                                       shell.dispose();
+
+                               OpenTraceProgressManager.getInstance().setSavePath(openPath);
+                               OpenTraceProgressManager.getInstance().startOpenTraceThread();
+                               shell.dispose();
                        }
                }
        };
@@ -336,11 +336,10 @@ public class OpenTraceDialog extends DAMessageBox {
                                isButtonStatus = false;
                        } else {
                                isButtonStatus = true;
-                       }
-                       
-                       if (items[0].getText(SaveFilesTable.VALIDATE_INDEX).equals(
-                                       SaveFilesTable.VALIDATE_N)) {
-                               isButtonStatus = false;
+                               if (items[0].getText(SaveFilesTable.VALIDATE_INDEX).equals(
+                                               SaveFilesTable.VALIDATE_N)) {
+                                       isButtonStatus = false;
+                               }
                        }
                }
                openButton.setButtonEnabled(isButtonStatus);
@@ -447,7 +446,7 @@ public class OpenTraceDialog extends DAMessageBox {
                        } else {
                                return;
                        }
-                       if(updateOKButtonStatus() == false){
+                       if (updateOKButtonStatus() == false) {
                                return;
                        }
                        OpenTraceProgressManager.getInstance().setSavePath(openPath);
index 6c9dea3..d0bc6a6 100644 (file)
@@ -113,51 +113,13 @@ public class ReplayEditDialogDataManager {
                        ReplayData replayData = getReplayDBData();
                        if (null != replayData) {
                                makeReplayEditData(replayModifyDataList, replayData);
-                               // removeNotExistMouseUpTimeItem(replayModifyDataList);
-                               // setRemoveDBIndex(replayModifyDataList);
-                               // sortTableItem(replayModifyDataList);
                        }
-
-                       // removeWrongData(replayModifyDataList);
                }
                return replayModifyDataList;
        }
 
-       // private void removeWrongData(List<ReplayEditTableData> listData) {
-       // List<ReplayEditTableData> removeList = new
-       // ArrayList<ReplayEditTableData>();
-       // for (int i = 0; i < listData.size(); i++) {
-       // if (listData.get(i).getLongEventMouseDownTime() > listData.get(i)
-       // .getLongEventMouseUpTime()) {
-       // removeList.add(listData.get(i));
-       // }
-       // if (i > 0) {
-       // if (listData.get(i - 1).getLongEventMouseDownTime() == listData
-       // .get(i).getLongEventMouseDownTime()
-       // && listData.get(i - 1).getLongEventMouseUpTime() == listData
-       // .get(i).getLongEventMouseUpTime()) {
-       // removeList.add(listData.get(i));
-       // }
-       // }
-       // }
-       // listData.removeAll(removeList);
-       // }
-
-       // private void removeNotExistMouseUpTimeItem(
-       // List<ReplayEditTableData> listData) {
-       // for (int i = 0; i < listData.size(); i++) {
-       // if (listData.get(i).getStrEventMouseUpTime().length() < 1) {
-       // listData.remove(i);
-       // }
-       // }
-       // }
-       //
-       // private void sortTableItem(List<ReplayEditTableData> listData) {
-       // Collections.sort(listData, new ReplayEditTableItemListSortComparator());
-       // }
-
        private ReplayEditTableData getLastReplayEditTableData() {
-               if(getReplayModifyData().size() > 0 ){
+               if (getReplayModifyData().size() > 0) {
                        return getReplayModifyData().get(getReplayModifyData().size() - 1);
                }
                return null;
@@ -182,28 +144,6 @@ public class ReplayEditDialogDataManager {
                }
        }
 
-       // private void setRemoveDBIndex(List<ReplayEditTableData> listData) {
-       // int nSize = listData.size();
-       // for (int i = 0; i < nSize; i++) {
-       // int rid = listData.get(i).getEventRid();
-       // if (rid > -1) {
-       // if (listData.get(i).getStrEventType()
-       // .equals(ReplayEditLabels.CONTEXT_TOUCH)) {
-       // for (int j = rid; j < rid + 7; j++) {
-       // removeDBIndex.add(j);
-       // }
-       // } else if (listData.get(i).getStrEventType()
-       // .equals(ReplayEditLabels.CONTEXT_KEY)) {
-       // for (int j = rid; j < rid + 4; j++) {
-       // removeDBIndex.add(j);
-       // }
-       // }
-       //
-       // }
-       //
-       // }
-       // }
-
        private boolean isEventMouseUpTime(RecordEventObject reo) {
                boolean isEventMouseUpTime = false;
                switch (reo.getEventType()) {
@@ -220,14 +160,14 @@ public class ReplayEditDialogDataManager {
                        break;
                }
                default: {
-
+                       break;
                }
                }
                return isEventMouseUpTime;
        }
 
        private void updateEventMouseUpTime(long time) {
-               if(null != getLastReplayEditTableData()){
+               if (null != getLastReplayEditTableData()) {
                        getLastReplayEditTableData().setEventMouseUpTime(time);
                }
        }
@@ -249,21 +189,17 @@ public class ReplayEditDialogDataManager {
                case TOUCH: {
                        if (reo.getEventCode() == TOUCH_EVENT_CODE_MOUSED_DOWN_START
                                        && reo.getEventValue() != -1) {
-                               // if (isDrawEvnet()) {
-                               // return null;
-                               // }
-
                                replayType = new ReplayEditTableData();
                                replayType.setEventMouseDownTime(reo.getTime());
                                replayType.setStrEventType(setEventType(reo.getEventType()));
                                replayType.setEventRid(reo.getId());
                        } else if (reo.getEventCode() == TOUCH_EVENT_CODE_X) {
                                if (getReplayModifyData().size() > 0) {
-                                       getReplayModifyData()
-                                       .get(getReplayModifyData().size() - 1)
-                                       .setStrEventValue1(
-                                                       ReplayEditLabels.CONTEXT_VALUE_X
-                                                                       + Integer.toString(reo.getEventValue()));
+                                       getReplayModifyData().get(getReplayModifyData().size() - 1)
+                                                       .setStrEventValue1(
+                                                                       ReplayEditLabels.CONTEXT_VALUE_X
+                                                                                       + Integer.toString(reo
+                                                                                                       .getEventValue()));
                                }
                        } else if (reo.getEventCode() == TOUCH_EVENT_CODE_Y) {
                                if (getReplayModifyData().size() > 0) {
@@ -335,22 +271,6 @@ public class ReplayEditDialogDataManager {
                return strType;
        }
 
-       // private boolean isDrawEvnet() {
-       // if (getReplayModifyData().size() < 1) {
-       // return false;
-       // }
-       // boolean isDrawEvnet = false;
-       // if (getLastReplayEditTableData().getStrEventMouseUpTime().equals(
-       // CommonConstants.EMPTY)) {
-       // getLastReplayEditTableData().setStrEventType(
-       // ReplayEditLabels.CONTEXT_DRAG);
-       // getLastReplayEditTableData().setModifiabilityEvent(false);
-       // getLastReplayEditTableData().setEventRid(-1);
-       // isDrawEvnet = true;
-       // }
-       // return isDrawEvnet;
-       // }
-
        public void saveDialog() {
                SqlManager.getInstance().closeConnection();
                Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
index 3b1f0c7..1774346 100644 (file)
@@ -102,12 +102,12 @@ public class ReplayEditSnapShopTableCellRenderer extends DefaultCellRenderer {
                                err.printStackTrace();
                                img = ImageResources.NO_IMAGE;
                        } catch (SWTException e) {
-                               System.out.println("Wait for receiving image : " + path);//$NON-NLS-1$
+                               System.out.println("Wait for receiving image : " + path);
                                img = ImageResources.NO_IMAGE;
                        }
 
                        if (img.isDisposed()) {
-                               System.out.println("before set image : disposed"); //$NON-NLS-1$
+                               System.out.println("before set image : disposed");
                        }
                }
 
index 65a93a1..59eb0b3 100644 (file)
@@ -30,6 +30,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.eclipse.nebula.widgets.grid.GridColumn;
+import org.eclipse.nebula.widgets.grid.GridEditor;
 import org.eclipse.nebula.widgets.grid.GridItem;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Point;
@@ -42,6 +43,7 @@ import org.tizen.dynamicanalyzer.model.TableInput;
 import org.tizen.dynamicanalyzer.nl.ReplayEditLabels;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.widgets.DAText;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
 import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenu;
@@ -50,7 +52,6 @@ import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuListener;
 
 public class ReplayEditTable extends DATableComposite {
        private String[] columnNames = null;
-       // private final int tableTextOptionColumnIndex = 6;
        protected DAPopupMenu eventTypePopupMenu = null;
        protected DAPopupMenu eventKeyPopupMenu = null;
 
@@ -59,10 +60,10 @@ public class ReplayEditTable extends DATableComposite {
        private int mouseSelectedColumnIndex = -1;
        private int mouseSelectedPreColunmEndX = -1;
 
-       private final int SEQ_TABLE_INDEX = 0;
-       private final int DOWN_TIME_TABLE_INDEX = 1;
-       private final int UP_TIME_TABLE_INDEX = 2;
-       private final int OPTION_TIME_TABLE_INDEX = 6;
+       public static final int SEQ_TABLE_INDEX = 0;
+       public static final int DOWN_TIME_TABLE_INDEX = 1;
+       public static final int UP_TIME_TABLE_INDEX = 2;
+       public static final int OPTION_TABLE_INDEX = 6;
 
        private String savedItemTextForReset = CommonConstants.EMPTY;
        private List<String> selectedPreKeyContext = new ArrayList<String>();
@@ -81,6 +82,8 @@ public class ReplayEditTable extends DATableComposite {
        DAPopupMenuItem pasteItem = null;
        DAPopupMenuItem deleteItem = null;
 
+       private DAText inputValueText = null;
+
        @Override
        protected List<TableInput> makeTableInput() {
                List<TableInput> input = new ArrayList<TableInput>();
@@ -172,6 +175,10 @@ public class ReplayEditTable extends DATableComposite {
                        case SWT.MouseMove:
                                upadteMouseOverTableItemsStatus(item, event);
                                updateMouseOverTableItemsText();
+                               if (null != inputValueText) {
+                                       inputValueText.getControl().dispose();
+                                       inputValueText = null;
+                               }
                                break;
                        case SWT.MouseDoubleClick:
                                break;
@@ -275,31 +282,31 @@ public class ReplayEditTable extends DATableComposite {
 
        private String getMouseSelectedItemOptionText() {
                return table.getItem(getMouseSelectedTableItemIndex()).getText(
-                               OPTION_TIME_TABLE_INDEX);
+                               OPTION_TABLE_INDEX);
        }
 
        private void setMouseSelectedItemOptionText(String text) {
                table.getItem(getMouseSelectedTableItemIndex()).setText(
-                               OPTION_TIME_TABLE_INDEX, text);
+                               OPTION_TABLE_INDEX, text);
        }
 
        private void addMouseSelectedItemOptionText(String text) {
                String optionText = table.getItem(getMouseSelectedTableItemIndex())
-                               .getText(OPTION_TIME_TABLE_INDEX);
+                               .getText(OPTION_TABLE_INDEX);
                if (!optionText.contains(text)) {
                        optionText += text;
                        table.getItem(getMouseSelectedTableItemIndex()).setText(
-                                       OPTION_TIME_TABLE_INDEX, optionText);
+                                       OPTION_TABLE_INDEX, optionText);
                }
        }
 
        private void removeMouseSelectedItemOptionText(String text) {
                String optionText = table.getItem(getMouseSelectedTableItemIndex())
-                               .getText(OPTION_TIME_TABLE_INDEX);
+                               .getText(OPTION_TABLE_INDEX);
                if (optionText.contains(text)) {
                        optionText = optionText.replace(text, CommonConstants.EMPTY);
                        table.getItem(getMouseSelectedTableItemIndex()).setText(
-                                       OPTION_TIME_TABLE_INDEX, optionText);
+                                       OPTION_TABLE_INDEX, optionText);
                }
        }
 
@@ -331,9 +338,9 @@ public class ReplayEditTable extends DATableComposite {
                        @Override
                        public void widgetSelected(DAPopupMenuItem menuItem) {
                                copyItemText = getSelectedItemText(getMouseSelectedTableItemIndex());
-                               if (copyItemText.get(OPTION_TIME_TABLE_INDEX).contains(
+                               if (copyItemText.get(OPTION_TABLE_INDEX).contains(
                                                ReplayEditDialogDataManager.SELECTED_ITEM_COPY)) {
-                                       copyItemText.get(OPTION_TIME_TABLE_INDEX).replace(
+                                       copyItemText.get(OPTION_TABLE_INDEX).replace(
                                                        ReplayEditDialogDataManager.SELECTED_ITEM_COPY,
                                                        CommonConstants.EMPTY);
                                }
@@ -354,9 +361,9 @@ public class ReplayEditTable extends DATableComposite {
                        @Override
                        public void widgetSelected(DAPopupMenuItem menuItem) {
                                copyItemText = getSelectedItemText(getMouseSelectedTableItemIndex());
-                               if (copyItemText.get(OPTION_TIME_TABLE_INDEX).contains(
+                               if (copyItemText.get(OPTION_TABLE_INDEX).contains(
                                                ReplayEditDialogDataManager.SELECTED_ITEM_COPY)) {
-                                       copyItemText.get(OPTION_TIME_TABLE_INDEX).replace(
+                                       copyItemText.get(OPTION_TABLE_INDEX).replace(
                                                        ReplayEditDialogDataManager.SELECTED_ITEM_COPY,
                                                        CommonConstants.EMPTY);
                                }
@@ -452,7 +459,7 @@ public class ReplayEditTable extends DATableComposite {
                                        ReplayEditDialogDataManager.SELECTED_ITEM_COPY,
                                        CommonConstants.EMPTY);
                }
-               table.getItem(index).setText(OPTION_TIME_TABLE_INDEX, itemOption);
+               table.getItem(index).setText(OPTION_TABLE_INDEX, itemOption);
        }
 
        private void setTyepMenu() {
@@ -547,33 +554,32 @@ public class ReplayEditTable extends DATableComposite {
                                }
 
                                if (!iskeyInput) {
+                                       removeInputValue();
                                        return;
                                }
 
-                               String savedString = getMouseSelectedTableItemText();
-                               String removeSString = CommonConstants.EMPTY;
-                               if (savedString.contains(ReplayEditLabels.CONTEXT_VALUE_S)) {
-                                       removeSString = savedString.replace(
-                                                       ReplayEditLabels.CONTEXT_VALUE_S,
-                                                       CommonConstants.EMPTY);
+                               String savedString = inputValueText.getText();
+                               if (!savedString.contains(ReplayEditLabels.CONTEXT_VALUE_S)) {
+                                       savedString += ReplayEditLabels.CONTEXT_VALUE_S;
                                }
 
-                               String inputString = removeSString + event.character;
-                               if (!inputString.contains(ReplayEditLabels.CONTEXT_VALUE_S)) {
-                                       inputString += ReplayEditLabels.CONTEXT_VALUE_S;
+                               if (savedString.length() > 10) {
+                                       removeInputValue();
+                                       return;
                                }
 
                                if (savedString.contains(CommonConstants.DOT)) {
-                                       String lines[] = savedString.split(CommonConstants.CMD_SPLIT_DOT);
+                                       String lines[] = savedString
+                                                       .split(CommonConstants.CMD_SPLIT_DOT);
                                        if (lines.length > 0) {
-                                               if (lines[1].length() > 1) {
+                                               if (lines[1].trim().length() > 2) {
+                                                       removeInputValue();
                                                        return;
                                                }
                                        }
 
                                }
-
-                               setMouseSelectedTableItemText(inputString);
+                               setMouseSelectedTableItemText(savedString);
                                tableRedraw();
                        } else if (getColumnName(getMouseSelectedTableColumnIndex())
                                        .equals(ReplayEditLabels.TABLE_COLUMN_VALUE1)
@@ -585,22 +591,21 @@ public class ReplayEditTable extends DATableComposite {
                                }
 
                                if (!iskeyInput) {
+                                       removeInputValue();
                                        return;
                                }
-                               String savedString = getMouseSelectedTableItemText();
+                               String savedString = inputValueText.getText();
                                StringBuffer inputString = new StringBuffer(savedString);
                                if (getColumnName(getMouseSelectedTableColumnIndex()).equals(
                                                ReplayEditLabels.TABLE_COLUMN_VALUE1)) {
                                        if (!savedString.contains(ReplayEditLabels.CONTEXT_VALUE_X)) {
-                                               inputString.append(ReplayEditLabels.CONTEXT_VALUE_X);
+                                               inputString.insert(0, ReplayEditLabels.CONTEXT_VALUE_X);
                                        }
                                } else {
                                        if (!savedString.contains(ReplayEditLabels.CONTEXT_VALUE_Y)) {
-                                               inputString.append(ReplayEditLabels.CONTEXT_VALUE_Y);
+                                               inputString.insert(0, ReplayEditLabels.CONTEXT_VALUE_Y);
                                        }
                                }
-
-                               inputString.append(event.character).toString();
                                setMouseSelectedTableItemText(inputString.toString());
                                tableRedraw();
                        }
@@ -608,6 +613,29 @@ public class ReplayEditTable extends DATableComposite {
                }
        }
 
+       private void addTextWidget(GridItem gridItem) {
+               GridEditor editor = new GridEditor(table);
+               editor.minimumWidth = 10;
+               editor.horizontalAlignment = SWT.CENTER;
+               editor.grabHorizontal = true;
+
+               inputValueText = new DAText(table, SWT.CENTER);
+               inputValueText.getControl().setText(getMouseSelectedTableItemText());
+               inputValueText.getControl().selectAll();
+               inputValueText.getControl().setFocus();
+               editor.setEditor(inputValueText.getControl(), gridItem,
+                               getMouseSelectedTableColumnIndex());
+       }
+
+       private void removeInputValue() {
+               if (null != inputValueText && inputValueText.getText().length() > 0) {
+                       StringBuffer textBuffer = new StringBuffer(inputValueText.getText());
+                       textBuffer.deleteCharAt(textBuffer.length() - 1);
+                       inputValueText.setText(textBuffer.toString());
+                       inputValueText.getControl().setSelection(textBuffer.length());
+               }
+       }
+
        private void updateSelectPopupMenu(String text) {
                if (!getColumnName(getMouseSelectedTableColumnIndex()).equals(
                                ReplayEditLabels.TABLE_COLUMN_TYPE)) {
@@ -706,7 +734,6 @@ public class ReplayEditTable extends DATableComposite {
                                        getMouseSelectedTableColumnIndex() + 2,
                                        selectedPreTouchContext.get(3));
                }
-
        }
 
        private void upadteMouseOverTableItemsStatus(GridItem item, Event event) {
@@ -746,16 +773,12 @@ public class ReplayEditTable extends DATableComposite {
                if (!isMouseSelectedTableItem) {
                        return;
                }
-
                removeMouseSelectedItemOptionText(ReplayEditDialogDataManager.SELECTED_ITEM_KEY_INPUT);
-
                updateRollbackText();
                updateNextItemsSavedTime();
-               
                updateVaildState();
                isMouseSelectedTableItem = false;
                tableRedraw();
-
        }
 
        private boolean updateVaildItems() {
@@ -770,36 +793,36 @@ public class ReplayEditTable extends DATableComposite {
                        long mouseUptime = 0;
                        if (!upTime.equals(CommonConstants.EMPTY)) {
                                mouseUptime = getLongTableTime(upTime);
-                       }else{
+                       } else {
                                mouseUptime = mouseDowntime;
                        }
-                       
+
                        if (mouseUptime < mouseDowntime) {
                                isVaild = false;
                        } else if (mouseDowntime < preEventTime) {
                                isVaild = false;
                        } else {
-                               String itemOption = table.getItem(i).getText(
-                                               OPTION_TIME_TABLE_INDEX);
+                               String itemOption = table.getItem(i)
+                                               .getText(OPTION_TABLE_INDEX);
                                if (itemOption
                                                .contains(ReplayEditDialogDataManager.ITEM_TIME_VAILD_FALSE)) {
                                        String removeItemOption = itemOption.replace(
                                                        ReplayEditDialogDataManager.ITEM_TIME_VAILD_FALSE,
                                                        CommonConstants.EMPTY);
-                                       table.getItem(i).setText(OPTION_TIME_TABLE_INDEX,
+                                       table.getItem(i).setText(OPTION_TABLE_INDEX,
                                                        removeItemOption);
                                }
                        }
                        preEventTime = mouseUptime;
 
                        if (!isVaild) {
-                               String itemOption = table.getItem(i).getText(
-                                               OPTION_TIME_TABLE_INDEX);
+                               String itemOption = table.getItem(i)
+                                               .getText(OPTION_TABLE_INDEX);
                                if (!itemOption
                                                .contains(ReplayEditDialogDataManager.ITEM_TIME_VAILD_FALSE)) {
                                        table.getItem(i)
                                                        .setText(
-                                                                       OPTION_TIME_TABLE_INDEX,
+                                                                       OPTION_TABLE_INDEX,
                                                                        itemOption
                                                                                        + ReplayEditDialogDataManager.ITEM_TIME_VAILD_FALSE);
                                }
@@ -853,7 +876,7 @@ public class ReplayEditTable extends DATableComposite {
                int nSize = table.getItemCount();
                int startItem = getMouseSelectedTableItemIndex();
                for (int i = startItem; i < nSize; i++) {
-                       if (!table.getItem(i).getText(OPTION_TIME_TABLE_INDEX)
+                       if (!table.getItem(i).getText(OPTION_TABLE_INDEX)
                                        .contains(ReplayEditDialogDataManager.MODIFIABILITY_TRUE)) {
                                continue;
                        }
@@ -879,7 +902,6 @@ public class ReplayEditTable extends DATableComposite {
                                        table.getItem(i).setText(UP_TIME_TABLE_INDEX,
                                                        getStrTableTime(mouseUptime));
                                }
-
                        }
                }
        }
@@ -905,50 +927,6 @@ public class ReplayEditTable extends DATableComposite {
                        boolean isResetText = false;
                        if (savedString.length() == 0) {
                                isResetText = true;
-                       } else {
-//                             if (getColumnName(getMouseSelectedTableColumnIndex()).equals(
-//                                             ReplayEditLabels.TABLE_COLUMN_MOUSE_DOWN_TIME)) {
-//                                     String preItemmouseUpTime = CommonConstants.ZERO
-//                                                     + CommonConstants.DOT + CommonConstants.ZERO
-//                                                     + ReplayEditLabels.CONTEXT_VALUE_S;
-//                                     if (getMouseSelectedTableItemIndex() > 0) {
-//                                             preItemmouseUpTime = table.getItem(
-//                                                             getMouseSelectedTableItemIndex() - 1).getText(
-//                                                             getMouseSelectedTableColumnIndex() + 1);
-//                                     }
-//                                     String mouseDownTime = updateDotChartAtTime();
-//                                     int comparePreItemTime = compareTime(preItemmouseUpTime,
-//                                                     mouseDownTime);
-//                                     if (comparePreItemTime >= 0) {
-//                                             isResetText = true;
-//                                     }
-//
-//                             } else if (getColumnName(getMouseSelectedTableColumnIndex())
-//                                             .equals(ReplayEditLabels.TABLE_COLUMN_MOUSE_UP_TIME)) {
-//                                     String mouseUpTime = updateDotChartAtTime();
-//                                     if (table.getItemCount() <= getMouseSelectedTableItemIndex()) {
-//                                             isResetText = false;
-//                                     } else {
-//                                             String sameItemMouseDownTime = table.getItem(
-//                                                             getMouseSelectedTableItemIndex()).getText(
-//                                                             getMouseSelectedTableColumnIndex() - 1);
-//                                             int compareSameItemTime = compareTime(
-//                                                             sameItemMouseDownTime, mouseUpTime);
-//                                             if (compareSameItemTime >= 0) {
-//                                                     isResetText = true;
-//                                             }
-//                                     }
-//                             } else if (getColumnName(getMouseSelectedTableColumnIndex())
-//                                             .equals(ReplayEditLabels.TABLE_COLUMN_VALUE1)) {
-//                                     if (savedString.length() > 7) {
-//                                             isResetText = true;
-//                                     }
-//                             } else if (getColumnName(getMouseSelectedTableColumnIndex())
-//                                             .equals(ReplayEditLabels.TABLE_COLUMN_VALUE2)) {
-//                                     if (savedString.length() > 7) {
-//                                             isResetText = true;
-//                                     }
-//                             }
                        }
                        if (isResetText) {
                                setMouseSelectedTableItemText(savedItemTextForReset);
@@ -958,26 +936,6 @@ public class ReplayEditTable extends DATableComposite {
                return false;
        }
 
-//     private int compareTime(String firstTime, String secondTime) {
-//             StringBuffer firstTimeBuffer = new StringBuffer(firstTime);
-//             StringBuffer highTimeBuffer = new StringBuffer(secondTime);
-//             firstTimeBuffer.deleteCharAt(firstTime.length() - 1);
-//             firstTimeBuffer.deleteCharAt(firstTime.length() - 3);
-//             highTimeBuffer.deleteCharAt(secondTime.length() - 1);
-//             highTimeBuffer.deleteCharAt(secondTime.length() - 3);
-//
-//             long lowTime = Long.parseLong(firstTimeBuffer.toString());
-//             long highTime = Long.parseLong(highTimeBuffer.toString());
-//
-//             if (lowTime > highTime) {
-//                     return 1;
-//             } else if (lowTime < highTime) {
-//                     return -1;
-//             } else {
-//                     return 0;
-//             }
-//     }
-
        private String updateDotChartAtTime() {
                String chagneString = CommonConstants.EMPTY;
                String savedString = getMouseSelectedTableItemText();
@@ -1019,7 +977,7 @@ public class ReplayEditTable extends DATableComposite {
        }
 
        private void updateKeyboardInputStatus(GridItem item, Event event) {
-               if (!item.getText(OPTION_TIME_TABLE_INDEX).contains(
+               if (!item.getText(OPTION_TABLE_INDEX).contains(
                                ReplayEditDialogDataManager.MODIFIABILITY_TRUE)) {
                        deleteItem.setEnabled(false);
                        return;
@@ -1032,8 +990,7 @@ public class ReplayEditTable extends DATableComposite {
                                || selectedText.equals(CommonConstants.EMPTY)) {
                        isMouseSelectedTableItem = true;
                        savedItemTextForReset = getMouseSelectedTableItemText();
-                       setMouseSelectedTableItemText(CommonConstants.EMPTY);
-
+                       addTextWidget(item);
                        addMouseSelectedItemOptionText(ReplayEditDialogDataManager.SELECTED_ITEM_KEY_INPUT);
                }
        }
@@ -1084,7 +1041,7 @@ public class ReplayEditTable extends DATableComposite {
 
        private void openPoppupMenuMouseDownSequenceColumn(GridItem item,
                        Event event) {
-               if (!item.getText(OPTION_TIME_TABLE_INDEX).contains(
+               if (!item.getText(OPTION_TABLE_INDEX).contains(
                                ReplayEditDialogDataManager.MODIFIABILITY_TRUE)) {
                        if (selectedCutItemIndex > 0 || selectedCopyItemIndex > 0) {
                                insertItem.setEnabled(true);
@@ -1123,7 +1080,7 @@ public class ReplayEditTable extends DATableComposite {
                int nSize = table.getItemCount();
                int index = -1;
                for (int i = 0; i < nSize; i++) {
-                       if (table.getItem(i).getText(OPTION_TIME_TABLE_INDEX)
+                       if (table.getItem(i).getText(OPTION_TABLE_INDEX)
                                        .contains(ReplayEditDialogDataManager.SELECTED_ITEM_COPY)) {
                                index = i;
                                break;
index 2bfc4d6..a9ef91d 100644 (file)
@@ -54,7 +54,7 @@ public class ReplayEditTableCellRenderer extends DefaultCellRenderer {
                paintTableBoardLine(gc, item);
                paintMouseOverColumn(gc, item);
                paintSelectedInputKey(gc, item);
-       //      paintSelectedCopy(gc, item);
+               // paintSelectedCopy(gc, item);
                paintVaildTime(gc, item);
 
        }
@@ -68,6 +68,8 @@ public class ReplayEditTableCellRenderer extends DefaultCellRenderer {
                } else if (!optionColumn
                                .contains(ReplayEditDialogDataManager.MODIFIABILITY_TRUE)) {
                        gc.setBackground(ColorResources.YELLOW);
+               } else if (item.getText(ReplayEditTable.UP_TIME_TABLE_INDEX).equals("")) {
+                       gc.setBackground(ColorResources.YELLOW);
                } else {
                        if (item.getParent().isEnabled()) {
                                Color bg = item.getBackground();
@@ -96,7 +98,7 @@ public class ReplayEditTableCellRenderer extends DefaultCellRenderer {
                if (menuImg != null && getColumn() != 0 && item.getChecked(getColumn())) {
                        int y = getBounds().y;
                        y += (getBounds().height - menuImg.getBounds().height) / 2;
-                       
+
                        gc.drawImage(menuImg, getBounds().x, y);
                }
        }
@@ -169,34 +171,34 @@ public class ReplayEditTableCellRenderer extends DefaultCellRenderer {
                }
        }
 
-//     private void paintSelectedCopy(GC gc, GridItem item) {
-//             String optionColumn = item.getText(6);
-//             if (optionColumn
-//                             .contains(ReplayEditDialogDataManager.SELECTED_ITEM_COPY)) {
-//                     gc.setForeground(ColorResources.BLACK);
-//                     gc.setLineWidth(2);
-//                     gc.setLineStyle(SWT.LINE_DOT);
-//                     gc.drawLine(getBounds().x, getBounds().y, getBounds().x
-//                                     + getBounds().width, getBounds().y);
-//
-//                     gc.drawLine(getBounds().x, getBounds().y + getBounds().height,
-//                                     getBounds().x + getBounds().width, getBounds().y
-//                                                     + getBounds().height);
-//                     if (getColumn() == 0) {
-//                             gc.drawLine(getBounds().x, getBounds().y, getBounds().x,
-//                                             getBounds().y + getBounds().height);
-//                     }
-//
-//                     if (getColumn() == 0) {
-//                             gc.drawLine(getBounds().x, getBounds().y, getBounds().x,
-//                                             getBounds().y + getBounds().height);
-//                     }
-//
-//                     gc.setLineStyle(SWT.LINE_SOLID);
-//                     gc.setLineWidth(1);
-//
-//             }
-//     }
+       // private void paintSelectedCopy(GC gc, GridItem item) {
+       // String optionColumn = item.getText(6);
+       // if (optionColumn
+       // .contains(ReplayEditDialogDataManager.SELECTED_ITEM_COPY)) {
+       // gc.setForeground(ColorResources.BLACK);
+       // gc.setLineWidth(2);
+       // gc.setLineStyle(SWT.LINE_DOT);
+       // gc.drawLine(getBounds().x, getBounds().y, getBounds().x
+       // + getBounds().width, getBounds().y);
+       //
+       // gc.drawLine(getBounds().x, getBounds().y + getBounds().height,
+       // getBounds().x + getBounds().width, getBounds().y
+       // + getBounds().height);
+       // if (getColumn() == 0) {
+       // gc.drawLine(getBounds().x, getBounds().y, getBounds().x,
+       // getBounds().y + getBounds().height);
+       // }
+       //
+       // if (getColumn() == 0) {
+       // gc.drawLine(getBounds().x, getBounds().y, getBounds().x,
+       // getBounds().y + getBounds().height);
+       // }
+       //
+       // gc.setLineStyle(SWT.LINE_SOLID);
+       // gc.setLineWidth(1);
+       //
+       // }
+       // }
 
        private void paintVaildTime(GC gc, GridItem item) {
                String optionColumn = item.getText(6);