當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。