use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.
the class VncConsoleModel method connect.
@Override
protected void connect() {
if (getEntity() == null || getEntity().getRunOnVds() == null) {
return;
}
// $NON-NLS-1$
getLogger().debug("VNC console info...");
UICommand invokeConsoleCommand = new UICommand("invokeConsoleCommand", new // $NON-NLS-1$
BaseCommandTarget() {
@Override
public void executeCommand(UICommand uiCommand) {
invokeConsole();
}
});
executeCommandWithConsoleSafenessWarning(invokeConsoleCommand);
}
use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.
the class ClusterPopupPresenterWidget method init.
@Override
public void init(final ClusterModel model) {
super.init(model);
model.getPropertyChangedEvent().addListener((ev, sender, args) -> {
String propName = args.propertyName;
if ("AllowClusterWithVirtGlusterEnabled".equals(propName)) {
// $NON-NLS-1$
getView().allowClusterWithVirtGlusterEnabled(model.getAllowClusterWithVirtGlusterEnabled());
}
});
String spiceProxyInConfig = (String) AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigValues.SpiceProxyDefault);
String spiceProxyMessage = StringHelper.isNullOrEmpty(spiceProxyInConfig) ? messages.noSpiceProxyDefined() : spiceProxyInConfig;
getView().setSpiceProxyOverrideExplanation(messages.consoleOverrideSpiceProxyMessage(messages.consoleOverrideDefinedInGlobalConfig(), spiceProxyMessage));
getModel().getVersion().getSelectedItemChangedEvent().addListener((ev, sender, args) -> {
final Version selectedVersion = getModel().getVersion().getSelectedItem();
if (selectedVersion == null) {
return;
}
if (AsyncDataProvider.getInstance().isMigrationPoliciesSupported(selectedVersion)) {
getView().getMigrationBandwidthLimitTypeEditor().setEnabled(true);
updateCustomMigrationBandwidthLimitEnabledState(model, null);
} else {
final String supportedVersions = String.join(", ", // $NON-NLS-1$
AsyncDataProvider.getInstance().getMigrationPoliciesSupportedVersions());
final String message = messages.onlyAvailableInCompatibilityVersions(supportedVersions);
getView().getMigrationBandwidthLimitTypeEditor().disable(message);
getView().getMigrationBandwidthLimitTypeEditor().setEnabled(false);
updateCustomMigrationBandwidthLimitEnabledState(model, message);
}
});
getModel().getMigrationBandwidthLimitType().getSelectedItemChangedEvent().addListener((ev, sender, args) -> updateCustomMigrationBandwidthLimitEnabledState(model, null));
model.getMacPoolModel().getEntityChangedEvent().addListener((ev, sender, args) -> getView().updateMacPool(model.getMacPoolModel()));
final UICommand addMacPoolCommand = model.getAddMacPoolCommand();
if (addMacPoolCommand == null) {
getView().makeMacPoolButtonInvisible();
} else {
getView().getMacPoolButton().setCommand(addMacPoolCommand);
registerHandler(getView().getMacPoolButton().addClickHandler(event -> getView().getMacPoolButton().getCommand().execute(model)));
}
}
use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.
the class GuidePopupView method updateActionsPanels.
private void updateActionsPanels(GuideModel<?> object) {
compulsoryActionsPanel.clear();
optionalActionsPanel.clear();
for (final UICommand command : object.getCompulsoryActions()) {
addButton(command, compulsoryActionsPanel, IconType.WRENCH);
}
for (final UICommand command : object.getOptionalActions()) {
addButton(command, optionalActionsPanel, IconType.PLUS);
}
}
use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.
the class SplitTable method addClickHandler.
private void addClickHandler(final boolean excludedTableIsSource) {
getButton(excludedTableIsSource).addClickHandler(event -> {
MultiSelectionModel<T> sourceSelectionModel = getSelectionModel(excludedTableIsSource);
UICommand command = excludedTableIsSource ? onIncludeButtonPressed : onExcludeButtonPressed;
if (command != null) {
command.execute();
}
Set<T> selectedItems = sourceSelectionModel.getSelectedSet();
if (excludedTableIsSource) {
includeItems(selectedItems, true);
} else {
excludeItems(selectedItems, true);
}
});
}
use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.
the class HostListModel method addInstallCommands.
private void addInstallCommands(InstallModel model, VDS host, boolean isOnlyClose) {
if (!isOnlyClose) {
// $NON-NLS-1$
UICommand command = UICommand.createDefaultOkUiCommand("OnInstall", this);
model.getCommands().add(command);
}
model.getUserName().setEntity(host.getSshUsername());
// $NON-NLS-1$
UICommand command = new UICommand("Cancel", this);
command.setTitle(isOnlyClose ? ConstantsManager.getInstance().getConstants().close() : ConstantsManager.getInstance().getConstants().cancel());
command.setIsCancel(true);
model.getCommands().add(command);
}
Aggregations