當前位置: 首頁>>代碼示例>>Java>>正文


Java CLabel.setLeftMargin方法代碼示例

本文整理匯總了Java中org.eclipse.swt.custom.CLabel.setLeftMargin方法的典型用法代碼示例。如果您正苦於以下問題:Java CLabel.setLeftMargin方法的具體用法?Java CLabel.setLeftMargin怎麽用?Java CLabel.setLeftMargin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.custom.CLabel的用法示例。


在下文中一共展示了CLabel.setLeftMargin方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createUI

import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
public void createUI(Composite cParent) {
	Label spcStatus = new Label(cParent, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_IN);
	spcStatus.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

	Composite pStatus = new Composite(cParent, SWT.NO_FOCUS);
	pStatus.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));
	GridLayout gl_pStatus = new GridLayout(4, false);
	gl_pStatus.marginTop = 1;
	gl_pStatus.marginBottom = 2;
	gl_pStatus.marginHeight = 0;
	gl_pStatus.verticalSpacing = 0;
	pStatus.setLayout(gl_pStatus);
	pStatus.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

	lStatus = new CLabel(pStatus, SWT.NONE);
	lStatus.setLeftMargin(3);
	lStatus.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	lStatus.setRightMargin(5);
	lStatus.setTopMargin(2);
	lStatus.setBottomMargin(1);

	setPortStatus("Port closed", false);

	createLeds(pStatus);
}
 
開發者ID:ploys,項目名稱:ecle,代碼行數:26,代碼來源:PortStatus.java

示例2: createLeds

import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
protected void createLeds(Composite parent) {
	Composite pSigstate = new Composite(parent, SWT.NONE);
	GridLayout gl_pSigstate = new GridLayout(6, true);
	gl_pSigstate.marginHeight = 0;
	pSigstate.setLayout(gl_pSigstate);

	createLed(pSigstate, Serial.Pin.RXD);
	createLed(pSigstate, Serial.Pin.TXD);

	createLed(pSigstate, Serial.Pin.CTS);
	createLed(pSigstate, Serial.Pin.DCD);
	createLed(pSigstate, Serial.Pin.DSR);
	createLed(pSigstate, Serial.Pin.RNG);

	CLabel led = createLed(parent, Serial.Pin.BREAK);
	led.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	led.setLeftMargin(20);

	led = createLed(parent, Serial.Pin.ERROR);
	led.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	led.setRightMargin(2);
	led.setLeftMargin(10);
}
 
開發者ID:ploys,項目名稱:ecle,代碼行數:24,代碼來源:PortStatus.java

示例3: createContextButton

import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
protected CLabel createContextButton (String text, Image icon)
{
	CLabel lbl = new CLabel(buttonsContainer, SWT.NONE);
	lbl.setLayoutData(new RowData(SWT.DEFAULT, 28));
	lbl.setRightMargin(10);
	lbl.setLeftMargin(8);
	lbl.setText(text);
	lbl.setImage(icon);
	lbl.setBackground(ColorResources.COLOR_CS_BLUE);
	lbl.setForeground(ColorResources.COLOR_WHITE);
	lbl.setCursor(new Cursor(getDisplay(), SWT.CURSOR_HAND));
	
	contextButtonsMap.put(lbl, text);
	
	return lbl;
}
 
開發者ID:CloudScale-Project,項目名稱:Environment,代碼行數:17,代碼來源:TitleWidget.java

示例4: createErrorComposite

import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
protected void createErrorComposite(final Composite parent) {
    errorMessageText = new CLabel(parent, SWT.NONE);
    errorMessageText.setLeftMargin(0);
    errorMessageText.setText("");

    final GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.heightHint = 30 * getErrorLine();
    gridData.horizontalSpan = numColumns;

    errorMessageText.setLayoutData(gridData);
    errorMessageText.setForeground(ColorConstants.red);
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:14,代碼來源:AbstractDialog.java

示例5: createLed

import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
protected CLabel createLed(Composite parent, Serial.Pin led) {
	CLabel element = new CLabel(parent, SWT.NONE);
	element.setTopMargin(1);
	element.setRightMargin(0);
	element.setBottomMargin(1);
	element.setLeftMargin(0);
	element.setText(led.name());
	element.setImage(Icons.state(State.OFF));

	leds.put(led, element);
	return element;
}
 
開發者ID:ploys,項目名稱:ecle,代碼行數:13,代碼來源:PortStatus.java

示例6: createSeparator

import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
protected CLabel createSeparator ()
{
	CLabel label = new CLabel(buttonsContainer, SWT.SEPARATOR | SWT.VERTICAL);
	label.setRightMargin(1);
	label.setLeftMargin(1);
	label.setBackground(org.eclipse.wb.swt.SWTResourceManager.getColor(SWT.COLOR_DARK_GRAY));
	label.setLayoutData(new RowData(-1, 24));
	return label;
}
 
開發者ID:CloudScale-Project,項目名稱:Environment,代碼行數:10,代碼來源:TitleWidget.java


注:本文中的org.eclipse.swt.custom.CLabel.setLeftMargin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。