本文整理汇总了Java中org.eclipse.swt.SWT.TOGGLE属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.TOGGLE属性的具体用法?Java SWT.TOGGLE怎么用?Java SWT.TOGGLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.TOGGLE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ButtonProfileEntry
public ButtonProfileEntry ( final DataBindingContext dbc, final Composite parent, final ProfileManager profileManager, final Profile profile, final ChartContext chartContext )
{
super ( dbc, profileManager, profile, chartContext );
this.widget = new Button ( parent, SWT.TOGGLE );
addBinding ( dbc.bindValue ( SWTObservables.observeText ( this.widget ), EMFObservables.observeValue ( profile, ChartPackage.Literals.PROFILE__LABEL ) ) );
this.widget.addSelectionListener ( new SelectionAdapter () {
@Override
public void widgetSelected ( final SelectionEvent e )
{
fireSelection ( ButtonProfileEntry.this.widget.getSelection () );
};
} );
}
示例2: ToggleButton
public ToggleButton(Composite parent, int style) {
super(parent, style);
if (colorOn == null) {
colorOn = getDisplay().getSystemColor(SWT.COLOR_GREEN);
colorOff = getDisplay().getSystemColor(SWT.COLOR_RED);
}
FillLayout layout = new FillLayout();
layout.marginHeight = layout.marginWidth = 2;
setLayout(layout);
button = new Button(this, SWT.TOGGLE);
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updateColor();
}
});
}
示例3: createHeader
private void createHeader ( final Composite parent )
{
this.header = new Composite ( parent, SWT.NONE );
this.header.setLayoutData ( new GridData ( GridData.BEGINNING, GridData.BEGINNING, true, false ) );
this.header.setLayout ( new RowLayout () );
this.startButton = new Button ( this.header, SWT.TOGGLE );
this.startButton.setText ( Messages.getString ( "GeneratorView.ButtonGo" ) );
this.startButton.addSelectionListener ( new SelectionAdapter () {
@Override
public void widgetSelected ( final SelectionEvent e )
{
GeneratorView.this.toggleButton ( GeneratorView.this.startButton.getSelection () );
}
} );
this.errorLabel = new Label ( this.header, SWT.NONE );
}
示例4: checkStyle
private static int checkStyle(int style) {
style = checkBits(style, SWT.NONE, SWT.PUSH, SWT.TOGGLE);
if ((style & (SWT.PUSH | SWT.TOGGLE)) != 0) {
return checkBits(style, SWT.CENTER, SWT.LEFT, SWT.RIGHT);
}
return style;
}