本文整理汇总了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 ();
}
示例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);
}
}
}
示例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);
}
}
示例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 ();
}
示例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 ();
}
示例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 );
}
}
示例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);
}
示例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);
}
示例9: setEnabled
import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
public void
setEnabled(
boolean enabled )
{
for ( Control c: getControls()){
c.setEnabled(enabled);
}
}
示例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);
}
}
}
示例11: setControlsEnabled
import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
private void setControlsEnabled(List<Control> controls, boolean enabled) {
for (Control control : controls) {
control.setEnabled(enabled);
}
}
示例12: setControlsEnabled
import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
private void setControlsEnabled(boolean enable) {
for (Control control : controls) {
control.setEnabled(enable);
}
}
示例13: setDescriptionEnabled
import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
public void setDescriptionEnabled(boolean enabled) {
Control dcontrol = descriptionBrowser.getControl();
if (dcontrol != null)
dcontrol.setEnabled(enabled);
}