jdic
  1. jdic
  2. JDIC-410

JavaBean support for browser component

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      410

      Description

      GUI Builder getting better and better, and more and more people recommend to use gui builder. So we
      should make it possible to use jdic browser with gui builder.

      Out of the box it is impossible to use browser component in a gui builder because the following
      resounds:

      • every implementation needs native libs
      • IWebBrowser browser = BrowserManager.getInstance() is not JavaBean compatible

      The first resound is address in issue #409, and the second with this issue.

      A simple wrapper is the solution, for example:
      public class WebBrowserBean extends Container implements IWebBrowser {
      IWebBrowser browser;

      /** Creates a new instance of WebBrowserBean */
      public WebBrowserBean()

      { setLayout(new BorderLayout()); browser = BrowserManager.getInstance(); add(browser.asComponent(), BorderLayout.CENTER); }

      public void setURL()

      { browser.setURL(); }

      ...
      }

      Btw i think we should rename WebBrowser to IeMozWebBrowser or something like that and call this
      WebBrowserBean WebBrowser. So the normal user only need to know WebBrowser...

      1. WebBrowserBean.java.tgz
        1 kB
        lordy
      2. WebBrowserBeanIssue.zip
        15 kB
        michael_shan

        Activity

        Hide
        lordy added a comment -

        Created an attachment (id=244)
        fast hack to try it out

        Show
        lordy added a comment - Created an attachment (id=244) fast hack to try it out
        Hide
        michael_shan added a comment -

        Created an attachment (id=246)
        Some draf fiels I've done fyi.

        Show
        michael_shan added a comment - Created an attachment (id=246) Some draf fiels I've done fyi.
        Hide
        michael_shan added a comment -

        Hi Chris,
        Agree with your thoughts, and thank you very much ! I uploaded some changes
        I've done to support the way to get web browser from engine FYI. Just some try
        code and not finished and still need to be tested under mac.

        Thanks!
        Michael

        Show
        michael_shan added a comment - Hi Chris, Agree with your thoughts, and thank you very much ! I uploaded some changes I've done to support the way to get web browser from engine FYI. Just some try code and not finished and still need to be tested under mac. Thanks! Michael
        Hide
        lordy added a comment -

        I see you add an abstract class ABrowserEngineImpl.java for that. In my tests I simple implement
        getWebBrowser() in every Engine.

        MozillaEngine.java and InternetExplorerEngine.java:
        public IWebBrowser getWebBrowser()

        { return new WebBrowser(); }

        WebKitEngine.java:
        public IWebBrowser getWebBrowser()

        { return new WebKitWebBrowser(); }

        JEditorPaneEngine.java:
        public IWebBrowser getWebBrowser()

        { return new JEditorPaneWebBrowser(); }

        The good thing is we so need no new class, and I see no bad thing in doing it this way.

        Show
        lordy added a comment - I see you add an abstract class ABrowserEngineImpl.java for that. In my tests I simple implement getWebBrowser() in every Engine. MozillaEngine.java and InternetExplorerEngine.java: public IWebBrowser getWebBrowser() { return new WebBrowser(); } WebKitEngine.java: public IWebBrowser getWebBrowser() { return new WebKitWebBrowser(); } JEditorPaneEngine.java: public IWebBrowser getWebBrowser() { return new JEditorPaneWebBrowser(); } The good thing is we so need no new class, and I see no bad thing in doing it this way.
        Hide
        michael_shan added a comment -

        Ok, this is better. Another issue,since we've provided JEditorPaneEngine, we
        should also support users use bem(BrowserEngineManager) to set it as the default
        one.

        Show
        michael_shan added a comment - Ok, this is better. Another issue,since we've provided JEditorPaneEngine, we should also support users use bem(BrowserEngineManager) to set it as the default one.
        Hide
        lordy added a comment -

        Current bem support setActiveEngine, so can you describe what you mean is different to setActiveEngine
        and "support users use bem(BrowserEngineManager) to set it as the default
        one"(setDefaultEngine?)?

        Show
        lordy added a comment - Current bem support setActiveEngine, so can you describe what you mean is different to setActiveEngine and "support users use bem(BrowserEngineManager) to set it as the default one"(setDefaultEngine?)?
        Hide
        michael_shan added a comment -

        Hi Chris,

        Support users to set JEditorPaneEngine as the default one like
        "bem.setActiveEngine(bem.JEDITORPANE)".

        Show
        michael_shan added a comment - Hi Chris, Support users to set JEditorPaneEngine as the default one like "bem.setActiveEngine(bem.JEDITORPANE)".
        Hide
        lordy added a comment -

        I see no reason why bem.setActiveEngine(bem.JEDITORPANE) should not work yet, because
        issue 409 should also add JEditorPaneEngine to bem in initExitingEngines and as public static String
        JEDITORPANE = "JEditorPane";

        Show
        lordy added a comment - I see no reason why bem.setActiveEngine(bem.JEDITORPANE) should not work yet, because issue 409 should also add JEditorPaneEngine to bem in initExitingEngines and as public static String JEDITORPANE = "JEditorPane";
        Hide
        michael_shan added a comment -

        "Issue 409 should also add JEditorPaneEngine to bem in initExitingEngines and as
        public static String JEDITORPANE = "JEditorPane"; "

        Yes, that's just what I mean.

        Show
        michael_shan added a comment - "Issue 409 should also add JEditorPaneEngine to bem in initExitingEngines and as public static String JEDITORPANE = "JEditorPane"; " Yes, that's just what I mean.

          People

          • Assignee:
            michael_shan
            Reporter:
            lordy
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: