本文整理汇总了Java中org.eclipse.swt.SWT.CENTER属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.CENTER属性的具体用法?Java SWT.CENTER怎么用?Java SWT.CENTER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.CENTER属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContent
private void createContent() {
group = new Group(this, SWT.NONE);
GridLayout layout = new GridLayout(9, false);
GridData layoutData = new GridData(SWT.FILL, SWT.TOP, true, false);
group.setLayout(layout);
group.setLayoutData(layoutData);
group.setText(resourceBundle.getString("process_filter"));
GridData comboLayoutData = new GridData(SWT.LEFT, SWT.CENTER, false,false);
comboLayoutData.widthHint = 60;
GridData textLayoutData = new GridData(SWT.LEFT, SWT.CENTER, true, true);
textLayoutData.widthHint = 150;
textLayoutData.minimumWidth = 150;
createPidFilterView(comboLayoutData, textLayoutData);
createApplicationFilterView(comboLayoutData, textLayoutData);
createDatabaseFilterView(comboLayoutData, textLayoutData);
createUserNameFilterView(comboLayoutData, textLayoutData);
createClientFilterView(comboLayoutData, textLayoutData);
createQueryFilterView(comboLayoutData, textLayoutData);
}
示例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: createLabelLabel
private void createLabelLabel(Composite parent) {
this.labelLabel = getWidgetFactory().createCLabel(parent, "名称:");
FormData data = new FormData();
data.top = new FormAttachment(labelText, 0, SWT.CENTER);
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(labelText, -ITabbedPropertyConstants.HSPACE);
this.labelLabel.setLayoutData(data);
}
示例4: createPkColumnNameLabel
private void createPkColumnNameLabel(Composite parent) {
this.pkColumnNameLabel = getWidgetFactory().createCLabel(parent, "主键名称:");
FormData data = new FormData();
data.top = new FormAttachment(pkColumnNameText, 0, SWT.CENTER);
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(pkColumnNameText, -ITabbedPropertyConstants.HSPACE);
this.pkColumnNameLabel.setLayoutData(data);
}
示例5: addRaw
public Composite addRaw(){
Composite composite = new Composite(container, SWT.NONE);
GridLayout gl_composite = new GridLayout(textGridRow.getNumberOfColumn() + 1, false);
gl_composite.horizontalSpacing = 7;
gl_composite.marginWidth = 1;
gl_composite.marginHeight = 0;
gl_composite.verticalSpacing = 1;
composite.setLayout(gl_composite);
Button rowSelection = new Button(composite, SWT.CHECK);
rowSelection.setEnabled(enabled);
Map<Integer, TextGridColumnLayout> columns = textGridRow.getTextGridColumns();
for(int columnNumber:columns.keySet()){
Text text = new Text(composite, SWT.BORDER);
if(!columns.get(columnNumber).grabHorizantalAccessSpace()){
GridData gd_text = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_text.widthHint = columns.get(columnNumber).getColumnWidth();
text.setLayoutData(gd_text);
text.setEditable(columns.get(columnNumber).isEditable());
text.setEnabled(columns.get(columnNumber).isEnabled());
}else{
text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
text.setBounds(0, 0, 76, 21);
text.setFocus();
text.setEditable(columns.get(columnNumber).isEditable());
text.setEnabled(columns.get(columnNumber).isEnabled());
}
if(rowData!=null)
text.setText(rowData.get(columnNumber));
}
return composite;
}
示例6: createText
/**
* Create Text Widget
* @param control
* @param widgetName
* @return
*/
public Widget createText(Composite control, String widgetName, int style){
Text text = new Text(control, style);
GridData gd_text = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
gd_text.horizontalIndent = 10;
text.setLayoutData(gd_text);
text.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
return text;
}
示例7: computeGap
private int computeGap() {
final int widthOfTextAndImage = computeSizeOfTextAndImages().x;
switch (this.alignment) {
case SWT.CENTER:
return (getWidth() - widthOfTextAndImage) / 2;
case SWT.RIGHT:
return getWidth() - widthOfTextAndImage - MARGIN;
default:
return MARGIN;
}
}
示例8: createTableViewerColumn
private TableViewerColumn createTableViewerColumn(String name, int width) {
TableViewerColumn column = new TableViewerColumn(tableViewer, SWT.CENTER);
column.getColumn().setText(name);
column.getColumn().setResizable(true);
column.getColumn().setWidth(width);
return column;
}
示例9: initYesNoInfoBar
/**
* Initializes the {@link InfoBar} with "Yes" and "No" {@link Button buttons}.
*
* @param managedForm The {@link IManagedForm} instance.
* @param yesListener The {@link SelectionListener} to handle the Yes button selection.
*/
protected void initYesNoInfoBar(IManagedForm managedForm, SelectionListener yesListener,
SelectionListener noListener) {
InfoBar infoBar = getInfoBar();
FormToolkit toolkit = managedForm.getToolkit();
Button yesButton = toolkit.createButton(infoBar, "Yes", SWT.PUSH);
if (yesListener != null) {
yesButton.addSelectionListener(yesListener);
}
Button noButton = toolkit.createButton(infoBar, "No", SWT.PUSH);
if (noListener != null) {
noButton.addSelectionListener(noListener);
}
FormData yesButtonFormData = new FormData();
yesButtonFormData.top = new FormAttachment(0, 0);
yesButtonFormData.right = new FormAttachment(noButton);
yesButton.setLayoutData(yesButtonFormData);
FormData noButtonFormData = new FormData();
noButtonFormData.top = new FormAttachment(0, 0);
noButtonFormData.right = new FormAttachment(100, 0);
noButton.setLayoutData(noButtonFormData);
FormData labelFormData = new FormData();
labelFormData.top = new FormAttachment(yesButton, 0, SWT.CENTER);
labelFormData.left = new FormAttachment(0, 0);
infoBar.getLabel().setLayoutData(labelFormData);
}
示例10: createLogLevelGroup
/**
* @param logLevel
*
*/
private void createLogLevelGroup(String logLevel) {
HydroGroup hydroGroup = new HydroGroup(this, SWT.NONE);
hydroGroup.setHydroGroupText(Messages.LOG_LEVEL_PREF_MESSAGE);
hydroGroup.setLayout(new GridLayout(1, false));
hydroGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
hydroGroup.getHydroGroupClientArea().setLayout(new GridLayout(2, false));
Label label = new Label(hydroGroup.getHydroGroupClientArea(), SWT.NONE);
label.setText(Messages.LOG_LEVEL_CONSOLE_PREF_MESSAGE);
ccLogLevels=new CCombo(hydroGroup.getHydroGroupClientArea(), SWT.BORDER);
GridData gd_ccLogLevels = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_ccLogLevels.widthHint = 300;
if(OSValidator.isMac()){
gd_ccLogLevels.heightHint=20;
}
ccLogLevels.setLayoutData(gd_ccLogLevels);
ccLogLevels.setItems(Messages.COMBO_LOG_LEVELS.split(HASH_REGEX));
ccLogLevels.setText(logLevel);
}
示例11: createOption
private Button createOption(String option, Composite parent) {
GridData optionsLD = new GridData(SWT.FILL, SWT.CENTER, false, false);
Button opt = new Button(parent, SWT.CHECK);
opt.setText(option);
opt.setLayoutData(optionsLD);
return opt;
}
示例12: createCommentLabel
private void createCommentLabel(Composite parent) {
this.commentLabel = getWidgetFactory().createCLabel(parent, "备注:");
FormData data = new FormData();
data.top = new FormAttachment(commentText, 0, SWT.CENTER);
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(commentText, -ITabbedPropertyConstants.HSPACE);
this.commentLabel.setLayoutData(data);
}
示例13: createNameLabel
private void createNameLabel(Composite parent) {
this.nameLabel = getWidgetFactory().createCLabel(parent, "列名:");
FormData data = new FormData();
data.top = new FormAttachment(nameText, 0, SWT.CENTER);
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(nameText, -ITabbedPropertyConstants.HSPACE);
this.nameLabel.setLayoutData(data);
}
示例14: createSearchTextBox
private void createSearchTextBox(Composite headerComposite) {
functionSearchTextBox = new Text(headerComposite, SWT.BORDER);
GridData gd_searchTextBox = new GridData(SWT.RIGHT, SWT.CENTER, true, true, 0, 0);
gd_searchTextBox.widthHint = 150;
functionSearchTextBox.setLayoutData(gd_searchTextBox);
functionSearchTextBox.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 128, 128, 128));
functionSearchTextBox.setText(Constants.DEFAULT_SEARCH_TEXT);
functionSearchTextBox.setEnabled(false);
addListnersToSearchTextBox();
ExpressionEditorUtil.INSTANCE.addFocusListenerToSearchTextBox(functionSearchTextBox);
}
示例15: createLabelledCombo
private CCombo createLabelledCombo(Composite content, String slabel) {
Label label = new Label(content, SWT.NONE);
label.setBackground(content.getDisplay().getSystemColor(SWT.COLOR_WHITE));
label.setText(" "+slabel+" ");
label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true));
CCombo ret = new CCombo(content, SWT.READ_ONLY|SWT.BORDER);
ret.setItems(getNames());
GridData fill = new GridData(SWT.FILL, SWT.CENTER, true, true);
fill.widthHint=100;
ret.setLayoutData(fill);
return ret;
}