[svn r346] WIP, with working x4o and simple ldap backend for listing end editing entries
This commit is contained in:
parent
5d64bde0bd
commit
f401b61a6c
60 changed files with 1756 additions and 585 deletions
|
|
@ -26,10 +26,15 @@
|
|||
|
||||
package com.idcanet.vasc;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.InputStream;
|
||||
import java.util.logging.LogManager;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuBar;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import com.idcanet.vasc.core.VascEntry;
|
||||
|
|
@ -57,16 +62,43 @@ public class SwingTest extends TestCase {
|
|||
|
||||
public void testAll() throws Exception {
|
||||
JFrame.setDefaultLookAndFeelDecorated(false);
|
||||
VascEntry entry = TestTable.getVascTable();
|
||||
JFrame frame = viewEntry(entry);
|
||||
|
||||
while (frame.isVisible()) {
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
public JFrame viewEntry(final VascEntry entry) throws Exception {
|
||||
// get GUI
|
||||
JFrame frame = new JFrame();
|
||||
frame.setTitle("Vasc Test - Swing");
|
||||
frame.setTitle("Vasc Test - Swing - "+entry.getName());
|
||||
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||
frame.setLocationRelativeTo(null);
|
||||
|
||||
// get table
|
||||
VascEntry entry = TestTable.getVascTable();
|
||||
|
||||
|
||||
JMenuBar menubar = new JMenuBar();
|
||||
JMenu vascMenu = new JMenu("Vasc Entries");
|
||||
|
||||
for (final String id:entry.getVascFrontendData().getVascController().getVascEntryControllerResolver().getVascEntryController().getVascEntryIds()) {
|
||||
JMenuItem item = new JMenuItem(id);
|
||||
item.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
VascEntry ee = entry.getVascFrontendData().getVascController().getVascEntryControllerResolver().getVascEntryController().getVascEntryById(id);
|
||||
TestTable.fill(ee,entry.getVascFrontendData().getVascController());
|
||||
viewEntry(ee);
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
vascMenu.add(item);
|
||||
}
|
||||
menubar.add(vascMenu);
|
||||
frame.setJMenuBar(menubar);
|
||||
|
||||
// define redering
|
||||
JPanel panel = new JPanel();
|
||||
SwingVascFrontend render = new SwingVascFrontend(panel);
|
||||
|
|
@ -74,18 +106,12 @@ public class SwingTest extends TestCase {
|
|||
|
||||
// render
|
||||
render.initEntry(entry);
|
||||
|
||||
//table.getTableColumns().get(0).set
|
||||
|
||||
//render.renderEdit(table.getTableData().get(0));
|
||||
render.renderView();
|
||||
|
||||
// view
|
||||
frame.pack();
|
||||
frame.setVisible(true);
|
||||
|
||||
while (frame.isVisible()) {
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue