Package Messages

Examples of Messages.Password


                OKMessage okm=new OKMessage(mwcMain, "File "+fleOpened.getName()+" was not found!");
                okm.setVisible(true);
                okm=null;
                return;
            }
            Password pcPass=new Password(mwcMain);
            pcPass.setVisible(true);
            if(pcPass.getPassword()!=null)
            {
                mwcMain.CloseDatabase();
                Profile prfMain=(new FileReader(fleOpened)).read(pcPass.getPassword());
                if(prfMain!=null)
                {
                    prfMain.resetModifyed();
                    mwcMain.setProfile(prfMain);
                    mwcMain.setOpenedFile(fleOpened);
                    mwcMain.setPassword(pcPass.getPassword());
                }
                else
                {
                    OKMessage okm=new OKMessage(mwcMain, "Incorrect password or broken file!");
                    okm.setVisible(true);
                    okm=null;
                }
            }
            pcPass.erasePass();
            pcPass=null;
        }
        fdOpen=null;
    }
View Full Code Here


    {
        mwcMain=main;
    }
    public void actionPerformed(ActionEvent e)
    {
        Password pswPass=new Password(mwcMain);
        pswPass.setVisible(true);
        if(pswPass.getPassword()==null)
            return;
        boolean blnEquals=(mwcMain.getPassword().length==pswPass.getPassword().length);
        if(blnEquals)
            for(int i=0; i<mwcMain.getPassword().length; i++)
            {
                blnEquals=(mwcMain.getPassword()[i]==pswPass.getPassword()[i]);
                if(!blnEquals)
                    break;
            }
        if(!blnEquals)
        {
View Full Code Here

        JFileChooser fdCreate=new JFileChooser(strDirrectory);
        fdCreate.addChoosableFileFilter(new FileFilterImpl("vcd", "Virtual cache database"));
        int intResult=fdCreate.showSaveDialog(fdCreate);
        if(intResult==JFileChooser.APPROVE_OPTION)
        {
            Password pcPass=new Password(mwcMain);
            //pcPass.setCheckPasswordStrenght(true);
            pcPass.setVisible(true);
            if(pcPass.getPassword()!=null)
            {
                InputBox inProfile=new InputBox(mwcMain, "Enter the name of this profile:", "The profile name could not be empty!");
                inProfile.setCheckEmpty(true);
                inProfile.setVisible(true);
                if(inProfile.getResult()==null)
                    return;
                Profile prfMain=new Profile(inProfile.getResult());
                inProfile=null;
                FileWriter fwDBWriter;
                if(!fdCreate.getSelectedFile().exists())
                {
                    if((!fdCreate.getSelectedFile().getName().toLowerCase().endsWith(".vcd"))&&(!(new File(fdCreate.getSelectedFile().getName()+".vcd")).exists()))
                        fwDBWriter=new FileWriter(fdCreate.getSelectedFile()+".vcd", prfMain);
                    else
                        fwDBWriter=new FileWriter(fdCreate.getSelectedFile(), prfMain);
                }
                else
                {
                    YesNoCancelMessage ynmDelete=new YesNoCancelMessage(mwcMain, mwcMain.getTitle(), "The file already exists would you like to replace it?", false);
                    ynmDelete.setVisible(true);
                    if(ynmDelete.getResult()==YesNoCancelMessage.NO)
                    {
                        ynmDelete=null;
                        fdCreate=null;
                        return;
                    }
                    fwDBWriter=new FileWriter(fdCreate.getSelectedFile(), prfMain);
                }
                if(!fwDBWriter.write(pcPass.getPassword()))
                {
                    OKMessage okError=new OKMessage(mwcMain, "The error occured while writing the file!");
                    okError.setVisible(true);
                    okError=null;
                }
                else
                {
                    mwcMain.setPassword(pcPass.getPassword());
                    mwcMain.setProfile(prfMain);
                    mwcMain.setOpenedFile(fdCreate.getSelectedFile());
                    IniHolder.WriteValue("DataWorkDir", fdCreate.getSelectedFile().getAbsolutePath());
                }
                fwDBWriter=null;
            }
            pcPass.erasePass();
            pcPass=null;
        }
        fdCreate=null;
        strDirrectory=null;
    }
View Full Code Here

    {
        mwcMain=main;
    }
    public void actionPerformed(ActionEvent e)
    {
        Password pswPass=new Password(mwcMain);
        pswPass.setVisible(true);
        if(pswPass.getPassword()==null)
            return;
        boolean blnEquals=(mwcMain.getPassword().length==pswPass.getPassword().length);
        if(blnEquals)
            for(int i=0; i<mwcMain.getPassword().length; i++)
            {
                blnEquals=(mwcMain.getPassword()[i]==pswPass.getPassword()[i]);
                if(!blnEquals)
                    break;
            }
        if(!blnEquals)
        {
View Full Code Here

        JFileChooser fdCreate=new JFileChooser(strDirrectory);
        fdCreate.addChoosableFileFilter(new FileFilterImpl("vcd", "Virtual cache database"));
        int intResult=fdCreate.showSaveDialog(fdCreate);
        if(intResult==JFileChooser.APPROVE_OPTION)
        {
            Password pcPass=new Password(mwcMain);
            //pcPass.setCheckPasswordStrenght(true);
            pcPass.setVisible(true);
            if(pcPass.getPassword()!=null)
            {
                InputBox inProfile=new InputBox(mwcMain, "Enter the name of this profile:", "The profile name could not be empty!");
                inProfile.setCheckEmpty(true);
                inProfile.setVisible(true);
                if(inProfile.getResult()==null)
                    return;
                Profile prfMain=new Profile(inProfile.getResult());
                inProfile=null;
                FileWriter fwDBWriter;
                if(!fdCreate.getSelectedFile().exists())
                {
                    if((!fdCreate.getSelectedFile().getName().toLowerCase().endsWith(".vcd"))&&(!(new File(fdCreate.getSelectedFile().getName()+".vcd")).exists()))
                        fwDBWriter=new FileWriter(fdCreate.getSelectedFile()+".vcd", prfMain);
                    else
                        fwDBWriter=new FileWriter(fdCreate.getSelectedFile(), prfMain);
                }
                else
                {
                    YesNoCancelMessage ynmDelete=new YesNoCancelMessage(mwcMain, mwcMain.getTitle(), "The file already exists would you like to replace it?", false);
                    ynmDelete.setVisible(true);
                    if(ynmDelete.getResult()==YesNoCancelMessage.NO)
                    {
                        ynmDelete=null;
                        fdCreate=null;
                        return;
                    }
                    fwDBWriter=new FileWriter(fdCreate.getSelectedFile(), prfMain);
                }
                if(!fwDBWriter.write(pcPass.getPassword()))
                {
                    OKMessage okError=new OKMessage(mwcMain, "The error occured while writing the file!");
                    okError.setVisible(true);
                    okError=null;
                }
                else
                {
                    mwcMain.setPassword(pcPass.getPassword());
                    mwcMain.setProfile(prfMain);
                    mwcMain.setOpenedFile(fdCreate.getSelectedFile());
                    IniHolder.WriteValue("DataWorkDir", fdCreate.getSelectedFile().getAbsolutePath());
                }
                fwDBWriter=null;
            }
            pcPass.erasePass();
            pcPass=null;
        }
        fdCreate=null;
        strDirrectory=null;
    }
View Full Code Here

                OKMessage okm=new OKMessage(mwcMain, "File "+fleOpened.getName()+" was not found!");
                okm.setVisible(true);
                okm=null;
                return;
            }
            Password pcPass=new Password(mwcMain);
            pcPass.setVisible(true);
            if(pcPass.getPassword()!=null)
            {
                mwcMain.CloseDatabase();
                Profile prfMain=(new FileReader(fleOpened)).read(pcPass.getPassword());
                if(prfMain!=null)
                {
                    prfMain.resetModifyed();
                    mwcMain.setProfile(prfMain);
                    mwcMain.setOpenedFile(fleOpened);
                    mwcMain.setPassword(pcPass.getPassword());
                }
                else
                {
                    OKMessage okm=new OKMessage(mwcMain, "Incorrect password or broken file!");
                    okm.setVisible(true);
                    okm=null;
                }
            }
            pcPass.erasePass();
            pcPass=null;
        }
        fdOpen=null;
    }
View Full Code Here

TOP

Related Classes of Messages.Password

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.