package org.ovirt.engine.ui.webadmin.section.main.view.popup.vm;
import org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel;
import org.ovirt.engine.ui.webadmin.ApplicationConstants;
import org.ovirt.engine.ui.webadmin.ApplicationResources;
import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.vm.VmSnapshotCreatePopupPresenterWidget;
import org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractModelBoundPopupView;
import org.ovirt.engine.ui.webadmin.widget.dialog.SimpleDialogPanel;
import org.ovirt.engine.ui.webadmin.widget.editor.EntityModelTextBoxEditor;
import com.google.gwt.core.client.GWT;
import com.google.gwt.editor.client.SimpleBeanEditorDriver;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Label;
import com.google.inject.Inject;
public class VmSnapshotCreatePopupView extends AbstractModelBoundPopupView<SnapshotModel>
implements VmSnapshotCreatePopupPresenterWidget.ViewDef {
interface Driver extends SimpleBeanEditorDriver<SnapshotModel, VmSnapshotCreatePopupView> {
Driver driver = GWT.create(Driver.class);
}
interface ViewUiBinder extends UiBinder<SimpleDialogPanel, VmSnapshotCreatePopupView> {
ViewUiBinder uiBinder = GWT.create(ViewUiBinder.class);
}
@UiField
@Path(value = "description.entity")
EntityModelTextBoxEditor descriptionEditor;
@UiField
Label message;
@Inject
public VmSnapshotCreatePopupView(EventBus eventBus, ApplicationResources resources, ApplicationConstants constants) {
super(eventBus, resources);
initWidget(ViewUiBinder.uiBinder.createAndBindUi(this));
localize(constants);
Driver.driver.initialize(this);
}
void localize(ApplicationConstants constants) {
descriptionEditor.setLabel(constants.virtualMachineSnapshotCreatePopupDescriptionLabel());
}
@Override
public void edit(SnapshotModel object) {
Driver.driver.edit(object);
}
@Override
public SnapshotModel flush() {
return Driver.driver.flush();
}
@Override
public void focusInput() {
descriptionEditor.setFocus(true);
}
}