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


Java Control.setEnabled方法代碼示例

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


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

示例1: clear

import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
@Override
protected void clear ()
{
    if ( this.query != null )
    {
        this.query.removePropertyChangeListener ( this );

        this.stateText.setText ( "" ); //$NON-NLS-1$
        this.startTimestampRequestText.setText ( "" ); //$NON-NLS-1$
        this.endTimestampRequestText.setText ( "" ); //$NON-NLS-1$
        this.entriesRequestText.setText ( "" ); //$NON-NLS-1$

        this.startTimestampText.setText ( "" ); //$NON-NLS-1$
        this.endTimestampText.setText ( "" ); //$NON-NLS-1$
        this.entriesText.setText ( "" ); //$NON-NLS-1$

        for ( final Control control : this.controls )
        {
            control.setEnabled ( false );
        }
    }

    super.clear ();
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:25,代碼來源:QueryControlView.java

示例2: setErrorMessage

import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
/**
 * Sets or clears the error message.
 * If not <code>null</code>, the OK button is disabled.
 * 
 * @param errorMessage
 *            the error message, or <code>null</code> to clear
 * @since 3.0
 */
public void setErrorMessage(String errorMessage) {
	this.errorMessage = errorMessage;
	if (errorMessageText != null && !errorMessageText.isDisposed()) {
		errorMessageText.setText(errorMessage == null ? " \n " : errorMessage); //$NON-NLS-1$
		// Disable the error message text control if there is no error, or
		// no error text (empty or whitespace only).  Hide it also to avoid
		// color change.
		// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=130281
		boolean hasError = errorMessage != null && (StringConverter.removeWhiteSpaces(errorMessage)).length() > 0;
		errorMessageText.setEnabled(hasError);
		errorMessageText.setVisible(hasError);
		errorMessageText.getParent().update();
		// Access the ok button by id, in case clients have overridden button creation.
		// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643
		Control button = getButton(IDialogConstants.OK_ID);
		if (button != null) {
			button.setEnabled(errorMessage == null);
		}
	}
}
 
開發者ID:32kda,項目名稱:com.onpositive.prefeditor,代碼行數:29,代碼來源:FolderSelectionDialog.java

示例3: toggleOK

import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
/**
 * Toggles enabled/disabled state of the OK button based state of the error messages.
 */
private void toggleOK(boolean enabled) {
	Control button = getButton(OK_ID);
	if (button != null) {
		button.setEnabled(enabled);
	}
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:10,代碼來源:InstallNpmDependencyDialog.java

示例4: createPartControl

import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
@Override
public void createPartControl ( final Composite parent )
{
    parent.setLayout ( new FillLayout ( SWT.VERTICAL ) );
    createControls ( parent );

    // disable all
    for ( final Control control : this.controls )
    {
        control.setEnabled ( false );
    }

    addListener ();
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:15,代碼來源:QueryControlView.java

示例5: setQuery

import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
@Override
protected void setQuery ( final AbstractQueryBuffer query )
{
    super.setQuery ( query );
    this.query.addPropertyChangeListener ( this );

    for ( final Control control : this.controls )
    {
        control.setEnabled ( true );
    }

    this.requestParameters = query.getRequestParameters ();
    updateRequestParameters ();
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:15,代碼來源:QueryControlView.java

示例6: updateEnablement

import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
protected void updateEnablement ()
{
    final boolean state = this.enable.getSelection ();

    for ( final Control c : this.controls )
    {
        c.setEnabled ( state );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:10,代碼來源:NgpExportPage.java

示例7: fillComposite

import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
protected void fillComposite (Composite composite) {
	composite.setLayout(new FormLayout());
	
	viewer = createViewer(composite);
	Control control = viewer.getControl();
	control.setEnabled(false);
	
	FormData fd_javaScript = new FormData();
	fd_javaScript.left = new FormAttachment(0, 10);
	fd_javaScript.right = new FormAttachment(100, -5);
	fd_javaScript.top = new FormAttachment(0, 10);
 		setHeight (fd_javaScript, control, 10);
	control.setLayoutData(fd_javaScript);
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:15,代碼來源:EdgeJavaScriptSection.java

示例8: fillComposite

import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
protected void fillComposite (Composite composite) {
	composite.setLayout(new FormLayout());
   
	viewer = ViewerHelper.createEditor(composite);	
	 
	viewer.getControl().setData(WIDGET_ID, WIDGET_SCRIPT);
	FocusListener listener = new FocusListener() {
		@Override
		public void focusGained(FocusEvent e) {
		}

		@Override
		public void focusLost(FocusEvent event) {
			if (!notification) return;
            GW4EVertexEditPartProperties properties = (GW4EVertexEditPartProperties) node.getAdapter(IPropertySource.class);
            if (viewer.getDocument() == null) return;
            String content  = viewer.getDocument().get();
			properties.setPropertyValue(ModelProperties.PROPERTY_VERTEX_INIT, content);
		}
	};
	viewer.getControl().addFocusListener(listener);
	 
	Control control = viewer.getControl();
	control.setEnabled(false);
	
	FormData fd_javaScript = new FormData();
	fd_javaScript.left = new FormAttachment(0, 10);
	fd_javaScript.right = new FormAttachment(100, -5);
	fd_javaScript.top = new FormAttachment(0, 10);
 		setHeight (fd_javaScript, control, 10);
	control.setLayoutData(fd_javaScript);
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:33,代碼來源:VertexInitSection.java

示例9: setEnabled

import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
public void
setEnabled(
	boolean	enabled )
{
	for ( Control c: getControls()){

		c.setEnabled(enabled);
	}
}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:10,代碼來源:Parameter.java

示例10: setRuleGroupEnable

import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
private void setRuleGroupEnable(boolean enabled) {
	if (ruleGroup != null) {
		Control[] controls = ruleGroup.getChildren();
		for (Control c : controls) {
			c.setEnabled(enabled);
		}
	}
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:9,代碼來源:ExportToDatabaseWizardPage.java

示例11: setControlsEnabled

import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
private void setControlsEnabled(List<Control> controls, boolean enabled) {
    for (Control control : controls) {
        control.setEnabled(enabled);
    }
}
 
開發者ID:baloise,項目名稱:eZooKeeper,代碼行數:6,代碼來源:ZnodeModelFileDataEditor.java

示例12: setControlsEnabled

import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
private void setControlsEnabled(boolean enable) {
	for (Control control : controls) {
		control.setEnabled(enable);
	}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:6,代碼來源:RegistrationPage.java

示例13: setDescriptionEnabled

import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
public void setDescriptionEnabled(boolean enabled) {
	Control dcontrol = descriptionBrowser.getControl();
	if (dcontrol != null)
		dcontrol.setEnabled(enabled);
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:6,代碼來源:BaseWizardSelectionPage.java


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