/** * Short description in header produces unexpected line wraps in footer. * * <p>Note: the frame is not packed to simulate the appframework context. */ public void interactiveHTMLTextWrapShort() { JXHeader header = new JXHeader(); header.setTitle("AlbumManager"); String headerShort = "An adaption from JGoodies Binding Tutorial in the context" + " of BeansBinding/AppFramework. "; header.setDescription(headerShort); header.setIcon(XTestUtils.loadDefaultIcon()); JXHeader footer = new JXHeader(); footer.setTitle("Notes:"); String footerDescription = "<html>" + " <ul> " + " <li> code: in the jdnc-incubator, section kleopatra, package appframework." + " <li> technique: back the view by a shared presentation model " + " <li> technique: veto selection change until editing is completed " + " <li> issue: selection of tab should be vetoable " + " <li> issue: empty selection should disable editing pane " + " </ul> " + " </html>"; footer.setDescription(footerDescription); JComponent panel = new JPanel(new BorderLayout()); panel.add(header, BorderLayout.NORTH); panel.add(footer, BorderLayout.SOUTH); JXFrame frame = new JXFrame("html wrapping in SOUTh: short text in NORTH"); frame.add(panel); frame.setSize(800, 400); frame.setVisible(true); }
/** * Long description in header produces expected line-wrap in footer. * * <p>Note: the frame is not packed to simulate the appframework context. */ public void interactiveHTMLTextWrapLong() { // Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() { // // public void eventDispatched(AWTEvent event) { // if (event.getID() != MouseEvent.MOUSE_MOVED) { // System.out.println("e:" + event); // } // }}, Long.MAX_VALUE); JXHeader header = createHeader(); JXHeader footer = new JXHeader(); footer.setTitle("Notes:"); String footerDescription = "<html>" + " <ul> " + " <li> code: in the jdnc-incubator, section kleopatra, package appframework." + " <li> technique: back the view by a shared presentation model " + " <li> technique: veto selection change until editing is completed " + " <li> issue: selection of tab should be vetoable " + " <li> issue: empty selection should disable editing pane " + " </ul> " + " </html>"; footer.setDescription(footerDescription); JComponent panel = new JPanel(new BorderLayout()); panel.add(header, BorderLayout.NORTH); // panel.add(new JScrollPane(table)); panel.add(footer, BorderLayout.SOUTH); // JXFrame frame = new JXFrame("html wrapping in SOUTH: long text in NORTH"); // frame.add(panel); JXFrame frame = wrapInFrame(panel, "html wrapping in SOUTH: long text in NORTH"); // addComponentOrientationToggle(frame); frame.setSize(800, 600); // show(frame); frame.setVisible(true); }
private JXHeader createHeader() { JXHeader header = new JXHeader(); header.setTitle("AlbumManager"); String headerLong = "An adaption from JGoodies Binding Tutorial in the context" + " of BeansBinding/AppFramework. " + "The Tabs show different styles of typical interaction " + "setups (in-place editing vs. dialog-editing). "; header.setDescription(headerLong); header.setIcon(XTestUtils.loadDefaultIcon()); return header; }