當前位置: 首頁>>代碼示例>>Java>>正文


Java PropertyVetoException.getMessage方法代碼示例

本文整理匯總了Java中java.beans.PropertyVetoException.getMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java PropertyVetoException.getMessage方法的具體用法?Java PropertyVetoException.getMessage怎麽用?Java PropertyVetoException.getMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.beans.PropertyVetoException的用法示例。


在下文中一共展示了PropertyVetoException.getMessage方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: readObject

import java.beans.PropertyVetoException; //導入方法依賴的package包/類
/** Initializes the root of FS.
*/
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
    //ois.defaultReadObject ();
    ObjectInputStream.GetField fields = ois.readFields();
    URL[] urls = (URL[]) fields.get("urlsToXml", null); // NOI18N

    if (urls == null) {
        urls = new URL[1];
        urls[0] = (URL) fields.get("uriId", null); // NOI18N
        if (urls[0] == null) {
            throw new IOException("missing uriId"); // NOI18N
        }
    }

    try {
        setXmlUrls(urls);
    } catch (PropertyVetoException ex) {
        IOException x = new IOException(ex.getMessage());
        ExternalUtil.copyAnnotation(x, ex);
        throw x;
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:24,代碼來源:XMLFileSystem.java

示例2: readObject

import java.beans.PropertyVetoException; //導入方法依賴的package包/類
/** Initializes the root of FS.
*/
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
    ois.defaultReadObject();
    closeSync = new Object();
    strongCache = null;
    softCache = new SoftReference<Cache>(null);
    aliveCount = 0;

    try {
        setJarFile(root);
    } catch (PropertyVetoException ex) {
        throw new IOException(ex.getMessage());
    } catch (IOException iex) {
        ExternalUtil.log(iex.getLocalizedMessage());
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:JarFileSystem.java

示例3: FileSelector

import java.beans.PropertyVetoException; //導入方法依賴的package包/類
/**
     * @param title is a title of the dialog
     * @param rootLabel label for the root node
     * @param root the base object to start browsing from
     * @param acceptor decides whether we have valid selection or not
     * @param top is a <code>Component</code> we just place on the top of the dialog
     * it can be <code>null</code>
     */
    public FileSelector ( String rootLabel, Node root, final NodeAcceptor acceptor, Component top) {
        super ();

        this.acceptor = acceptor;
        
        ResourceBundle bundle = NbBundle.getBundle(FileSelector.class);


        okButton = new JButton(bundle.getString("CTL_FileSelectorOkButton"));
        cancelButton = new JButton(bundle.getString("CTL_FileSelectorCancelButton"));
        okButton.getAccessibleContext().setAccessibleDescription(bundle.getString ("ACSD_FileSelectorOkButton"));
        cancelButton.getAccessibleContext().setAccessibleDescription(bundle.getString ("ACSD_FileSelectorCancelButton"));
        buttons = new JButton[] { okButton, cancelButton };
        

        manager.setRootContext (root);//s[0]);
        
        // Center
        tree = new BeanTreeView () {
            {
                tree.setCellEditor(null);
                tree.setEditable(false);
            }
        };
        tree.setPopupAllowed (false);
        tree.setDefaultActionAllowed (false);
        // install proper border for tree
        tree.setBorder((Border)UIManager.get("Nb.ScrollPane.border")); // NOI18N
        tree.getAccessibleContext().setAccessibleName(NbBundle.getBundle(FileSelector.class).getString("ACSN_FileSelectorTreeView"));
        tree.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(FileSelector.class).getString("ACSD_FileSelectorTreeView"));
        this.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(FileSelector.class).getString("ACSD_FileSelectorDialog"));
        setLayout(new BorderLayout());
        add(tree, BorderLayout.CENTER);

        // component to place at the top
        try {
                manager.setSelectedNodes (new Node[] { root });
                JLabel label = new JLabel();
                Mnemonics.setLocalizedText(label, rootLabel);
                label.setLabelFor(tree.getViewport().getView());
                add(label, BorderLayout.NORTH);
        } catch(PropertyVetoException pve) {
            throw new IllegalStateException(pve.getMessage());
        }



        // South
        if (top != null) {
            add(top, BorderLayout.SOUTH);
        }

        manager.addPropertyChangeListener (this);

//        if (top != null) top.requestFocus ();

        if (acceptor.acceptNodes (manager.getSelectedNodes())) {
            enableButton ();
        } else {
            disableButton ();
        }

    }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:72,代碼來源:FileSelector.java

示例4: initialize

import java.beans.PropertyVetoException; //導入方法依賴的package包/類
/**
 * Create the underlying C3PO ComboPooledDataSource with the 
 * default supported properties.
 * @throws SchedulerException 
 */
private void initialize(
    String dbDriver, 
    String dbURL, 
    String dbUser,
    String dbPassword, 
    int maxConnections, 
    int maxStatementsPerConnection, 
    String dbValidationQuery,
    boolean validateOnCheckout,
    int idleValidationSeconds,
    int maxIdleSeconds) throws SQLException, SchedulerException {
    if (dbURL == null) {
        throw new SQLException(
            "DBPool could not be created: DB URL cannot be null");
    }
    
    if (dbDriver == null) {
        throw new SQLException(
            "DBPool '" + dbURL + "' could not be created: " +
            "DB driver class name cannot be null!");
    }
    
    if (maxConnections < 0) {
        throw new SQLException(
            "DBPool '" + dbURL + "' could not be created: " + 
            "Max connections must be greater than zero!");
    }

    
    datasource = new ComboPooledDataSource(); 
    try {
        datasource.setDriverClass(dbDriver);
    } catch (PropertyVetoException e) {
        throw new SchedulerException("Problem setting driver class name on datasource: " + e.getMessage(), e);
    }  
    datasource.setJdbcUrl(dbURL); 
    datasource.setUser(dbUser); 
    datasource.setPassword(dbPassword);
    datasource.setMaxPoolSize(maxConnections);
    datasource.setMinPoolSize(1);
    datasource.setMaxIdleTime(maxIdleSeconds);
    datasource.setMaxStatementsPerConnection(maxStatementsPerConnection);
    
    if (dbValidationQuery != null) {
        datasource.setPreferredTestQuery(dbValidationQuery);
        if(!validateOnCheckout)
            datasource.setTestConnectionOnCheckin(true);
        else
            datasource.setTestConnectionOnCheckout(true);
        datasource.setIdleConnectionTestPeriod(idleValidationSeconds);
    }
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:58,代碼來源:PoolingConnectionProvider.java


注:本文中的java.beans.PropertyVetoException.getMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。