本文整理汇总了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;
}
}
示例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());
}
}
示例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 ();
}
}
示例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);
}
}