本文整理匯總了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);
}