Search in sources :

Example 1 with InfoDialogType

use of org.eclipse.kapua.app.console.client.widget.dialog.InfoDialog.InfoDialogType in project kapua by eclipse.

the class DeviceTabPackages method openUninstallDialog.

private void openUninstallDialog() {
    final GwtDeploymentPackage selectedDeploymentPackage = installedPackageTab.getSelectedDeploymentPackage();
    if (selectedDeploymentPackage != null) {
        toolBar.disable();
        final PackageUninstallDialog packageUninstallDialog = new PackageUninstallDialog(selectedDevice.getScopeId(), selectedDevice.getId(), selectedDeploymentPackage);
        packageUninstallDialog.addListener(Events.Hide, new Listener<BaseEvent>() {

            @Override
            public void handleEvent(BaseEvent be) {
                toolBar.enable();
                Boolean exitStatus = packageUninstallDialog.getExitStatus();
                if (exitStatus == null) {
                    // Operation Aborted
                    return;
                } else {
                    InfoDialogType exitDialogType;
                    String exitMessage = packageUninstallDialog.getExitMessage();
                    if (exitStatus == true) {
                        // Operation Success
                        exitDialogType = InfoDialogType.INFO;
                    } else {
                        // Operaton Failed
                        exitDialogType = InfoDialogType.ERROR;
                    }
                    // 
                    // Exit dialog
                    InfoDialog exitDialog = new InfoDialog(exitDialogType, exitMessage);
                    exitDialog.show();
                    m_uninstallButton.disable();
                    m_deviceTabs.setDevice(selectedDevice);
                }
            }
        });
        packageUninstallDialog.show();
    }
}
Also used : InfoDialogType(org.eclipse.kapua.app.console.client.widget.dialog.InfoDialog.InfoDialogType) GwtDeploymentPackage(org.eclipse.kapua.app.console.shared.model.GwtDeploymentPackage) InfoDialog(org.eclipse.kapua.app.console.client.widget.dialog.InfoDialog) BaseEvent(com.extjs.gxt.ui.client.event.BaseEvent)

Example 2 with InfoDialogType

use of org.eclipse.kapua.app.console.client.widget.dialog.InfoDialog.InfoDialogType in project kapua by eclipse.

the class DeviceTabPackages method openInstallDialog.

// 
// ACTIONS DIALOGS
// 
private void openInstallDialog() {
    toolBar.disable();
    final PackageInstallDialog packageInstallDialog = new PackageInstallDialog(selectedDevice.getScopeId(), selectedDevice.getId());
    packageInstallDialog.addListener(Events.Hide, new Listener<BaseEvent>() {

        @Override
        public void handleEvent(BaseEvent be) {
            toolBar.enable();
            Boolean exitStatus = packageInstallDialog.getExitStatus();
            if (exitStatus == null) {
                // Operation Aborted
                return;
            } else {
                InfoDialogType exitDialogType;
                String exitMessage = packageInstallDialog.getExitMessage();
                if (exitStatus == true) {
                    // Operation Success
                    exitDialogType = InfoDialogType.INFO;
                } else {
                    // Operaton Failed
                    exitDialogType = InfoDialogType.ERROR;
                }
                // 
                // Exit dialog
                InfoDialog exitDialog = new InfoDialog(exitDialogType, exitMessage);
                exitDialog.show();
                m_uninstallButton.disable();
                m_deviceTabs.setDevice(selectedDevice);
            }
        }
    });
    packageInstallDialog.show();
}
Also used : InfoDialogType(org.eclipse.kapua.app.console.client.widget.dialog.InfoDialog.InfoDialogType) InfoDialog(org.eclipse.kapua.app.console.client.widget.dialog.InfoDialog) BaseEvent(com.extjs.gxt.ui.client.event.BaseEvent)

Aggregations

BaseEvent (com.extjs.gxt.ui.client.event.BaseEvent)2 InfoDialog (org.eclipse.kapua.app.console.client.widget.dialog.InfoDialog)2 InfoDialogType (org.eclipse.kapua.app.console.client.widget.dialog.InfoDialog.InfoDialogType)2 GwtDeploymentPackage (org.eclipse.kapua.app.console.shared.model.GwtDeploymentPackage)1