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;
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
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$
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) {
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) {
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 {
DASelectionData data = new DASelectionData(observingViews[i],
startTime, endTime, selection, table);
updateView(data);
- return;
}
+ return;
}
clear();
}
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) {
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;
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;
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) {
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);
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)
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);
} 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
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);
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
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()
&& 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
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);
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 {
false);
}
}
- // updateDetails();
}
@Override
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));
}
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);
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);
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) {
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) {
}
}
-// 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()) {
+ 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;
-// }
}
}
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(
} else {
checkImg = ImageResources.CHECKBOX_UNSELECTED;
}
+
Rectangle checkImgRect = ImageResources.CHECKBOX_SELECTED
.getBounds();
x += intevalSize;
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();
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;
}
/**
protected Point mousePoint = new Point(0, 0);
+ private int preTableLength = 0;
+ private boolean isFinishUpdateTable = true;
+
protected RangeDataManager rangeDataManager = RangeDataManager
.getInstance();
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();
+ }
}
}
});
scrollStartSelection = 0;
}
- scrollEndSelection = scrollSelection + getTableLenght() + 1;
+ scrollEndSelection = getTableLenght();
if (getItemCount() < additionalSelectCount) {
scrollEndSelection = getItemCount();
} else {
isQueryDB = true;
}
- if (null != savedLogDataList
- && savedLogDataList.size() != getTableLenght()) {
+ if (preTableLength != getTableLenght()) {
isQueryDB = true;
+ preTableLength = getTableLenght();
}
preLogCount = getItemCount();
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
-
}
};