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;
}
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);
}
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();
}
Aggregations