Search in sources :

Example 1 with NewPoolModelBehavior

use of org.ovirt.engine.ui.uicommonweb.models.vms.NewPoolModelBehavior in project ovirt-engine by oVirt.

the class PoolListModel method newEntity.

public void newEntity() {
    if (getWindow() != null) {
        return;
    }
    PoolModel model = new PoolModel(new NewPoolModelBehavior());
    model.setIsNew(true);
    model.setCustomPropertiesKeysList(AsyncDataProvider.getInstance().getCustomPropertiesList());
    // $NON-NLS-1$
    model.setIsAdvancedModeLocalStorageKey("wa_pool_dialog");
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().newPoolTitle());
    model.setHelpTag(HelpTag.new_pool);
    // $NON-NLS-1$
    model.setHashName("new_pool");
    model.getVmType().setSelectedItem(VmType.Desktop);
    model.initialize();
    VmBasedWidgetSwitchModeCommand switchModeCommand = new VmBasedWidgetSwitchModeCommand();
    switchModeCommand.init(model);
    model.getCommands().add(switchModeCommand);
    // $NON-NLS-1$
    UICommand command = UICommand.createDefaultOkUiCommand("OnSave", this);
    model.getCommands().add(command);
    // $NON-NLS-1$
    model.getCommands().add(UICommand.createCancelUiCommand("Cancel", this));
}
Also used : NewPoolModelBehavior(org.ovirt.engine.ui.uicommonweb.models.vms.NewPoolModelBehavior) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) VmBasedWidgetSwitchModeCommand(org.ovirt.engine.ui.uicommonweb.models.vms.VmBasedWidgetSwitchModeCommand)

Aggregations

UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)1 NewPoolModelBehavior (org.ovirt.engine.ui.uicommonweb.models.vms.NewPoolModelBehavior)1 VmBasedWidgetSwitchModeCommand (org.ovirt.engine.ui.uicommonweb.models.vms.VmBasedWidgetSwitchModeCommand)1