本文整理汇总了Java中org.eclipse.swt.custom.CLabel.setRightMargin方法的典型用法代码示例。如果您正苦于以下问题:Java CLabel.setRightMargin方法的具体用法?Java CLabel.setRightMargin怎么用?Java CLabel.setRightMargin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.custom.CLabel
的用法示例。
在下文中一共展示了CLabel.setRightMargin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
示例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;
}
示例4: 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;
}
示例5: 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;
}