Search in sources :

Example 1 with ListTableExplorer

use of cern.gp.explorer.ListTableExplorer in project ACS by ACS-Community.

the class TestColoredListTableExplorer method createListTableExplorer.

/**
   * method that creates and returns a ListTableExplorer
   */
public static ListTableExplorer createListTableExplorer() {
    ListTableExplorer expl = null;
    try {
        expl = new ListTableExplorer();
        GPNode root = NodeFactory.createNode(new Object(), new RecursiveChildrenListManager(ColoredBean.class, 1, 10));
        expl.setRootNode(root);
        expl.setTableColumns(new ColoredBean(), null);
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return expl;
}
Also used : ListTableExplorer(cern.gp.explorer.ListTableExplorer) ColoredBean(cern.gp.explorer.test.helpers.ColoredBean) RecursiveChildrenListManager(cern.gp.explorer.test.helpers.RecursiveChildrenListManager) GPNode(cern.gp.nodes.GPNode)

Example 2 with ListTableExplorer

use of cern.gp.explorer.ListTableExplorer in project ACS by ACS-Community.

the class PrintUtil method print.

/* (non-Javadoc)
   * @see cern.gp.printing.PrintStrategy#print(java.awt.print.Printable)
   */
public void print(Component component) {
    Printable printable = null;
    if (component instanceof TreeExplorer) {
        printable = new PrintableTreeExplorer((TreeExplorer) component);
    } else if (component instanceof ListTableExplorer) {
        printable = new PrintableListTableExplorer((ListTableExplorer) component);
    } else {
        printable = new PrintableComponent(component);
    }
    printPDF(component.getName(), printable);
}
Also used : TreeExplorer(cern.gp.explorer.TreeExplorer) ListTableExplorer(cern.gp.explorer.ListTableExplorer) Printable(java.awt.print.Printable)

Example 3 with ListTableExplorer

use of cern.gp.explorer.ListTableExplorer in project ACS by ACS-Community.

the class TestListTableExplorer method main.

public static void main(String[] args) throws Exception {
    int numberOfBeans = 6;
    // create the beans you want to display
    SimpleDemoBean[] beans = new SimpleDemoBean[numberOfBeans];
    for (int ix = 0; ix < numberOfBeans; ix++) {
        beans[ix] = new SimpleDemoBean("bean_" + ix);
    }
    // create nodes associated with the beans
    GPNode[] nodes = NodeFactory.createNode(beans);
    // create the explorer and set the columns it shall display
    ListTableExplorer expl = new ListTableExplorer(nodes);
    expl.setTableColumns(new String[] { "name", "value" });
    //  open the explorer in a NetBeans "Mode"
    WindowUtils.openInMode(expl, "TestListTableExplorer");
    expl.requestFocus();
}
Also used : SimpleDemoBean(cern.gp.explorer.test.helpers.SimpleDemoBean) ListTableExplorer(cern.gp.explorer.ListTableExplorer) GPNode(cern.gp.nodes.GPNode)

Aggregations

ListTableExplorer (cern.gp.explorer.ListTableExplorer)3 GPNode (cern.gp.nodes.GPNode)2 TreeExplorer (cern.gp.explorer.TreeExplorer)1 ColoredBean (cern.gp.explorer.test.helpers.ColoredBean)1 RecursiveChildrenListManager (cern.gp.explorer.test.helpers.RecursiveChildrenListManager)1 SimpleDemoBean (cern.gp.explorer.test.helpers.SimpleDemoBean)1 Printable (java.awt.print.Printable)1