Package com.lightcrafts.platform

Examples of com.lightcrafts.platform.AlertDialog


    /**
     * Show the user a dialog telling him/her to upgrade the installed Java
     * version, then quit.
     */
    private static void showUpgradeJavaDialogAndQuit() {
        final AlertDialog dialog = Platform.getPlatform().getAlertDialog();
        dialog.showAlert(
            null, LOCALE.get( "UpgradeJavaErrorMajor" ),
            LOCALE.get( "UpgradeJavaErrorMinor" ),
            AlertDialog.ERROR_ALERT, LOCALE.get( "QuitButton" )
        );
        System.exit( 0 );
View Full Code Here


* dialogs to ask about overwrite and to report errors.
*/
class FileActions {

    static void deleteFiles(File[] files, Component parent) {
        AlertDialog alert = Platform.getPlatform().getAlertDialog();
        Frame frame = (Frame) SwingUtilities.getAncestorOfClass(
            Frame.class, parent
        );
        StringBuilder info = new StringBuilder();
        String message;
        if (files.length > 1) {
            message = LOCALE.get("DeleteQuestionPlural", Integer.toString(files.length));
        }
        else {
            message = LOCALE.get("DeleteQuestionSingular", files[0].getName());
        }
        String okButton = LOCALE.get("DeleteButton");
        String cancelButton = LOCALE.get("CancelButton");
        int option = alert.showAlert(
            frame, message, info.toString(),
            AlertDialog.WARNING_ALERT,
            okButton, cancelButton
        );
        if (option == 0) {
            Platform platform = Platform.getPlatform();
            for (File file : files) {
                String path = file.getAbsolutePath();
                boolean deleted;
                try {
                    ImageInfo.closeAll();
                    deleted = platform.moveFilesToTrash(new String[] { path });
                }
                catch (IOException e) {
                    deleted = false;
                }
                if (! deleted) {
                    String error =
                        LOCALE.get("DeleteFailed", file.getName());
                    option = alert.showAlert(
                        frame, error, "", AlertDialog.ERROR_ALERT,
                        LOCALE.get( "ContinueButton" ),
                        LOCALE.get( "CancelButton" )
                    );
                    if (option > 0) {
View Full Code Here

        if ( "ESD".equals( licenseType ) )
            licenseChecker = new ESDLicenseCheckerModule();
        else if ( "TB".equals( licenseType ) )
            licenseChecker = new ExpirationLicenseCheckerModule();
        else {
            final AlertDialog dialog = Platform.getPlatform().getAlertDialog();
            dialog.showAlert(
                null, LOCALE.get( "NoLicenseTypeDefinedMajor" ),
                LOCALE.get( "NoLicenseTypeDefinedMinor" ),
                AlertDialog.ERROR_ALERT,
                LOCALE.get( "QuitButton" )
            );
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public boolean showDeactivateDialog() {
        final AlertDialog dialog = Platform.getPlatform().getAlertDialog();
        final int button = dialog.showAlert(
            null,
            LOCALE.get( "DeactivateQuestionMajor" ),
            LOCALE.get( "DeactivateQuestionMinor" ), AlertDialog.WARNING_ALERT,
            LOCALE.get( "CancelButton" ), LOCALE.get( "DeactivateButton" )
        );
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void showErrorAlert( String errorMessage, boolean isFatal ) {
        final AlertDialog dialog = Platform.getPlatform().getAlertDialog();
        dialog.showAlert(
            null, errorMessage, null, AlertDialog.ERROR_ALERT,
            isFatal ? LOCALE.get( "QuitButton" ) : LOCALE.get( "OKButton" )
        );
    }
View Full Code Here

                                       ESDLicenseDialogs dialogs ) {
        if ( lib.isKeyValid( key ) )
            return true;
        if ( key.startsWith( "0101605001" ) ||  // LZ 1.x
             key.startsWith( "LZRT" ) || key.startsWith( "LZ2" ) ) {
            final AlertDialog dialog = Platform.getPlatform().getAlertDialog();
            final int button = dialog.showAlert(
                null,
                LOCALE.get( "Pre3SNErrorMajor" ),
                LOCALE.get( "Pre3SNErrorMinor" ),
                AlertDialog.ERROR_ALERT,
                LOCALE.get( "BuyNowButton" ),
View Full Code Here

            dialogs.showErrorAlert(
                LOCALE.get( "LC_WRITE_LICENSE_KEY_FAILED" ), false
            );
            return false;
        }
        final AlertDialog dialog = Platform.getPlatform().getAlertDialog();
        dialog.showAlert(
            null, LOCALE.get( "ActivationSucceededMajor" ),
            LOCALE.get( "ActivationSucceededMinor" ),
            AlertDialog.WARNING_ALERT, LOCALE.get( "OKButton" )
        );
        return true;
View Full Code Here

    public static void checkNowAndWait() {
        //
        // First, check to see if the computer has an internet connection.
        //
        if ( !hasInternetConnection() ) {
            final AlertDialog alert = Platform.getPlatform().getAlertDialog();
            alert.showAlert(
                null,
                LOCALE.get( "NoInternetConnectionErrorMajor" ),
                LOCALE.get( "NoInternetConnectionErrorMinor" ),
                AlertDialog.ERROR_ALERT,
                LOCALE.get( "CheckForUpdateOKButton" )
            );
            return;
        }

        //
        // Second, check to see if we previosuly determined that an update was
        // available.  If so, we don't need to check again.
        //
        if ( isUpdateAvailable( true ) ) {
            showDownloadNowOrCancelAlert();
            return;
        }

        //
        // Finally, put up a ProgressDialog and check to see if there is an
        // update available.
        //
        final ProgressDialog progress =
            Platform.getPlatform().getProgressDialog();
        final SynchronousCheckThread checkThread =
            new SynchronousCheckThread( progress );
        progress.showProgress(
            null, checkThread, LOCALE.get( "CheckingForUpdateMessage" ), false
        );
        final Throwable t = progress.getThrown();
        if ( t != null ) {
            final AlertDialog alert = Platform.getPlatform().getAlertDialog();
            alert.showAlert(
                null,
                LOCALE.get( "CheckingForUpdateProblem" ),
                t.getLocalizedMessage(),
                AlertDialog.ERROR_ALERT,
                LOCALE.get( "CheckForUpdateOKButton" )
View Full Code Here

    /**
     * Shows an alert to the user indicating that a new version is available.
     * This method is used by the synchronous check mechamism.
     */
    private static void showDownloadNowOrCancelAlert() {
        final AlertDialog alert = Platform.getPlatform().getAlertDialog();
        final int button = alert.showAlert(
            null, getUpdateIsAvailableMessage(),
            null, AlertDialog.WARNING_ALERT,
            LOCALE.get( "DownloadNowButton" ),
            LOCALE.get( "DownloadCancelButton" )
        );
View Full Code Here

    /**
     * Shows an alert to the user indicating that a new version is available.
     * This method is used by the asynchronous check mechanism.
     */
    private static void showDownloadNowOrLaterAlert() {
        final AlertDialog alert = Platform.getPlatform().getAlertDialog();
        final int button = alert.showAlert(
            null, getUpdateIsAvailableMessage(),
            null, AlertDialog.WARNING_ALERT,
            LOCALE.get( "DownloadNowButton" ),
            LOCALE.get( "RemindMeLaterButton" ),
            LOCALE.get( "DontRemindMeButton" )
View Full Code Here

TOP

Related Classes of com.lightcrafts.platform.AlertDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.