当前位置: 首页>>代码示例>>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;未经允许,请勿转载。