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


Java SWT.TOGGLE屬性代碼示例

本文整理匯總了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 () );
        };
    } );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:16,代碼來源:ButtonProfileEntry.java

示例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();
		}
	});
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:19,代碼來源:ToggleButton.java

示例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 );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:18,代碼來源:GeneratorView.java

示例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;
}
 
開發者ID:sergueik,項目名稱:SWET,代碼行數:7,代碼來源:BreadcrumbItem.java


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