Example usage for javax.swing.event TreeSelectionEvent isAddedPath

List of usage examples for javax.swing.event TreeSelectionEvent isAddedPath

Introduction

In this page you can find the example usage for javax.swing.event TreeSelectionEvent isAddedPath.

Prototype

public boolean isAddedPath() 

Source Link

Document

Returns whether the path identified by getPath was added to the selection.

Usage

From source file:com.enderville.enderinstaller.ui.Installer.java

@Override
public void valueChanged(TreeSelectionEvent e) {
    if (!e.isAddedPath()) {
        return;// ww w.  ja  v  a  2s .c  o m
    }
    TreePath path = e.getPath();
    CheckBoxTree tree = getModTree();
    if (e.getSource() == tree.getSelectionModel()) {
        DefaultMutableTreeNode last = (DefaultMutableTreeNode) path.getLastPathComponent();
        loadModDescription(last.getUserObject().toString());
    } else if (e.getSource() == tree.getCheckBoxTreeSelectionModel()) {
        getPresetDropdown().setSelectedItem(PRESET_CUSTOM);
    }
}