@MinDoc(copyright="Copyright 2004-2016, 2019 A. Weinert", author="Albrecht Weinert", version="V.50", lastModified="4.06.2021", usage="start as Java application (-? for help)", purpose="report or question on Window with timeout") public class AskAlert extends App
java AskAlert -help
verbosity
determines, what is
logged:Verbos.SILENT
(option -silent) :
no log output, Verbos.NORMAL
(default) :
the report text,Verbos.VERBOSE
(Option -v) : also
the question and the response.AskAlert
the window is made visible
and it is now waited for a limited time for a user reaction. This time
until answering or pressing a button is settable in 1/10s units in the
range 5 to 90000 seconds.Value | Meaning | |
---|---|---|
>5 | problems | The application had startup problems; the window was not shown. |
5 | cancel | Cancel button / middle button |
4 | closed | window was explicitly closed (by X or icon menu). |
3 | time out | No response, waiting time over *1). |
1 | no | No button / right button |
0 | yes | Yes button / left button |
@Echo
and @Pause
). java AskAlert "Onwards with WWW server update" -v
"Stop and cancel" -wa -wp
if ERRORLEVEL 1 goto :ende
frame4j.jar
", that
should be an installed extension in directory ...jre\lib\ext
.
Therefore AskAlert
is the start application of the .jar file
frame4j.jar. Byjava -jar frame4j.jar
or by double clicking the .jar file this
application AskAlert
is started in this info mode. Exit codes
0, 5 (buttons), 4 (close) as well as 3 (time-out) are returned also in
this mode.AskAlert
(source) belongs
(as integral part) a .properties file named
AskAlert.properties. It's part of the
documentation.de.frame4j
,
App
,
de.frame4j.graf
,
AskDialog
ComVar.Impl
Modifier and Type | Field and Description |
---|---|
protected Color |
bg
Dialouege's background colour.
|
String |
cancel
Middle Cancel-button, text.
|
String |
cancelKey
Middle Cancel-button, key.
|
String |
lower
The question / text below the buttons.
|
String |
no
Right No button, text.
|
String |
noKey
Right No button, key.
|
int |
timeOutCode
Return code for timeout.
|
String |
upper
The report / text above buttons.
|
boolean |
upperMonospaced
Font of upper text non proportional.
|
protected int |
waitMax
Maximal wait time in tenth (1/10) of seconds.
|
String |
yes
Left Yes-button, text.
|
String |
yesKey
Left Yes-button, key.
|
ano, appBase, appIO, appStartTime, appStartTimeMS, args, argsOrig, bgColor, err, fullClassName, help, icon, log, mainThread, myClass, myFrame, name, out, outMode, packName, prop, retCode, runFlag, shortClassName, title, verbose, verbosity
AUTHOR, BLANK_STRING, cons, CONSOL_ENCODING, COPYRIGHT, D, D_NaN, D_NegInf, D_PosInf, EMPTY_INT_A, EMPTY_STRING, FILE_ENCODING, FRW_CLLD, FS, FSS, H, hasCons, HOST_IP, HOST_IPv4, HOST_NAME, INIT_ERROR, JAR_ENCODING, JH, JOB_DONE_OK, JRL, LOG_OUT_ERROR, M, MAIN_THREAD_EXC, NO_BYTES, NO_CLASSES, NO_DOUBLES, NO_OBJECTS, NO_PARS_ERROR, NO_STRINGS, NOT_WINDOWS, ON_PI, ONE_DAY, ONE_HOUR, ONE_LEAP_YEAR, ONE_MINUTE, ONE_SECOND, ONE_WEEK, ONE_YEAR, OS, PROG_NAME, PROG_SHORT, PS, RUNTIME, S, SHY, UD, UL, UL_UR_da, UR
ILLEGAL_TYPE, ILLEGAL_VALUE, NO_ATTRIBUTE, NO_KNOWN_ATTRIBUTE, NO_VALUE, OK, retVtext
Constructor and Description |
---|
AskAlert() |
Modifier and Type | Method and Description |
---|---|
int |
doIt()
AskAlert's working method.
|
static void |
main(String[] args)
AskAlert's start method.
|
void |
setBg(CharSequence bg)
Set dialogoue's background colour.
|
void |
setCancel(String cancel)
Setter for Cancel text.
|
void |
setCancelKey(String cancelKey)
Setter for Cancel key.
|
void |
setLower(String lower)
Set the question / text below the buttons.
|
void |
setNo(String no)
Setter for No text.
|
void |
setNoKey(String noKey)
Setter for No key.
|
void |
setUpper(String upper)
Set the report / text above buttons.
|
void |
setWaitMax(int waitMax)
Set maximal wait time in tenth (1/10) of seconds.
|
void |
setYes(String yes)
Setter for
yes . |
void |
setYesKey(String yesKey)
Setter for
yesKey . |
actionPerformed, allowNoPropertiesFile, clientOrder, condHelpLog, connect, errMeld, errMeld, errorExit, errorExit, errorText, extraPropertiesFile, formMessage, formMessage, formMessage, getAbout, getAboutText, getActTime, getAppLogger, getAppStartTime, getArgs, getAuthor, getCopyright, getDbLogger, getExecTimeMs, getExecTimeMsL, getExecTimeString, getHelp, getHelpText, getIcon, getLanguage, getLogHandler, getMessageComponent, getMessageComponentsLength, getMyFrame, getName, getNameWithVersDate, getOutMode, getProp, getPurpose, getStartTime, getStateString, getTheCloser, getTitle, getUsage, getVerbose, getVerbosity, getVersDate, go, go, go, haveIcon, isDebug, isHelp, isHelpLog, isNormal, isRunFlag, isSilent, isTest, isVerbose, logVerbose, logVerbose, makeStatusTextEnd, makeStatusTextStart, messageFormat, normalExit, parsePartial, performeAction, queueAction, regAsStdMBean, repExc, setAboutText, setAttribute, setAttribute, setAuthor, setBgColor, setCodePages, setCopyright, setHelp, setLogOut2, setName, setOutMode, setOutMode, setPurpose, setTitle, setUsage, setVerbose, setVerbose, setVerbosity, setVerbosity, setVersDate, stop, threeLineEndMsg, toString, twoLineEndMsg, twoLineStartMsg, valueLang, valueLang, wakeMainThread
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
retVtext
protected int waitMax
public String upper
public boolean upperMonospaced
public String lower
public String yes
yesKey
) is empty.public String yesKey
yes
value is null or empty, this is the key to a
(inter) nationalised, user language dependent value fetched by
(@link App#valueLang(CharSequence) valueLang(yesKey)}.AppLangMap
public String cancel
public String cancelKey
public String no
public String noKey
protected Color bg
setBg(CharSequence)
public int timeOutCode
public void setWaitMax(int waitMax)
waitMax
- wait time in 1/10spublic void setUpper(String upper)
upper
- message / report text (above the buttons)public void setLower(String lower)
lower
- message / report text (below the buttons)public void setYes(String yes)
yes
- text (label) for yes buttonsetYesKey(String)
public void setYesKey(String yesKey)
yesKey
- the key, will be stripped from surrounding white space;
(then) empty acts like nullsetYes(String)
public void setCancel(String cancel)
cancel
- text (label) for cancel buttonpublic void setCancelKey(String cancelKey)
cancelKey
- key (command) for cancel buttonpublic void setNo(String no)
no
- text (label) for no buttonpublic void setNoKey(String noKey)
noKey
- key (command) for no buttonpublic void setBg(CharSequence bg)
bg
as colour by
ColorHelper.getColor(CharSequence)
. If this is not possible null is
set or left.bg
- names a background colourpublic static void main(String[] args)
args
- command line parameterspublic int doIt()
doIt
in class App
Prop
,
App.go(String[])
,
App.go(String[], String, CharSequence)
,
App.mainThread