Refine search
/** @param ev event with changes */ public void vetoableChange(PropertyChangeEvent ev) throws PropertyVetoException { if (ev.getPropertyName().equals("systemName")) { final String ov = (String) ev.getOldValue(); final String nv = (String) ev.getNewValue(); if (names.get(nv) != null) { throw new PropertyVetoException("system name already exists: " + ov + " -> " + nv, ev); // NOI18N } } } };
public void actionPerformed(final ActionEvent e) { final JInternalFrame[] frames = gcViewer.getDesktopPane().getAllFrames(); final DesktopManager desktopManager = gcViewer.getDesktopPane().getDesktopManager(); for (int i=0; i<frames.length; i++) { final JInternalFrame frame = frames[i]; desktopManager.deiconifyFrame(frame); try { frame.setMaximum(false); } catch (PropertyVetoException e1) { e1.printStackTrace(); } final int height = gcViewer.getDesktopPane().getHeight()/frames.length; desktopManager.setBoundsForFrame(frame, 0, height * i, gcViewer.getDesktopPane().getWidth(), height); } } }
/** 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()); } }
public void vetoableChange( PropertyChangeEvent evt ) throws PropertyVetoException { Object val = evt.getNewValue(); if ( "jndiName".equals( evt.getPropertyName() ) ) { if (! (val instanceof Name || val instanceof String) ) throw new PropertyVetoException("jndiName must be a String or a javax.naming.Name", evt); } } };
List<PropertyChangeEvent> appliedChanges = new ArrayList<PropertyChangeEvent>(); for (PropertyChangeEvent event : changedAttributes.values()) { ConfigModel.Property property = bean.model.findIgnoreCase(event.getPropertyName()); ConfigBeanInterceptor interceptor = bean.getOptionalFeature(ConfigBeanInterceptor.class); try { throw new TransactionFailure(e.getMessage(), e); property.set(bean, event.getNewValue()); if (interceptor!=null) { interceptor.afterChange(event, System.currentTimeMillis()); List<Object> originalList = entry.readOnly; for (PropertyChangeEvent event : entry.changeEvents) { if (event.getOldValue()==null) { originalList.add(event.getNewValue()); } else {
public void propertyChange(PropertyChangeEvent evt) { Content content = (Content) evt.getSource(); if ("maximized.before".equals(evt.getPropertyName())) { if ((Boolean) evt.getNewValue()) { toolWindowManager.getPersistenceDelegate().save(tmpWorkspace = new ByteArrayOutputStream()); toolWindowManager.getToolWindowGroup().setVisible(false); ((MyDoggyDesktopContentUI) getContentUI(content)).getInternalFrame().setMaximum(true); } catch (PropertyVetoException e) { throw new RuntimeException(e.getMessage(), e); PersistenceDelegate.MergePolicy.UNION)); try { ((MyDoggyDesktopContentUI) getContentUI(content)).getInternalFrame().setMaximum(false); } catch (PropertyVetoException e) { throw new RuntimeException(e.getMessage(), e);
VetoableListSelectionModel vetoableSelection = new VetoableListSelectionModel(); VetoableChangeListener navigationController = new VetoableChangeListener() { public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException { // custom method that implements your condition if (!canSelect((int) evt.getOldValue(), (int) evt.getNewValue())) throw new PropertyVetoException("uncommitted changes", evt); } }; vetoableSelection.addVetoableChangeListener(navigationController); myTable.setSelectionModel(vetoableSelection);
@Override public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException { final Object newValue = evt.getNewValue(); if(isAfterburning() && newValue == Boolean.TRUE) throw new PropertyVetoException(null, evt); }//end vetoableChange(...) }//end FiringVetoListener
VetoableChangeListener vcl = new VetoableChangeListener() { public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException { if ( evt.getPropertyName().equals(JTree.LEAD_SELECTION_PATH_PROPERTY) ) { try { <some code logic that has to be satisfied> } catch (InvalidInputException e) { throw new PropertyVetoException("", evt); } } } }; tree.addVetoableChangeListener(vcl);
final JInternalFrame iframe = new JInternalFrame(view.getTitle(), true, true, true, true); iframe.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosing(InternalFrameEvent e) { Cytoscape.destroyNetworkView(view); new InternalFrameComponent(iframe.getLayeredPane(), (DGraphView) view); iframe.getContentPane().add(internalFrameComp); iframe.setMaximum(true); } catch (PropertyVetoException pve) { logger.warn("Unable to maximize internal frame: "+pve.getMessage());
void select(final JInternalFrame frame) { frame.setVisible(true); try { if (frame.isIcon()) { frame.setIcon(false); } else { frame.setSelected(true); } } catch (final PropertyVetoException ex) { ex.printStackTrace(); } final Dimension size = getDesktopPane().getSize(); final Dimension s = frame.getSize(); final Point p = frame.getLocation(); final int x = Math.max(Math.min(p.x - (p.x + s.width - size.width), p.x), 0); final int y = Math.max(Math.min(p.y - (p.y + s.height - size.height), p.y), 0); if (x != p.x || y != p.y) { frame.setLocation(x, y); } final int width = Math.min(s.width, size.width); final int height = Math.min(s.height, size.height); if (width < s.width || height < s.height) { frame.setSize(width, height); } }
int frameOffset=0; for (int i = allFrames.length - 1; i >= 0; i--) { Point p=SwingUtilities.convertPoint(allFrames[i].getContentPane(),0,0,allFrames[i]); frameOffset=Math.max(frameOffset,Math.max(p.x,p.y)); for (int i = allFrames.length - 1; i >= 0; i--) { try { allFrames[i].setMaximum(false); } catch (PropertyVetoException e) { e.printStackTrace(); allFrames[i].setBounds(x, y, frameWidth, frameHeight); x = x + frameOffset; y = y + frameOffset;
JInternalFrame frame = (JInternalFrame) obj; Rectangle visible = OVTK2Desktop.getInstance().getDesktopPane().getVisibleRect(); Dimension size = frame.getSize(); frame.setLocation((visible.width / 2) - (size.width / 2), (visible.height / 2) - (size.height / 2)); if (size.height > visible.height) frame.setLocation(frame.getX(), 0); frame.setVisible(true); } catch (PropertyVetoException e1) { e1.printStackTrace();
Point location = (Point) constraints[0]; internalFrame.setBounds(location.x, location.y, 320, 200); } else if (constraints[0] instanceof Rectangle) { internalFrame.setBounds((Rectangle) constraints[0]); } else constraints = null; contentY = contentX = 10; internalFrame.setBounds(contentX, contentY, 320, 200); internalFrame.setSelected(true); } catch (PropertyVetoException e) { e.printStackTrace();
@Override public void actionPerformed(ActionEvent e) { List<RegisteredFrame> frames = frameRegistry.getInternalFrames(); for (RegisteredFrame frame : frames) { if (frame instanceof JInternalFrame && (group == null || frame.getGroup().equals(group))) { JInternalFrame internalF = ((JInternalFrame) frame); if (internalF.isIconifiable() && !internalF.isIcon()) { try { internalF.setIcon(true); } catch (PropertyVetoException e1) { e1.printStackTrace(); } } } } }
protected void setter(ConfigModel.Property target, Object value) throws Exception { if (!writeLock) { throw new PropertyVetoException("Instance of " + getImplementation() + " named '" + getKey() + "' is not locked for writing when changing attribute " + target.xmlName() + ", you must use transaction semantics to access it.", null); } _setter(target, value); }
@Override public void actionPerformed(ActionEvent e) { if (frame instanceof JInternalFrame) { JInternalFrame internalF = (JInternalFrame) frame; try { internalF.setSelected(true); if (internalF.isIcon()) internalF.setIcon(false); internalF.moveToFront(); } catch (PropertyVetoException e1) { e1.printStackTrace(); } } else if (frame instanceof LauncherFrame) { LauncherFrame launcher = (LauncherFrame) frame; launcher.getJFrame().setState(Frame.NORMAL); launcher.getJFrame().toFront(); } } }
public void actionPerformed(final ActionEvent ae) { try { internalFrame.setSelected(true); } catch (PropertyVetoException e1) { e1.printStackTrace(); } }
public void actionPerformed(ActionEvent ae) { JInternalFrame frame = ((ChildMenuItem) ae.getSource()).getFrame(); frame.moveToFront(); try { frame.setSelected(true); } catch (PropertyVetoException e) { e.printStackTrace(); } } });
/** Creates new MemoryFS */ public MemoryFileSystem() { attr = this; list = this; change = this; info = this; try { _setSystemName("MemoryFileSystem" + String.valueOf(id)); } catch (PropertyVetoException ex) { ex.printStackTrace(); } }