@ -54,6 +54,7 @@ import javafx.scene.control.TextArea;
import javafx.scene.control.Tooltip ;
import javafx.scene.image.Image ;
import javafx.scene.image.ImageView ;
import javafx.scene.input.Clipboard ;
import javafx.scene.input.ClipboardContent ;
import javafx.scene.input.DataFormat ;
import javafx.scene.input.DragEvent ;
@ -70,6 +71,7 @@ import javafx.scene.paint.Color;
import javafx.scene.shape.Line ;
import javafx.stage.DirectoryChooser ;
import javafx.stage.Stage ;
import javafx.util.Duration ;
/ * *
* Main class of the application . Changes the views , commands the work and
@ -1105,6 +1107,9 @@ public class UICoordinator implements ChangeListener<Boolean>
ComboBox < String > levelThree = getComboBox ( comboContainer ) ;
ComboBox < String > levelFour = getComboBox ( comboContainer ) ;
levelOne . setStyle ( "-fx-font-family :\"Arial\"" ) ;
levelTwo . setStyle ( "-fx-font-family :\"Arial\"" ) ;
levelThree . setStyle ( "-fx-font-family :\"Arial\"" ) ;
levelFour . setStyle ( "-fx-font-family :\"Arial\"" ) ;
levelOne . setItems ( getOccupationList ( "" ) ) ;
levelOne . setDisable ( false ) ;
@ -1459,20 +1464,30 @@ public class UICoordinator implements ChangeListener<Boolean>
clipboardFiles . add ( fileForSaving ) ;
/ / copy filepath to clipboard
BorderPane showInFileBrowser = new BorderPane ( ) ;
showInFileBrowser . setId ( "openFileInFileBrowser " ) ;
Label openInFileBrowser Text = new Label ( Text . OPEN_FILE_IN_BROWSER ) ;
showInFileBrowser . setCenter ( openInFileBrowser Text) ;
showInFileBrowser . setLeft ( new ImageView (
BorderPane copyToClipboard = new BorderPane ( ) ;
copyToClipboard . setId ( "copyToClipboard " ) ;
Label clipBoard Text = new Label ( Text . COPY_FILE_PATH ) ;
copyToClipboard . setCenter ( clipBoard Text) ;
copyToClipboard . setLeft ( new ImageView (
new Image ( this . getClass ( ) .
getResourceAsStream ( "filepath.png" ) , 64 . 0 , 64 . 0 , true , true ) ) ) ;
showInFileBrowser . setOnMouseClicked ( new EventHandler < MouseEvent > ( )
copyToClipboard . setOnMouseClicked ( new EventHandler < MouseEvent > ( )
{
@Override
public void handle ( MouseEvent arg0 )
{
hostServices . showDocument ( fileForSaving . getParent ( ) ) ;
final Clipboard clipboard = Clipboard . getSystemClipboard ( ) ;
final ClipboardContent content = new ClipboardContent ( ) ;
content . putString ( fileForSaving . getAbsolutePath ( ) ) ;
clipboard . setContent ( content ) ;
Point2D p = clipBoardText . localToScreen ( clipBoardText . getLayoutBounds ( ) . getCenterX ( ) ,
clipBoardText . getLayoutBounds ( ) . getCenterY ( ) ) ;
Tooltip copied = new Tooltip ( Text . FILE_PATH_IN_CLIPBOARD ) ;
clipBoardText . setTooltip ( copied ) ;
copied . show ( clipBoardText , p . getX ( ) , p . getY ( ) ) ;
copied . setHideDelay ( Duration . seconds ( 5 ) ) ;
copied . autoHideProperty ( ) . set ( true ) ;
}
} ) ;
@ -1518,16 +1533,17 @@ public class UICoordinator implements ChangeListener<Boolean>
}
} ) ;
HBox . setHgrow ( showInFileBrowser , Priority . ALWAYS ) ;
HBox . setHgrow ( copyToClipboard , Priority . ALWAYS ) ;
HBox . setHgrow ( dragToNextcloud , Priority . ALWAYS ) ;
HBox . setHgrow ( goToNextcloud , Priority . ALWAYS ) ;
nextcloudHelp . getChildren ( ) . add ( dragToNextcloud ) ;
nextcloudHelp . getChildren ( ) . add ( showInFileBrowser ) ;
nextcloudHelp . getChildren ( ) . add ( copyToClipboard ) ;
container . getChildren ( ) . add ( nextcloudHelp ) ;
TextArea copyable = new TextArea ( String . format ( Text . F_RAW_UPLOAD_DATA , fileForSaving . getAbsolutePath ( ) , Text . NEXTCLOUD_ADDRESS ) ) ;
copyable . setEditable ( false ) ;
copyable . setWrapText ( true ) ;
copyable . setStyle ( "-fx-font-family :\"Arial\"" ) ;
copyable . setId ( "buttonProblems" ) ;
copyable . setFocusTraversable ( false ) ;
copyable . setPrefHeight ( 70 ) ;