[Title] change db, and improvement configuration dlg.
authorHyunjong,park <phjwithyou.park@samsung.com>
Mon, 2 Dec 2013 08:07:14 +0000 (17:07 +0900)
committerHyunjong,park <phjwithyou.park@samsung.com>
Mon, 2 Dec 2013 08:07:14 +0000 (17:07 +0900)
[Desc.] change h2 db to hsqldb, change configuration ui
[Issue] -

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ConfigureLabels.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ConfigureLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/callstack/CallstackView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/calltrace/CallTraceTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialogFeaturesPage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialogFeaturesTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialogFeaturesTreeTableCellRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialogFeaturesTreeTableToggleRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DAWindowingTableComposite.java

index 834d160..3711041 100644 (file)
@@ -50,6 +50,8 @@ public class ConfigureLabels extends NLS {
        public static String AUTO;
        public static String SECOND;
        public static String MS;
+       public static String SAMPLING;
+       public static String PERIODIC;
 
        // features name
        public static String FEATURE_FUNCTION_PROFILING;
index 4cf9c47..0bf7e35 100644 (file)
@@ -83,4 +83,6 @@ SYSTEM_INFOMATION_SAMPLING_PERIODIC=System information sampling periodic
 SNAPSHOT_PERIODIC_AUTO=Snapshot periodic auto
 MS=ms
 SECOND=s
-AUTO=auto
\ No newline at end of file
+AUTO=auto
+SAMPLING=sampling
+PERIODIC=periodic
\ No newline at end of file
index 59d47f5..e287fde 100644 (file)
@@ -68,7 +68,7 @@ public class DBTableManager {
        public static int TABLE_COUNT = 12;
 
        public static final String EMPTY = CommonConstants.EMPTY;
-       public static final String TEXT = "VARCHAR(2048)";//$NON-NLS-1$
+       public static final String TEXT = "VARCHAR(128)";//$NON-NLS-1$
        public static final String INTEGER = "INTEGER";//$NON-NLS-1$
        public static final String LONG = "bigint";//$NON-NLS-1$
        public static final String NOT_NULL = "not null";//$NON-NLS-1$
index 7b69c83..e8a37c9 100755 (executable)
@@ -87,68 +87,17 @@ public class SqlManager {
                return null;
        }
 
-//     public Connection getReplayConnection(String path) {
-//             try {
-//                     if (null != replayConnection) {
-//                             return replayConnection;
-//                     }
-//                     Class.forName("org.hsqldb.jdbcDriver");
-//                     String dbUrl = "jdbc:hsqldb:"
-//                                     + path
-//                                     + File.separator
-//                                     + AnalyzerConstants.DATABASE_NAME
-//                                     + ";shutdown=true;hsqldb.default_table_type=cached;hsqldb.large_data=true;hsqldb.cache_row=1000;hsqldb.cache_size=1000"; //$NON-NLS-1$ //$NON-NLS-2$
-//                     replayConnection = DriverManager.getConnection(dbUrl, "SA", "");
-//                     SQLWarning warning = replayConnection.getWarnings();
-//                     while (warning != null) {
-//                             System.out.println("Message: " + warning.getMessage());
-//                             System.out.println("SQL state: " + warning.getSQLState());
-//                             System.out.println("Vendor code: " + warning.getErrorCode());
-//                             warning = warning.getNextWarning();
-//                     }
-//             } catch (ClassNotFoundException e) {
-//                     e.printStackTrace();
-//             } catch (SQLException e) {
-//                     e.printStackTrace();
-//             }
-//             return replayConnection;
-//     }
-//
-//     public Connection getConnection(String path) {
-//             try {
-//                     if (null != connection) {
-//                             return connection;
-//                     }
-//                     Class.forName("org.hsqldb.jdbcDriver");
-//                     String dbUrl = "jdbc:hsqldb:"
-//                                     + path
-//                                     + File.separator
-//                                     + AnalyzerConstants.DATABASE_NAME
-//                                     + ";shutdown=true;hsqldb.default_table_type=cached;hsqldb.large_data=true;hsqldb.cache_row=1000;hsqldb.cache_size=1000"; //$NON-NLS-1$ //$NON-NLS-2$
-//                     connection = DriverManager.getConnection(dbUrl, "SA", "");
-//                     SQLWarning warning = connection.getWarnings();
-//                     while (warning != null) {
-//                             System.out.println("Message: " + warning.getMessage());
-//                             System.out.println("SQL state: " + warning.getSQLState());
-//                             System.out.println("Vendor code: " + warning.getErrorCode());
-//                             warning = warning.getNextWarning();
-//                     }
-//             } catch (ClassNotFoundException e) {
-//                     e.printStackTrace();
-//             } catch (SQLException e) {
-//                     e.printStackTrace();
-//             }
-//             return connection;
-//     }
-
        public Connection getReplayConnection(String path) {
                try {
                        if (null != replayConnection) {
                                return replayConnection;
                        }
-                       Class.forName("org.h2.Driver");
-                       String dbUrl = "jdbc:h2:file:" + path + File.separator
-                                       + AnalyzerConstants.DATABASE_NAME; //$NON-NLS-1$ //$NON-NLS-2$
+                       Class.forName("org.hsqldb.jdbcDriver");
+                       String dbUrl = "jdbc:hsqldb:"
+                                       + path
+                                       + File.separator
+                                       + AnalyzerConstants.DATABASE_NAME
+                                       + ";shutdown=true;hsqldb.default_table_type=cached;hsqldb.large_data=true;hdqldb.log_data=false"; //$NON-NLS-1$
                        replayConnection = DriverManager.getConnection(dbUrl, "SA", "");
                        SQLWarning warning = replayConnection.getWarnings();
                        while (warning != null) {
@@ -170,9 +119,12 @@ public class SqlManager {
                        if (null != connection) {
                                return connection;
                        }
-                       Class.forName("org.h2.Driver");
-                       String dbUrl = "jdbc:h2:file:" + path + File.separator
-                                       + AnalyzerConstants.DATABASE_NAME; //$NON-NLS-1$ //$NON-NLS-2$
+                       Class.forName("org.hsqldb.jdbcDriver");
+                       String dbUrl = "jdbc:hsqldb:"
+                                       + path
+                                       + File.separator
+                                       + AnalyzerConstants.DATABASE_NAME
+                                       + ";shutdown=true;hsqldb.default_table_type=cached;hsqldb.large_data=true;hdqldb.log_data=false"; //$NON-NLS-1$
                        connection = DriverManager.getConnection(dbUrl, "SA", "");
                        SQLWarning warning = connection.getWarnings();
                        while (warning != null) {
@@ -189,6 +141,54 @@ public class SqlManager {
                return connection;
        }
 
+//     public Connection getReplayConnection(String path) {
+//             try {
+//                     if (null != replayConnection) {
+//                             return replayConnection;
+//                     }
+//                     Class.forName("org.h2.Driver");
+//                     String dbUrl = "jdbc:h2:file:" + path + File.separator
+//                                     + AnalyzerConstants.DATABASE_NAME; //$NON-NLS-1$ //$NON-NLS-2$
+//                     replayConnection = DriverManager.getConnection(dbUrl, "SA", "");
+//                     SQLWarning warning = replayConnection.getWarnings();
+//                     while (warning != null) {
+//                             System.out.println("Message: " + warning.getMessage());
+//                             System.out.println("SQL state: " + warning.getSQLState());
+//                             System.out.println("Vendor code: " + warning.getErrorCode());
+//                             warning = warning.getNextWarning();
+//                     }
+//             } catch (ClassNotFoundException e) {
+//                     e.printStackTrace();
+//             } catch (SQLException e) {
+//                     e.printStackTrace();
+//             }
+//             return replayConnection;
+//     }
+//
+//     public Connection getConnection(String path) {
+//             try {
+//                     if (null != connection) {
+//                             return connection;
+//                     }
+//                     Class.forName("org.h2.Driver");
+//                     String dbUrl = "jdbc:h2:file:" + path + File.separator
+//                                     + AnalyzerConstants.DATABASE_NAME; //$NON-NLS-1$ //$NON-NLS-2$
+//                     connection = DriverManager.getConnection(dbUrl, "SA", "");
+//                     SQLWarning warning = connection.getWarnings();
+//                     while (warning != null) {
+//                             System.out.println("Message: " + warning.getMessage());
+//                             System.out.println("SQL state: " + warning.getSQLState());
+//                             System.out.println("Vendor code: " + warning.getErrorCode());
+//                             warning = warning.getNextWarning();
+//                     }
+//             } catch (ClassNotFoundException e) {
+//                     e.printStackTrace();
+//             } catch (SQLException e) {
+//                     e.printStackTrace();
+//             }
+//             return connection;
+//     }
+
        public void semaphoreAcquire() {
                if (connection != null) {
                        try {
index 9b7a648..a6f3a60 100644 (file)
@@ -148,8 +148,8 @@ public class CallstackView extends DAView {
                                DASelectionData data = new DASelectionData(observingViews[i],
                                                startTime, endTime, selection, table);
                                updateView(data);
-                               return;
                        }
+                       return;
                }
                clear();
        }
index 79f569d..7731267 100644 (file)
@@ -50,7 +50,7 @@ import org.tizen.dynamicanalyzer.ui.widgets.table.DAWindowingTableComposite;
 import org.tizen.dynamicanalyzer.utils.Formatter;
 
 public class CallTraceTable extends DAWindowingTableComposite {
-       private String selectOptionQuery = " messageid = " + DataChannelConstants.MSG_FUNCTION_ENTRY + " order by time";//$NON-NLS-1$
+       private String selectOptionQuery = " messageid = " + DataChannelConstants.MSG_FUNCTION_ENTRY;//$NON-NLS-1$
        private String rangeOptionQuery = " messageid = " + DataChannelConstants.MSG_FUNCTION_ENTRY;//$NON-NLS-1$
 
        public CallTraceTable(Composite parent, int compStyle, int tableStyle) {
index aebc8b0..f18761e 100644 (file)
@@ -34,8 +34,6 @@ import org.eclipse.swt.events.KeyEvent;
 import org.eclipse.swt.events.KeyListener;
 import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Rectangle;
@@ -44,13 +42,13 @@ import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.DAText;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
 import org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckBox;
@@ -68,8 +66,9 @@ public class ConfigurationDialogFeaturesPage extends DAPageComposite {
        private int[] columnSizes = { 571 };
        private boolean[] columnVisibility = { true };
 
-       private Text textBox = null;
+       private DAText textBox = null;
        private Label textBoxLabel = null;
+       private Label descriptionLabel = null;
        private DACheckBox detailSettingCheckBox = null;
 
        public ConfigurationDialogFeaturesPage(Composite parent, int style) {
@@ -154,7 +153,7 @@ public class ConfigurationDialogFeaturesPage extends DAPageComposite {
                FormLayout compLayout = new FormLayout();
                detailSettingComp.setLayout(compLayout);
                detailSettingComp
-                               .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+               .setBackground(ColorResources.BINARY_SETTINGS_INPUT_BOX_COLOR);
                FormData compData = new FormData();
                compData.top = new FormAttachment(detailLabel, 5);
                compData.left = new FormAttachment(0, 5);
@@ -211,13 +210,18 @@ public class ConfigurationDialogFeaturesPage extends DAPageComposite {
                        detailSettingCheckBox = null;
                }
                if (null != textBox) {
-                       textBox.dispose();
+                       textBox.getControl().dispose();
                        textBox = null;
                }
                if (null != textBoxLabel) {
                        textBoxLabel.dispose();
                        textBoxLabel = null;
                }
+               
+               if (null != descriptionLabel) {
+                       descriptionLabel.dispose();
+                       descriptionLabel = null;
+               }
 
                String featureName = items[0].getText(0);
                if (featureName.equals(ConfigureLabels.FEATURE_MEMORY_ALLOCATION)
@@ -235,7 +239,7 @@ public class ConfigurationDialogFeaturesPage extends DAPageComposite {
                        detailSettingCheckBox.setLayoutData(data);
                        detailSettingCheckBox.setForeground(ColorResources.BLACK);
                        detailSettingCheckBox
-                                       .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+                                       .setBackground(ColorResources.BINARY_SETTINGS_INPUT_BOX_COLOR);
                        detailSettingCheckBox
                                        .setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
                        detailSettingCheckBox.setText(ConfigureLabels.INCLUDE_INSIDE_CALL);
@@ -261,14 +265,14 @@ public class ConfigurationDialogFeaturesPage extends DAPageComposite {
                } else if (featureName.equals(ConfigureLabels.FEATURE_SCREENSHOT)) {
                        detailSettingCheckBox = new DACheckBox(detailSettingComp, SWT.NONE);
                        FormData data = new FormData();
-                       data.top = new FormAttachment(0, 10);
+                       data.top = new FormAttachment(0, 13);
                        data.left = new FormAttachment(0, 10);
                        data.height = 20;
                        data.width = 170;
                        detailSettingCheckBox.setLayoutData(data);
                        detailSettingCheckBox.setForeground(ColorResources.BLACK);
                        detailSettingCheckBox
-                                       .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+                                       .setBackground(ColorResources.BINARY_SETTINGS_INPUT_BOX_COLOR);
                        detailSettingCheckBox
                                        .setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
                        detailSettingCheckBox
@@ -276,37 +280,26 @@ public class ConfigurationDialogFeaturesPage extends DAPageComposite {
                        detailSettingCheckBox
                                        .addSelectionListener(snapshotPeriodicAutoCheckBoxListener);
 
-                       // if (ConfigurationDialogDataManager
-                       // .getInstance()
-                       // .getfeatureSwapValue(ConfigureLabels.SNAPSHOT_PERIODIC_AUTO) > 0)
-                       // {
-                       // detailSettingCheckBox.setChecked(false);
-                       // } else {
-                       // ConfigurationDialogDataManager.getInstance()
-                       // .setfeatureSwapValue(
-                       // ConfigureLabels.SNAPSHOT_PERIODIC_AUTO, 1);
-                       // detailSettingCheckBox.setChecked(true);
-                       // }
-
-                       textBox = new Text(detailSettingComp, SWT.SINGLE);
+                       descriptionLabel = new Label(detailSettingComp, SWT.TRANSPARENT);
+                       descriptionLabel.setText(ConfigureLabels.PERIODIC);
+                       descriptionLabel
+                                       .setBackground(ColorResources.BINARY_SETTINGS_INPUT_BOX_COLOR);
+                       descriptionLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+                       descriptionLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
                        data = new FormData();
-                       data.top = new FormAttachment(0, 10);
+                       data.top = new FormAttachment(0, 15);
                        data.left = new FormAttachment(0, 200);
+                       descriptionLabel.setLayoutData(data);
+                       
+                       textBox = new DAText(detailSettingComp, SWT.SINGLE);
+                       data = new FormData();
+                       data.top = new FormAttachment(0, 12);
+                       data.left = new FormAttachment(descriptionLabel, 10);
                        data.height = 15;
                        data.width = 50;
                        textBox.setLayoutData(data);
-                       textBox.setBackground(ColorResources.VIEW_BG_COLOR);
-                       textBox.addKeyListener(keyListener);
-                       textBox.addPaintListener(new PaintListener() {
-                               @Override
-                               public void paintControl(PaintEvent e) {
-                                       e.gc.setForeground(ColorResources.BUTTON_OUTLINE_HOVER_IN_COLOR);
-                                       Text text = (Text) e.widget;
-                                       Rectangle rect = text.getClientArea();
-                                       e.gc.drawRectangle(rect.x, rect.y, rect.width - 1,
-                                                       rect.height - 1);
-                               }
-                       });
+                       textBox.setBackground(ColorResources.BINARY_SETTINGS_INPUT_BOX_COLOR);
+                       textBox.getControl().addKeyListener(keyListener);
 
                        String optionFeatusName = ConfigurationDialogDataManager
                                        .getInstance().getOptionFeatureName(featureName);
@@ -317,12 +310,12 @@ public class ConfigurationDialogFeaturesPage extends DAPageComposite {
                        textBoxLabel = new Label(detailSettingComp, SWT.TRANSPARENT);
                        textBoxLabel.setText(ConfigureLabels.SECOND);
                        textBoxLabel
-                                       .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+                                       .setBackground(ColorResources.BINARY_SETTINGS_INPUT_BOX_COLOR);
                        textBoxLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
                        textBoxLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
                        data = new FormData();
-                       data.top = new FormAttachment(0, 13);
-                       data.left = new FormAttachment(textBox, 5);
+                       data.top = new FormAttachment(0, 15);
+                       data.left = new FormAttachment(textBox.getControl(), 5);
                        textBoxLabel.setLayoutData(data);
 
                        if (ConfigurationDialogDataManager
@@ -336,10 +329,10 @@ public class ConfigurationDialogFeaturesPage extends DAPageComposite {
                        if (ConfigurationDialogDataManager.getInstance()
                                        .getfeatureSwapValue(featureName) > 0) {
                                detailSettingCheckBox.setEnabled(true);
-                               textBox.setEditable(true);
+                               textBox.getControl().setEditable(true);
                        } else {
                                detailSettingCheckBox.setEnabled(false);
-                               textBox.setEditable(false);
+                               textBox.getControl().setEditable(false);
                        }
 
                        if (ConfigurationDialogDataManager.getInstance()
@@ -347,9 +340,9 @@ public class ConfigurationDialogFeaturesPage extends DAPageComposite {
                                        && ConfigurationDialogDataManager.getInstance()
                                                        .getfeatureSwapValue(
                                                                        ConfigureLabels.SNAPSHOT_PERIODIC_AUTO) < 1) {
-                               textBox.setEditable(true);
+                               textBox.getControl().setEditable(true);
                        } else {
-                               textBox.setEditable(false);
+                               textBox.getControl().setEditable(false);
                        }
                        detailSettingComp.layout(true);
                } else if (featureName
@@ -365,26 +358,28 @@ public class ConfigurationDialogFeaturesPage extends DAPageComposite {
                        if (featureName.equals(ConfigureLabels.FEATURE_SYSTEM)) {
                                featureName = ConfigureLabels.FEATURE_SYSTEM_CPU;
                        }
-
-                       textBox = new Text(detailSettingComp, SWT.SINGLE);
+                       
+                       descriptionLabel = new Label(detailSettingComp, SWT.TRANSPARENT);
+                       descriptionLabel.setText(ConfigureLabels.SAMPLING);
+                       descriptionLabel
+                                       .setBackground(ColorResources.BINARY_SETTINGS_INPUT_BOX_COLOR);
+                       descriptionLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+                       descriptionLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
                        FormData data = new FormData();
-                       data.top = new FormAttachment(0, 10);
+                       data.top = new FormAttachment(0, 13);
                        data.left = new FormAttachment(0, 10);
+                       descriptionLabel.setLayoutData(data);
+                       
+
+                       textBox = new DAText(detailSettingComp, SWT.SINGLE);
+                       data = new FormData();
+                       data.top = new FormAttachment(0, 10);
+                       data.left = new FormAttachment(descriptionLabel, 5);
                        data.height = 15;
                        data.width = 50;
                        textBox.setLayoutData(data);
                        textBox.setBackground(ColorResources.VIEW_BG_COLOR);
-                       textBox.addKeyListener(keyListener);
-                       textBox.addPaintListener(new PaintListener() {
-                               @Override
-                               public void paintControl(PaintEvent e) {
-                                       e.gc.setForeground(ColorResources.BUTTON_OUTLINE_HOVER_IN_COLOR);
-                                       Text text = (Text) e.widget;
-                                       Rectangle rect = text.getClientArea();
-                                       e.gc.drawRectangle(rect.x, rect.y, rect.width - 1,
-                                                       rect.height - 1);
-                               }
-                       });
+                       textBox.getControl().addKeyListener(keyListener);
 
                        String optionFeatusName = ConfigurationDialogDataManager
                                        .getInstance().getOptionFeatureName(featureName);
@@ -395,20 +390,20 @@ public class ConfigurationDialogFeaturesPage extends DAPageComposite {
                        textBoxLabel = new Label(detailSettingComp, SWT.TRANSPARENT);
                        textBoxLabel.setText(ConfigureLabels.MS);
                        textBoxLabel
-                                       .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+                                       .setBackground(ColorResources.BINARY_SETTINGS_INPUT_BOX_COLOR);
                        textBoxLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
                        textBoxLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
                        data = new FormData();
                        data.top = new FormAttachment(0, 13);
-                       data.left = new FormAttachment(textBox, 5);
+                       data.left = new FormAttachment(textBox.getControl(), 5);
                        textBoxLabel.setLayoutData(data);
 
-                       if (ConfigurationDialogDataManager.getInstance()
-                                       .getfeatureSwapValue(featureName) > 0) {
-                               textBox.setEditable(true);
-                       } else {
-                               textBox.setEditable(false);
-                       }
+//                     if (ConfigurationDialogDataManager.getInstance()
+//                                     .getfeatureSwapValue(featureName) > 0) {
+//                             textBox.getControl().setEditable(true);
+//                     } else {
+//                             textBox.getControl().setEditable(false);
+//                     }
                        detailSettingComp.layout(true);
                } else {
 
@@ -500,7 +495,6 @@ public class ConfigurationDialogFeaturesPage extends DAPageComposite {
                                                                        false);
                                }
                        }
-                       // updateDetails();
                }
 
                @Override
index 74b25c3..da9769e 100644 (file)
@@ -103,7 +103,10 @@ public class ConfigurationDialogFeaturesTable extends DATreeComposite {
 
                String optionFeatureName = ConfigurationDialogDataManager.getInstance()
                                .getOptionFeatureName(featueName);
-               if (!optionFeatureName.equals(CommonConstants.EMPTY)) {
+               if (!optionFeatureName.equals(CommonConstants.EMPTY)
+                               && ConfigurationDialogDataManager.getInstance()
+                                               .getParentFeatureName(featueName)
+                                               .equals(CommonConstants.EMPTY)) {
                        optionColumn += (FEATURE_OPTION_VALUE + getOptionText(optionFeatureName));
                }
 
@@ -142,7 +145,17 @@ public class ConfigurationDialogFeaturesTable extends DATreeComposite {
                                        DATableDataFormat tableData = new DATableDataFormat(0);
                                        List<String> text = new ArrayList<String>();
                                        text.add(parentFeaturesName);
-                                       text.add(ITEM_ALL_CHECKED);
+
+                                       String optionFeatureName = ConfigurationDialogDataManager
+                                                       .getInstance().getOptionFeatureName(
+                                                                       parentFeaturesName);
+                                       if (!optionFeatureName.equals(CommonConstants.EMPTY)) {
+                                               text.add(FEATURE_OPTION_VALUE
+                                                               + getOptionText(optionFeatureName));
+                                       } else {
+                                               text.add(ITEM_ALL_CHECKED);
+                                       }
+
                                        TreeInput treeData = new TreeInput();
                                        treeData.setText(text);
                                        treeData.setData(tableData);
@@ -293,6 +306,10 @@ public class ConfigurationDialogFeaturesTable extends DATreeComposite {
 
        private void updateCheckBox(GridItem item, Event event) {
                String optionText = item.getText(tableTextOptionColumnIndex);
+               if (optionText.contains(ITEM_PART_CHECKED)) {
+                       optionText = item.getText(tableTextOptionColumnIndex).replace(
+                                       ITEM_PART_CHECKED, CommonConstants.EMPTY);
+               }
                if (optionText.contains(ITEM_ALL_CHECKED)) {
                        optionText = item.getText(tableTextOptionColumnIndex).replace(
                                        ITEM_ALL_CHECKED, CommonConstants.EMPTY);
index 10c8594..c9e4698 100644 (file)
@@ -35,17 +35,13 @@ import org.eclipse.swt.graphics.Rectangle;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
 
-public class ConfigurationDialogFeaturesTreeTableCellRenderer extends DefaultCellRenderer {
+public class ConfigurationDialogFeaturesTreeTableCellRenderer extends
+               DefaultCellRenderer {
        int leftMargin = 4;
-//     int rightMargin = 4;
-//     int textTopMargin = 1;
-//     int insideMargin = 3;
-
-//     public Image menuImg = null;
        protected ConfigurationDialogFeaturesTreeTableToggleRenderer toggleRenderer;
 
        Rectangle checkImgRect = ImageResources.CHECKBOX_SELECTED.getBounds();
-       
+
        public void setTree(boolean tree) {
                super.setTree(tree);
                if (tree) {
@@ -53,27 +49,22 @@ public class ConfigurationDialogFeaturesTreeTableCellRenderer extends DefaultCel
                        toggleRenderer.setDisplay(getDisplay());
                }
        }
-       
+
        @Override
        public void paint(GC gc, Object value) {
                GridItem item = (GridItem) value;
                gc.setFont(item.getFont(getColumn()));
 
-               
                paintBackground(gc, item);
 
                int x = leftMargin;
                x += item.getLevel() * 20;
-               toggleRenderer.setLocation(getBounds().x + x,(getBounds().height - toggleRenderer.getBounds().height) / 2+ getBounds().y);
+               toggleRenderer.setLocation(getBounds().x + x,
+                               (getBounds().height - toggleRenderer.getBounds().height) / 2
+                                               + getBounds().y);
                toggleRenderer.paint(gc, item);
-               
 
-       //      paintImage(gc, item);
-       //      paintText(gc, item);
                paintTableBoardLine(gc, item);
-               // paintSelectedLine(gc, item);
-               // paintSelectedCopy(gc, item);
-               // paintVaildTime(gc, item);
        }
 
        private void paintBackground(GC gc, GridItem item) {
@@ -111,29 +102,6 @@ public class ConfigurationDialogFeaturesTreeTableCellRenderer extends DefaultCel
                }
        }
 
-//     private void paintImage(GC gc, GridItem item) {
-//             menuImg = item.getImage();
-//             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);
-//             }
-//     }
-
-//     private void paintText(GC gc, GridItem item) {
-//             int x = leftMargin;
-//             int width = getBounds().width - x - rightMargin;
-//             String text = item.getText(getColumn());
-//             int len = gc.stringExtent(text).x;
-//             if (len < width) {
-//                     x += (width - len) / 2;
-//             }
-//             gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
-//             gc.setFont(FontResources.TABLE_CELL_FONT);
-//             gc.drawText(text, getBounds().x + x, getBounds().y + textTopMargin,
-//                             true);
-//     }
-
        private void paintTableBoardLine(GC gc, GridItem item) {
                if (item.getParent().getLinesVisible()) {
                        if (isCellSelected()) {
@@ -149,100 +117,4 @@ public class ConfigurationDialogFeaturesTreeTableCellRenderer extends DefaultCel
                                                        + getBounds().height);
                }
        }
-
-//     private void paintSelectedLine(GC gc, GridItem item) {
-//             if (getColumn() != 0 && item.getChecked(getColumn())) {
-//                     Rectangle focusRect = new Rectangle(getBounds().x - 1,
-//                                     getBounds().y - 1, getBounds().width,
-//                                     getBounds().height + 1);
-//                     gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_START);
-//                     gc.drawRectangle(focusRect);
-//                     if (isFocus()) {
-//                             focusRect.x++;
-//                             focusRect.width -= 2;
-//                             focusRect.y++;
-//                             focusRect.height -= 2;
-//                             gc.drawRectangle(focusRect);
-//                     }
-//             }
-//     }
-//
-//     private void paintSelectedCopy(GC gc, GridItem item) {
-//             String optionColumn = item.getText(1);
-//             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(1);
-//             if (optionColumn.contains(ReplayEditDialogDataManager.ITEM_TIME_VAILD_FALSE)) {
-//                     gc.setForeground(ColorResources.RED);
-//                     gc.setLineWidth(1);
-//                     gc.drawLine(getBounds().x, getBounds().y+(getBounds().height/3), getBounds().x
-//                                     + getBounds().width, getBounds().y+(getBounds().height/3));
-//                     gc.setLineWidth(1);
-//
-//             }
-//     }
-       
-//     public boolean notify(int event, Point point, Object value) {
-//             GridItem item = (GridItem) value;
-//             if (event == IInternalWidget.LeftMouseButtonDown) {
-//                     if (overCheck(item, point)) {
-//                             if (item.getChecked() == true) {
-//                                     item.setChecked(false);
-//                             } else {
-//                                     item.setChecked(true);
-//                             }
-//                             ConfigurationDialogValues.getInstance().setFeaturesChecked(
-//                                             item.getText(1), item.getChecked());
-//                             item.getParent().redraw();
-//                             return false;
-//                     }
-//             }
-//             return false;
-//     }
-//
-//     private boolean overCheck(GridItem item, Point point) {
-//             System.out.println("item : "+item.getText(1));
-//             point = new Point(point.x, point.y);
-//             point.x -= getBounds().x - 1;
-//             point.y -= getBounds().y - 1;
-//             
-//             Rectangle treeFoldImgRect = ImageResources.TREE_FOLD.getBounds();
-//             int foldImgOffset = (getBounds().width - treeFoldImgRect.width) / 2;
-//             checkImgRect.x = getBounds().x + foldImgOffset + 15;
-//             
-//             System.out.println("checkImgRect.x : "+checkImgRect.x+" point.x : "+point.x+" checkImgRect.y : "+checkImgRect.y+" point.y : "+point.y);
-//             
-//             if ((checkImgRect.x <= point.x)
-//                             && (point.x <= checkImgRect.x + checkImgRect.width + 10)
-//                             && (checkImgRect.y <= point.y)
-//                             && (point.y <= checkImgRect.y + checkImgRect.height)) {
-//                     return true;
-//             }
-//             return false;
-//     }
 }
index dca5268..60cd5c2 100644 (file)
@@ -57,10 +57,17 @@ public class ConfigurationDialogFeaturesTreeTableToggleRenderer extends
                }
 
                if (item.hasChildren()) {
-                       Rectangle treeFoldImgRect = ImageResources.TREE_FOLD.getBounds();
-                       int foldImgOffset = (getBounds().width - treeFoldImgRect.width) / 2;
+                       Image treeFoldImg = null;
+                       if (item.isExpanded()) {
+                               treeFoldImg = ImageResources.TREE_OPEN;
+                       } else {
+                               treeFoldImg = ImageResources.TREE_FOLD;
+                       }
+
+                       int foldImgOffset = (getBounds().width - ImageResources.TREE_OPEN
+                                       .getBounds().width) / 2;
                        int x = getBounds().x + foldImgOffset;
-                       gc.drawImage(ImageResources.TREE_FOLD, 5, getBounds().y);
+                       gc.drawImage(treeFoldImg, 5, getBounds().y);
 
                        Image checkImg = null;
                        if (item.getText(1).contains(
@@ -72,6 +79,7 @@ public class ConfigurationDialogFeaturesTreeTableToggleRenderer extends
                        } else {
                                checkImg = ImageResources.CHECKBOX_UNSELECTED;
                        }
+                       
                        Rectangle checkImgRect = ImageResources.CHECKBOX_SELECTED
                                        .getBounds();
                        x += intevalSize;
@@ -84,15 +92,7 @@ public class ConfigurationDialogFeaturesTreeTableToggleRenderer extends
                                gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
                        }
 
-                       String printText = item.getText();
-                       if (item.getText(1).contains(
-                                       ConfigurationDialogFeaturesTable.FEATURE_OPTION_VALUE)) {
-                               String[] optionList = item.getText(1).split(
-                                               ConfigurationDialogFeaturesTable.FEATURE_OPTION_VALUE);
-                               if (optionList.length > 1) {
-                                       printText += optionList[1];
-                               }
-                       }
+                       String printText = getOptionText(item);
                        gc.drawText(printText, x, getBounds().y - 2, true);
                } else {
                        Rectangle r = ImageResources.TREE_OPEN.getBounds();
@@ -121,17 +121,27 @@ public class ConfigurationDialogFeaturesTreeTableToggleRenderer extends
                                gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
                        }
 
-                       String printText = item.getText();
-                       if (item.getText(1).contains(
-                                       ConfigurationDialogFeaturesTable.FEATURE_OPTION_VALUE)) {
-                               String[] optionList = item.getText(1).split(
-                                               ConfigurationDialogFeaturesTable.FEATURE_OPTION_VALUE);
-                               if (optionList.length > 1) {
+                       String printText = getOptionText(item);
+                       gc.drawText(printText, x, getBounds().y - 2, true);
+               }
+       }
+       
+       private String getOptionText(GridItem item){
+               String printText = item.getText();
+               if (item.getText(1).contains(
+                               ConfigurationDialogFeaturesTable.FEATURE_OPTION_VALUE)) {
+                       String[] optionList = item.getText(1).split(
+                                       ConfigurationDialogFeaturesTable.FEATURE_OPTION_VALUE);
+                       if (optionList.length > 1) {
+                               if(optionList[1].contains(",")){
+                                       String[] optionList2 = optionList[1].split(",");
+                                       printText += optionList2[0];
+                               }else{
                                        printText += optionList[1];
                                }
                        }
-                       gc.drawText(printText, x, getBounds().y - 2, true);
                }
+               return printText;
        }
 
        /**
index bf59ecc..a389013 100644 (file)
@@ -117,6 +117,9 @@ public abstract class DAWindowingTableComposite extends Composite {
 
        protected Point mousePoint = new Point(0, 0);
        
+       private int preTableLength = 0;
+       private boolean isFinishUpdateTable = true;
+       
        protected RangeDataManager rangeDataManager = RangeDataManager
                        .getInstance();
 
@@ -216,6 +219,21 @@ public abstract class DAWindowingTableComposite extends Composite {
                                                        dialog.open();
                                                }
                                        }
+                               } else if (e.keyCode == SWT.ARROW_UP) {
+                                       int nowScrollBar = scrollbar.getSelection();
+                                       int tableSelectionIndex = table.getSelectionIndex();
+                                       if (nowScrollBar > 0 && tableSelectionIndex <= 0) {
+                                               scrollbar.setSelection(nowScrollBar - 1);
+                                               updateTable();
+                                       }
+
+                               } else if (e.keyCode == SWT.ARROW_DOWN) {
+                                       int nowScrollBar = scrollbar.getSelection();
+                                       int tableSelectionIndex = table.getSelectionIndex();
+                                       if (tableSelectionIndex >= getTableLenght()) {
+                                               scrollbar.setSelection(nowScrollBar + 1);
+                                               updateTable();
+                                       }
                                }
                        }
                });
@@ -312,7 +330,7 @@ public abstract class DAWindowingTableComposite extends Composite {
                        scrollStartSelection = 0;
                }
 
-               scrollEndSelection = scrollSelection + getTableLenght() + 1;
+               scrollEndSelection = getTableLenght();
                if (getItemCount() < additionalSelectCount) {
                        scrollEndSelection = getItemCount();
                } else {
@@ -336,9 +354,9 @@ public abstract class DAWindowingTableComposite extends Composite {
                        isQueryDB = true;
                }
 
-               if (null != savedLogDataList
-                               && savedLogDataList.size() != getTableLenght()) {
+               if (preTableLength != getTableLenght()) {
                        isQueryDB = true;
+                       preTableLength = getTableLenght();
                }
 
                preLogCount = getItemCount();
@@ -579,13 +597,17 @@ public abstract class DAWindowingTableComposite extends Composite {
        private SelectionListener scrollbarSelectionListener = new SelectionListener() {
                @Override
                public void widgetSelected(SelectionEvent e) {
-                       updateTable();
+                       if (preSelectionScrollIndex != scrollbar.getSelection()) {
+                               if (isFinishUpdateTable) {
+                                       isFinishUpdateTable = false;
+                                       updateTable();
+                                       isFinishUpdateTable = true;
+                               }
+                       }
                }
 
                @Override
                public void widgetDefaultSelected(SelectionEvent e) {
-                       // TODO Auto-generated method stub
-
                }
        };