Examples of JXErrorPane


Examples of org.jdesktop.swingx.JXErrorPane

    container.add(component);
  }

  public static void showErrorMessage(final String shortMessage, final String detailedMessage, final Throwable exception) {
    JXErrorPane.setDefaultLocale(Locale.ENGLISH);
    final JXErrorPane errorPane = new JXErrorPane();
    final ErrorInfo info = new ErrorInfo(shortMessage, detailedMessage, null, "error", exception, ErrorLevel.SEVERE,
        null);
    errorPane.setErrorInfo(info);
    final JDialog dialog = JXErrorPane.createDialog(null, errorPane);
    centerOnScreen(dialog);
    dialog.setLocale(Locale.ENGLISH);
    dialog.setModal(true);
    dialog.setTitle(shortMessage);
View Full Code Here

Examples of org.jdesktop.swingx.JXErrorPane

        installListeners();

        //if the report action needs to be defined, do so
        Action a = c.getActionMap().get(JXErrorPane.REPORT_ACTION_KEY);
        if (a == null) {
            final JXErrorPane pane = (JXErrorPane)c;
            AbstractActionExt reportAction = new AbstractActionExt() {
                public void actionPerformed(ActionEvent e) {
                    ErrorReporter reporter = pane.getErrorReporter();
                    if (reporter != null) {
                        reporter.reportError(pane.getErrorInfo());
                    }
                }
            };
            configureReportAction(reportAction);
            c.getActionMap().put(JXErrorPane.REPORT_ACTION_KEY, reportAction);
View Full Code Here

Examples of org.jdesktop.swingx.JXErrorPane

                if (activeWindow != null)
                    parent = activeWindow.getControl();
            }
        }

        JXErrorPane pane = new JXErrorPane();
        pane.setErrorInfo(errorInfo);
        pane.setErrorReporter(new JdicEmailNotifierErrorReporter());

        JXErrorPane.showDialog(parent, pane);
    }
View Full Code Here

Examples of org.jdesktop.swingx.JXErrorPane

      CommonUtilities.initializeWaitDialogBoxMessage();
        FrameFactory.disposeFrame(FrameFactory.waitDialogFrameSetId,null);
    }

    public static void showErrorDialogForComponent(final JComponent component,final SwingObjectsException e, SwingObjectsException... additionalErrors){
      JXErrorPane errorPane=new JXErrorPane();
      String detailedMessage=null;
      if(additionalErrors!=null && additionalErrors.length>0) {
        StringBuilder builder=new StringBuilder("<html>");
        builder.append(e.getDetailedMessage(false,true));
        for(SwingObjectsException error : additionalErrors) {
          builder.append(error.getDetailedMessage(false,true));
          builder.append("<br/>");
        }
        builder.append("</html>");
        detailedMessage=builder.toString();
      }else {
        detailedMessage=e.getDetailedMessage(false);
      }
      errorPane.setFont(new Font(Font.SANS_SERIF,Font.PLAIN,13));
      errorPane.setErrorInfo(new ErrorInfo(e.getErrorType().toString(), e.getDetailedMessage(true),
          detailedMessage, null, e, e.getErrorType().getJavaLoggingLevel(), null));
      errorPane.setPreferredSize(new Dimension(CommonUI.getFractionedWidth(35), CommonUI.getFractionedHeight(22)));
      JXErrorPane.showFrame(null, errorPane);
    }
View Full Code Here

Examples of org.jdesktop.swingx.JXErrorPane

        ErrorInfo errorInfo = new ErrorInfo(
                resolveExceptionCaption(throwable),
                (String) createExceptionContent(throwable),
                getDetailsAsHTML(throwable.getMessage(), logLevel, throwable),
                null, throwable, logLevel.getJdkLogLevel(), null);
        JXErrorPane pane = new JXErrorPane();
        pane.setErrorInfo(errorInfo);
        if (errorReporter != null) {
            pane.setErrorReporter(errorReporter);
        }

        JXErrorPane.showDialog(resolveParentFrame(), pane);
    }
View Full Code Here

Examples of org.jdesktop.swingx.JXErrorPane

   */
  @Override
  public void notifyUserAboutException( Thread thread, Throwable throwable ) {
    try {
      ErrorInfo errorInfo = new ErrorInfo( resolveExceptionCaption( throwable ), ( String ) createExceptionContent( throwable ), getDetailsAsHTML( throwable.getMessage(), resolveMessageType(), throwable ), null, throwable, resolveMessageType(), null );
      JXErrorPane pane = new JXErrorPane();
      pane.setErrorInfo( errorInfo );
      if ( errorReporter != null ) {
        pane.setErrorReporter( errorReporter );
      }

      JXErrorPane.showDialog( resolveParentFrame(), pane );
    } catch ( Exception e ) {
      System.err.println( "---------------" );
View Full Code Here

Examples of org.jdesktop.swingx.JXErrorPane

                pos= 1;
                tipoComando = SHELL;
            }
            else {
                //JOptionPane.showMessageDialog(menuItem, "Tipo de comando desconocido::" + comando);
                JXErrorPane panel = new JXErrorPane();
                panel.setErrorInfo(new ErrorInfo("Error ejecucion comando"//
                        , "Tipo de comando desconocido::" + comando//
                        , null, null, null, Level.CONFIG, null));
                panel.setPreferredSize(new Dimension(500,200));
                JXErrorPane.showDialog(menuItem, panel);
                return;
            }
           
            ElementoOrigenComando elementoOrigenComando = new ElementoOrigenComando(objetoSeleccionadoRecibo);
            //CARGA DE PARAMETROS
            for(String parametro: menuItem.getParametros() ){
                if(parametro.equals("PREVIA") ) {
                    File fd = repositorio.getFicheroRevisionAnterior(elementoOrigenComando.getPath()
                            , elementoOrigenComando.getRevision());
                    if( fd != null ) {
                        parametros[pos++] = fd.getAbsolutePath();
                        getLogger().log("PREVIA:>" + fd.getAbsolutePath());
                    }
                }
                else if(parametro.equals("HEAD")) {
                    File fd = getFichero( elementoOrigenComando.getPath() );
                    if( fd != null ) {
                        parametros[pos++] = fd.getAbsolutePath();
                        getLogger().log("HEAD:>" +fd.getAbsolutePath());
                    }
                }
                else if(parametro.equals("COMMIT")) {
                    File fd = repositorio.getFichero(elementoOrigenComando.getPath()
                            , elementoOrigenComando.getRevision());
                    if( fd != null ) {
                        parametros[pos++] = fd.getAbsolutePath();
                        getLogger().log("COMMIT:>" +fd.getAbsolutePath());
                    }
                }
                else if(parametro.equals("LOG")) {
                    SVNLogEntrada logEntrada = getListaLogEntrada(elementoOrigenComando.getPath(), elementoOrigenComando.getRevision());
                    if( logEntrada != null ) {
                        if( tipoComando == JAVA ) {
                            parametros[pos++] = logEntrada.getMensaje();
                        }
                        else {
                            File fd = UtilFichero.crearFicheroTemporal("svn", ".tmp");
                            try
                            {
                                fd.deleteOnExit();
                                FileWriter fstream = new FileWriter(fd);
                                BufferedWriter out = new BufferedWriter(fstream);
                                out.write(logEntrada.getMensaje());
                                out.close();
                            }
                            catch (Exception e){
                              System.err.println("Error: " + e.getMessage());
                            }
                            parametros[pos++] = fd.getAbsolutePath();
                        }
                    }
                }
                else {
                    parametros[pos++] = parametro;
                }
            }
            System.out.println(parametros);
           
           
            if( tipoComando == JAVA ) {
                Class classPlugin =  getClass().getClassLoader().loadClass(classNamePlugin);
                SVNPlugin plugin = (SVNPlugin)classPlugin.newInstance();
                plugin.ejecutar(this, objetoSeleccionadoRecibo, parametros);
            }
            else if( tipoComando == SHELL  ) {
                Runtime runTime = Runtime.getRuntime();
                Process proceso = runTime.exec(parametros);
            }
            else {
                JOptionPane.showMessageDialog(menuItem, "Tipo de comando desconocido::" + comando);
            }
        }
        catch(Exception exception) {
            JXErrorPane panel = new JXErrorPane();
            panel.setErrorInfo(new ErrorInfo("Error ejecucion comando"//
                    , "Se ha produccido un error al intentar ejecutar un comando"//
                    , null, null, exception, Level.SEVERE, null));
            panel.setPreferredSize(new Dimension(500,200));
            JXErrorPane.showDialog(menuItem, panel);
        }
    }
View Full Code Here

Examples of org.jdesktop.swingx.JXErrorPane

   * Shows the {@link org.jdesktop.swingx.JXErrorPane} to the user.
   */
  @Override
  public void notifyUserAboutException( Thread thread, Throwable throwable ) {
    ErrorInfo errorInfo = new ErrorInfo( resolveExceptionCaption( throwable ), ( String ) createExceptionContent( throwable ), getDetailsAsHTML( throwable.getMessage(), resolveMessageType(), throwable ), null, throwable, resolveMessageType(), null );
    JXErrorPane pane = new JXErrorPane();
    pane.setErrorInfo( errorInfo );
    if ( errorReporter != null ) {
      pane.setErrorReporter( errorReporter );
    }

    JXErrorPane.showDialog( resolveParentFrame(), pane );
  }
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.