本文整理了Java中javax.swing.JTree.removeTreeSelectionListener()
方法的一些代码示例,展示了JTree.removeTreeSelectionListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.removeTreeSelectionListener()
方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:removeTreeSelectionListener
暂无
代码示例来源:origin: pentaho/mondrian
/**
* Call this method whenever you update the tree and needs it reloaded
*/
public synchronized void update() {
synchronized (this.tree) {
this.tree.removeTreeExpansionListener(this);
this.tree.removeTreeSelectionListener(this);
((DefaultTreeModel) this.tree.getModel()).reload();
for (TreePath treePath : expandedTreePaths) {
this.tree.expandPath(treePath);
}
this.tree.getSelectionModel().setSelectionPaths(selectedTreePaths);
this.tree.addTreeExpansionListener(this);
this.tree.addTreeSelectionListener(this);
}
}
代码示例来源:origin: xyz.cofe/gui.swing
@Override
public void close() throws IOException {
if(cmpt!=null && l!=null ){
cmpt.removeTreeSelectionListener(l);
cmpt = null;
l = null;
}
}};
代码示例来源:origin: org.qi4j.tool/org.qi4j.tool.envisage
public final void removeTreeSelectionListener( TreeSelectionListener listener )
{
structureTree.removeTreeSelectionListener( listener );
}
代码示例来源:origin: com.jidesoft/jide-oss
@Override
protected void uninstallListeners(JFileChooser fc) {
super.uninstallListeners(fc);
_fileSystemTree.removeTreeSelectionListener(_selectionListener);
}
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui
private void removeListeners() {
final Enumeration e = BuLib.getAllSubComponents(view_).elements();
while (e.hasMoreElements()) {
final Object c = e.nextElement();
if (c instanceof AbstractButton) {
((AbstractButton) c).removeActionListener(updater_);
} else if (c instanceof JList) {
((JList) c).removeListSelectionListener(updater_);
} else if (c instanceof JTree) {
((JTree) c).removeTreeSelectionListener(updater_);
} else if (c instanceof JTextComponent) {
((JTextComponent) c).getDocument().removeDocumentListener(updater_);
} else if (c instanceof JTable) {
((JTable) c).getSelectionModel().removeListSelectionListener(updater_);
}
}
}
代码示例来源:origin: info.aduna.commons/aduna-commons-swing
private void resetGlassPane() {
if (oldGlassPane != null) {
overlayPainter.setVisible(false);
getRootPane().setGlassPane(oldGlassPane);
oldGlassPane = null;
tree.removeTreeSelectionListener(this);
}
}
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu
private void removeListeners()
{
Enumeration e=BuLib.getAllSubComponents(view_).elements();
while(e.hasMoreElements())
{
Object c=e.nextElement();
if(c instanceof AbstractButton)
((AbstractButton)c).removeActionListener(UPDATER);
else
if(c instanceof JList)
((JList)c).removeListSelectionListener(UPDATER);
else
if(c instanceof JTree)
((JTree)c).removeTreeSelectionListener(UPDATER);
else
if(c instanceof JTextComponent)
((JTextComponent)c).getDocument().removeDocumentListener(UPDATER);
else
if(c instanceof JTable)
((JTable)c).getSelectionModel().removeListSelectionListener(UPDATER);
}
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer
/**
* Description of the Method
*/
private void initForCurrentDocument() {
// tree stuff
TreeModel model = new DOMTreeModel(doc);
tree.setModel(model);
if (!(tree.getCellRenderer() instanceof DOMTreeCellRenderer)) {
tree.setCellRenderer(new DOMTreeCellRenderer());
}
if (styleReference != null) {
if (elementPropPanel != null) {
splitPane.remove(elementPropPanel);
}
elementPropPanel = new ElementPropertiesPanel(styleReference);
splitPane.setRightComponent(elementPropPanel);
tree.removeTreeSelectionListener(nodeSelectionListener);
//nodeSelectionListener = new DOMSelectionListener( tree, styleReference, elementPropPanel );
nodeSelectionListener = new DOMSelectionListener(tree, elementPropPanel);
tree.addTreeSelectionListener(nodeSelectionListener);
}
}
}
代码示例来源:origin: danfickle/openhtmltopdf
/**
* Description of the Method
*/
private void initForCurrentDocument() {
// tree stuff
TreeModel model = new DOMTreeModel(doc);
tree.setModel(model);
if (!(tree.getCellRenderer() instanceof DOMTreeCellRenderer)) {
tree.setCellRenderer(new DOMTreeCellRenderer());
}
if (styleReference != null) {
if (elementPropPanel != null) {
splitPane.remove(elementPropPanel);
}
elementPropPanel = new ElementPropertiesPanel(styleReference);
splitPane.setRightComponent(elementPropPanel);
tree.removeTreeSelectionListener(nodeSelectionListener);
//nodeSelectionListener = new DOMSelectionListener( tree, styleReference, elementPropPanel );
nodeSelectionListener = new DOMSelectionListener(tree, elementPropPanel);
tree.addTreeSelectionListener(nodeSelectionListener);
}
}
}
代码示例来源:origin: org.xhtmlrenderer/core-renderer
/**
* Description of the Method
*/
private void initForCurrentDocument() {
// tree stuff
TreeModel model = new DOMTreeModel(doc);
tree.setModel(model);
if (!(tree.getCellRenderer() instanceof DOMTreeCellRenderer)) {
tree.setCellRenderer(new DOMTreeCellRenderer());
}
if (styleReference != null) {
if (elementPropPanel != null) {
splitPane.remove(elementPropPanel);
}
elementPropPanel = new ElementPropertiesPanel(styleReference);
splitPane.setRightComponent(elementPropPanel);
tree.removeTreeSelectionListener(nodeSelectionListener);
//nodeSelectionListener = new DOMSelectionListener( tree, styleReference, elementPropPanel );
nodeSelectionListener = new DOMSelectionListener(tree, elementPropPanel);
tree.addTreeSelectionListener(nodeSelectionListener);
}
}
}
代码示例来源:origin: org.docx4j/xhtmlrenderer
/**
* Description of the Method
*/
private void initForCurrentDocument() {
// tree stuff
TreeModel model = new DOMTreeModel(doc);
tree.setModel(model);
if (!(tree.getCellRenderer() instanceof DOMTreeCellRenderer)) {
tree.setCellRenderer(new DOMTreeCellRenderer());
}
if (styleReference != null) {
if (elementPropPanel != null) {
splitPane.remove(elementPropPanel);
}
elementPropPanel = new ElementPropertiesPanel(styleReference);
splitPane.setRightComponent(elementPropPanel);
tree.removeTreeSelectionListener(nodeSelectionListener);
//nodeSelectionListener = new DOMSelectionListener( tree, styleReference, elementPropPanel );
nodeSelectionListener = new DOMSelectionListener(tree, elementPropPanel);
tree.addTreeSelectionListener(nodeSelectionListener);
}
}
}
代码示例来源:origin: org.zaproxy/zap
public void setLinkWithSitesTreeSelection(boolean enabled) {
linkWithSitesTreeButton.setSelected(enabled);
final JTree sitesTree = view.getSiteTreePanel().getTreeSite();
String baseUri = null;
if (enabled) {
final TreePath selectionPath = sitesTree.getSelectionPath();
if (selectionPath != null) {
baseUri = getLinkWithSitesTreeBaseUri((SiteNode) selectionPath.getLastPathComponent());
}
sitesTree.addTreeSelectionListener(getLinkWithSitesTreeSelectionListener());
} else {
sitesTree.removeTreeSelectionListener(getLinkWithSitesTreeSelectionListener());
}
extension.setLinkWithSitesTree(enabled, baseUri);
}
代码示例来源:origin: org.icepdf.os/icepdf-viewer
new DefaultMutableTreeNode("Root");
boolean isIRT = buildCommentTree(parentAnnotation, annotations, root);
commentTree.removeTreeSelectionListener(this);
((DefaultTreeModel) (commentTree.getModel())).setRoot(root);
commentTree.addTreeSelectionListener(this);
代码示例来源:origin: net.sf.cuf/cuf-swing
((JTree)eventSource).removeTreeSelectionListener(SCM);
((JTree)eventSource).removeFocusListener (SCM);
代码示例来源:origin: org.zaproxy/zap
/**
* Sets whether the "Alerts" tree is filtered, or not based on a selected "Sites" tree node.
* <p>
* If {@code enabled} is {@code true} only the alerts of the selected "Sites" tree node will be shown.
* </p>
* <p>
* Calling this method removes the filter "Just in Scope", if enabled, as they are mutually exclusive.
* </p>
*
* @param enabled {@code true} if the "Alerts" tree should be filtered based on the "Sites" tree selection, {@code false}
* otherwise.
* @see ExtensionAlert#setShowJustInScope(boolean)
*/
public void setLinkWithSitesTreeSelection(boolean enabled) {
linkWithSitesTreeButton.setSelected(enabled);
if (enabled) {
extension.setShowJustInScope(false);
final JTree sitesTree = view.getSiteTreePanel().getTreeSite();
final TreePath selectionPath = sitesTree.getSelectionPath();
getTreeAlert().setModel(getLinkWithSitesTreeModel());
if (selectionPath != null) {
recreateLinkWithSitesTreeModel((SiteNode) selectionPath.getLastPathComponent());
}
sitesTree.addTreeSelectionListener(getLinkWithSitesTreeSelectionListener());
} else {
extension.setMainTreeModel();
((AlertNode) getLinkWithSitesTreeModel().getRoot()).removeAllChildren();
view.getSiteTreePanel().getTreeSite().removeTreeSelectionListener(getLinkWithSitesTreeSelectionListener());
}
}
内容来源于网络,如有侵权,请联系作者删除!