Package org.apache.directory.ldapstudio.browser.ui

Examples of org.apache.directory.ldapstudio.browser.ui.ExceptionHandler


                            out.flush();
                            out.close();
                        }
                        catch ( FileNotFoundException e )
                        {
                            new ExceptionHandler().handleException( new Status( IStatus.ERROR,
                                BrowserUIPlugin.PLUGIN_ID, IStatus.ERROR, "Can't write to file", e ) );
                        }
                        catch ( IOException e )
                        {
                            new ExceptionHandler().handleException( new Status( IStatus.ERROR,
                                BrowserUIPlugin.PLUGIN_ID, IStatus.ERROR, "Can't write to file", e ) );
                        }
                    }
                }
            } );
View Full Code Here


                    out.flush();
                    out.close();
                }
                catch ( FileNotFoundException e )
                {
                    new ExceptionHandler().handleException( new Status( IStatus.ERROR, BrowserUIPlugin.PLUGIN_ID,
                        IStatus.ERROR, "Can't write to file", e ) );
                }
                catch ( IOException e )
                {
                    new ExceptionHandler().handleException( new Status( IStatus.ERROR, BrowserUIPlugin.PLUGIN_ID,
                        IStatus.ERROR, "Can't write to file", e ) );
                }
            }
        }
        else if ( buttonId == LOAD_BUTTON_ID )
        {
            FileDialog fileDialog = new FileDialog( getShell(), SWT.OPEN );
            fileDialog.setText( "Load Data" );
            String returnedFileName = fileDialog.open();
            if ( returnedFileName != null )
            {
                try
                {
                    File file = new File( returnedFileName );
                    FileInputStream in = new FileInputStream( file );
                    ByteArrayOutputStream out = new ByteArrayOutputStream( ( int ) file.length() );
                    byte[] buf = new byte[4096];
                    int len;
                    while ( ( len = in.read( buf ) ) > 0 )
                    {
                        out.write( buf, 0, len );
                    }
                    this.currentData = out.toByteArray();
                    hexText.setText( toFormattedHex( this.currentData ) );
                    out.close();
                    in.close();
                }
                catch ( FileNotFoundException e )
                {
                    new ExceptionHandler().handleException( new Status( IStatus.ERROR, BrowserUIPlugin.PLUGIN_ID,
                        IStatus.ERROR, "Can't read file", e ) );
                }
                catch ( IOException e )
                {
                    new ExceptionHandler().handleException( new Status( IStatus.ERROR, BrowserUIPlugin.PLUGIN_ID,
                        IStatus.ERROR, "Can't read file", e ) );
                }
            }
        }
        else
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.browser.ui.ExceptionHandler

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.