Examples of AlertDialog


Examples of com.lightcrafts.platform.AlertDialog

            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

Examples of com.lightcrafts.platform.AlertDialog

    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

Examples of com.lightcrafts.platform.AlertDialog

    /**
     * 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

Examples of com.lightcrafts.platform.AlertDialog

    /**
     * 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

Examples of com.lightcrafts.platform.AlertDialog

    /**
     * Shows an alert to the user indicating that no update is available.
     */
    private static void showNoUpdateIsAvailableAlert() {
        final AlertDialog alert = Platform.getPlatform().getAlertDialog();
        alert.showAlert(
            null,
            LOCALE.get( "NoUpdateIsAvailableMessage" ), null,
            AlertDialog.WARNING_ALERT,
            LOCALE.get( "CheckForUpdateOKButton" )
        );
View Full Code Here

Examples of com.lightcrafts.platform.AlertDialog

                        },
                        LOCALE.get("AutoSaveSaveOption"), 3
                    );
                    if (check.isSelected()) {
                        prefs.putBoolean("AutoSave", true);
                        AlertDialog alert =
                            Platform.getPlatform().getAlertDialog();
                        alert.showAlert(
                            this,
                            LOCALE.get("AutoSaveOnMessageMajor"),
                            LOCALE.get("AutoSaveOnMessageMinor"),
                            AlertDialog.WARNING_ALERT,
                            LOCALE.get("AutoSaveOnButton")
View Full Code Here

Examples of com.lightcrafts.platform.AlertDialog

    }

    // Conduct the dialog to accept a new color profile.
    public void actionPerformed(ActionEvent event) {
        FileChooser chooser = Platform.getPlatform().getFileChooser();
        AlertDialog alert = Platform.getPlatform().getAlertDialog();
        String path;
        if (text.isEnabled()) {
            path = text.getText();
        }
        else {
            path = System.getProperty("user.home");
        }
        File file = new File(path);
        file = chooser.openFile(
            "Display Color Profile", file, null, null
        );
        if (file != null) {
            if (! file.isFile()) {
                alert.showAlert(
                    null,
                    '\"' + file.getName() + "\" is not a file.",
                    "A color profile is a file, " +
                    "usually ending with \".icc\" or \".icm\".",
                    AlertDialog.WARNING_ALERT,
                    "OK"
                );
                return;
            }
            try {
                ICC_Profile.getInstance(file.getAbsolutePath());
            }
            catch (IOException e) {
                alert.showAlert(
                    null,
                    '\"' + file.getName() + "\" could not be read.",
                    e.getClass().getName() + ": " + e.getMessage(),
                    AlertDialog.WARNING_ALERT,
                    "OK"
                );
                return;
            }
            catch (IllegalArgumentException e) {
                alert.showAlert(
                    null,
                    '\"' + file.getName() + "\" is not a valid color profile.",
                    e.getClass().getName() + ": " + e.getMessage(),
                    AlertDialog.WARNING_ALERT,
                    "OK"
                );
                return;
            }
            path = file.getAbsolutePath();
            text.setText(path);
            text.setEnabled(true);
            alert.showAlert(
                null,
                "Display color profile \"" + file.getName() + "\" accepted.",
                "You must now restart LightZone for your new display " +
                "profile to take effect.",
                AlertDialog.WARNING_ALERT,
View Full Code Here

Examples of com.lightcrafts.platform.AlertDialog

        public void actionPerformed(ActionEvent event) {
            Frame parent = (Frame) SwingUtilities.getAncestorOfClass(
                Frame.class, this
            );
            AlertDialog alert = Platform.getPlatform().getAlertDialog();
            int option = alert.showAlert(
                parent,
                LOCALE.get("BrowserCacheItemClearWarningMajor"),
                LOCALE.get("BrowserCacheItemClearWarningMinor"),
                AlertDialog.WARNING_ALERT,
                LOCALE.get( "BrowserCacheItemClearOption" ),
                LOCALE.get( "BrowserCacheItemCancelOption" )
            );
            if (option != 0) {
                return;
            }
            try {
                FileCache cache = FileCacheFactory.getGlobalCache();
                if (cache != null) {
                    cache.clear();
                }
                else {
                    throw new IOException("Global cache does not exist");
                }
            }
            catch (IOException e) {
                alert.showAlert(
                    parent,
                    LOCALE.get("BrowserCacheItemError"),
                    e.getMessage(),
                    AlertDialog.ERROR_ALERT,
                    new String[] { LOCALE.get("BrowserCacheItemErrorButton") }
View Full Code Here

Examples of megamek.client.ui.AWT.AlertDialog

            ce().setSecondaryFacing(ce().getFacing());
            clientgui.bv.redrawEntity(ce());
            turnMode = false;
        } else if(ce().isBoardProhibited(client.game.getBoard().getType())) {
            //check if this type of unit can be on the given type of map
            AlertDialog dlg = new AlertDialog(clientgui.frame,
                    Messages.getString("DeploymentDisplay.alertDialog.title"), //$NON-NLS-1$
                    Messages
                            .getString(
                                    "DeploymentDisplay.wrongMapType", new Object[] { ce().getShortName(), Board.getTypeName(client.game.getBoard().getType()) })); //$NON-NLS-1$
            dlg.setVisible(true);
            return;
        } else if (!(client.game.getBoard().isLegalDeployment(moveto,
                ce().getOwner()) || assaultDropPreference)
                || ce().isHexProhibited(client.game.getBoard().getHex(moveto))) {
            JOptionPane
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.