Search in sources :

Example 6 with HasEnabled

use of com.google.gwt.user.client.ui.HasEnabled in project ovirt-engine by oVirt.

the class AbstractUiCommandButton method updateButton.

protected void updateButton() {
    Widget widget = getButtonWidget();
    widget.setVisible(command.getIsAvailable() && command.getIsVisible());
    if (widget instanceof HasEnabled) {
        ((HasEnabled) widget).setEnabled(command.getIsExecutionAllowed());
    }
    String label = getLabel();
    if (command.getTitle() == null) {
        // $NON-NLS-1$
        setLabel("");
    } else if (label != null && label.equals("")) {
        // $NON-NLS-1$
        setLabel(command.getTitle());
    }
}
Also used : HasEnabled(com.google.gwt.user.client.ui.HasEnabled) Widget(com.google.gwt.user.client.ui.Widget)

Example 7 with HasEnabled

use of com.google.gwt.user.client.ui.HasEnabled in project ovirt-engine by oVirt.

the class EntityModelWidgetWithInfo method setEnabled.

@Override
public void setEnabled(boolean enabled) {
    label.setEnabled(enabled);
    if (contentWidget instanceof HasEnabled) {
        HasEnabled enableableWidget = (HasEnabled) this.contentWidget;
        enableableWidget.setEnabled(enabled);
    }
}
Also used : HasEnabled(com.google.gwt.user.client.ui.HasEnabled)

Aggregations

HasEnabled (com.google.gwt.user.client.ui.HasEnabled)7 Widget (com.google.gwt.user.client.ui.Widget)2 HashMap (java.util.HashMap)2 StringListPanel (com.google.gerrit.client.StringListPanel)1 AccessMap (com.google.gerrit.client.access.AccessMap)1 ConfigParameterInfo (com.google.gerrit.client.projects.ConfigInfo.ConfigParameterInfo)1 ConfigParameterValue (com.google.gerrit.client.projects.ConfigInfo.ConfigParameterValue)1 NativeMap (com.google.gerrit.client.rpc.NativeMap)1 NpIntTextBox (com.google.gerrit.client.ui.NpIntTextBox)1 SmallHeading (com.google.gerrit.client.ui.SmallHeading)1 CheckBox (com.google.gwt.user.client.ui.CheckBox)1 IsWidget (com.google.gwt.user.client.ui.IsWidget)1 ListBox (com.google.gwt.user.client.ui.ListBox)1 TextBox (com.google.gwt.user.client.ui.TextBox)1 NpTextBox (com.google.gwtexpui.globalkey.client.NpTextBox)1 Map (java.util.Map)1