本文整理匯總了Java中org.eclipse.swt.widgets.DateTime.setLayoutData方法的典型用法代碼示例。如果您正苦於以下問題:Java DateTime.setLayoutData方法的具體用法?Java DateTime.setLayoutData怎麽用?Java DateTime.setLayoutData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.DateTime
的用法示例。
在下文中一共展示了DateTime.setLayoutData方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createArea
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
protected void createArea(Composite parent) {
Composite area = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, true);
layout.marginWidth = 10;
layout.horizontalSpacing = 10;
area.setLayout(layout);
area.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
Label label = new Label(area, SWT.LEFT);
label.setText("Set the build start time and interval days:");
label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
time = new DateTime(area, SWT.TIME);
time.setTime(calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND));
time.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
interval = new Combo(area, SWT.DROP_DOWN | SWT.BORDER);
for(int i = 1; i <= 14; ++i)
interval.add(String.valueOf(i));
interval.select(intervalDays - 1);
interval.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
}
示例2: createPartControl
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
@Override
public void createPartControl(Composite parent) {
GridLayout layout = new GridLayout();
layout.numColumns = 2;
parent.setLayout(layout);
new Label(parent, SWT.NONE).setText("Summary");
Text text = new Text(parent, SWT.BORDER);
text.setText(todo.getSummary());
text.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
new Label(parent, SWT.NONE).setText("Description");
Text lastName = new Text(parent, SWT.BORDER);
lastName.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
lastName.setText(todo.getDescription());
new Label(parent, SWT.NONE).setText("Done");
Button doneBtn = new Button(parent, SWT.CHECK);
doneBtn.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
doneBtn.setSelection(todo.isDone());
new Label(parent, SWT.NONE).setText("Due Date");
DateTime dueDate = new DateTime(parent, SWT.CHECK);
dueDate.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
Date date = todo.getDueDate();
dueDate.setDate(date.getYear(), date.getMonth(), date.getDay());
}
示例3: createDatePicker
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
protected void createDatePicker( int style )
{
btnDate = new Button( this, SWT.CHECK );
btnDate.addListener( SWT.Selection, this );
pickerDate = new DateTime( this, SWT.DATE | style );
pickerDate.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
pickerDate.addListener( SWT.Selection, this );
btnTime = new Button( this, SWT.CHECK );
btnTime.addListener( SWT.Selection, this );
pickerTime = new DateTime( this, SWT.TIME | style );
pickerTime.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
pickerTime.addListener( SWT.Selection, this );
}
示例4: createCalendarArea
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
private Composite createCalendarArea(Composite parent){
Composite composite = new Composite(parent, SWT.NONE);
GridLayout gd = new GridLayout(1, false);
gd.marginLeft = 2; // SWT BUG
composite.setLayout(gd);
dateSelection = new DateTime(composite, SWT.CALENDAR);
dateSelection.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1));
Composite dateComposite = new Composite(composite, SWT.NONE);
dateComposite.setLayout(new GridLayout(2, true));
dateComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label label = new Label(dateComposite, SWT.NONE);
label.setText("Zeitpunkt");
label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
timeSelection = new DateTime(dateComposite, SWT.TIME);
timeSelection.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
timeSelection.setTime(date.get(Calendar.HOUR_OF_DAY), date.get(Calendar.MINUTE),
date.get(Calendar.SECOND));
dateSelection.setDate(date.get(Calendar.YEAR), date.get(Calendar.MONTH),
date.get(Calendar.DAY_OF_MONTH));
getShell().setText(Messages.DateTimeSelectorDialog_enterDate); //$NON-NLS-1$
return composite;
}
示例5: createDefaultArea
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
private Composite createDefaultArea(Composite parent){
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(2, false));
Label label = new Label(composite, SWT.NONE);
label.setText("Zeitpunkt");
label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
Composite dateComposite = new Composite(composite, SWT.NONE);
dateComposite.setLayout(new GridLayout(2, true));
dateComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
timeSelection = new DateTime(dateComposite, SWT.TIME);
timeSelection.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
dateSelection = new DateTime(dateComposite, SWT.CALENDAR);
dateSelection.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
timeSelection.setTime(date.get(Calendar.HOUR_OF_DAY), date.get(Calendar.MINUTE),
date.get(Calendar.SECOND));
dateSelection.setDate(date.get(Calendar.YEAR), date.get(Calendar.MONTH),
date.get(Calendar.DAY_OF_MONTH));
getShell().setText(Messages.DateTimeSelectorDialog_enterDate); //$NON-NLS-1$
return composite;
}
示例6: createDialogArea
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
/**
* Create contents of the dialog.
*
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent){
setMessage("Bitte wählen Sie die anzuzeigende Zeitperiode");
setTitle("Zeitperiode setzen");
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
container.setLayout(new GridLayout(2, false));
container.setLayoutData(new GridData(GridData.FILL_BOTH));
startDateTime = new DateTime(container, SWT.CALENDAR);
startDateTime.setDate(_startDate.get(Calendar.YEAR), _startDate.get(Calendar.MONTH),
_startDate.get(Calendar.DAY_OF_MONTH));
startDateTime.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
endDateTime = new DateTime(container, SWT.CALENDAR);
endDateTime.setDate(_endDate.get(Calendar.YEAR), _endDate.get(Calendar.MONTH),
_endDate.get(Calendar.DAY_OF_MONTH));
endDateTime.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
return area;
}
示例7: createDeliveryDateTime
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
private void createDeliveryDateTime(final Composite container) {
Label deliveryDateLabel = new Label(container, SWT.NONE);
deliveryDateLabel.setText("Delivery Date");
deliveryDateTime = new DateTime(container, SWT.BORDER | SWT.SINGLE);
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 3;
deliveryDateTime.setLayoutData(gridData);
}
示例8: createControl
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent)
{
Composite container = new Composite(parent, SWT.NONE);
GridLayout containerLayout = new GridLayout(2, true);
container.setLayout(containerLayout);
new Label(container, SWT.NONE).setText("Start time in UTC:");
new Label(container, SWT.NONE).setText("Stop time in UTC:");
calendarStart = new DateTime(container, SWT.CALENDAR);
calendarStart.addSelectionListener(pageCompleteValidation);
calendarStart.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
calendarStop = new DateTime(container, SWT.CALENDAR);
calendarStop.addSelectionListener(pageCompleteValidation);
calendarStop.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
timeStart = new DateTime(container, SWT.TIME);
timeStart.addSelectionListener(pageCompleteValidation);
timeStart.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
timeStop = new DateTime(container, SWT.TIME);
timeStop.addSelectionListener(pageCompleteValidation);
timeStop.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
setControl(container);
setPageComplete(false);
setErrorMessage("Specify a valid start and stop time (UTC).");
}
示例9: createControls
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
private Composite createControls(Composite parent)
{
GridLayout layout = new GridLayout(2, true);
layout.marginWidth = 0;
layout.marginHeight = 0;
Composite container = new Composite(parent, SWT.NONE);
container.setLayout(layout);
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
new Label(container, SWT.NONE).setText("Start time in UTC:");
new Label(container, SWT.NONE).setText("Stop time in UTC:");
calendarStart = new DateTime(container, SWT.CALENDAR);
calendarStart.addSelectionListener(pageCompleteValidation);
calendarStart.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
calendarStop = new DateTime(container, SWT.CALENDAR);
calendarStop.addSelectionListener(pageCompleteValidation);
calendarStop.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
timeStart = new DateTime(container, SWT.TIME);
timeStart.addSelectionListener(pageCompleteValidation);
timeStart.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
timeStop = new DateTime(container, SWT.TIME);
timeStop.addSelectionListener(pageCompleteValidation);
timeStop.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
return container;
}
示例10: date
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
public static DateTime date(Composite parent, String label, String property, ModelEditor<?> editor,
FormToolkit toolkit) {
toolkit.createLabel(parent, label, SWT.NONE);
DateTime dateTime = new DateTime(parent, SWT.DATE | SWT.DROP_DOWN);
GridData data = new GridData();
data.widthHint = 150;
dateTime.setLayoutData(data);
editor.getBinding().onDate(() -> editor.getModel(), property, dateTime);
new CommentControl(parent, toolkit, property, editor.getComments());
return dateTime;
}
示例11: OrderDetailView
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
public OrderDetailView(final Composite parent, final Order order) {
this.order = order;
this.container = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, false);
container.setLayout(layout);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
// Order Number
Label orderNumberLabel = new Label(container, SWT.NONE);
orderNumberLabel.setText("Order Number");
orderNumberText = new Text(container, SWT.BORDER | SWT.SINGLE);
orderNumberText.setText(getTextOrEmpty(order.getOrderNumber()));
orderNumberText.setLayoutData(gd);
// Creation Date
Label creationDateLabel = new Label(container, SWT.NONE);
creationDateLabel.setText("Creation Date");
creationDateText = new Text(container, SWT.BORDER | SWT.SINGLE);
creationDateText.setEnabled(false);
SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd.MM.yyyy");
creationDateText.setText(DATE_FORMAT.format(order.getCreationDate()));
creationDateText.setLayoutData(gd);
// Order State
Label orderStateLabel = new Label(container, SWT.NONE);
orderStateLabel.setText("Order State");
stateCombo = new Combo(container, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
stateCombo.setEnabled(false);
stateCombo.setItems(OrderState.getItems());
stateCombo.select(OrderState.getSelectedIndex(order.getState()));
stateCombo.setLayoutData(gd);
// Delivery Date
Label deliveryDateLabel = new Label(container, SWT.NONE);
deliveryDateLabel.setText("Delivery Date");
deliveryDateTime = new DateTime(container, SWT.BORDER | SWT.SINGLE);
setDeliveryDate(order.getDeliveryDate());
deliveryDateTime.setLayoutData(gd);
// Full Name
Label recipientFullNameLabel = new Label(container, SWT.NONE);
recipientFullNameLabel.setText("Full Name");
recipientFullNameText = new Text(container, SWT.BORDER | SWT.SINGLE);
recipientFullNameText.setText(getTextOrEmpty(order.getRecipientFullName()));
recipientFullNameText.setLayoutData(gd);
// Address
Label recipientAddressLabel = new Label(container, SWT.NONE);
recipientAddressLabel.setText("Address");
recipientAddressText = new Text(container, SWT.BORDER | SWT.SINGLE);
recipientAddressText.setText(getTextOrEmpty(order.getRecipientAddress()));
recipientAddressText.setLayoutData(gd);
// ZIP Code
Label recipientZipCodeLabel = new Label(container, SWT.NONE);
recipientZipCodeLabel.setText("ZIP");
recipientZipCodeText = new Text(container, SWT.BORDER | SWT.SINGLE);
recipientZipCodeText.setText(getTextOrEmpty(order.getRecipientZipCode()));
recipientZipCodeText.setLayoutData(gd);
// City
Label recipientCityLabel = new Label(container, SWT.NONE);
recipientCityLabel.setText("City");
recipientCityText = new Text(container, SWT.BORDER | SWT.SINGLE);
recipientCityText.setText(getTextOrEmpty(order.getRecipientCity()));
recipientCityText.setLayoutData(gd);
}
示例12: createDateField
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
public void createDateField(final Composite parent) {
final GridData grid = new GridData();
dateField = new DateTime(parent, SWT.DATE | SWT.DROP_DOWN | SWT.BORDER);
dateField.setLayoutData(grid);
}
示例13: createPartControl
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
@Override
public void createPartControl(Composite parent) {
container = new Composite(parent, SWT.NONE);
container.setLayout(new GridLayout(2, false));
{
leftSideComposite = new Composite(container, SWT.NONE);
leftSideComposite.setLayout(new GridLayout(1, false));
leftSideComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 1, 1));
{
Composite locationComposite = new Composite(leftSideComposite, SWT.NONE);
locationComposite.setLayout(new GridLayout(1, false));
locationComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 1, 1));
{
labelSelectedCity = new CLabel(locationComposite, SWT.NONE);
labelSelectedCity.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
updateLabelSelectedCity(PreferenceHelper.getCityFromPreference());
}
{
labelSelectedtimezone = new CLabel(locationComposite, SWT.NONE);
labelSelectedtimezone.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
updateLabelSelectedTimezone();
}
{
buttonGetAutomaticCity = new Button(locationComposite, SWT.CHECK);
buttonGetAutomaticCity.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
initButtonGetAutomaticCity();
}
{
groupSearchCity = new Group(leftSideComposite, SWT.NONE);
groupSearchCity.setLayout(new GridLayout(2, false));
groupSearchCity.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 1, 1));
initGroupSearchCity();
}
}
}
{
rightSideComposite = new Composite(container, SWT.NONE);
rightSideComposite.setLayout(new GridLayout(1, false));
rightSideComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 1, 1));
{
dateTime = new DateTime(rightSideComposite, SWT.BORDER | SWT.DROP_DOWN | SWT.LONG);
dateTime.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
initDateTimeComponent();
}
initPraysTableViewer(rightSideComposite);
}
hookComponentsEnabled();
getSite().setSelectionProvider(searchBox.getTableViewer());
createActions();
contributeToActionBars();
updatePrayInputs();
}