    public MachineImageView() {
        this.setSizeFull();
        VerticalLayout verticalLayout = new VerticalLayout();
        verticalLayout.setSizeFull();
        HorizontalLayout actionButtonHeader = new HorizontalLayout();
        actionButtonHeader.setMargin(true);
        actionButtonHeader.setSpacing(true);
        actionButtonHeader.setWidth("100%");
        actionButtonHeader.setHeight("50px");
        this.registerMachineImageButton = new Button("Register Image...");
        this.registerMachineImageButton.setIcon(new ThemeResource("img/add.png"));
        this.registerMachineImageButton.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                if (MachineImageView.this.machineImageRegisterWizard.init(MachineImageView.this)) {
                    UI.getCurrent().addWindow(MachineImageView.this.machineImageRegisterWizard);
                }
            }
        });
        actionButtonHeader.addComponent(this.registerMachineImageButton);
        this.deleteMachineImageButton = new Button("Delete");
        this.deleteMachineImageButton.setIcon(new ThemeResource("img/delete.png"));
        this.deleteMachineImageButton.setEnabled(false);
        this.deleteMachineImageButton.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                final Set<?> selectedImageIds = (Set<?>) MachineImageView.this.machineImageTable.getValue();
                String name = MachineImageView.this.images.getItem(selectedImageIds.iterator().next()).getBean().getName();
                ConfirmDialog confirmDialog = ConfirmDialog.newConfirmDialogWithOption("Delete Image",
                    "Are you sure you want to delete image " + name + " ?", "delete image on provider",
                    new ConfirmDialog.ConfirmationDialogCallback() {
                        @Override
                        public void response(final boolean ok, final boolean deleteOnProvider) {
                            if (ok) {
                                for (Object id : selectedImageIds) {
                                    try {
                                        if (deleteOnProvider) {
                                            MachineImageView.this.machineImageManager.deleteMachineImage(id.toString());
                                        } else {
                                            MachineImageView.this.machineImageManager.unregisterMachineImage(id.toString());
                                        }
                                    } catch (CloudProviderException e) {
                                        Util.diplayErrorMessageBox("Image delete failure", e);
                                    }
                                }
                                MachineImageView.this.valueChange(null);
                            }
                        }
                    });
                MachineImageView.this.getUI().addWindow(confirmDialog);
            }
        });
        actionButtonHeader.addComponent(this.deleteMachineImageButton);
        Label spacer = new Label();
        spacer.setWidth("100%");
        actionButtonHeader.addComponent(spacer);
        actionButtonHeader.setExpandRatio(spacer, 1.0f);
        Button button = new Button("Refresh", new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                MachineImageView.this.refresh();
            }
        });
        button.setIcon(new ThemeResource("img/refresh.png"));
        actionButtonHeader.addComponent(button);
        verticalLayout.addComponent(actionButtonHeader);
        verticalLayout.addComponent(this.machineImageTable = this.createMachineImageTable());
        verticalLayout.setExpandRatio(this.machineImageTable, 1.0f);
        this.setFirstComponent(verticalLayout);
        this.setSecondComponent(this.detailView = new MachineImageDetailView(this));
        this.setSplitPosition(60.0f);
    }

    public MachineImageView() {
        this.setSizeFull();
        VerticalLayout verticalLayout = new VerticalLayout();
        verticalLayout.setSizeFull();
        HorizontalLayout actionButtonHeader = new HorizontalLayout();
        actionButtonHeader.setMargin(true);
        actionButtonHeader.setSpacing(true);
        actionButtonHeader.setWidth("100%");
        actionButtonHeader.setHeight("50px");
        this.registerMachineImageButton = new Button("Register Image...");
        this.registerMachineImageButton.setIcon(new ThemeResource("img/add.png"));
        this.registerMachineImageButton.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                if (MachineImageView.this.machineImageRegisterWizard.init(MachineImageView.this)) {
                    UI.getCurrent().addWindow(MachineImageView.this.machineImageRegisterWizard);
                }
            }
        });
        actionButtonHeader.addComponent(this.registerMachineImageButton);
        this.deleteMachineImageButton = new Button("Delete");
        this.deleteMachineImageButton.setIcon(new ThemeResource("img/delete.png"));
        this.deleteMachineImageButton.setEnabled(false);
        this.deleteMachineImageButton.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                final Set<?> selectedImageIds = (Set<?>) MachineImageView.this.machineImageTable.getValue();
                StringBuilder sb = new StringBuilder();
                sb.append("Are you sure you want to delete ");
                if (selectedImageIds.size() == 1) {
                    Object id = selectedImageIds.iterator().next();
                    sb.append("image " + MachineImageView.this.images.getItem(id).getBean().getName() + " ?");
                } else {
                    sb.append(" these " + selectedImageIds.size() + " images ?");
                }
                String name = MachineImageView.this.images.getItem(selectedImageIds.iterator().next()).getBean().getName();
                ConfirmDialog confirmDialog = ConfirmDialog.newConfirmDialogWithOption("Delete Image", sb.toString(),
                    "delete image on provider", new ConfirmDialog.ConfirmationDialogCallback() {
                        @Override
                        public void response(final boolean ok, final boolean deleteOnProvider) {
                            if (ok) {
                                for (Object id : selectedImageIds) {
                                    try {
                                        if (deleteOnProvider) {
                                            MachineImageView.this.machineImageManager.deleteMachineImage(id.toString());
                                        } else {
                                            MachineImageView.this.machineImageManager.unregisterMachineImage(id.toString());
                                        }
                                    } catch (CloudProviderException e) {
                                        Util.diplayErrorMessageBox("Image delete failure", e);
                                    }
                                }
                                MachineImageView.this.valueChange(null);
                            }
                        }
                    });
                MachineImageView.this.getUI().addWindow(confirmDialog);
            }
        });
        actionButtonHeader.addComponent(this.deleteMachineImageButton);
        Label spacer = new Label();
        spacer.setWidth("100%");
        actionButtonHeader.addComponent(spacer);
        actionButtonHeader.setExpandRatio(spacer, 1.0f);
        Button button = new Button("Refresh", new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                MachineImageView.this.refresh();
            }
        });
        button.setIcon(new ThemeResource("img/refresh.png"));
        actionButtonHeader.addComponent(button);
        verticalLayout.addComponent(actionButtonHeader);
        verticalLayout.addComponent(this.machineImageTable = this.createMachineImageTable());
        verticalLayout.setExpandRatio(this.machineImageTable, 1.0f);
        this.setFirstComponent(verticalLayout);
        this.setSecondComponent(this.detailView = new MachineImageDetailView(this));
        this.setSplitPosition(60.0f);
    }
