Package org.eclipse.jface.dialogs

Examples of org.eclipse.jface.dialogs.MessageDialog


            // Checking if we are already in the LDAP perspective
            if ( ( ldapPerspective != null ) && ( ldapPerspective.equals( currentPerspective ) ) )
            {
                // As we're already in the LDAP perspective, we only indicate to the user
                // the name of the connection that has been created
                MessageDialog dialog = new MessageDialog( window.getShell(), "Connection created", null,
                    "A connection called '" + connection.getName() + "' has been created.", MessageDialog.INFORMATION,
                    new String[]
                        { IDialogConstants.OK_LABEL }, MessageDialog.OK );
                dialog.open();
            }
            else
            {
                // We're not already in the LDAP perspective, we indicate to the user
                // the name of the connection that has been created and we ask him
                // if we wants to switch to the LDAP perspective
                MessageDialog dialog = new MessageDialog( window.getShell(), "Connection created", null,
                    "A connection called '" + connection.getName()
                        + "' has been created.\n\nDo you want to switch to the LDAP perspective ?",
                    MessageDialog.INFORMATION, new String[]
                        { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, MessageDialog.OK );
                if ( dialog.open() == MessageDialog.OK )
                {
                    // Switching to the LDAP perspective
                    window.getActivePage().setPerspective( ldapPerspective );
                }
            }
View Full Code Here


                    }

                    message += ApacheDsPluginUtils.LINE_SEPARATOR + ApacheDsPluginUtils.LINE_SEPARATOR
                        + "Do you wish to continue?";

                    MessageDialog dialog = new MessageDialog( view.getSite().getShell(), title, null, message,
                        MessageDialog.WARNING, new String[]
                            { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, MessageDialog.OK );
                    if ( dialog.open() == MessageDialog.CANCEL )
                    {
                        return;
                    }
                }
View Full Code Here

        {
            message = "Unable to read the server configuration." + ApacheDsPluginUtils.LINE_SEPARATOR
                + ApacheDsPluginUtils.LINE_SEPARATOR + "The following error occurred: " + errorMessage;
        }

        MessageDialog dialog = new MessageDialog( view.getSite().getShell(), "Unable to read the server configuration",
            null, message, MessageDialog.ERROR, new String[]
                { IDialogConstants.OK_LABEL }, MessageDialog.OK );
        dialog.open();
    }
View Full Code Here

        String testPassword = testPasswordText.getText();
        if ( currentPassword != null )
        {
            if ( currentPassword.verify( testPassword ) )
            {
                MessageDialog dialog = new MessageDialog( getShell(), "Password Verification", getShell().getImage(),
                    "Password verified sucessfully", MessageDialog.INFORMATION, new String[]
                        { IDialogConstants.OK_LABEL }, 0 );
                dialog.open();
            }
            else
            {
                MessageDialog dialog = new MessageDialog( getShell(), "Password Verification", getShell().getImage(),
                    "Password verification failed", MessageDialog.ERROR, new String[]
                        { IDialogConstants.OK_LABEL }, 0 );
                dialog.open();
            }
        }
    }
View Full Code Here

                final File externalFile = new File( path );
                if ( externalFile.exists() )
                {
                    String question = "The file '" + path
                        + "' already exists. Do you want to replace the existing file?";
                    MessageDialog overwriteDialog = new MessageDialog( shell, "Question", null, question,
                        MessageDialog.QUESTION, new String[]
                            { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 0 );
                    int overwrite = overwriteDialog.open();
                    switch ( overwrite )
                    {
                        case 0: // Yes
                            canOverwrite = true;
                            break;
View Full Code Here

            // Check whether file exists and if so, confirm overwrite
            final File externalFile = new File( path );
            if ( externalFile.exists() )
            {
                MessageDialog overwriteDialog = new MessageDialog( shell, "Overwrite", null, "Overwrite?",
                    MessageDialog.WARNING, new String[]
                        { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 1 ); // 'No' is the default
                if ( overwriteDialog.open() != Window.OK )
                {
                    if ( progressMonitor != null )
                    {
                        progressMonitor.setCanceled( true );
                        return;
View Full Code Here

        String testPassword = testPasswordText.getText();
        if ( currentPassword != null )
        {
            if ( currentPassword.verify( testPassword ) )
            {
                MessageDialog dialog = new MessageDialog( getShell(), "Password Verification", getShell().getImage(),
                    "Password verified sucessfully", MessageDialog.INFORMATION, new String[]
                        { IDialogConstants.OK_LABEL }, 0 );
                dialog.open();
            }
            else
            {
                MessageDialog dialog = new MessageDialog( getShell(), "Password Verification", getShell().getImage(),
                    "Password verification failed", MessageDialog.ERROR, new String[]
                        { IDialogConstants.OK_LABEL }, 0 );
                dialog.open();
            }
        }
    }
View Full Code Here

                    createConnection( server, serverConfiguration );
                }
                else
                {
                    // LDAP and LDAPS protocols are disabled, we report this error to the user
                    MessageDialog dialog = new MessageDialog( view.getSite().getShell(),
                        Messages.getString( "CreateConnectionAction.UnableCreateConnection" ), null, //$NON-NLS-1$
                        Messages.getString( "CreateConnectionAction.LDAPAndLDAPSDisabled" ), MessageDialog.ERROR, //$NON-NLS-1$
                        new String[]
                            { IDialogConstants.OK_LABEL }, MessageDialog.OK );
                    dialog.open();
                }
            }
        }
    }
View Full Code Here

     * @param message
     *      the message
     */
    public static void openErrorDialog( String title, String message )
    {
        MessageDialog dialog = new MessageDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
            title, null, message, MessageDialog.ERROR, new String[]
                { IDialogConstants.OK_LABEL }, MessageDialog.OK );
        dialog.open();
    }
View Full Code Here

     * @param message
     *      the message
     */
    private void reportErrorReadingServerConfiguration( ServersView view, String message )
    {
        MessageDialog dialog = new MessageDialog( view.getSite().getShell(),
            Messages.getString( "CreateConnectionAction.UnableReadServerConfiguration" ), //$NON-NLS-1$
            null, message, MessageDialog.ERROR, new String[]
                { IDialogConstants.OK_LABEL }, MessageDialog.OK );
        dialog.open();
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.dialogs.MessageDialog

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.