当前位置: 首页>>代码示例>>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;未经允许,请勿转载。