use of org.eclipse.swt.widgets.DateTime in project cubrid-manager by CUBRID.
the class TimeCellPopuoDialog method createDialogArea.
/**
* Create dialog area
*
* @param parent Composite
* @return Control
*/
protected Control createDialogArea(Composite parent) {
Composite parentComp = (Composite) super.createDialogArea(parent);
Composite composite = new Composite(parentComp, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout();
layout.numColumns = 2;
composite.setLayout(layout);
timeComposite = new DateTime(composite, SWT.TIME | SWT.CALENDAR | SWT.BORDER);
timeComposite.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 1, 1, -1, -1));
setNullBtn = new Button(composite, SWT.CHECK);
setNullBtn.setText(Messages.btnSetNull);
setNullBtn.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
setNullBtn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
changeBtnStatus();
}
});
initValue();
return composite;
}
use of org.eclipse.swt.widgets.DateTime in project cubrid-manager by CUBRID.
the class DateCellPopupDialog method createDialogArea.
/**
* Create dialog area
*
* @param parent Composite
* @return Control
*/
protected Control createDialogArea(Composite parent) {
Composite parentComp = (Composite) super.createDialogArea(parent);
Composite composite = new Composite(parentComp, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout();
layout.numColumns = 3;
composite.setLayout(layout);
dateComposite = new DateTime(composite, SWT.CALENDAR | SWT.BORDER);
dateComposite.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 3, 1, -1, -1));
setNullBtn = new Button(composite, SWT.CHECK);
setNullBtn.setText(Messages.btnSetNull);
setNullBtn.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
setNullBtn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
changeBtnStatus();
}
});
initValue();
return composite;
}
use of org.eclipse.swt.widgets.DateTime in project cubrid-manager by CUBRID.
the class DateTimeCellPopuoDialog method createDialogArea.
/**
* Create dialog area
*
* @param parent Composite
* @return Control
*/
protected Control createDialogArea(Composite parent) {
Composite parentComp = (Composite) super.createDialogArea(parent);
Composite composite = new Composite(parentComp, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout();
layout.numColumns = 3;
composite.setLayout(layout);
dateComposite = new DateTime(composite, SWT.CALENDAR | SWT.BORDER);
dateComposite.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 3, 1, -1, -1));
timeComposite = new DateTime(composite, SWT.TIME | SWT.BORDER);
timeComposite.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 1, 1, -1, -1));
if (DataType.isDateTimeDataType(columnInfo.getType())) {
millSpinner = new Spinner(composite, SWT.BORDER);
millSpinner.setMinimum(0);
millSpinner.setMaximum(999);
millSpinner.setLayoutData(CommonUITool.createGridData(1, 1, 30, -1));
}
setNullBtn = new Button(composite, SWT.CHECK);
setNullBtn.setText(Messages.btnSetNull);
setNullBtn.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
setNullBtn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
changeBtnStatus();
}
});
initValue();
return composite;
}
use of org.eclipse.swt.widgets.DateTime in project eclipse.platform.swt by eclipse.
the class Test_org_eclipse_swt_widgets_DateTime method test_setBackgroundTimeDateTime.
@Test
public void test_setBackgroundTimeDateTime() {
DateTime time = new DateTime(shell, SWT.TIME);
Color color = new Color(time.getDisplay(), 255, 0, 0);
time.setBackground(color);
assertEquals("getBackground not equal after setBackground for SWT.TIME DateTime", color, time.getBackground());
time.setBackground(null);
assertTrue("getBackground unchanged after setBackground(null) for SWT.TIME DateTime", !time.getBackground().equals(color));
color.dispose();
color = new Color(time.getDisplay(), 255, 0, 0, 0);
time.setBackground(color);
assertEquals("getBackground not equal after setBackground with 0 alpha for SWT.TIME DateTime", color, time.getBackground());
time.setBackground(null);
assertTrue("getBackground unchanged after setBackground(null) with 0 alpha for SWT.TIME DateTime", !time.getBackground().equals(color));
if ("gtk".equals(SWT.getPlatform())) {
Color fg = new Color(time.getDisplay(), 0, 255, 0);
time.setBackground(color);
time.setForeground(fg);
assertEquals("Setting a foreground disrupted the background color for SWT.TIME DateTime", color, time.getBackground());
assertEquals("Setting a foreground onto an SWT.TIME DateTime with a background failed", fg, time.getForeground());
fg.dispose();
}
color.dispose();
time.dispose();
}
use of org.eclipse.swt.widgets.DateTime in project eclipse.platform.swt by eclipse.
the class Test_org_eclipse_swt_widgets_DateTime method test_setForegroundTimeDateTime.
@Test
public void test_setForegroundTimeDateTime() {
DateTime time = new DateTime(shell, SWT.TIME);
Color color = new Color(time.getDisplay(), 255, 0, 0);
time.setForeground(color);
assertEquals(color, time.getForeground());
time.setForeground(null);
assertFalse(time.getForeground().equals(color));
if ("gtk".equals(SWT.getPlatform())) {
Color bg = new Color(time.getDisplay(), 0, 255, 0);
time.setForeground(color);
time.setBackground(bg);
assertEquals("Setting a background disrupted the foreground color for SWT.TIME DateTime", color, time.getForeground());
assertEquals("Setting a background onto an SWT.TIME DateTime with a foreground failed", bg, time.getBackground());
bg.dispose();
}
color.dispose();
time.dispose();
}
Aggregations