Example usage for java.beans PropertyVetoException printStackTrace

List of usage examples for java.beans PropertyVetoException printStackTrace

Introduction

In this page you can find the example usage for java.beans PropertyVetoException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:Main.java

public void setInterest(double interest) {
    try {/*from  ww w .j a va 2 s  .  c  o  m*/
        vcs.fireVetoableChange("interest", new Double(this.interest), new Double(interest));
        this.interest = interest;
    } catch (PropertyVetoException e) {
        e.printStackTrace();
    }
}

From source file:test.other.T_Dao.java

public void setup() {

    try {//  w  w w  .  ja v  a 2 s.co m
        Class.forName("org.postgresql.Driver");
        String url = "jdbc:postgresql://localhost:5432/free-choice-v1";
        String url1 = "jdbc:postgresql://localhost:5432/test";
        conn = DriverManager.getConnection(url, "bcgh2013", "2013.bcgh.start");

        ComboPooledDataSource cpds = new ComboPooledDataSource();
        try {
            cpds.setDriverClass("org.postgresql.Driver");
        } catch (PropertyVetoException e) {
            e.printStackTrace();
        }
        cpds.setJdbcUrl("jdbc:postgresql://localhost:5432/free-choice-v1");
        cpds.setUser("bcgh2013");
        cpds.setPassword("2013.bcgh.start");
        cpds.setMinPoolSize(5);
        cpds.setAcquireIncrement(5);
        cpds.setMaxPoolSize(80);
        dataSource = cpds;

        jdbcTemplate = new JdbcTemplate(dataSource, false);

    } catch (Exception e) {
        e.printStackTrace();
    }

}

From source file:com.joliciel.jochre.JochreServiceLocator.java

private DataSource getDataSource() {
    if (dataSource == null) {
        Properties props = this.getDataSourceProperties();
        if (props != null) {
            ComboPooledDataSource ds = new ComboPooledDataSource();
            try {
                ds.setDriverClass(props.getProperty("jdbc.driverClassName"));
            } catch (PropertyVetoException e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            }/*  www.j  a va2  s. c  o  m*/
            ds.setJdbcUrl(props.getProperty("jdbc.url"));
            ds.setUser(props.getProperty("jdbc.username"));
            ds.setPassword(props.getProperty("jdbc.password"));
            dataSource = ds;
        }
    }
    return dataSource;
}

From source file:KjellDirdalNotepad.java

private void buildChildMenus() {
    int i;/* w ww.  j a  v  a  2 s  . c om*/
    ChildMenuItem menu;
    JInternalFrame[] array = desktop.getAllFrames();

    add(cascade);
    add(tile);
    if (array.length > 0)
        addSeparator();
    cascade.setEnabled(array.length > 0);
    tile.setEnabled(array.length > 0);

    for (i = 0; i < array.length; i++) {
        menu = new ChildMenuItem(array[i]);
        menu.setState(i == 0);
        menu.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                JInternalFrame frame = ((ChildMenuItem) ae.getSource()).getFrame();
                frame.moveToFront();
                try {
                    frame.setSelected(true);
                } catch (PropertyVetoException e) {
                    e.printStackTrace();
                }
            }
        });
        menu.setIcon(array[i].getFrameIcon());
        add(menu);
    }
}

From source file:com.tag.FramePreferences.java

@SuppressWarnings("serial")
public FramePreferences(final JInternalFrame frame, String pathName) {
    setFrame(new Frame() {

        @Override//from   w  w w.ja  v a2s  .  c  om
        public synchronized int getExtendedState() {
            if (frame.isMaximum()) {
                return Frame.MAXIMIZED_BOTH;
            } else if (frame.isIcon()) {
                return Frame.ICONIFIED;
            } else {
                return Frame.NORMAL;
            }
        }

        @Override
        public synchronized void setExtendedState(int state) {
            try {
                switch (state) {
                case Frame.MAXIMIZED_HORIZ:
                case Frame.MAXIMIZED_VERT:
                case Frame.MAXIMIZED_BOTH:
                    frame.setMaximum(true);
                    break;
                case Frame.ICONIFIED:
                    frame.setIcon(true);
                    break;
                case Frame.NORMAL:
                    frame.setIcon(false);
                    frame.setMaximum(false);
                    break;
                }
            } catch (PropertyVetoException e) {
                e.printStackTrace();
            }
        }

        @Override
        public synchronized void addWindowStateListener(final WindowStateListener l) {
            final Frame source = this;
            frame.addInternalFrameListener(new InternalFrameAdapter() {

                @Override
                public void internalFrameIconified(InternalFrameEvent e) {
                    l.windowStateChanged(new WindowEvent(source, WindowEvent.WINDOW_ICONIFIED));
                }

                @Override
                public void internalFrameDeiconified(InternalFrameEvent e) {
                    l.windowStateChanged(new WindowEvent(source, WindowEvent.WINDOW_DEICONIFIED));
                }

            });
        }

        @Override
        public synchronized void removeWindowStateListener(WindowStateListener l) {
            super.removeWindowStateListener(l);
        }

        @Override
        public GraphicsConfiguration getGraphicsConfiguration() {
            return frame.getGraphicsConfiguration();
        }

        public Point getLocation() {
            return frame.getLocation();
        }

        @Override
        public void setLocation(Point p) {
            frame.setLocation(p);
        }

        @Override
        public Dimension getSize() {
            return frame.getSize();
        }

        @Override
        public void setSize(Dimension size) {
            frame.setSize(size);
        }

        @Override
        public synchronized void addComponentListener(ComponentListener l) {
            frame.addComponentListener(l);
        }

        @Override
        public synchronized void removeComponentListener(ComponentListener l) {
            frame.addComponentListener(l);
        }

    });
    setPathName(pathName);
}

From source file:org.opencastproject.ingest.endpoint.IngestRestServiceTest.java

public void setupAndTestLimit(String limit, int expectedLimit, boolean expectedEnabled) {
    try {//from ww  w.j a  v  a  2  s.co  m
        setupPooledDataSource();
    } catch (PropertyVetoException e) {
        e.printStackTrace();
    }

    Map<String, Object> props = setupPersistenceProperties();

    restService = new IngestRestService();
    restService.setPersistenceProvider(new PersistenceProvider());
    restService.setPersistenceProperties(props);

    // Create a mock ingest service
    IngestService ingestService = EasyMock.createNiceMock(IngestService.class);
    ComponentContext cc = EasyMock.createNiceMock(ComponentContext.class);
    BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
    EasyMock.expect(cc.getBundleContext()).andReturn(bc).anyTimes();
    EasyMock.replay(cc);
    EasyMock.expect(bc.getProperty(IngestRestService.DEFAULT_WORKFLOW_DEFINITION)).andReturn("full").anyTimes();
    if (StringUtils.trimToNull(limit) != null) {
        EasyMock.expect(bc.getProperty(IngestRestService.MAX_INGESTS_KEY)).andReturn(limit).anyTimes();
    }
    EasyMock.replay(bc);
    restService.setIngestService(ingestService);
    restService.activate(cc);
    Assert.assertEquals(expectedLimit, restService.getIngestLimit());
    Assert.assertEquals(expectedEnabled, restService.isIngestLimitEnabled());
}

From source file:op.care.sysfiles.PnlFiles.java

private CollapsiblePane addCommands() {
    JPanel mypanel = new JPanel();
    mypanel.setLayout(new VerticalLayout());
    mypanel.setBackground(Color.WHITE);

    CollapsiblePane cmdPane = new CollapsiblePane(SYSTools.xx(internalClassID));
    cmdPane.setStyle(CollapsiblePane.PLAIN_STYLE);
    cmdPane.setCollapsible(false);/*www . j  a v  a 2s  .com*/

    try {
        cmdPane.setCollapsed(false);
    } catch (PropertyVetoException e) {
        e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
    }

    mypanel.add(GUITools.getDropPanel(new FileDrop.Listener() {
        public void filesDropped(java.io.File[] files) {
            java.util.List<SYSFiles> successful = SYSFilesTools.putFiles(files, resident);
            if (!successful.isEmpty()) {
                OPDE.getDisplayManager().addSubMessage(new DisplayMessage(successful.size() + " "
                        + SYSTools.xx("misc.msg.Files") + " " + SYSTools.xx("misc.msg.added")));
            }
            reloadTable();
        }
    }));

    cmdPane.setContentPane(mypanel);
    return cmdPane;
}

From source file:net.sf.jabref.model.entry.BibtexEntry.java

/**
 * Sets this entry's type./*from   w  ww.ja  v a 2  s .  c o m*/
 */
public void setType(EntryType type) {
    Objects.requireNonNull(type, "Every BibtexEntry must have a type.");

    EntryType oldType = this.type;

    try {
        // We set the type before throwing the changeEvent, to enable
        // the change listener to access the new value if the change
        // sets off a change in database sorting etc.
        this.type = type;
        firePropertyChangedEvent(TYPE_HEADER, oldType != null ? oldType.getName() : null, type.getName());
    } catch (PropertyVetoException pve) {
        pve.printStackTrace();
    }

}

From source file:com.joliciel.talismane.terminology.postgres.PostGresTerminologyBase.java

public PostGresTerminologyBase(String projectCode, Properties connectionProperties) {
    this.projectCode = projectCode;

    ComboPooledDataSource ds = new ComboPooledDataSource();
    try {//from   w  ww  .ja  v a2s  .  c o  m
        ds.setDriverClass(connectionProperties.getProperty("jdbc.driverClassName"));
    } catch (PropertyVetoException e) {
        e.printStackTrace();
        throw new RuntimeException(e);
    }
    ds.setJdbcUrl(connectionProperties.getProperty("jdbc.url"));
    ds.setUser(connectionProperties.getProperty("jdbc.username"));
    ds.setPassword(connectionProperties.getProperty("jdbc.password"));
    dataSource = ds;
}

From source file:canreg.client.gui.components.FastFilterInternalFrame.java

/** This method is called from within the constructor to
 * initialize the form.//from w ww .  j ava2  s.co  m
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jPanel1 = new javax.swing.JPanel();
    instructionLabel1 = new javax.swing.JLabel();
    instructionLabel2 = new javax.swing.JLabel();
    variableComboBox = new javax.swing.JComboBox();
    operationComboBox = new javax.swing.JComboBox();
    logicalOperatorComboBox = new javax.swing.JComboBox();
    variableLabel = new javax.swing.JLabel();
    operationLabel = new javax.swing.JLabel();
    valueLabel = new javax.swing.JLabel();
    valuesSplitPane = new javax.swing.JSplitPane();
    valueTextField = new javax.swing.JTextField();
    valueTextField2 = new javax.swing.JTextField();
    jLabel1 = new javax.swing.JLabel();
    filterPanel = new javax.swing.JPanel();
    scrollPane = new javax.swing.JScrollPane();
    textPane = new javax.swing.JTextPane();
    cancelButton = new javax.swing.JButton();
    okButton = new javax.swing.JButton();

    setMaximizable(true);
    setResizable(true);
    org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application
            .getInstance(canreg.client.CanRegClientApp.class).getContext()
            .getResourceMap(FastFilterInternalFrame.class);
    setTitle(resourceMap.getString("Form.title")); // NOI18N
    setFrameIcon(resourceMap.getIcon("Form.frameIcon")); // NOI18N
    setName("Form"); // NOI18N
    try {
        setSelected(true);
    } catch (java.beans.PropertyVetoException e1) {
        e1.printStackTrace();
    }

    jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
    jPanel1.setName("jPanel1"); // NOI18N

    instructionLabel1.setText(resourceMap.getString("instructionLabel1.text")); // NOI18N
    instructionLabel1.setName("instructionLabel1"); // NOI18N

    instructionLabel2.setText(resourceMap.getString("instructionLabel2.text")); // NOI18N
    instructionLabel2.setName("instructionLabel2"); // NOI18N

    variableComboBox.setModel(
            new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
    javax.swing.ActionMap actionMap = org.jdesktop.application.Application
            .getInstance(canreg.client.CanRegClientApp.class).getContext()
            .getActionMap(FastFilterInternalFrame.class, this);
    variableComboBox.setAction(actionMap.get("varibleChosenAction")); // NOI18N
    variableComboBox.setName("variableComboBox"); // NOI18N
    variableComboBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            variableComboBoxActionPerformed(evt);
        }
    });

    operationComboBox.setModel(
            new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
    operationComboBox.setAction(actionMap.get("operatorSelected")); // NOI18N
    operationComboBox.setName("operationComboBox"); // NOI18N

    logicalOperatorComboBox.setModel(
            new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
    logicalOperatorComboBox.setAction(actionMap.get("operatorAction")); // NOI18N
    logicalOperatorComboBox.setName("logicalOperatorComboBox"); // NOI18N

    variableLabel.setText(resourceMap.getString("variableLabel.text")); // NOI18N
    variableLabel.setName("variableLabel"); // NOI18N

    operationLabel.setText(resourceMap.getString("operationLabel.text")); // NOI18N
    operationLabel.setName("operationLabel"); // NOI18N

    valueLabel.setText(resourceMap.getString("valueLabel.text")); // NOI18N
    valueLabel.setName("valueLabel"); // NOI18N

    valuesSplitPane.setResizeWeight(0.5);
    valuesSplitPane.setName("valuesSplitPane"); // NOI18N

    valueTextField.setText(resourceMap.getString("valueTextField.text")); // NOI18N
    valueTextField.setAction(actionMap.get("addAction")); // NOI18N
    valueTextField.setName("valueTextField"); // NOI18N
    valueTextField.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            mouseClickHandler(evt);
        }
    });
    valuesSplitPane.setLeftComponent(valueTextField);

    valueTextField2.setAction(actionMap.get("addAction")); // NOI18N
    valueTextField2.setName("valueTextField2"); // NOI18N
    valueTextField2.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            valueTextField2mouseClickHandler(evt);
        }
    });
    valuesSplitPane.setRightComponent(valueTextField2);

    jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
    jLabel1.setName("jLabel1"); // NOI18N

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(instructionLabel1)
            .addComponent(instructionLabel2)
            .addGroup(jPanel1Layout.createSequentialGroup()
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(variableComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 115,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(variableLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(operationLabel).addComponent(operationComboBox,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addComponent(valuesSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 269,
                                            Short.MAX_VALUE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                            .addGroup(jPanel1Layout.createSequentialGroup().addComponent(valueLabel).addGap(246,
                                    246, 246)))
                    .addGroup(
                            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(logicalOperatorComboBox, 0,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addComponent(instructionLabel1)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(instructionLabel2)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(valueLabel).addComponent(operationLabel).addComponent(jLabel1)
                            .addComponent(variableLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(logicalOperatorComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(variableComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(operationComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(valuesSplitPane, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));

    filterPanel.setBorder(
            javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("filterPanel.border.title"))); // NOI18N
    filterPanel.setName("filterPanel"); // NOI18N

    scrollPane.setName("scrollPane"); // NOI18N

    textPane.setToolTipText(resourceMap.getString("textPane.toolTipText")); // NOI18N
    textPane.setName("textPane"); // NOI18N
    textPane.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mousePressed(java.awt.event.MouseEvent evt) {
            textPaneMousePressed(evt);
        }
    });
    scrollPane.setViewportView(textPane);

    javax.swing.GroupLayout filterPanelLayout = new javax.swing.GroupLayout(filterPanel);
    filterPanel.setLayout(filterPanelLayout);
    filterPanelLayout
            .setHorizontalGroup(filterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 535, Short.MAX_VALUE));
    filterPanelLayout
            .setVerticalGroup(filterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE));

    cancelButton.setAction(actionMap.get("cancelAction")); // NOI18N
    cancelButton.setToolTipText(resourceMap.getString("cancelButton.toolTipText")); // NOI18N
    cancelButton.setName("cancelButton"); // NOI18N

    okButton.setAction(actionMap.get("okAction")); // NOI18N
    okButton.setToolTipText(resourceMap.getString("okButton.toolTipText")); // NOI18N
    okButton.setName("okButton"); // NOI18N

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
            javax.swing.GroupLayout.Alignment.TRAILING,
            layout.createSequentialGroup().addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(filterPanel, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup().addComponent(cancelButton)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(okButton))
                            .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE))
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
            javax.swing.GroupLayout.Alignment.TRAILING,
            layout.createSequentialGroup().addContainerGap()
                    .addComponent(filterPanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 97,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(okButton).addComponent(cancelButton))
                    .addContainerGap()));

    pack();
}