Examples of JWebBrowser


Examples of chrriis.dj.nativeswing.swtimpl.components.JWebBrowser

  private static class CMJ_commandReceived extends ControlCommandMessage {
    @Override
    public Object run(Object[] args) {
      NativeWebBrowser nativeWebBrowser = (NativeWebBrowser)getNativeComponent();
      JWebBrowser webBrowser = nativeWebBrowser == null? null: nativeWebBrowser.webBrowser.get();
      if(webBrowser == null) {
        return null;
      }
      Object[] listeners = nativeWebBrowser.listenerList.getListenerList();
      WebBrowserCommandEvent e = null;
View Full Code Here

Examples of chrriis.dj.nativeswing.swtimpl.components.JWebBrowser

  private static class CMJ_locationChanging extends ControlCommandMessage {
    @Override
    public Object run(Object[] args) {
      NativeWebBrowser nativeWebBrowser = (NativeWebBrowser)getNativeComponent();
      JWebBrowser webBrowser = nativeWebBrowser == null? null: nativeWebBrowser.webBrowser.get();
      if(webBrowser == null) {
        return false;
      }
      Object[] listeners = nativeWebBrowser.listenerList.getListenerList();
      String location = (String)args[0];
View Full Code Here

Examples of chrriis.dj.nativeswing.swtimpl.components.JWebBrowser

  private static class CMJ_locationChangeCanceled extends ControlCommandMessage {
    @Override
    public Object run(Object[] args) {
      NativeWebBrowser nativeWebBrowser = (NativeWebBrowser)getNativeComponent();
      JWebBrowser webBrowser = nativeWebBrowser == null? null: nativeWebBrowser.webBrowser.get();
      if(webBrowser == null) {
        return null;
      }
      Object[] listeners = nativeWebBrowser.listenerList.getListenerList();
      String location = (String)args[0];
View Full Code Here

Examples of chrriis.dj.nativeswing.swtimpl.components.JWebBrowser

  private static class CMJ_updateTitle extends ControlCommandMessage {
    @Override
    public Object run(Object[] args) {
      NativeWebBrowser nativeWebBrowser = (NativeWebBrowser)getNativeComponent();
      JWebBrowser webBrowser = nativeWebBrowser == null? null: nativeWebBrowser.webBrowser.get();
      if(webBrowser == null) {
        return null;
      }
      nativeWebBrowser.title = (String)args[0];
      Object[] listeners = nativeWebBrowser.listenerList.getListenerList();
View Full Code Here

Examples of chrriis.dj.nativeswing.swtimpl.components.JWebBrowser

  private static class CMJ_updateStatus extends ControlCommandMessage {
    @Override
    public Object run(Object[] args) {
      NativeWebBrowser nativeWebBrowser = (NativeWebBrowser)getNativeComponent();
      JWebBrowser webBrowser = nativeWebBrowser == null? null: nativeWebBrowser.webBrowser.get();
      if(webBrowser == null) {
        return null;
      }
      nativeWebBrowser.status = (String)args[0];
      Object[] listeners = nativeWebBrowser.listenerList.getListenerList();
View Full Code Here

Examples of chrriis.dj.nativeswing.swtimpl.components.JWebBrowser

  private static class CMJ_updateLoadingProgress extends ControlCommandMessage {
    @Override
    public Object run(Object[] args) {
      NativeWebBrowser nativeWebBrowser = (NativeWebBrowser)getNativeComponent();
      JWebBrowser webBrowser = nativeWebBrowser == null? null: nativeWebBrowser.webBrowser.get();
      if(webBrowser == null) {
        return null;
      }
      nativeWebBrowser.loadingProgress = (Integer)args[0];
      Object[] listeners = nativeWebBrowser.listenerList.getListenerList();
View Full Code Here

Examples of chrriis.dj.nativeswing.swtimpl.components.JWebBrowser

  private static class CMJ_consolePrinting extends ControlCommandMessage {
    @Override
    public Object run(Object[] args) {
      NativeWebBrowser nativeWebBrowser = (NativeWebBrowser)getNativeComponent();
      JWebBrowser webBrowser = nativeWebBrowser == null? null: nativeWebBrowser.webBrowser.get();
      if(webBrowser == null) {
        return null;
      }
      System.out.println(args[0]);
      return null;
View Full Code Here

Examples of chrriis.dj.nativeswing.swtimpl.components.JWebBrowser

    contentPane.add(webBrowserPanel, BorderLayout.CENTER);
    // Add the listeners
    testHeaderButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        webBrowserPanel.removeAll();
        JWebBrowser webBrowser = new JWebBrowser();
        webBrowser.setBarsVisible(false);
        WebBrowserNavigationParameters parameters = new WebBrowserNavigationParameters();
        Map<String, String> headersMap = new HashMap<String, String>();
        headersMap.put("User-agent", "Native Swing Browser");
        headersMap.put(testHeaderKeyTextField.getText(), testHeaderValueTextField.getText());
        parameters.setHeaders(headersMap);
        Map<String, String> postDataMap = new HashMap<String, String>();
        postDataMap.put(testPostDataKeyTextField.getText(), testPostDataValueTextField.getText());
        parameters.setPostData(postDataMap);
        // Let's generate the page with the resulting HTTP headers dynamically.
        webBrowser.navigate(WebServer.getDefaultWebServer().getDynamicContentURL(NavigationParameters.class.getName(), "header-viewer.html"), parameters);
        webBrowserPanel.add(webBrowser, BorderLayout.CENTER);
        webBrowserPanel.revalidate();
        webBrowserPanel.repaint();
      }
    });
View Full Code Here

Examples of chrriis.dj.nativeswing.swtimpl.components.JWebBrowser

  public static JComponent createContent() {
    JPanel contentPane = new JPanel(new BorderLayout());
    JPanel webBrowserPanel = new JPanel(new BorderLayout());
    webBrowserPanel.setBorder(BorderFactory.createTitledBorder("Native Web Browser component"));
    final JWebBrowser webBrowser = new JWebBrowser();
    webBrowser.setBarsVisible(false);
    webBrowser.setStatusBarVisible(true);
    webBrowserPanel.add(webBrowser, BorderLayout.CENTER);
    contentPane.add(webBrowserPanel, BorderLayout.CENTER);
    JPanel configurationPanel = new JPanel(new BorderLayout());
    configurationPanel.setBorder(BorderFactory.createTitledBorder("Configuration"));
    final JTextArea configurationTextArea = new JTextArea(
        "<html>" + LS +
        "  <body>" + LS +
        "    <h1>Some header</h1>" + LS +
        "    <p>A paragraph with a <a href=\"http://www.google.com\">link</a>.</p>" + LS +
        "  </body>" + LS +
        "</html>");
    JScrollPane scrollPane = new JScrollPane(configurationTextArea);
    Dimension preferredSize = scrollPane.getPreferredSize();
    preferredSize.height += 20;
    scrollPane.setPreferredSize(preferredSize);
    configurationPanel.add(scrollPane, BorderLayout.CENTER);
    JPanel configurationButtonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));
    JButton setContentButton = new JButton("Set Content");
    setContentButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        webBrowser.setHTMLContent(configurationTextArea.getText());
      }
    });
    configurationButtonPanel.add(setContentButton);
    configurationPanel.add(configurationButtonPanel, BorderLayout.SOUTH);
    contentPane.add(configurationPanel, BorderLayout.NORTH);
View Full Code Here

Examples of chrriis.dj.nativeswing.swtimpl.components.JWebBrowser

  public static JComponent createContent() {
    JPanel contentPane = new JPanel(new BorderLayout());
    JPanel webBrowserPanel = new JPanel(new BorderLayout());
    webBrowserPanel.setBorder(BorderFactory.createTitledBorder("Native Web Browser component"));
    final JWebBrowser webBrowser = new JWebBrowser();
    webBrowser.navigate("http://www.google.com");
    webBrowserPanel.add(webBrowser, BorderLayout.CENTER);
    contentPane.add(webBrowserPanel, BorderLayout.CENTER);
    // Create an additional bar allowing to show/hide the menu bar of the web browser.
    JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 4, 4));
    JCheckBox menuBarCheckBox = new JCheckBox("Menu Bar", webBrowser.isMenuBarVisible());
    menuBarCheckBox.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        webBrowser.setMenuBarVisible(e.getStateChange() == ItemEvent.SELECTED);
      }
    });
    buttonPanel.add(menuBarCheckBox);
    contentPane.add(buttonPanel, BorderLayout.SOUTH);
    return contentPane;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.