本文整理汇总了Java中org.eclipse.swt.SWT.LEAD属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.LEAD属性的具体用法?Java SWT.LEAD怎么用?Java SWT.LEAD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.LEAD属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: InfoBar
/**
* Constructor.
*
* @param parent The parent {@link Composite}.
* @param style The InfoBar {@link Composite#getStyle() style}.
*/
public InfoBar(Composite parent, int style) {
super(parent, style);
setVisible(false);
FormLayout layout = new FormLayout();
layout.marginTop = 5;
layout.marginBottom = 5;
layout.marginLeft = 5;
layout.marginRight = 5;
layout.spacing = 5;
setLayout(layout);
Color backgroundColor = parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND);
setBackground(backgroundColor);
_Label = new Label(this, SWT.LEAD | SWT.WRAP);
_Label.setBackground(backgroundColor);
FormData labelFormData = new FormData();
labelFormData.top = new FormAttachment(0, 0);
labelFormData.left = new FormAttachment(0, 0);
_Label.setLayoutData(labelFormData);
}
示例2: convertColumnAlignmentToSWT
public static int convertColumnAlignmentToSWT(int align) {
int swt = 0;
int hAlign = align & 3;
if (hAlign == TableColumn.ALIGN_CENTER) {
swt = SWT.CENTER;
} else if (hAlign == TableColumn.ALIGN_LEAD) {
swt = SWT.LEAD;
} else if (hAlign == TableColumn.ALIGN_TRAIL) {
swt = SWT.TRAIL;
} else {
swt = SWT.LEAD;
}
int vAlign = align & ~3;
if (vAlign == TableColumn.ALIGN_TOP) {
swt |= SWT.TOP;
} else if (vAlign == TableColumn.ALIGN_BOTTOM) {
swt |= SWT.BOTTOM;
}
return swt;
}
示例3: createContents
@Override
protected void createContents() {
Label authInfoLabel = new Label(this, SWT.LEAD);
authInfoLabel.setText("Auth Info:");
authInfoLabel.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
_AuthInfoComposite = new ZooKeeperConnectionAuthInfoComposite(this, SWT.NULL);
_AuthInfoComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
GridLayout authInfoCompositeLayout = new GridLayout(2, false);
authInfoCompositeLayout.marginWidth = 0;
authInfoCompositeLayout.marginHeight = 0;
authInfoCompositeLayout.horizontalSpacing = ((GridLayout) getLayout()).horizontalSpacing;
_AuthInfoComposite.setLayout(authInfoCompositeLayout);
Table table = new Table(_AuthInfoComposite, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER | SWT.H_SCROLL
| SWT.V_SCROLL);
GridData tableLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2);
tableLayoutData.heightHint = 200;
table.setLayoutData(tableLayoutData);
_AuthInfoComposite.setTable(table);
Button addButton = new Button(_AuthInfoComposite, SWT.NULL);
addButton.setText("Add...");
addButton.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, false, false));
_AuthInfoComposite.setAddButton(addButton);
final Button removeButton = new Button(_AuthInfoComposite, SWT.NULL);
removeButton.setText("Remove");
removeButton.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, false, false));
_AuthInfoComposite.setRemoveButton(removeButton);
_AuthInfoComposite.init();
}
示例4: createContents
@Override
protected void createContents() {
ZnodeModel parentZnodeModel = getParentZnodeModel();
Label connectionLabel = new Label(this, SWT.LEAD);
connectionLabel.setText("Connection:");
connectionLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
Label connectionImageLabel = new Label(this, SWT.LEAD);
connectionImageLabel.setImage(ZooKeeperActivator
.getManagedImage(ZooKeeperActivator.IMAGE_KEY_OBJECT_ZOO_KEEPER_CONNECTION));
connectionImageLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
Label connectionValueLabel = new Label(this, SWT.LEAD);
connectionValueLabel.setText(parentZnodeModel.getOwnerModel().getKey().getName());
connectionValueLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
addControl(CONTROL_NAME_CONNECTION_LABEL, connectionValueLabel);
addControlDecoration(CONTROL_NAME_CONNECTION_LABEL, connectionValueLabel);
Label parentLabel = new Label(this, SWT.LEAD);
parentLabel.setText("Parent:");
parentLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
Label parentImageLabel = new Label(this, SWT.LEAD);
parentImageLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
addControl(CONTROL_NAME_PARENT_IMAGE_LABEL, parentImageLabel);
updateParentZnodeImage();
Label parentValueLabel = new Label(this, SWT.LEAD);
parentValueLabel.setText(parentZnodeModel.getData().getPath());
parentValueLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
addControl(CONTROL_NAME_PARENT_PATH_LABEL, parentValueLabel);
addControlDecoration(CONTROL_NAME_PARENT_PATH_LABEL, parentValueLabel);
}
示例5: convertSWTAlignmentToColumn
private static int convertSWTAlignmentToColumn(int align) {
if ((align & SWT.LEAD) != 0) {
return TableColumn.ALIGN_LEAD;
} else if ((align & SWT.CENTER) != 0) {
return TableColumn.ALIGN_CENTER;
} else if ((align & SWT.RIGHT) != 0) {
return TableColumn.ALIGN_TRAIL;
}
return TableColumn.ALIGN_LEAD;
}