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


Java ExpandVetoException類代碼示例

本文整理匯總了Java中javax.swing.tree.ExpandVetoException的典型用法代碼示例。如果您正苦於以下問題:Java ExpandVetoException類的具體用法?Java ExpandVetoException怎麽用?Java ExpandVetoException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: treeExpansionVetoed

import javax.swing.tree.ExpandVetoException; //導入依賴的package包/類
/** Messaged if the tree expansion event (for which we will have already
 * constructed a TableModelEvent) was vetoed;  disposes of the constructed
 * TableModelEvent in that circumstance. */
@Override
public void treeExpansionVetoed(TreeExpansionEvent event, ExpandVetoException exception) {
    assert SwingUtilities.isEventDispatchThread();
    
    log ("treeExpansionVetoed", exception);
    
    //Make sure the event that was vetoed is the one we're interested in
    if (event == inProgressEvent) {
        //If so, delete the expansion event we thought we were going
        //to use in treeExpanded/treeCollapsed, so that it doesn't
        //stick around forever holding references to objects from the
        //model
        pendingExpansionEvent = null;
        inProgressEvent = null;
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:20,代碼來源:EventBroadcaster.java

示例2: expandPath

import javax.swing.tree.ExpandVetoException; //導入依賴的package包/類
public void expandPath(TreePath path)
{
  // Don't expand if path is null
  // or is already expanded.
  if (path == null || isExpanded(path))
    return;

  try
    {
      fireTreeWillExpand(path);
    }
  catch (ExpandVetoException ev)
    {
      // We do nothing if attempt has been vetoed.
    }

  setExpandedState(path, true);
  fireTreeExpanded(path);
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:20,代碼來源:JTree.java

示例3: treeWillExpand

import javax.swing.tree.ExpandVetoException; //導入依賴的package包/類
@Override
public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException {
  final InspectionTreeNode node = (InspectionTreeNode)event.getPath().getLastPathComponent();
  final Object userObject = node.getUserObject();
  //TODO: never re-sort
  if (node.isValid() && !myExpandedUserObjects.contains(userObject)) {
    sortChildren(node);
    nodeStructureChanged(node);
  }
  myExpandedUserObjects.add(userObject);
  // Smart expand
  if (node.getChildCount() == 1) {
    ApplicationManager.getApplication().invokeLater(new Runnable() {
      @Override
      public void run() {
        expandPath(new TreePath(node.getPath()));
      }
    });
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:InspectionTree.java

示例4: treeWillExpand

import javax.swing.tree.ExpandVetoException; //導入依賴的package包/類
/**
 * @see javax.swing.event.TreeWillExpandListener#treeWillExpand(javax.swing.event.TreeExpansionEvent)
 */
public void treeWillExpand(TreeExpansionEvent e) throws ExpandVetoException {
    logger.debug("Tree will expand " + e.getPath());

    /*
     * DefaultMutableTreeNode node = (DefaultMutableTreeNode)
     * tree.getLastSelectedPathComponent(); if (node == null) { return; }
     * logger.debug(""+node.getPath()[node.getLevel()]); // buttons
     * disabling switch(node.getLevel()) { case LEVEL_FOLDERS: // disconnect
     * childrens from the node Enumeration enumeration=node.children(); //
     * delete nodes itself while (enumeration.hasMoreElements()) { Object
     * object=enumeration.nextElement();
     * treeNodeToResourceUriMap.remove(object);
     * treeModel.removeNodeFromParent((MutableTreeNode)object); } // get
     * folder URI logger.debug("Expanding folder:
     * "+treeNodeToResourceUriMap.get(node)); FolderResource folder =new
     * FolderResource(MindRaider.folderCustodian.get((String)treeNodeToResourceUriMap.get(node)));
     * String[] notebookUris=folder.getNotebookUris(); if (notebookUris !=
     * null) { for (int i= 0; i < notebookUris.length; i++) {
     * NotebookResource notebook=new
     * NotebookResource(MindRider.notebookCustodian.get(notebookUris[i]));
     * addNotebookNode(node,notebook.resource.metadata.uri.toASCIIString(),notebook.getLabel()); } } }
     */
}
 
開發者ID:dvorka,項目名稱:mindraider,代碼行數:27,代碼來源:TrashJPanel.java

示例5: treeWillExpand

import javax.swing.tree.ExpandVetoException; //導入依賴的package包/類
public void treeWillExpand(final TreeExpansionEvent event) throws ExpandVetoException {
    final TreePath path = event.getPath();
    final DefaultMutableTreeNode lastTreeNode = (DefaultMutableTreeNode) path.getLastPathComponent();
    SwingWorker<?, ?> worker = null;
    if (lastTreeNode.getChildCount() == 1) {
        final DefaultMutableTreeNode firstChildNode = (DefaultMutableTreeNode) lastTreeNode.getChildAt(0);
        if (firstChildNode.getUserObject() == LOADING_TABLES_STRING) {
            // Load a schema's tables
            worker = new LoadTablesSwingWorker(lastTreeNode);
        } else if (firstChildNode.getUserObject() == LOADING_COLUMNS_STRING) {
            // Load a table's columns
            worker = new LoadColumnsSwingWorker(path, lastTreeNode);
        }
    }

    if (worker != null) {
        worker.execute();
    }
}
 
開發者ID:datacleaner,項目名稱:DataCleaner,代碼行數:20,代碼來源:SchemaTree.java

示例6: doSetExpandedState

import javax.swing.tree.ExpandVetoException; //導入依賴的package包/類
private void doSetExpandedState(TreePath path, boolean state) {
    if (path == null) {
        return;
    }
    doSetExpandedState(path.getParentPath(), true);
    if (isExpanded(path) == state) {
        return;
    }
    try {
        if (state) {
            fireTreeWillExpand(path);
        } else {
            fireTreeWillCollapse(path);
        }
    } catch (ExpandVetoException e) {
        return;
    }
    togglePaths.put(path, Boolean.valueOf(state));
    if (state) {
        fireTreeExpanded(path);
    } else {
        fireTreeCollapsed(path);
    }
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:25,代碼來源:JTree.java

示例7: treeWillExpand

import javax.swing.tree.ExpandVetoException; //導入依賴的package包/類
@Override
public void treeWillExpand(TreeExpansionEvent event)
throws ExpandVetoException {
    // prepare wait cursor and optionally show it
    TreePath path = event.getPath();
    prepareWaitCursor(DragDropUtilities.secureFindNode(path.getLastPathComponent()));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:TreeView.java

示例8: treeWillCollapse

import javax.swing.tree.ExpandVetoException; //導入依賴的package包/類
/** Receives a TreeWillCollapse event and constructs a TableModelEvent
 * based on the pending changes while the model still reflects the unchanged
 * state */
@Override
public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException {
    assert SwingUtilities.isEventDispatchThread();
    
    log ("treeWillCollapse", event);
    
    //Construct the TableModelEvent here, before data structures have
    //changed.  We will fire it from TreeCollapsed if the change is 
    //not vetoed.
    pendingExpansionEvent = translateEvent (event, false);
    log ("treeWillCollapse generated ", pendingExpansionEvent);
    inProgressEvent = event;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:EventBroadcaster.java

示例9: treeWillExpand

import javax.swing.tree.ExpandVetoException; //導入依賴的package包/類
/** Receives a TreeWillExpand event and constructs a TableModelEvent
 * based on the pending changes while the model still reflects the unchanged
 * state */
@Override
public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException {
    assert SwingUtilities.isEventDispatchThread();

    log ("treeWillExpand", event);
    
    //Construct the TableModelEvent here, before data structures have
    //changed.  We will fire it from TreeExpanded if the change is not
    //vetoed
    pendingExpansionEvent = translateEvent (event, true);
    
    log ("treeWillExpand generated", pendingExpansionEvent);
    inProgressEvent = event;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:EventBroadcaster.java

示例10: fireTreeWillExpand

import javax.swing.tree.ExpandVetoException; //導入依賴的package包/類
private void fireTreeWillExpand (TreeExpansionEvent e, boolean expanded) throws ExpandVetoException {
    int size = weListeners.size();
    
    TreeWillExpandListener[] listeners = new TreeWillExpandListener[size];
    synchronized (this) {
        listeners = weListeners.toArray(listeners);
    }
    for (int i=0; i < listeners.length; i++) {
        if (expanded) {
            listeners[i].treeWillExpand(e);
        } else {
            listeners[i].treeWillCollapse(e);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:TreePathSupport.java

示例11: fireTreeExpansionVetoed

import javax.swing.tree.ExpandVetoException; //導入依賴的package包/類
private void fireTreeExpansionVetoed (TreeExpansionEvent e, ExpandVetoException ex) {
    int size = weListeners.size();
    
    TreeWillExpandListener[] listeners = new TreeWillExpandListener[size];
    synchronized (this) {
        listeners = weListeners.toArray(listeners);
    }
    for (int i=0; i < listeners.length; i++) {
        if (listeners[i] instanceof ExtTreeWillExpandListener) {
            ((ExtTreeWillExpandListener) listeners[i]).treeExpansionVetoed(e,
                ex);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:15,代碼來源:TreePathSupport.java

示例12: fireTreeWillCollapse

import javax.swing.tree.ExpandVetoException; //導入依賴的package包/類
/**
 * Maps {@code JTree.fireTreeWillCollapse(TreePath)} through queue
 */
public void fireTreeWillCollapse(final TreePath treePath) {
    runMapping(new MapVoidAction("fireTreeWillCollapse") {
        @Override
        public void map() throws ExpandVetoException {
            ((JTree) getSource()).fireTreeWillCollapse(treePath);
        }
    });
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:12,代碼來源:JTreeOperator.java

示例13: fireTreeWillExpand

import javax.swing.tree.ExpandVetoException; //導入依賴的package包/類
/**
 * Maps {@code JTree.fireTreeWillExpand(TreePath)} through queue
 */
public void fireTreeWillExpand(final TreePath treePath) {
    runMapping(new MapVoidAction("fireTreeWillExpand") {
        @Override
        public void map() throws ExpandVetoException {
            ((JTree) getSource()).fireTreeWillExpand(treePath);
        }
    });
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:12,代碼來源:JTreeOperator.java

示例14: treeWillExpand

import javax.swing.tree.ExpandVetoException; //導入依賴的package包/類
/**
 * Invoked whenever a node in the tree is about to be expanded.
 */
public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException {
    if (classificationViewer.isLocked()) {
        throw new ExpandVetoException(event);
    }
    jTree.addChildren((ViewerJTree.MyJTreeNode) event.getPath().getLastPathComponent());
}
 
開發者ID:danielhuson,項目名稱:megan-ce,代碼行數:10,代碼來源:ViewerJTree.java

示例15: treeWillCollapse

import javax.swing.tree.ExpandVetoException; //導入依賴的package包/類
/**
 * Invoked whenever a node in the tree is about to be collapsed.
 */
public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException {
    if (inspectorWindow.isLocked()) {
        if (dir.getDocument().getProgressListener() != null)
            dir.getDocument().getProgressListener().setUserCancelled(true);
        throw new ExpandVetoException(event);
    }
}
 
開發者ID:danielhuson,項目名稱:megan-ce,代碼行數:11,代碼來源:InspectorWindow.java


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