bitronix.tm.gui.ResourcesPanel Maven / Gradle / Ivy
package bitronix.tm.gui;
import bitronix.tm.TransactionManagerServices;
import bitronix.tm.utils.PropertyUtils;
import bitronix.tm.resource.ResourceLoader;
import bitronix.tm.resource.common.ResourceBean;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Iterator;
import java.util.Map;
/**
*
*
* @author lorban
*/
public class ResourcesPanel extends JPanel {
private JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
private JTree resourcesTree = new JTree();
private JScrollPane resourcesTreeScrollpane = new JScrollPane(resourcesTree);
private JTextArea activeResource = new JTextArea();
public ResourcesPanel() {
setLayout(new GridLayout(1, 1));
resourcesTree.setModel(new ResourcesTreeModel());
resourcesTree.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent evt) {
JTree tree = (JTree) evt.getSource();
int selectedRow = tree.getSelectionRows()[0] -1;
ResourceLoader resourceLoader = TransactionManagerServices.getResourceLoader();
Iterator it = resourceLoader.getResources().entrySet().iterator();
ResourceBean resource = null;
for (int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy