Search in sources :

Example 1 with CheckModulePanel

use of org.jetbrains.android.exportSignedPackage.CheckModulePanel in project android by JetBrains.

the class GenerateSignedApkAction method checkFacet.

private static boolean checkFacet(@NotNull AndroidFacet facet) {
    final CheckModulePanel panel = new CheckModulePanel();
    panel.updateMessages(facet);
    final boolean hasError = panel.hasError();
    if (hasError || panel.hasWarnings()) {
        DialogWrapper dialog = new DialogWrapper(facet.getModule().getProject()) {

            {
                if (!hasError) {
                    setOKButtonText("Continue");
                }
                init();
            }

            @NotNull
            @Override
            protected Action[] createActions() {
                if (hasError) {
                    return new Action[] { getOKAction() };
                }
                return super.createActions();
            }

            @Override
            protected JComponent createCenterPanel() {
                return panel;
            }
        };
        dialog.setTitle(hasError ? CommonBundle.getErrorTitle() : CommonBundle.getWarningTitle());
        dialog.show();
        return !hasError && dialog.isOK();
    }
    return true;
}
Also used : CheckModulePanel(org.jetbrains.android.exportSignedPackage.CheckModulePanel) AnAction(com.intellij.openapi.actionSystem.AnAction) DialogWrapper(com.intellij.openapi.ui.DialogWrapper)

Aggregations

AnAction (com.intellij.openapi.actionSystem.AnAction)1 DialogWrapper (com.intellij.openapi.ui.DialogWrapper)1 CheckModulePanel (org.jetbrains.android.exportSignedPackage.CheckModulePanel)1