Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8126966

Gtk: URL is recognised both as FILE and as URL, linux only, DnD and Clipboard

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 7u6, 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:
    • Environment:

      2.2.0b21, JDK7u6b23, ubuntu10.04x64;

      Description

      Use code to reproduce:


      import javafx.application.Application;
      import javafx.event.ActionEvent;
      import javafx.event.EventHandler;
      import javafx.scene.Scene;
      import javafx.scene.control.ButtonBuilder;
      import javafx.scene.input.Clipboard;
      import javafx.scene.input.ClipboardContent;
      import javafx.scene.input.DataFormat;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class SimpleApp extends Application {

          public static void main(String[] args) {
              launch(args);
          }

          @Override
          public void start(Stage stage) throws Exception {
              VBox rbox = new VBox(10);

              final ClipboardContent content = new ClipboardContent();

              rbox.getChildren().add(ButtonBuilder.create().text("Put to clipboard").onAction(new EventHandler<ActionEvent>() {

                  @Override
                  public void handle(ActionEvent t) {
                      content.put(DataFormat.URL, CONTENT_URL);
                      Clipboard.getSystemClipboard().setContent(content);
                  }
              }).build());

              rbox.getChildren().add(ButtonBuilder.create().text("paste from clipboard").onAction(new EventHandler<ActionEvent>() {

                  @Override
                  public void handle(ActionEvent t) {
                      System.out.println("URL : " + Clipboard.getSystemClipboard().getContent(DataFormat.URL));
                      System.out.println("FILE : " + Clipboard.getSystemClipboard().getContent(DataFormat.FILES));
                  }
              }).build());

              Scene scene = new Scene(rbox, 300, 300);
              stage.setScene(scene);
              stage.show();
          }
          final static String CONTENT_URL = "http://www.oracle.com";
      }

      Put to clipboard and get from it.
      I see output:
      run:
      URL : http://www.oracle.com
      FILE : [http:/www.oracle.com]

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                azvegint Alexander Zvegintsev (Inactive)
                Reporter:
                akirov Alexander Kirov (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: