8000 GitHub - jnorthr/F5: Keyboard Function Key Support Tool to copy boilerplate text to your System Clipboard
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

jnorthr/F5

Repository files navigation

F5 README

Travis C/I Project Health - Build Status (Travis CI) Apache License

A Gradle project for users who need a utility tool to copy text strings to system clipboards. Clone includes gradle build tool wrapper and folder structure like maven/gradle so you don’t need an installed gradle build tool.

divider3

This trick works nicely if you have a shared drive service like Dropbox, or Google Drive etc. and all your internal systems use the same Dropbox,etc. account.

On one of my least-used systems, did the following:

Gradle Continuous Doctor Translation
cd ~/Dropbox
git clone https://github.com/jnorthr/DoctorPepper.git
cd ~/Dropbox/DoctorPepper
gradlew -t asciidoctor

The -t option keeps gradle running in continuous mode so now any changes i make to any asciidoctor files are near-instantly translated for me.


Note
If you don’t have a git client click here to install one

Layout

This is a comment for the text that follows ?

The code we write today and tomorrow will probably never run on a single processor system: parallel hardware has become standard. Not so with the software though, at least not yet.

Pre-requisites
  1. Working internet connection

  2. Installed Git client to copy/clone this repo

  3. Ability to use terminal console

Steps
  1. Open terminal console

  2. Change directory \( cd \) into target folder location

  3. Run this command to create a folder and copy down all the pieces :

    git clone https://github.com/jnorthr/F5.git
  4. cd F5/

  5. ./gradlew runs defined tasks to build and test code samples

  6. After prior step completes, examine F5/ folder to find the /build/ folder with test results


The Copier.groovy source has methods to interact with the System Clipboard for most O/S types.

Method Layout
public void copy(String s)

This is a class method to do the deed. Call this method with a Java/Groovy or JVM language String types to place that string on to the System Clipboard of the operating system. Only String copies are supported.

Method Sample
Copier ck = new Copier();
       ck.copy("Hi from me");
Method Layout
public String paste()

This is a class method to do the deed. Call this method with a Java/Groovy or JVM language to receive a String type from System Clipboard of the operating system. Only String copies are supported.

Method Sample
Copier ck = new Copier();
def what = ck.paste();

Here is a general explanation of each source code file/groovy class used to make F5 work.

These classes provide keyboard actions when attached to known keys.

Feature to create a Copy Action skeleton for mouseAdapter and KeyboardAdapter actions
Feature to create a system clipboard Cut Action skeleton for mouseAdapter and KeyboardAdapter actions
Here we show dialog to allow user to revise text for a function key, then stored in file named after function key plus .txt suffix. So function key four would store text in file named F4.txt
Feature to create a skeleton action to exit an app for mouseAdapter and KeyboardAdapter actions
Feature to create a skeleton action to paste text to system clipboard using mouseAdapter and KeyboardAdapter actions
Feature to copy the current view of your screen to a system clipboard using mouseAdapter and KeyboardAdapter actions
Feature to create an Action to dispose of the current JOptionPane dialog
Here's logic to copy payload text to clipboard for one function key that's been presssed

These source files hold a number of java/groovy classes to do the deed.
Utility method to build a single JButton for each function key to paste text to the System clipboard  containing logic to read text from external file due to being mouse clicked or pressing it's associate Function Key.
Also support methods to make Quit, screen print and panel move buttons for the F5 dialog.
Called from F5 wrapper
Groovy code to choose one folder using java's JFileChooser then write user's choice into <user>\.F5.txt file.
Will only allow choice of a single directory by setting another JFileChooser feature
Default constructor builds a tool to interact with the System Clipboard for most operatng systems.
Wrapper code to build and run the F5 copy tool.
This class retains the session instance values for the currently running F5 class
JFrame GUI to build a tool to support function key usage to paste text onto the System clipboard
single method to confirm string is a valid function key choice between F1 and F24
Tool to read/write/update/delete/confirm there is text from a File for each function key, where file name starts with a capital letter 'F' - for function key plus a number between one and twenty-four. This is followed by a file
suffix '.txt'.
So, for example, 'F1.txt' has this format and content: The optional, tooltip is located at the start of text within a pair of ||'s  so: |Asciidoctor Template|Text payload for the F1 function key ${abbrev} ${name}.
After loading, the 'payload' variable holds :
Text payload for the F1 function key ${abbrev} ${name}
and 'tooltip' variable has : Asciidoctor Template
Note, in this example are optional replacement variables denoted by ${} and when, in this example, the F1 function key is pressed, the user is asked, via a dialog, to provide a replacement value for that name. Here, the user is asked for a value to be used instead of 'abbrev' plus a second time to provide a new value for 'name'.
If the user answers 'Cool' for the 'abbrev' and 'Fred' for 'name', then the system clipboard will be filled with :
*Text payload for the F1 function key Cool Fred.*
and the title of the dialog will be 'Asciidoctor Template'.
Feature to find template replacement names within a template string
This program implements a support application that gains system & user values for directory and folder names, confirms the exists of an optional text file, and if that exists and has a text value that is also a valid system directory foler name, then copyPathFound boolean becomes true.
This Swing class demonstrates JFrame positional features. It allows JFrame provided controlling logic to move the frame to each corner of the physical screen display using mouse on button or keyboard backslash '\' key.
A sample test harness to build prototypes of GUI components and test how they would look when being moved around.
A class that holds session instance results of most recent user dialog
Feature class to get text & tooltip for valid function keys and save it with known .txt filename in the PathFinder discovered local file path or folder directory.
Called from two actions: ToClipboardAction & EditAction. Tested in two test scripts: F5TestSpec & TemplateMakerTestSpec

About

Keyboard Function Key Support Tool to copy boilerplate text to your System Clipboard

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0