Skip to content

Instantly share code, notes, and snippets.

View ishimoto's full-sized avatar
🏠
Working from home

Ken Ishimoto ishimoto

🏠
Working from home
View GitHub Profile
@ishimoto
ishimoto / Branch Delegate : Custom Confirm.java
Created March 16, 2025 07:28
Sample can be found on `TBBM_TBTestingButtonDelegate`
/*
* This creates a custom Confirm Page.
* confirm is CUSTOM_CONFIRM
* The Button name has three dots ... after clicking a confirm screen displays.
* You are able to cancel or submit. only if you click submit the code get executed.
* You have to return `null` and it will finish and return to your current page.
* Or you could return a new Component where it should go.
*/
@TBSangriaDelegate(availablePages = "InspectTBPerson", confirm = ETBD2WDelegateConfirm.CUSTOM_CONFIRM)
@ishimoto
ishimoto / Branch Delegate : Password.java
Created March 16, 2025 07:26
Sample can be found on `TBBM_TBTestingButtonDelegate`
/*
* This creates a Confirm Page with password confirmation.
* confirm is PASSWORD
* The Button name has three dots ... after clicking a confirm screen ask for the password.
* You are able to cancel or submit. only if your password is valid the code get executed.
* You have to return `null` and it will finish and return to your current page.
* Or you could return a new Component where it should go.
*/
@TBSangriaDelegate(availablePages = "InspectTBPerson", confirm = ETBD2WDelegateConfirm.PASSWORD, confirmMessage = "Password Check.")
@ishimoto
ishimoto / Branch Delegate : Confirm.java
Last active March 16, 2025 07:25
Sample can be found on `TBBM_TBTestingButtonDelegate`
/*
* This creates a simple Confirm Page with a check-box for confirmation.
* confirm is CONFIRM
* The Button name has three dots ... after clicking a confirm screen ask for checking a check-box.
* You are able to cancel or submit. only if you check the box and submit the code get executed.
* You have to return `null` and it will finish and return to your current page.
* Or you could return a new Component where it should go.
*/
@TBSangriaDelegate(availablePages = "InspectTBPerson", confirm = ETBD2WDelegateConfirm.CONFIRM, confirmMessage = "Are you Really, sure?")
@ishimoto
ishimoto / Branch Delegate : No Confirm.java
Last active March 16, 2025 07:20
Sample can be found on `TBBM_TBTestingButtonDelegate`
/*
* This is the simplest default implementation of a modern BranchDelegate.
* confirm is NO_CONFIRM
* After clicking the code get executed immediately, also the Button name will not have the three dots ...
* You have to return `null` and it will finish and return to your current page.
* Or you could return a new Component where it should go.
*/
@TBSangriaDelegate(availablePages = "InspectTBPerson", confirm = ETBD2WDelegateConfirm.NO_CONFIRM)
public TBComponent noConfirm() {
@ishimoto
ishimoto / Authorization Token.java
Last active January 29, 2025 02:09
Request an access token from an external service, with using a config file.
// READ token
TBKVAuthorizationTokenUtility authorizationTokenUtility = TBKVAuthorizationTokenUtility.of("static://app:ConfigFile.json");
var nToken = authorizationTokenUtility.readToken(ec);
// CREATE and SAVE new token
var nToken = authorizationTokenUtility.createAndSaveNewAuthorizationToken(ec)
// ConfigFile.json Sample
{
@ishimoto
ishimoto / Toast.java
Created December 23, 2024 11:10
Simple Toast Notification
final var toast = TBKeenToastr.of("Notification", "Message Sent");
toast.toast(context());