use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.
the class InstanceTypeListModel method createWindow.
private void createWindow(VmModelBehaviorBase<UnitVmModel> behavior, String hashName, String onOkAction, boolean isNew, String title, HelpTag helpTag) {
if (getWindow() != null) {
return;
}
UnitVmModel model = new UnitVmModel(behavior, this);
// $NON-NLS-1$
model.setIsAdvancedModeLocalStorageKey("instance_type_dialog");
setWindow(model);
model.setTitle(title);
model.setHelpTag(helpTag);
// $NON-NLS-1$
model.setHashName(hashName);
model.setIsNew(isNew);
model.initialize();
VmBasedWidgetSwitchModeCommand switchModeCommand = new VmBasedWidgetSwitchModeCommand();
switchModeCommand.init(model);
model.getCommands().add(switchModeCommand);
UICommand newTemplate = UICommand.createDefaultOkUiCommand(onOkAction, this);
model.getCommands().add(newTemplate);
// $NON-NLS-1$
UICommand cancel = UICommand.createCancelUiCommand("Cancel", this);
model.getCommands().add(cancel);
}
use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.
the class RoleListModel method remove.
public void remove() {
if (getWindow() != null) {
return;
}
ConfirmationModel model = new ConfirmationModel();
setWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().removeRolesTitle());
model.setHelpTag(HelpTag.remove_role);
// $NON-NLS-1$
model.setHashName("remove_role");
ArrayList<String> list = new ArrayList<>();
for (Role role : getSelectedItems()) {
list.add(role.getName());
}
model.setItems(list);
// $NON-NLS-1$
UICommand tempVar = UICommand.createDefaultOkUiCommand("OnRemove", this);
model.getCommands().add(tempVar);
// $NON-NLS-1$
UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this);
model.getCommands().add(tempVar2);
}
use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.
the class RolePermissionListModel method remove.
private void remove() {
if (getWindow() != null) {
return;
}
ConfirmationModel model = new ConfirmationModel();
setWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().removePermissionTitle());
model.setHelpTag(HelpTag.remove_permission);
// $NON-NLS-1$
model.setHashName("remove_permission");
model.setItems(getSelectedItems());
// $NON-NLS-1$
UICommand tempVar = UICommand.createDefaultOkUiCommand("OnRemove", this);
model.getCommands().add(tempVar);
// $NON-NLS-1$
UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this);
model.getCommands().add(tempVar2);
}
use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.
the class ClusterPolicyListModel method managePolicyUnits.
private void managePolicyUnits() {
if (getWindow() != null) {
return;
}
policyUnitModel = new ManagePolicyUnitModel();
policyUnitModel.setTitle(ConstantsManager.getInstance().getConstants().managePolicyUnits());
policyUnitModel.setHelpTag(HelpTag.manage_policy_units);
// $NON-NLS-1$
policyUnitModel.setHashName("manage_policy_units");
policyUnitModel.setPolicyUnits(new ListModel());
policyUnitModel.getPolicyUnits().setItems(sort(policyUnits));
policyUnitModel.getRefreshPolicyUnitsEvent().addListener((ev, sender, args) -> {
setIsQueryFirstTime(true);
syncSearch();
});
// $NON-NLS-1$
UICommand command = new UICommand("Cancel", this);
command.setTitle(ConstantsManager.getInstance().getConstants().close());
command.setIsCancel(true);
policyUnitModel.getCommands().add(command);
setWindow(policyUnitModel);
}
use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.
the class NewClusterPolicyModel method initCommands.
private void initCommands() {
if (!clusterPolicy.isLocked() || commandType == CommandType.Clone) {
// $NON-NLS-1$
UICommand onSaveCommand = UICommand.createDefaultOkUiCommand("OnSave", this);
getCommands().add(onSaveCommand);
// $NON-NLS-1$
UICommand onResetCommand = new UICommand("OnReset", this);
onResetCommand.setTitle(ConstantsManager.getInstance().getConstants().resetTitle());
getCommands().add(onResetCommand);
}
// $NON-NLS-1$
UICommand cancelCommand = new UICommand("Cancel", this);
cancelCommand.setTitle(!clusterPolicy.isLocked() ? ConstantsManager.getInstance().getConstants().cancel() : ConstantsManager.getInstance().getConstants().close());
cancelCommand.setIsCancel(true);
getCommands().add(cancelCommand);
}
Aggregations