本文整理汇总了Java中java.beans.PropertyVetoException类的典型用法代码示例。如果您正苦于以下问题:Java PropertyVetoException类的具体用法?Java PropertyVetoException怎么用?Java PropertyVetoException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PropertyVetoException类属于java.beans包,在下文中一共展示了PropertyVetoException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import java.beans.PropertyVetoException; //导入依赖的package包/类
@Setup
public void setup() throws PropertyVetoException {
dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("com.mysql.jdbc.Driver");
dataSource.setUrl(propertyOr("jdbcUrl", "jdbc:mysql://127.0.0.1:3306?useSSL=false"));
dataSource.setUsername(propertyOr("username", "root"));
dataSource.setPassword(propertyOr("password", "root"));
JdbcTemplate delegate = new JdbcTemplate(dataSource);
delegate.setDataSource(dataSource);
proxy = new SenderProxy(new JdbcTemplateSender(delegate));
proxy.onMessages(updated -> counter.addAndGet(updated.size()));
reporter = reporter(proxy);
batch = new BatchJdbcTemplate(delegate, reporter);
batch.setDataSource(dataSource);
unbatch = new JdbcTemplate(dataSource);
unbatch.setDataSource(dataSource);
unbatch.update(CREATE_DATABASE);
unbatch.update(DROP_TABLE);
unbatch.update(CREATE_TABLE);
}
示例2: prepareTest
import java.beans.PropertyVetoException; //导入依赖的package包/类
public static void prepareTest(String[] additionalLayers, Object[] additionalLookupContent) throws IOException, SAXException, PropertyVetoException {
Collection<URL> allUrls = new ArrayList<URL>();
for (String u : additionalLayers) {
if (u.charAt(0) == '/') {
u = u.substring(1);
}
for (Enumeration<URL> en = Thread.currentThread().getContextClassLoader().getResources(u); en.hasMoreElements(); ) {
allUrls.add(en.nextElement());
}
}
XMLFileSystem system = new XMLFileSystem();
system.setXmlUrls(allUrls.toArray(new URL[allUrls.size()]));
Repository repository = new Repository(system);
Object[] lookupContent = new Object[additionalLookupContent.length + 1];
System.arraycopy(additionalLookupContent, 0, lookupContent, 1, additionalLookupContent.length);
lookupContent[0] = repository;
setLookup(lookupContent, BaseCaretTest.class.getClassLoader());
}
示例3: testRenameInteriorSection
import java.beans.PropertyVetoException; //导入依赖的package包/类
public void testRenameInteriorSection() throws BadLocationException, PropertyVetoException {
System.out.println("-- testRenameInteriorSection -------------");
editor.doc.insertString(0, "aaa", null);
InteriorSection is1 = guards.createInteriorSection(editor.doc.createPosition(1), "is1");
assertEquals("name", "is1", is1.getName());
is1.setName("isNewName");
assertTrue("valid", is1.isValid());
assertEquals("new name", "isNewName", is1.getName());
// set the same name
is1.setName("isNewName");
InteriorSection is2 = guards.createInteriorSection(
editor.doc.createPosition(is1.getEndPosition().getOffset() + 1),
"is2");
// rename to existing name
try {
is1.setName("is2");
fail("accepted already existing name");
} catch (PropertyVetoException ex) {
assertTrue("valid", is1.isValid());
assertEquals("name", "isNewName", is1.getName());
}
}
示例4: setGlobalActiveWindow
import java.beans.PropertyVetoException; //导入依赖的package包/类
/**
* Sets the active Window. Only a Frame or a Dialog can be the active
* Window. The native windowing system may denote the active Window or its
* children with special decorations, such as a highlighted title bar. The
* active Window is always either the focused Window, or the first Frame or
* Dialog that is an owner of the focused Window.
* <p>
* This method does not actually change the active Window as far as the
* native windowing system is concerned. It merely stores the value to be
* subsequently returned by {@code getActiveWindow()}. Use
* {@code Component.requestFocus()} or
* {@code Component.requestFocusInWindow()} to change the active
* Window, subject to platform limitations.
*
* @param activeWindow the active Window
* @see #getActiveWindow
* @see #getGlobalActiveWindow
* @see Component#requestFocus()
* @see Component#requestFocusInWindow()
* @throws SecurityException if this KeyboardFocusManager is not the
* current KeyboardFocusManager for the calling thread's context
* and if the calling thread does not have "replaceKeyboardFocusManager"
* permission
*/
protected void setGlobalActiveWindow(Window activeWindow)
throws SecurityException
{
Window oldActiveWindow;
synchronized (KeyboardFocusManager.class) {
checkKFMSecurity();
oldActiveWindow = getActiveWindow();
if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
focusLog.finer("Setting global active window to " + activeWindow + ", old active " + oldActiveWindow);
}
try {
fireVetoableChange("activeWindow", oldActiveWindow,
activeWindow);
} catch (PropertyVetoException e) {
// rejected
return;
}
KeyboardFocusManager.activeWindow = activeWindow;
}
firePropertyChange("activeWindow", oldActiveWindow, activeWindow);
}
示例5: callSelectionChanged
import java.beans.PropertyVetoException; //导入依赖的package包/类
/**
* Called when selection in tree is changed.
*/
private void callSelectionChanged (Node[] nodes) {
manager.removePropertyChangeListener (wlpc);
manager.removeVetoableChangeListener (wlvc);
try {
manager.setSelectedNodes(nodes);
} catch (PropertyVetoException e) {
synchronizeSelectedNodes(false);
} finally {
// to be sure not to add them twice!
manager.removePropertyChangeListener (wlpc);
manager.removeVetoableChangeListener (wlvc);
manager.addPropertyChangeListener (wlpc);
manager.addVetoableChangeListener (wlvc);
}
}
示例6: nodeBasedView
import java.beans.PropertyVetoException; //导入依赖的package包/类
private static Component nodeBasedView(Node root) {
Node root2;
if (Children.MUTEX == Mutex.EVENT) {
// #35833 branch.
root2 = root;
} else {
root2 = new EQReplannedNode(root);
}
ExpPanel p = new ExpPanel();
p.setLayout(new BorderLayout());
JComponent tree = new BeanTreeView();
p.add(tree, BorderLayout.CENTER);
p.getExplorerManager().setRootContext(root2);
try {
p.getExplorerManager().setSelectedNodes(new Node[] {root2});
} catch (PropertyVetoException pve) {
pve.printStackTrace();
}
Object key = "org.openide.actions.PopupAction";
KeyStroke ks = KeyStroke.getKeyStroke("shift F10");
tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(ks, key);
return p;
}
示例7: createInstanceImpl
import java.beans.PropertyVetoException; //导入依赖的package包/类
protected JInternalFrame createInstanceImpl() {
JInternalFrame frame = new JInternalFrame(title, resizable, closable, maximizable, iconable) {
protected JRootPane createRootPane() {
return _rootPane == null ? null : _rootPane.createInstance();
}
public void addNotify() {
try {
// Doesn't seem to work correctly
setClosed(_isClosed);
setMaximum(_isMaximum);
setIcon(_isIcon);
setSelected(_isSelected);
} catch (PropertyVetoException ex) {}
}
};
return frame;
}
示例8: 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;
}
}
示例9: setIcon
import java.beans.PropertyVetoException; //导入依赖的package包/类
/**
* Iconifies or de-iconifies this internal frame,
* if the look and feel supports iconification.
* If the internal frame's state changes to iconified,
* this method fires an <code>INTERNAL_FRAME_ICONIFIED</code> event.
* If the state changes to de-iconified,
* an <code>INTERNAL_FRAME_DEICONIFIED</code> event is fired.
*
* @param b a boolean, where <code>true</code> means to iconify this internal frame and
* <code>false</code> means to de-iconify it
* @exception PropertyVetoException when the attempt to set the
* property is vetoed by the <code>JInternalFrame</code>
*
* @see InternalFrameEvent#INTERNAL_FRAME_ICONIFIED
* @see InternalFrameEvent#INTERNAL_FRAME_DEICONIFIED
*
* @beaninfo
* bound: true
* constrained: true
* description: The image displayed when this internal frame is minimized.
*/
public void setIcon(boolean b) throws PropertyVetoException {
if (isIcon == b) {
return;
}
/* If an internal frame is being iconified before it has a
parent, (e.g., client wants it to start iconic), create the
parent if possible so that we can place the icon in its
proper place on the desktop. I am not sure the call to
validate() is necessary, since we are not going to display
this frame yet */
firePropertyChange("ancestor", null, getParent());
Boolean oldValue = isIcon ? Boolean.TRUE : Boolean.FALSE;
Boolean newValue = b ? Boolean.TRUE : Boolean.FALSE;
fireVetoableChange(IS_ICON_PROPERTY, oldValue, newValue);
isIcon = b;
firePropertyChange(IS_ICON_PROPERTY, oldValue, newValue);
if (b)
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_ICONIFIED);
else
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED);
}
示例10: TelaInicial
import java.beans.PropertyVetoException; //导入依赖的package包/类
/**
* Creates new form TelaInicial
*/
public TelaInicial() throws PropertyVetoException, IOException {
initComponents();
this.setLocationRelativeTo(null);
jDesktopPane3.add(obj);
obj.setMaximizable(true);
obj.setMaximum(true);
obj.setVisible(true);
getContentPane().setBackground(Color.WHITE);
File file = new File("CADASTRADOS.txt");
if(!file.exists()){
file.createNewFile();// TODO code application logic here
}
File dir = new File("CadastroRemedios");
if(!dir.exists()){
dir.mkdir();
}
//this.setExtendedState(MAXIMIZED_BOTH);
//jDesktopPane3.setExtendedState(MAXIMIZED_BOTH);
//obj.setLocation(jDesktopPane3.getSize().width/2 - obj.getSize().width/2,jDesktopPane3.getSize().height/2 - obj.getSize().height/2);
}
示例11: expandAllNodes
import java.beans.PropertyVetoException; //导入依赖的package包/类
private static void expandAllNodes(BeanTreeView btv, Node node, ExplorerManager mgr, AndroidSdk platform) {
btv.expandNode(node);
Children ch = node.getChildren();
if (ch == Children.LEAF) {
if (platform != null && platform.equals(node.getLookup().lookup(AndroidSdk.class))) {
try {
mgr.setSelectedNodes(new Node[]{node});
} catch (PropertyVetoException e) {
//Ignore it
}
}
return;
}
Node nodes[] = ch.getNodes(true);
for (int i = 0; i < nodes.length; i++) {
expandAllNodes(btv, nodes[i], mgr, platform);
}
}
示例12: main
import java.beans.PropertyVetoException; //导入依赖的package包/类
public static void main(String[] args) throws PropertyVetoException, SQLException, InterruptedException {
//DataSourceFactory factory = new C3P0DataSourceFactory();
//DataSourceFactory factory = new DBCPDataSourceFactory();
DataSourceFactory factory = new HikariCPDataSourceFactory();
Connection connection = factory.get().getConnection();
System.out.println("DatabaseProductName: " + connection.getMetaData().getDatabaseProductName());
Connection connection2 = factory.get().getConnection();
System.out.println("DriverName: " + connection2.getMetaData().getDriverName());
Connection connection3 = factory.get().getConnection();
System.out.println("URL: " + connection3.getMetaData().getURL());
hold();
}
示例13: 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());
}
}
示例14: testPlusInName
import java.beans.PropertyVetoException; //导入依赖的package包/类
public void testPlusInName() throws IOException, PropertyVetoException {
clearWorkDir();
File plus = new File(getWorkDir(), "plus+plus");
plus.createNewFile();
LocalFileSystem lfs = new LocalFileSystem();
lfs.setRootDirectory(getWorkDir());
Repository.getDefault().addFileSystem(lfs);
URL uPlus = BaseUtilities.toURI(plus).toURL();
FileObject fo = URLMapper.findFileObject(uPlus);
assertNotNull("File object found", fo);
assertEquals("plus+plus", fo.getNameExt());
URL back = URLMapper.findURL(fo, URLMapper.EXTERNAL);
assertTrue("plus+plus is there", back.getPath().endsWith("plus+plus"));
}
示例15: MineC3P0DataSource
import java.beans.PropertyVetoException; //导入依赖的package包/类
public MineC3P0DataSource(boolean autoregister) {
super(autoregister);
this.dmds = new DriverManagerDataSource();
this.wcpds = new WrapperConnectionPoolDataSource();
this.wcpds.setNestedDataSource(this.dmds);
try {
this.setConnectionPoolDataSource(this.wcpds);
} catch (PropertyVetoException var3) {
logger.log(MLevel.WARNING, "Hunh??? This can\'t happen. We haven\'t set up any listeners to veto the property change yet!", var3);
throw new RuntimeException("Hunh??? This can\'t happen. We haven\'t set up any listeners to veto the property change yet! " + var3);
}
this.setUpPropertyEvents();
}