java类java.beans.PropertyVetoException的实例源码

TestMethods.java 文件源码 项目:jdk8u-jdk 阅读 16 收藏 0 点赞 0 评论 0
public static void main(String[] args) throws PropertyVetoException {
    Object source = new Object();
    new TestMethods(source).fireVetoableChange(new PropertyChangeEvent(source, NAME, null, null));
    new TestMethods(source).fireVetoableChange(NAME, null, null);
    new TestMethods(source).fireVetoableChange(NAME, 0, 1);
    new TestMethods(source).fireVetoableChange(NAME, true, false);
}
TestPopupMenu.java 文件源码 项目:openjdk-jdk10 阅读 26 收藏 0 点赞 0 评论 0
private void createAndShowUI() throws Exception {
    frame = new JFrame();
    frame.setTitle("Test Frame");
    frame.setSize(800, 600);

    JDesktopPane pane = new JDesktopPane();
    TestInternalFrameWPopup testInternalFrame1 = new TestInternalFrameWPopup();
    pane.add(testInternalFrame1);

    testInternalFrame1.setVisible(true);
    JScrollPane scrollPane = new JScrollPane(pane);
    frame.getContentPane().add(scrollPane);
    testInternalFrame1.setMaximum(true);
    frame.getRootPane().registerKeyboardAction(e -> {
        TestInternalFrame testInternalFrame2 = new TestInternalFrame();
        pane.add(testInternalFrame2);
        try {
            testInternalFrame2.setMaximum(true);
        } catch (PropertyVetoException ex) {
            throw new RuntimeException(ex);
        }
        testInternalFrame2.setVisible(true);
    }, KeyStroke.getKeyStroke(KeyEvent.VK_U, KeyEvent.CTRL_MASK),
                             JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);

    frame.setVisible(true);
}
MergeDialogComponent.java 文件源码 项目:incubator-netbeans 阅读 24 收藏 0 点赞 0 评论 0
private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
    // Add your handling code here:
    synchronized (this) {
        try {
            fireVetoableChange(PROP_ALL_CANCELLED, null, null);
        } catch (PropertyVetoException pvex) {}
        try {
            internallyClosing = true;
            close();
        } finally {
            internallyClosing = false;
        }
    }
}
PropertiesEditorSupport.java 文件源码 项目:incubator-netbeans 阅读 28 收藏 0 点赞 0 评论 0
/** Called from the <code>EnvironmentListener</code>.
 * The components are going to be closed anyway and in case of
 * modified document its asked before if to save the change. */
private void fileRemoved() {
    LOG.finer("Environment.fileRemoved() ... ");                //NOI18N
    try {
        fireVetoableChange(PROP_VALID, Boolean.TRUE, Boolean.FALSE);
    } catch(PropertyVetoException pve) {
        // Ignore it and close anyway. File doesn't exist anymore.
    }

    firePropertyChange(PROP_VALID, Boolean.TRUE, Boolean.FALSE);
}
OpenSupport.java 文件源码 项目:incubator-netbeans 阅读 22 收藏 0 点赞 0 评论 0
/** Accepts vetoable changes and fires them to own listeners.
*/
public void vetoableChange(PropertyChangeEvent ev) throws PropertyVetoException {
    fireVetoableChange (
        ev.getPropertyName (),
        ev.getOldValue (),
        ev.getNewValue ()
    );
}
bug6647340.java 文件源码 项目:openjdk-jdk10 阅读 17 收藏 0 点赞 0 评论 0
private void setIcon(boolean b) {
    try {
        jif.setIcon(b);
    } catch (PropertyVetoException e) {
        e.printStackTrace();
    }
}
MultiFileSystem3Test.java 文件源码 项目:incubator-netbeans 阅读 19 收藏 0 点赞 0 评论 0
/**
 * 
 * @param testName name of test 
 * @return  array of FileSystems that should be tested in test named: "testName" */
protected FileSystem[] createFileSystem (String testName, String[] resources) throws IOException {        
        FileSystem lfs = TestUtilHid.createLocalFileSystem("mfs3"+testName, resources);
        FileSystem xfs = TestUtilHid.createXMLFileSystem(testName, resources);
        FileSystem mfs = new MultiFileSystem(lfs, xfs);
        try {
            mfs.setSystemName("mfs3test");
        } catch (PropertyVetoException e) {
            e.printStackTrace();  //To change body of catch statement use Options | File Templates.
        }
    return new FileSystem[] {mfs,lfs,xfs};
}
AttrTest.java 文件源码 项目:incubator-netbeans 阅读 17 收藏 0 点赞 0 评论 0
/** it mounts LocalFileSystem in temorary directory
     */
    private void preprocess() throws IOException,PropertyVetoException {
//        fileSystemFile.mkdir();
        clearWorkDir();
        fileSystemDir = new File(getWorkDir(), "testAtt123rDir");
        if(fileSystemDir.mkdir() == false || fileSystemDir.isDirectory() == false) {
            throw new IOException (fileSystemDir.toString() + " is not directory");
        }
        fileSystem = new LocalFileSystem();
        fileSystem.setRootDirectory(fileSystemDir);
    }
DocumentsDlg.java 文件源码 项目:incubator-netbeans 阅读 24 收藏 0 点赞 0 评论 0
private void updateNodes() {
    //Create nodes for TopComponents, sort them using their own comparator
    List<TopComponent> tcList = getOpenedDocuments();
    TopComponent activeTC = TopComponent.getRegistry().getActivated();
    TopComponentNode[] tcNodes = new TopComponentNode[tcList.size()];
    TopComponentNode toSelect = null;
    for (int i = 0; i < tcNodes.length; i++) {
        TopComponent tc = tcList.get(i);
        tcNodes[i] = new TopComponentNode(tc);
        if( tc == activeTC ) {
            toSelect = tcNodes[i];
        }
    }
    if( radioOrderByName.isSelected() ) {
        Arrays.sort(tcNodes);
    }

    Children.Array nodeArray = new Children.Array();
    nodeArray.add(tcNodes);
    Node root = new AbstractNode(nodeArray);
    explorer.setRootContext(root);
    // set focus to documents list
    listView.requestFocus();
    // select the active editor tab or the first item if possible
    if (tcNodes.length > 0) {
        try {
            if( null == toSelect ) 
                toSelect = tcNodes[0];
            explorer.setSelectedNodes(new Node[] {toSelect} );
        } catch (PropertyVetoException exc) {
            // do nothing, what should I do?
        }
    }
}
SynthInternalFrameTitlePane.java 文件源码 项目:OpenJSharp 阅读 16 收藏 0 点赞 0 评论 0
protected void assembleSystemMenu() {
    systemPopupMenu = new JPopupMenuUIResource();
    addSystemMenuItems(systemPopupMenu);
    enableActions();
    menuButton = createNoFocusButton();
    updateMenuIcon();
    menuButton.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent e) {
            try {
                frame.setSelected(true);
            } catch(PropertyVetoException pve) {
            }
            showSystemMenu();
        }
    });
    JPopupMenu p = frame.getComponentPopupMenu();
    if (p == null || p instanceof UIResource) {
        frame.setComponentPopupMenu(systemPopupMenu);
    }
    if (frame.getDesktopIcon() != null) {
        p = frame.getDesktopIcon().getComponentPopupMenu();
        if (p == null || p instanceof UIResource) {
            frame.getDesktopIcon().setComponentPopupMenu(systemPopupMenu);
        }
    }
    setInheritsPopupMenu(true);
}


问题


面经


文章

微信
公众号

扫码关注公众号