* [ 1662593 ] Bad behavior of OnlineLogin Help

This commit is contained in:
Heng Sin Low 2007-02-21 03:36:21 +00:00
parent ddebc8ac20
commit aa9c5dc980
2 changed files with 19 additions and 4 deletions

View File

@ -111,8 +111,8 @@ public final class ALogin extends CDialog
private BorderLayout southLayout = new BorderLayout(); private BorderLayout southLayout = new BorderLayout();
private StatusBar statusBar = new StatusBar(); private StatusBar statusBar = new StatusBar();
private ConfirmPanel confirmPanel = new ConfirmPanel(true, false, false, false, false, false, false); private ConfirmPanel confirmPanel = new ConfirmPanel(true, false, false, false, false, false, false);
private OnlineHelp onlineHelp = new OnlineHelp(true); //private OnlineHelp onlineHelp = new OnlineHelp(true);
private CPanel helpPanel = new CPanel(); //private CPanel helpPanel = new CPanel();
private JScrollPane helpScollPane = new JScrollPane(); private JScrollPane helpScollPane = new JScrollPane();
private BorderLayout helpLayout = new BorderLayout(); private BorderLayout helpLayout = new BorderLayout();
@ -278,10 +278,11 @@ public final class ALogin extends CDialog
loginTabPane.add(defaultPanel, res.getString("Defaults")); loginTabPane.add(defaultPanel, res.getString("Defaults"));
// Help // Help
/*
helpPanel.setLayout(helpLayout); helpPanel.setLayout(helpLayout);
helpPanel.setPreferredSize(new Dimension (100,100)); helpPanel.setPreferredSize(new Dimension (100,100));
helpPanel.add(helpScollPane, BorderLayout.CENTER); helpPanel.add(helpScollPane, BorderLayout.CENTER);
loginTabPane.add(helpPanel, "?"); loginTabPane.add(helpPanel, "?");*/
// //
this.getContentPane().add(mainPanel); this.getContentPane().add(mainPanel);
mainPanel.add(loginTabPane, BorderLayout.CENTER); mainPanel.add(loginTabPane, BorderLayout.CENTER);
@ -290,8 +291,15 @@ public final class ALogin extends CDialog
// //
southPanel.add(confirmPanel, BorderLayout.NORTH); southPanel.add(confirmPanel, BorderLayout.NORTH);
southPanel.add(statusBar, BorderLayout.SOUTH); southPanel.add(statusBar, BorderLayout.SOUTH);
helpScollPane.getViewport().add(onlineHelp, null); //helpScollPane.getViewport().add(onlineHelp, null);
confirmPanel.addActionListener(this); confirmPanel.addActionListener(this);
CButton helpBtn = new CButton(Env.getImageIcon2("Help24"));
helpBtn.setActionCommand("onlineLoginHelp");
helpBtn.addActionListener(this);
helpBtn.setToolTipText(res.getString("Help"));
confirmPanel.addComponent(helpBtn);
statusBar.setStatusDB(null); statusBar.setStatusDB(null);
} // jbInit } // jbInit
@ -446,6 +454,8 @@ public final class ALogin extends CDialog
clientComboChanged(); clientComboChanged();
else if (e.getSource() == orgCombo) else if (e.getSource() == orgCombo)
orgComboChanged(); orgComboChanged();
else if ("onlineLoginHelp".equals(e.getActionCommand()))
OnlineHelp.openInDefaultBrowser();
} // actionPerformed } // actionPerformed

View File

@ -28,6 +28,7 @@ import javax.swing.text.html.*;
import org.adempiere.plaf.AdempierePLAF; import org.adempiere.plaf.AdempierePLAF;
import org.compiere.plaf.*; import org.compiere.plaf.*;
import org.compiere.util.Env;
/** /**
* Online Help Browser & Link. * Online Help Browser & Link.
@ -81,6 +82,10 @@ public class OnlineHelp extends JEditorPane implements HyperlinkListener
/** Base of Online Help System */ /** Base of Online Help System */
protected static final String BASE_URL = "http://www.adempiere.com/wiki/index.php/OnlineLoginHelp"; protected static final String BASE_URL = "http://www.adempiere.com/wiki/index.php/OnlineLoginHelp";
public static void openInDefaultBrowser()
{
Env.startBrowser(BASE_URL);
}
/************************************************************************** /**************************************************************************
* Hyperlink Listener * Hyperlink Listener