Package org.jdesktop.swingx.error

Examples of org.jdesktop.swingx.error.ErrorInfo


    public static void main(String args[]) {
        try {
            Configuracao.getInstance();
        } catch (Exception ex) {
            ErrorInfo info = new ErrorInfo("Erro", ex.getMessage(), null, "category", ex, Level.SEVERE, null);
            JXErrorPane.showDialog(null, info);
        }
        EventQueue.invokeLater(new Runnable() {

            @Override
View Full Code Here


                        projetoDAO.connect();
                        projetoDAO.delete(projetoDAO.find(projeto.getId()));
                        projetoDAO.close();
                    }
                } catch (Exception ex) {
                    ErrorInfo info = new ErrorInfo("Erro", ex.getMessage(), null, "category", ex, Level.SEVERE, null);
                    JXErrorPane.showDialog(null, info);
                }
            }
        });
        menuTree.setInvoker(treeNavigator);
        menuTree.add(miExcluir);
        treeNavigator.remove(menuTree);
        treeNavigator.add(menuTree);


        treeNavigator.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseReleased(MouseEvent e) {
                if (e.getClickCount() == 1) {
                    switch (e.getButton()) {
                        case MouseEvent.BUTTON1: {
                            if (treeNavigator.getLastSelectedPathComponent() != null) {
                                String noSelecionado = ((IconNode) treeNavigator.getLastSelectedPathComponent()).toString();
                                IconNode no = ((IconNode) treeNavigator.getLastSelectedPathComponent());

                                if (noSelecionado.equals("Projeto")) {
                                    ProjetoPresenter projetoPresenter = new ProjetoPresenter(Main.this);
                                    projetoPresenter.setStrategy(new EdicaoProjeto(projeto.getId(), projetoPresenter.getView()));
                                    activePanel(projetoPresenter.getView());
                                } else if ((((ImageIcon) no.getIcon()).getDescription().contains("cenario2.png"))) {
                                    CenarioVolume cenario = projeto.getCenarioById(no.getId());
                                    CenarioVolumePresenter presenterEditaCenario = new CenarioVolumePresenter(Main.this);
                                    removeFrameVolume();
                                    presenterEditaCenario.setStrategy(new EdicaoCenario(projeto.getId(), cenario.getId(), presenterEditaCenario.getView()));
                                    activePanel(presenterEditaCenario.getView());
                                } else {
                                    desktop.removeAll();
                                    desktop.updateUI();
                                }
                                treeNavigator.updateUI();
                                treeNavigator.expandPath(treeNavigator.getLeadSelectionPath());
                                break;
                            }
                        }
                        default: {
                            if (e.isPopupTrigger() && projeto != null) {
                                noSelecionado = ((IconNode) treeNavigator.getLastSelectedPathComponent());
                                JMenuItem miExcluirCenario = new JMenuItem("Excluir cenário", new ImageIcon(Configuracao.getPath() + "images/deleteCenario.png"));
                                miExcluirCenario.addActionListener(new ActionListener() {

                                    @Override
                                    public void actionPerformed(ActionEvent e) {
                                        try {
                                            projetoDAO.connect();
                                            projeto.removeCenario(noSelecionado.toString());
                                            removeFrameVolume();
                                            projetoDAO.update(projeto, false, projeto.getId());
                                            state.updateTreeModel();
                                            projetoDAO.close();
                                        } catch (Exception ex) {
                                            ErrorInfo info = new ErrorInfo("Erro", ex.getMessage(), null, "category", ex, Level.SEVERE, null);
                                            JXErrorPane.showDialog(null, info);
                                        }
                                    }
                                });
View Full Code Here

                frame.setVisible(true);
                frame.setMaximizable(true);
                frame.setMaximum(true);
            }
        } catch (PropertyVetoException ex) {
            ErrorInfo info = new ErrorInfo("Erro", ex.getMessage(), null, "category", ex, Level.SEVERE, null);
            JXErrorPane.showDialog(Main.this, info);
        }
    }
View Full Code Here

                }
            }


        } catch (Exception ex) {
            ErrorInfo info = new ErrorInfo("Erro", ex.getMessage(), null, "category", ex, Level.SEVERE, null);
            JXErrorPane.showDialog(Main.this, info);
        }
    }
View Full Code Here

    private void mantemModelos() {
        try {
            new ModelosPresenter();
        } catch (Exception ex) {
            ErrorInfo info = new ErrorInfo("Erro", ex.getMessage(), null, "category", ex, Level.SEVERE, null);
            JXErrorPane.showDialog(null, info);
        }
    }
View Full Code Here

    private void fechar() {
        try {
            state.fechar();
        } catch (IOException ex) {
            ErrorInfo info = new ErrorInfo("Erro", ex.getMessage(), null, "category", ex, Level.SEVERE, null);
            JXErrorPane.showDialog(Main.this, info);
        }
    }
View Full Code Here

                    try {
                        cenario.addColumnData(coluna);
                        carregaColunasProjeto();
                        System.out.println();
                    } catch (Exception ex) {
                        ErrorInfo info = new ErrorInfo("Erro", ex.getMessage(), null, "category", ex, Level.SEVERE, null);
                        JXErrorPane.showDialog(view, info);

                    }
                }
            }
View Full Code Here

            @Override
            public void actionPerformed(ActionEvent e) {
                try {
                    duplicaColecao();
                } catch (Exception ex) {
                    ErrorInfo info = new ErrorInfo("Erro", ex.getMessage(), null, "category", ex, Level.SEVERE, null);
                    JXErrorPane.showDialog(null, info);
                }
            }
        });
View Full Code Here

  /**
   * 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 );
    }
View Full Code Here

            @Override
            public void actionPerformed(ActionEvent e) {
                try {
                    strategy.salvarProjeto(main);
                } catch (Exception ex) {
                    ErrorInfo info = new ErrorInfo("Erro", ex.getMessage(), null, "category", ex, Level.SEVERE, null);
                    JXErrorPane.showDialog(null, info);
                }
            }
        });
View Full Code Here

TOP

Related Classes of org.jdesktop.swingx.error.ErrorInfo

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.