当前位置: 首页>>代码示例>>Java>>正文


Java SWT.CENTER属性代码示例

本文整理汇总了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);
}
 
开发者ID:technology16,项目名称:pgsqlblocks,代码行数:21,代码来源:DBProcessesFiltersView.java

示例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;
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:20,代码来源:TableColumnSWTUtils.java

示例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);
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:8,代码来源:TableSection.java

示例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);
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:8,代码来源:ConnectionSection.java

示例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;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:37,代码来源:TextGridRowBuilder.java

示例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;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:14,代码来源:FTPWidgetUtility.java

示例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;
	}
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:11,代码来源:BreadcrumbItem.java

示例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;
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:7,代码来源:CustomPropertiesAttributeControl.java

示例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);

}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:39,代码来源:DataModelFormPage.java

示例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);
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:30,代码来源:JobRunPreferenceComposite.java

示例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;
}
 
开发者ID:juanerasmoe,项目名称:pmTrans,代码行数:7,代码来源:FindReplaceDialog.java

示例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);
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:8,代码来源:TableSection.java

示例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);
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:8,代码来源:ColumnSection.java

示例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);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:11,代码来源:FunctionsUpperComposite.java

示例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;
	}
 
开发者ID:eclipse,项目名称:scanning,代码行数:15,代码来源:AxesCellEditor.java


注:本文中的org.eclipse.swt.SWT.CENTER属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。