Need to use progress bar in my application

hello friends,
Actually i m using jsp filedownload and I am gettting my file in byte array and need to implement a progress bar while downloading file (as IE showing in status bar downloading file size ..% of total file size)...no fake progress bars and no stop gap solutions as like a gif moving with sign "plz wait ..file is downloading "
plz help how to get this done
My code
HashMap result = (HashMap)request.getAttribute("requestParams");
     String type = request.getParameter("type");
     boolean isFile = false;
          if(result != null){
          String successFlag = (String) result.get("");
          String sFileName = null;
          byte[] bFile = null;
          String sContentType = null;
          if(successFlag != null && successFlag.equals("true")){
               for(int i=0;i<result.size();i++){
                    sFileName = (String) result.get("FILENAME");
                    bFile = (byte[]) result.get("FILEDATA");
                    sContentType = (String) result.get("CONTENTTYPE");
               response.reset();
               if(null!=bFile) {
                    if(bFile.length>0){
                         if(sContentType == null || sContentType.equals("")){
                              response.setContentType( "application/octet-stream" );
                         else response.setContentType(sContentType);
                         response.setHeader("Accept-Ranges", "bytes");
                         isFile = true;
                         response.setHeader("Content-Length", Integer.toString(bFile.length, 10));
                         if(null!=sFileName){
                              if("view".equals(type)){
                                   if(null!=sFileName)response.setHeader("Content-Disposition","inline; filename=\""+sFileName+"\"");
                              else{
                                   response.setHeader("Content-Disposition","attachment; filename=\""+sFileName+"\"");
                         ServletOutputStream outs = response.getOutputStream();
                         if(null!=bFile)outs.write(bFile);
                         outs.flush();
                         outs.close();
                         out.clear();
                         out = pageContext.pushBody();
                                   }

You should get your keyboard fixed. There's a lot of letters missing from what you type and it makes it very hard for other people to read. It looks extremely inelegant.
Anyway, your JSP isn't in control of the download. (You shouldn't have all that Java code in a JSP either but that's a separate issue.) All it does is to send the data to the browser, which is in charge of the download. And in all the browsers I use, there's a box which tells you how far the download has proceeded. No real need for a progress bar, even if you could persuade the browser to make one. Which you can't.

Similar Messages

  • How can i use Progress bar in IR Report

    Hi ,
    I have created IR Report based on the View so, it's been taking 10-15 mins of time to execute the IR Report. Here user want to see the Progress bar while executing the IR Report. How can i use Progress bar in IR Report.
    Anybody have idea on Progress bar please help me.
    Regards
    Narender B

    Hi ,
    Thanks for your information.
    I am new to the APEX.*i need to show Progress bar while opening the each page* then user can know some process is happening from the backside and i don't know where i need to add and call the below function.could you please provide the steps for the progress bar.
    In my application there are almost 100 pages are there so, i need to show progress bar on each page while opening .could you please provide Global function to call on each page.
    function html_url_Progress(pThis){ 
    $x_Show('AjaxLoading');
    window.setTimeout('$s("AjaxLoading",$x("AjaxLoading").innerHTML)', 100);
    //doSubmit('APPLY_CHANGES');
    redirect(pUrl);
    Regards
    Narender B

  • How to use progress bar for Main and Subsequences in teststand

    HI,
    I have one main sequence in that I am calling different subsequences (Containing many steps and for loop).
    I am trying to use progress bar for this sequence, but my requirement is progressbar is able to show the progress of all the steps containing in Main and subsequences.
    I have developed sequence in that I am able to show the progress for only Main sequence steps not for subsequences steps.
    Is it possible? If yes please let me know the suggestions.
    Thank You

    Hi Santosh
    Here you are
    Greetings
    Juergen
    never Double Click on Submit
    Message Edited by j_dodek on 08-05-2008 08:05 AM
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=
    Attachments:
    Progress_ts351.seq ‏52 KB

  • Need help with progress bar !!!!!!!

    Is ther anyway to display the progress of functions, which I created in my application, through a progress bar ... while the results are being computed with my alogs..
    They are quite long and it takes quite sometime for the results to generate and user shud see that something is working ... while he waits and shud feel that nothing is happening ....
    The progress shudnt necessarily be measurable ... a non measurable progress bar will also do .... Jst want to show that some activity is goin on at the back ...
    My algo consist of functions :
    for (i = 0 ; i < = 6 ; i++)
    my function 1 (my parameters) {} - called 10 times each time the i increments with different parameters
    my function 2() {} - called 10 times ....
    my functions 3() {}   - called 10 times IF somebody know how to do it ... please help meee......... its urgent

    Are you posting this on your cell phone? There seems to be something horribly wrong with your keyboard or your auto complete for your words, as it is, I could barely understand what you were asking. If that is the way you actually spell, then I doubt anyone could help you, maybe you should just step away from the keyboard or what ever device it is your are using to input, because it's correct operation seems to escape you--will you actually be able to comprehend a solution if it is presented?
    But on the outside chance that you may be a savant, and just cannot form sentences and words properly, here is an idea...
    Ages ago, long before you were ever an itch in your parents'... you get the picture...
    They used to say: "Hey, I'm going to be doing a lot of processing or repetitive tasks and maybe between each task I should do something to let the user know the process is running and not just locked up."
    Even a status bar needs you to do something between each process, you have to make it do something between executions of tasks.

  • [SOLVED] Almost there just need a global progress bar

    Heya,
    There's no man page for bar so I have looked at the code a bit. I am trying to have a progress bar to copy a folder with many files including symbolic links (unfortunately pycp does not support them yet). With the -s parameter, I can specify the approximate size of what I am copying but it works only if it is a single file.
    I have also tried pv, pipemeter, orphan advcp, ecp, scp and I am now desperate.
    Would someone be kind enough to help me ?
    [tamikana@archlinux ~]$ cat /usr/bin/bar
    #! /bin/sh
    # bar
    # 'cat' with ASCII progress bar
    # (c) Henrik Theiling
    BAR_VERSION=1.4
    # Synopsis:
    # 'bar' works just like 'cat', but shows a progress bar in ASCII art on stderr.
    # The script's main function is meant to be usable in any Bourne shell to be
    # suitable for install scripts without the need for any additional tool.
    # Shell Script Usage: bar [options] [files]
    # Options:
    # -h displays help
    # Examples:
    # Normal pipe:
    # : bar mypack.tar.bz2 | tar xjpf -
    # Individual pipe for each file:
    # : bar -c 'tar xjpf -' mypack1.tar.bz2 mypack2.tar.bz2
    # Individual pipe, using ${bar_file} variable:
    # : bar -c 'echo ${bar_file}: ; gzip -dc | tar tvf -' \
    # : -e .tar.gz \
    # : file1 file2 file3 file4 file5 \
    # : > package-list.txt
    # Programs and shell commands:
    # Required (otherwise this fails):
    # if, then, else, fi, expr, test, cat, eval, exec
    # shell functions
    # test:
    # a = b
    # a -lt b
    # a -gt b
    # a -le b
    # -f a
    # -n a
    # -z a
    # expr:
    # a + b
    # a - b
    # a '*' b
    # a / b
    # a : b
    # Optional (otherwise this does not show the bar):
    # grep, dd, echo, ls, sed, cut
    # ls:
    # must output the file size at fifth position.
    # The command line interface also uses:
    # awk
    ####>-SCHNIPP-<########################################################
    bar_cat()
    # Use this shell function in your own install scripts.
    # Options:
    # Width of the bar (in ten characters). The default is 76 characters.
    test -z "${BAR_WIDTH}" && test -n "${COLUMNS}" && BAR_WIDTH=${COLUMNS}
    # Check syntax:
    ( expr "${BAR_WIDTH}" + 0 >/dev/null 2>&1 ) || BAR_WIDTH=0
    BAR_WIDTH=`expr ${BAR_WIDTH} + 0` || BAR_WIDTH=0
    test "x${BAR_WIDTH}" = x0 && BAR_WIDTH=76
    # Maximal block size to use for dd.
    test -n "${BAR_BS}" || BAR_BS=1048567
    # BEGIN PERC
    # Whether to show a percentage.
    test -n "${BAR_PERC}" || BAR_PERC=1
    # END PERC
    # BEGIN ETA
    # Whether to show estimated time of arrival (ETA).
    test -n "${BAR_ETA}" || BAR_ETA=1
    # END ETA
    # Width of the trace display:
    # BEGIN TRACE
    test -n "${BAR_TRACE_WIDTH}" || BAR_TRACE_WIDTH=10
    # END TRACE
    # The command to execute for every given file. Each file
    # is piped into this command individually. By default, the
    # files are simply dumped to stdout.
    test -n "${BAR_CMD}" || BAR_CMD=cat
    # The characters to be used in the bar
    test -n "${BAR_L}" || BAR_L='['
    test -n "${BAR_R}" || BAR_R=']'
    test -n "${BAR_C0}" || BAR_C0='.'
    test -n "${BAR_C1}" || BAR_C1='='
    # Additional extension to add to each file:
    #BAR_EXT=${BAR_EXT-}
    # Whether to clear bar after termination. Otherwise keep the full bar.
    #BAR_CLEAR=${BAR_CLEAR-0}
    # Unless switched off by user, use the bar by default:
    test -n "${BAR_OK}" || BAR_OK=1
    BAR_WIDTH=`expr ${BAR_WIDTH} - 3`
    bar_trace=''
    # BEGIN TRACE
    if test "x${BAR_TRACE}" = x1
    then
    BAR_WIDTH=`expr ${BAR_WIDTH} - ${BAR_TRACE_WIDTH}`
    bar_lauf=${BAR_TRACE_WIDTH}
    bar_t_space=''
    bar_t_dot=''
    while test "${bar_lauf}" -gt 1
    do
    bar_t_space="${bar_t_space} "
    bar_t_dot="${bar_t_dot}."
    bar_lauf=`expr ${bar_lauf} - 1`
    done
    bar_trace="${bar_t_space} "
    fi
    # END TRACE
    bar_eta=''
    BAR_GET_TIME='echo'
    # BEGIN ETA
    ( expr 1 + ${SECONDS} >/dev/null 2>&1 ) || BAR_ETA=0
    if test "x${BAR_ETA}" = x1
    then
    BAR_GET_TIME='( echo ${SECONDS} )'
    BAR_WIDTH=`expr ${BAR_WIDTH} - 6`
    bar_eta='--:-- '
    fi
    # END ETA
    bar_perc=''
    # BEGIN PERC
    if test "x${BAR_PERC}" = x1
    then
    BAR_WIDTH=`expr ${BAR_WIDTH} - 5`
    bar_perc=' 0% '
    fi
    # END PERC
    BAR_GET_SIZE='( ls -l "${BAR_DIR}${bar_file}${BAR_EXT}" | sed "s@ *@ @g" | cut -d " " -f 5 ) 2>/dev/null'
    # portable?
    # check features:
    ( ( echo a ) >/dev/null 2>&1 ) || BAR_OK=0
    ( ( echo a | dd bs=2 count=2 ) >/dev/null 2>&1 ) || BAR_OK=0
    ( ( echo a | grep a ) >/dev/null 2>&1 ) || BAR_OK=0
    ( ( echo a | sed 's@ *@ @g' ) >/dev/null 2>&1 ) || BAR_OK=0
    ( ( echo a | cut -d ' ' -f 1 ) >/dev/null 2>&1 ) || BAR_OK=0
    # check ranges:
    test "${BAR_WIDTH}" -ge 4 || BAR_OK=0
    BAR_ECHO='echo'
    BAR_E_C1=''
    BAR_E_C2=''
    BAR_E_NL='echo'
    # Does echo accept -n without signalling an error?
    if echo -n abc >/dev/null 2>&1
    then
    BAR_E_C1='-n'
    fi
    # Check how to print a line without newline:
    if ( ( ${BAR_ECHO} "${BAR_E_C1}" abc ; echo 1,2,3 ) | grep n ) >/dev/null 2>&1
    then
    # Try echo \c:
    if ( ( ${BAR_ECHO} 'xyz\c' ; echo 1,2,3 ) | grep c ) >/dev/null 2>&1
    then
    # Try printf:
    if ( ( printf 'ab%s' c ; echo 1,2,3 ) | grep abc ) >/dev/null 2>&1
    then
    BAR_ECHO='printf'
    BAR_E_C1='%s'
    else
    BAR_ECHO=':'
    BAR_E_C1=''
    BAR_E_NL=':'
    BAR_OK=0
    fi
    else
    BAR_E_C1=''
    BAR_E_C2='\c'
    fi
    fi
    # prepare initial bar:
    bar_shown=0
    if test "${BAR_OK}" = 1
    then
    bar_lauf=0
    bar_graph=''
    while test `expr ${bar_lauf} + 5` -le "${BAR_WIDTH}"
    do
    bar_graph="${bar_graph}${BAR_C0}${BAR_C0}${BAR_C0}${BAR_C0}${BAR_C0}"
    bar_lauf=`expr ${bar_lauf} + 5`
    done
    while test "${bar_lauf}" -lt "${BAR_WIDTH}"
    do
    bar_graph="${bar_graph}${BAR_C0}"
    bar_lauf=`expr ${bar_lauf} + 1`
    done
    ${BAR_E_C2}" 1>&2_eta}${bar_perc}${BAR_L}${bar_graph}${BAR_R}
    bar_shown=1
    fi
    # for shifting large numbers so that expr can handle them:
    # Assume we can compute up to 2147483647, thus 9 arbitrary digits.
    # We must be able to do + of two numbers of 9 digits length. Ok.
    # BEGIN LARGE
    ( ( test 1999999998 = `expr 999999999 + 999999999` ) >/dev/null 2>&1 ) || BAR_OK=0
    bar_large_num="........."
    bar_div=""
    # END LARGE
    bar_numsuff=""
    # find size:
    bar_size=0
    if test -n "${BAR_SIZE}"
    then
    bar_size=${BAR_SIZE}
    # BEGIN LARGE
    while expr "${bar_size}" : "${bar_large_num}" >/dev/null 2>&1
    do
    bar_div="${bar_div}."
    bar_numsuff="${bar_numsuff}0"
    bar_size=`expr "${bar_size}" : '\(.*\).$'`
    done
    # END LARGE
    BAR_GET_SIZE="echo '${BAR_SIZE}'"
    else
    for bar_file
    do
    bar_size1=0
    if test -f "${BAR_DIR}${bar_file}${BAR_EXT}"
    then
    bar_size1=`eval "${BAR_GET_SIZE}"`
    # BEGIN LARGE
    # divide and upround by pattern matching:
    if test -n "${bar_div}"
    then
    bar_size1=`expr "${bar_size1}" : '\(.*\)'${bar_div}'$'` || bar_size1=0
    fi
    # adjust if still too large:
    while expr "${bar_size1}" : "${bar_large_num}" >/dev/null 2>&1
    do
    bar_div="${bar_div}."
    bar_numsuff="${bar_numsuff}0"
    bar_size1=`expr "${bar_size1}" : '\(.*\).$'`
    bar_size=`expr "${bar_size}" : '\(.*\).$'` || bar_size=0
    done
    # upround if necessary:
    if test -n "${bar_div}"
    then
    bar_size1=`expr "${bar_size1}" + 1`
    fi
    # END LARGE
    # add to total size:
    bar_size=`expr ${bar_size} + ${bar_size1}`
    # BEGIN LARGE
    # adjust if still too large:
    while expr "${bar_size}" : "${bar_large_num}" >/dev/null 2>&1
    do
    bar_div="${bar_div}."
    bar_numsuff="${bar_numsuff}0"
    bar_size=`expr "${bar_size}" : '\(.*\).$'`
    done
    # END LARGE
    else
    BAR_OK=0
    fi
    done
    fi
    bar_quad=`expr ${BAR_WIDTH} '*' ${BAR_WIDTH}`
    test "${bar_size}" -gt "${bar_quad}" || BAR_OK=0
    if test "${BAR_OK}" = 0
    then
    # For some reason, we cannot display the bar. Thus plain operation:
    for bar_file
    do
    if test "${bar_file}" = "/dev/stdin"
    then
    eval "${BAR_CMD}"
    else
    eval "${BAR_CMD}" < "${BAR_DIR}${bar_file}${BAR_EXT}"
    fi
    done
    else
    # Compute wanted bytes per step:
    bar_want_bps=`expr ${bar_size} + ${BAR_WIDTH}`
    bar_want_bps=`expr ${bar_want_bps} - 1`
    bar_want_bps=`expr ${bar_want_bps} / ${BAR_WIDTH}`
    # Compute block count per step to keep within maximum block size:
    bar_count=1
    if test "${bar_want_bps}" -gt "${BAR_BS}"
    then
    bar_count=`expr ${bar_want_bps} + ${BAR_BS}`
    bar_count=`expr ${bar_count} - 1`
    bar_count=`expr ${bar_count} / ${BAR_BS}`
    fi
    # Compute block size for given count:
    bar_wc=`expr ${BAR_WIDTH} '*' ${bar_count}`
    bar_bs=`expr ${bar_size} + ${bar_wc}`
    bar_bs=`expr ${bar_bs} - 1`
    bar_bs=`expr ${bar_bs} / ${bar_wc}`
    # Compute bs * count, the bytes per step:
    bar_bps=`expr ${bar_bs} '*' ${bar_count}`
    # Compute bytes per hundredth:
    bar_bph=`expr ${bar_size} + 99`
    bar_bph=`expr ${bar_bph} / 100`
    # Run loop:
    bar_pos=0
    bar_graph="${BAR_L}"
    bar_cur_char=0
    bar_t0=`eval "${BAR_GET_TIME}" 2>/dev/null` || bar_t0=0
    for bar_file
    do
    # BEGIN TRACE
    if test "x${BAR_TRACE}" = x1
    then
    bar_trace=`expr "${bar_file}" : '.*/\([^/][^/]*\)$'` || bar_trace="${bar_file}"
    bar_trace=`expr "${bar_trace}${bar_t_space}" : '\('${bar_t_dot}'\)'`
    bar_trace="${bar_trace} "
    fi
    # END TRACE
    # Initial character position in bar for file:
    bar_char=`expr ${bar_pos} / ${bar_want_bps}` || bar_char=0
    while test "${bar_char}" -gt `expr ${bar_cur_char} + 4`
    do
    bar_graph="${bar_graph}${BAR_C1}${BAR_C1}${BAR_C1}${BAR_C1}${BAR_C1}"
    bar_cur_char=`expr ${bar_cur_char} + 5`
    done
    while test "${bar_char}" -gt "${bar_cur_char}"
    do
    bar_graph="${bar_graph}${BAR_C1}"
    bar_cur_char=`expr ${bar_cur_char} + 1`
    done
    # Get file size. This must work now (we checked with test -f before).
    bar_size1=`eval "${BAR_GET_SIZE}" 2>/dev/null` || bar_size1=0
    # BEGIN LARGE
    # Divide and upround by pattern matching:
    if test -n "${bar_div}"
    then
    bar_size1=`expr "${bar_size1}" : '\(.*\)'${bar_div}'$'` || bar_size1=0
    bar_size1=`expr "${bar_size1}" + 1`
    fi
    # END LARGE
    # loop:
    bar_total=0
    exec 6>&1
    exec 5<"${BAR_DIR}${bar_file}${BAR_EXT}"
    while test "${bar_total}" -lt "${bar_size1}"
    do
    dd bs="${bar_bs}" count="${bar_count}${bar_numsuff}" <&5 >&6 2>/dev/null
    bar_total=`expr ${bar_total} + ${bar_bps}`
    if test "${bar_total}" -gt "${bar_size1}"
    then
    bar_total="${bar_size1}"
    fi
    bar_pos1=`expr ${bar_pos} + ${bar_total}`
    bar_proz=`expr ${bar_pos1} / ${bar_bph}` || bar_proz=0
    # BEGIN PERC
    if test "x${BAR_PERC}" = x1
    then
    bar_perc=" ${bar_proz}% "
    bar_perc=`expr "${bar_perc}" : '.*\(.....\)$'`
    fi
    # END PERC
    # BEGIN ETA
    if test "x${BAR_ETA}" = x1
    then
    bar_diff=`eval "${BAR_GET_TIME}" 2>/dev/null` || bar_diff=0
    bar_diff=`expr ${bar_diff} - ${bar_t0} 2>/dev/null` || bar_diff=0
    bar_100p=`expr 100 - ${bar_proz}` || bar_100p=0
    bar_diff=`expr ${bar_diff} '*' ${bar_100p}` || bar_diff=0
    bar_diff=`expr ${bar_diff} + ${bar_proz}` || bar_diff=0
    bar_diff=`expr ${bar_diff} - 1` || bar_diff=0
    bar_diff=`expr ${bar_diff} / ${bar_proz} 2>/dev/null` || bar_diff=0
    if test "${bar_diff}" -gt 0
    then
    bar_t_unit=":"
    if test "${bar_diff}" -gt 2700
    then
    bar_t_uni="h"
    bar_diff=`expr ${bar_diff} / 60`
    fi
    bar_diff_h=`expr ${bar_diff} / 60` || bar_diff_h=0
    if test "${bar_diff_h}" -gt 99
    then
    bar_eta=" ${bar_diff_h}${bar_t_unit} "
    else
    bar_diff_hi=`expr ${bar_diff_h} '*' 60` || bar_diff_hi=0
    bar_diff=`expr ${bar_diff} - ${bar_diff_hi}` || bar_diff=0
    bar_diff=`expr "00${bar_diff}" : '.*\(..\)$'`
    bar_eta=" ${bar_diff_h}${bar_t_unit}${bar_diff} "
    fi
    bar_eta=`expr "${bar_eta}" : '.*\(......\)$'`
    fi
    fi
    # END ETA
    bar_char=`expr ${bar_pos1} / ${bar_want_bps}` || bar_char=0
    while test "${bar_char}" -gt "${bar_cur_char}"
    do
    bar_graph="${bar_graph}${BAR_C1}"
    ${bar_trace}${bar_eta}${bar_perc}${bar_graph}${BAR_E_C2}" 1>&2
    bar_cur_char=`expr ${bar_cur_char} + 1`
    done
    done
    ) | eval "${BAR_CMD}"
    bar_pos=`expr ${bar_pos} + ${bar_size1}`
    done
    # ${BAR_ECHO} "${BAR_E_C1}" "${BAR_R}${BAR_E_C2}" 1>&2
    fi
    if test "${bar_shown}" = 1
    then
    # BEGIN TRACE
    test "x${BAR_TRACE}" = x1 && bar_trace="${bar_t_space} "
    # END TRACE
    # BEGIN ETA
    test "x${BAR_ETA}" = x1 && bar_eta=' '
    # END ETA
    if test "x${BAR_CLEAR}" = x1
    then
    # BEGIN PERC
    test "x${BAR_PERC}" = x1 && bar_perc=' '
    # END PERC
    bar_lauf=0
    bar_graph=''
    while test `expr ${bar_lauf} + 5` -le "${BAR_WIDTH}"
    do
    bar_graph="${bar_graph} "
    bar_lauf=`expr ${bar_lauf} + 5`
    done
    while test "${bar_lauf}" -lt "${BAR_WIDTH}"
    do
    bar_graph="${bar_graph} "
    bar_lauf=`expr ${bar_lauf} + 1`
    done
    ${BAR_E_C2}" 1>&2_eta}${bar_perc} ${bar_graph}
    else
    # BEGIN PERC
    test "x${BAR_PERC}" = x1 && bar_perc='100% '
    # END PERC
    bar_lauf=0
    bar_graph=''
    while test `expr ${bar_lauf} + 5` -le "${BAR_WIDTH}"
    do
    bar_graph="${bar_graph}${BAR_C1}${BAR_C1}${BAR_C1}${BAR_C1}${BAR_C1}"
    bar_lauf=`expr ${bar_lauf} + 5`
    done
    while test "${bar_lauf}" -lt "${BAR_WIDTH}"
    do
    bar_graph="${bar_graph}${BAR_C1}"
    bar_lauf=`expr ${bar_lauf} + 1`
    done
    ${bar_trace}${bar_eta}${bar_perc}${BAR_L}${bar_graph}${BAR_R}${BAR_E_C2}" 1>&2
    ${BAR_E_NL} 1>&2
    fi
    fi
    ####>-SCHNAPP-<########################################################
    BAR_AWK_0=''
    # Command line interface:
    while test -n "$1"
    do
    case "$1" in
    -o|-c|-w|-0|-1|-e|-d|-b|-s|-\[\]|-\[|-\]|-T)
    if test -z "$2"
    then
    echo "$0: Error: A non-empty argument was expected after $1" 1>&2
    fi
    BAR_ARG="$1"
    BAR_OPT="$2"
    shift
    shift
    -o*|-c*|-w*|-0*|-1*|-e*|-d*|-b*|-T*)
    BAR_ARG=`expr "$1" : '\(-.\)'`
    BAR_OPT=`expr "$1" : '-.\(.*\)$'`
    shift
    -h|-n|-p|-D|-D-|-q|-V|-t|-E|-L)
    BAR_ARG="$1"
    BAR_OPT=""
    shift
    --) shift
    break
    -*) echo "$0: Error: Unrecognized option: $1" 1>&2
    exit 1
    break
    esac
    case "${BAR_ARG}" in
    -h) echo 'Usage: bar [-n] [-p] [-q] [-o FILE] [-c CMD] [-s SIZE] [-b SIZE]'
    echo ' [-w WIDTH] [-0/1/[/] CHAR] [-d DIR] [-e EXT] [Files]'
    echo ' bar -V'
    echo ' bar -D'
    echo ' bar -D-'
    echo 'Options:'
    echo ' -h displays help'
    echo ' -o FILE sets output file'
    echo ' -c CMD sets individual execution command'
    echo ' -e EXT append an extension to each file'
    echo ' -d DIR prepend this prefix to each file (a directory must end in /)'
    echo ' -s SIZE expected number of bytes. Use for pipes. This is a hint'
    echo ' only that must be greater or equal to the amount actually'
    echo ' processed. Further, this only works for single files.'
    echo ' -b SIZE maximal block size (bytes) (default: 1048567)'
    echo ' -w WIDTH width in characters (default: terminal width-3 or 76)'
    echo ' -0 CHAR character for empty bar (default: .)'
    echo ' -1 CHAR character for full bar (default: =)'
    echo ' -[ CHAR first character of bar (default: [)'
    echo ' -] CHAR last character of bar (default: ])'
    echo ' -n clears bar after termination'
    echo ' -t traces (=displays) which file is processed'
    echo ' -T WIDTH no of characters reserved for the file display of -t'
    echo ' -p hides percentage'
    echo ' -E hides estimated time display'
    echo ' -q hides the whole bar, be quiet'
    echo ' -D tries to dump the bar_cat() shell function, then exit.'
    echo ' Here, -t, -p, -E remove the corresponding feature completely.'
    echo ' Further, -L removes large file support from the code.'
    echo ' -D- same as -D, but dumps the function body only'
    echo ' -V displays version number'
    echo ' -- end of options: only file names follow'
    exit 0
    -n) BAR_CLEAR=1
    -L) BAR_LARGE=0
    BAR_AWK_0="${BAR_AWK_0} /END *LARGE/ {x=1} ;"
    BAR_AWK_0="${BAR_AWK_0} /BEGIN *LARGE/ {x=0} ;"
    -t) BAR_TRACE=1
    BAR_AWK_0="${BAR_AWK_0} /END *TRACE/ {x=1} ;"
    BAR_AWK_0="${BAR_AWK_0} /BEGIN *TRACE/ {x=0} ;"
    -T) BAR_TRACE_WIDTH="${BAR_OPT}"
    -q) BAR_OK=0
    -p) BAR_PERC=0
    BAR_AWK_0="${BAR_AWK_0} /END *PERC/ {x=1} ;"
    BAR_AWK_0="${BAR_AWK_0} /BEGIN *PERC/ {x=0} ;"
    -E) BAR_ETA=0
    BAR_AWK_0="${BAR_AWK_0} /END *ETA/ {x=1} ;"
    BAR_AWK_0="${BAR_AWK_0} /BEGIN *ETA/ {x=0} ;"
    -V) echo "bar v${BAR_VERSION}"
    exit 0
    -D) echo "BAR_VERSION=${BAR_VERSION}"
    awk "${BAR_AWK_0}"'{sub(/ *#.*$/,"")} ; /^bar_cat/ {x=1} ; {sub(/^ */,"")} ; /./ {if(x)print} ; /^}/ {x=0}' "$0"
    exit 0
    -D-) echo "BAR_VERSION=${BAR_VERSION}"
    awk "${BAR_AWK_0}"'{sub(/ *#.*$/,"")} ; /^}/ {x=0} ; {sub(/^ */,"")} ; /./ {if(x)print} ; /^{/ {x=1}' "$0"
    exit 0
    -o) exec 1>"${BAR_OPT}"
    -c) BAR_CMD="${BAR_OPT}"
    -b) BAR_BS="${BAR_OPT}"
    if BAR_RAW=`expr "${BAR_BS}" : '\(.*\)k$'`
    then
    BAR_BS=`expr ${BAR_RAW} '*' 1024`
    elif BAR_RAW=`expr "${BAR_BS}" : '\(.*\)M$'`
    then
    BAR_BS=`expr ${BAR_RAW} '*' 1048567`
    fi
    -s) BAR_SIZE="${BAR_OPT}"
    if BAR_RAW=`expr "${BAR_SIZE}" : '\(.*\)k$'`
    then
    BAR_SIZE=`expr ${BAR_RAW} '*' 1024`
    elif BAR_RAW=`expr "${BAR_SIZE}" : '\(.*\)M$'`
    then
    BAR_SIZE=`expr ${BAR_RAW} '*' 1048567`
    fi
    if test "$#" -gt 1
    then
    echo "Error: -s cannot be specified for multiple input files." 1>&2
    exit 1
    fi
    -e) BAR_EXT="${BAR_OPT}"
    -d) BAR_DIR="${BAR_OPT}"
    -0) BAR_C0="${BAR_OPT}"
    -1) BAR_C1="${BAR_OPT}"
    -\[) BAR_L="${BAR_OPT}"
    -\]) BAR_R="${BAR_OPT}"
    BAR_L="${BAR_OPT}"
    BAR_R="${BAR_OPT}"
    -w) BAR_WIDTH="${BAR_OPT}"
    esac
    done
    # Invoke main function:
    if test "$#" = 0
    then
    bar_cat /dev/stdin
    else
    bar_cat "$@"
    fi
    EDIT: solved https://bbs.archlinux.org/viewtopic.php … 85#p498885
    It seems like I have not tried every potential packages after all
    Last edited by tamikana (2011-10-30 16:04:46)

    This might help http://www.dwcourse.com/dreamweaver/ten-commandments-spry-menubars.php#one
    Also, if you use DW CS5 click on Live Code and Live View. Then when clicking on the menu items in Live View, watch the changes in classes that occur. This mifgt give you a clue of what to do.
    Cheers,
    Gramps

  • How to use progress bar

    Hi
    I am using jdev11.1.1.5.0
    I have created an adf application in which i have a select many shuttle to display data from database.
    On the radio button change event i am setting another where clause on associated vo and re-executing vo.
    Now the problem is that the processing takes few seconds to fetch data from database according to where condition. For the time being I want to display a progress bar to user.
    How it is possible....?
    Thanks...

    Read http://myjdeveloperhints.blogspot.de/2010/12/add-glass-pane-to-long-running-db-job.html...
    Here it's an example http://myjdeveloperhints.blogspot.de/2010/12/add-glass-pane-to-long-running-db-job.html
    Timo

  • Need very simple ''progress bar'' or a ''Please wait notice'' in javascript

    I have a JSF portlet app, made in JSC. It uses remote EJB calls and some calls take a long time to finish. E.g. User clicks a button, some data are gathered, sent to an EJB and the app. is waiting for reply.
    For the user it looks like this: Click ... Internet Explorer progress bar flashes, nothing happens for 30s, then the progress bar starts from zero again and loads the next page in 15s.
    So I need a very simple notice in the middle of the screen, that will just say "Take a break, don't click the button again, please! ... " and animate a clock, a bar or whatever, maybe disabling the window so the user will not be able to push buttons. (The users are annoying folk!)
    The message should dissapear as soon as the next (or the same) page loads.
    I've never did javascript, so if anybody has a simple example code, I will be grateful and give him a duke or two. (And I really don't need the AJAX super-components)

    Martin, best of luck, i fought this same problem last year.
    Even when I got a progress bar on my page, it would not "animate" as IE apparently does not animate gifs after a form is submitted (and before the page is destroyed). I think I eventually got around this by adding an onclick event to my form submit that reset the image.
    Best of luck.
    Ideally, is there anyway that we can get this IE behavior (page loads, waits for X times, page loads again correctly) fixed? This is highly confusing to my clients.

  • Jni using progress bar problem

    Hi
    i am new in jni application actually my project is j2ee(servlet,jsp) based. In my one of project module we need to call vb ocx for large processing in background so it is time taking and my framwork is pure mvc based so how i have to show
    progress bar please give me some idea....
    Thanks in advance and sorry for english
    ni

    There's no solution to that in the JNI or Java side of things. If the VB has control, only the VB knows what its progress is, so only the VB can display it. So change it to do that.

  • UI 6.7 How could I use Progress bar form?

    Hi all,
    some SAP Business One add-ons use a small form with a progress bar instead of using the progress bar in the status bar. Does anyone knows how to use this form?
    Bernhard

    Hi,
    I think that you have to create your own form.
    In my Addon, I create a form with FormType = ft_FixedNoTitle, add several EditTexts (9) with the property Enabled = False and Visible = False, and the name beginnig with "oEditText" + Number Sequential.
    After, when executing my code, I change the property Visible = True, to the next EditText.
    That way I have a "progress form" like used in others Addons.
    I use the following code to "progress" (after created the form)
        Private Sub WriteProgressInstall(ByVal pMsg As String, ByVal pPosition As Integer)
                Dim oForm As SAPbouiCOM.Form
                Dim oStaticText As SAPbouiCOM.StaticText
                Dim i As Integer
                Try
                    If pMsg <> String.Empty Then
                        oForm = SBO_Application.Forms.Item("frmProgressForm")
    'if we have a StaticText to show the progress message
                        oStaticText = oForm.Items.Item("oMSG").Specific
                        oStaticText.Caption = pMsg
                    End If
                    'Hide all "progress steps"
                    If pPosition = 0 Then
                        For i = 1 To 9
                            oForm.Items.Item("oEditText" + CStr(pPosition)).Visible = False
                        Next
                    End If
                    oForm.Items.Item("oEditText" + CStr(pPosition)).Visible = True
                Catch er As Exception
                    MsgBox(er.Message)
                End Try
            End Sub
    To move to next "progress step" is just call
    WriteProgressInstall("Executing Step 1..", 1)
    HTH,
    Ribeiro Santos

  • No progress bar when an application installs?

    After signing up I started downloading photoshop. It is more than 2 hours and it was still not completed... There was no progress bar either on the application manager. Any help here? Thank you

    Try the direct download.
    Assuming that you mean Photoshop CC: http://prodesigntools.com/adobe-cc-2014-direct-download-links.html
    Photoshop Elements: http://prodesigntools.com/photoshop-elements-13-direct-download-links-premiere.html
    Make sure you follow the Very Important Instructions on these pages.

  • Progress Bar in MultiThreaded Application

    Hi,
    Can anybody tell me how can set a progress bar for a multi threaded application.
    See for eg ..I have a multi threaded application which copies 100 files and there are 5 threads, so I assign 20 files to copy for each thread.
    how can set the overall progress of copy?
    Can somebody help me in this regard.
    Thank you so much in advance.

    muthu_veerappan wrote:
    Hi,
    Can anybody tell me how can set a progress bar for a multi threaded application.
    See for eg ..I have a multi threaded application which copies 100 files and there are 5 threads, so I assign 20 files to copy for each thread.
    how can set the overall progress of copy?The same way you would with a single thread. Keep track of the progress (bytes copied or number of files) and update the progress bar. The java.util.concurrent.Executors class can make this easier in a multi-threaded environment.
    Jim S.

  • How to make use of *progress bar*?

    I have a progress bar requirement in my swings project,
    i.e on clicking a button, some task should be executed and in parallel to this
    progress should run on progress bar in the same frame and soon after this task
    gets completed the progress on progress bar should come to an end.
    How can i do this in swings?
    could any one help me out from this?

    How to use progress bar
    http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html
    If you want an example scroll down to the bottom of the page and download the examples.

  • Progress Bar in Java

    Hi,
    I'm new here, i need to create a Progress Bar for my application,
    but i just don't get how to get back how much that a process has proceed,
    can anyone help me? i have stuck at here for a few days
    example; i do a System.out.Println("blablabla")
    how to see it's done or how many percent have been done?
    or anyone can give me a good example of Java Progress Bar?
    Any help will be very appriciated.

    By using this method
    public boolean saveAs(Shell shell) {
              FileDialog saveDialog = new FileDialog(shell, SWT.SAVE);
              saveDialog.setFilterExtensions(new String[] { "*.xsd;", "*.*" });
              saveDialog.setFilterNames(new String[] {
                        "XML Schema Definition (*.xsd)", "All Files " });
              saveDialog.open();
              String name = saveDialog.getFileName();
              if (name.equals(""))
                   return false;
              if (name.indexOf(".xsd") != name.length() - 4) {
                   name += ".xsd";
              File file = new File(saveDialog.getFilterPath(), name);
              if (file.exists()) {
                   MessageBox box = new MessageBox(shell, SWT.ICON_WARNING | SWT.YES
                             | SWT.NO);
                   box.setText("Save As");
                   box.setMessage("File " + file.getName() + " is already exits "
                             + "\n" + "Do you want to replace it?");
                   if (box.open() != SWT.YES) {
                        return false;
              this.file = file;
              this.saveToPath = saveDialog.getFilterPath();
              return save(shell);
         public boolean save(Shell shell) {
              if (file == null)
                   return saveAs(shell);
              Cursor waitCursor = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
              shell.setCursor(waitCursor);
              FileWriter fileWriter = null;
              try {
                   fileWriter = new FileWriter(file.getAbsolutePath(), false);
                   fileWriter.write(text.getText());
              } catch (FileNotFoundException e) {
                   displayError("File_not_found " + file.getName(), shell);
                   return false;
              } catch (IOException e) {
                   displayError("IO_error_write" + "\n" + file.getName(), shell);
                   return false;
              } finally {
                   shell.setCursor(null);
                   waitCursor.dispose();
                   if (fileWriter != null) {
                        try {
                             fileWriter.close();
                        } catch (IOException e) {
                             displayError("IO_error_close" + "\n" + file.getName(),
                                       shell);
                             return false;
              return true;
         }

  • JavaFX progress bar with glow effect.

    I am hoping someone can help me with this issue. I recently followed James Clarke example of a progress bar with glow effect and it helped with developing a progress bar for an application I was working on. But now, with the JavaFX sdk 1.2 update, the application does not fully work anymore. The progressbar.fx code is posted below:
    ProgressBar.fx code:
    import java.lang.Math;
    import java.lang.Object;
    import javafx.animation.Interpolator;
    import javafx.animation.Timeline;
    import javafx.scene.CustomNode;
    import javafx.scene.effect.GaussianBlur;
    import javafx.scene.Group;
    import javafx.scene.Node;
    import javafx.scene.paint.Color;
    import javafx.scene.paint.Paint;
    import javafx.scene.Scene;
    import javafx.scene.shape.Ellipse;
    import javafx.scene.shape.Rectangle;
    import javafx.scene.text.Font;
    import javafx.scene.text.Text;
    import javafx.scene.text.TextOrigin;
    import javafx.stage.Stage;
    import javafx.scene.layout.Resizable;
    public class ProgressBar extends CustomNode, Resizable{
    public var min: Number;
    public var max: Number = 100.0;
    public var value: Number;
    public var background: Paint = Color.rgb(118,149,178);
    public var foreground: Paint = Color.rgb(216,219,225);
    public var font = bind Font{name: "Courier Bold Italic" size: height - borderWidth * 8};
    public var arcWidth: Number = 20;
    public var arcHeight: Number = 50;
    public var borderStroke: Color = Color.BLACK;
    public var borderWidth: Number = 1;
    public var fontPaint: Paint = Color.LIGHTGRAY;
    public var showPercentage = true;
    var progressText: Text;
    var backgroundText: Text;
    var progessBar: Rectangle;
    var range = bind Math.abs(max - min);
    var percentComplete: Number = bind if(max != 0) { (
    value - min) / max
    } // if
    else {0.0;} // else;
    var currentX = bind percentComplete * width;
    var blurX: Number = 30;
    var progressString: String = bind "%%{%.0f (percentComplete*100)}";
    var progressValue = bind "{%.2f value}";
    var progressHeight = bind height - borderWidth * 4;
    var blurAnim = Timeline {
    repeatCount: Timeline.INDEFINITE
    autoReverse: true
    keyFrames: [
    at(0s) { blurX => 0.0 }
    at(2s) { blurX =>
    currentX - progressHeight / 2 tween Interpolator.EASEBOTH }
    var playing = bind visible on replace{
    if(playing) {
    blurAnim.play();
    }else {
    blurAnim.stop();
    public override function create(): Node {
    return Group {
    content: [
    Rectangle { //background
    width: bind width
    height: bind height
    fill: bind background
    stroke: bind borderStroke
    strokeWidth: bind borderWidth
    arcWidth: bind arcWidth
    arcHeight: bind arcHeight
    cache: true
    backgroundText = Text { // Text over Background
    layoutX: bind (width - backgroundText.layoutBounds.width) / 2
    layoutY: bind (height - backgroundText.layoutBounds.height) / 2
    textOrigin: TextOrigin.TOP
    font: bind font
    fill: bind foreground
    content: bind if(showPercentage) progressString else progressValue
    cache: true
    Group {
    content: [
    progessBar = Rectangle { // Progress
    layoutX: bind borderWidth
    layoutY: bind borderWidth * 2
    width: bind currentX
    height: bind progressHeight
    fill: bind foreground
    arcWidth: bind arcWidth
    arcHeight: bind arcHeight
    Ellipse {
    centerX: bind blurX
    centerY: bind height / 2
    radiusX: bind progressHeight
    radiusY: bind progressHeight / 2
    fill: Color.rgb(255,255,255,.7)
    effect: GaussianBlur{ radius: 30
    Text { // Text Over Progress Bar, this has to be in progressBar coordinate space
    x: bind (width - backgroundText.layoutBounds.width) / 2
    y: bind (height - backgroundText.layoutBounds.height) / 2
    textOrigin: TextOrigin.TOP
    font: bind font
    fill: bind background
    content: bind if(showPercentage) progressString else progressValue
    clip: bind progessBar
    }, // Text
    ] // 2nd content
    } // 2nd Group
    ] // 1st content
    }; // 1st Group
    } // public override function create(): Node
    } // public abstract class ProgressBar extends CustomNode, Resizeable
    function run(args:String[]):Void {
    var stage: Stage = Stage {
         title: "Progress Bar"
    scene: Scene {
    width: 925
    height: 60
    content: ProgressBar {
         layoutX: 10
    layoutY: 10
    width: 890
    height: 35
    value: 80
    } // content: ProgressBar
    } // scene: Scene
    } // var stage: Stage = Stage
    } // function run(args:String[]):Void
    I use RESTful ws to get the progress of the billing run, which is the loadProgressdata() method in the main.fx, and everything was working fine until we did the javafx sdk 1.2 update. With the update in place, I recompiled the project and found that "Resizable" in
    the "public class ProgressBar extends CustomNode, Resizable" was throwing an error when the project was recompiled. I made some changes(mainly adding variables for height and width) but now when the program runs, the backing rectangle appears along with the
    percentage of billing progress, but the progress part(2nd rectangle) does not appear with the glow effect. I have read about using "getPrefWidth()" and "getPrefHeight()" methods, but not really sure how I would use them. I can't make the public class ProgressBar extends CustomNode, Resizable abstract as I need to instantiate in the Main.fx.
    Can anyone shed some light on what might need to be done to get this running correctly again. I don't need anyone the give me the exact code, but just to point me in the correct direction.

    Can you post your code again between "{ code} ... {code }" tags ? Some symbols are missing if copy/pasted.
    That said, your preferred width and height, simply return the width and height of your component. What I discovered recently is using LayoutInfo on controls to set the preferred width and height. These are the dimensions the surrounding container (VBox, HBox, Flow, ....) will use to arrange size and position of the enclosed components. So maybe you won't need Resizable any more. Simply fill in the layoutInfo property.
    Edited by: Java.Artisan on Jun 26, 2009 11:25 AM
    Edited by: Java.Artisan on Jun 26, 2009 11:26 AM

  • Jsf progress bar

    Hello,
    I have an application where I need to read a large text file and insert data to database.I want to display progress bar(I am using netbeans 6.1 and hence woodstock progress bar) while the above process running in the background.I am not sure whether I have run that process in a separate thread.Please help with any ideas on how to use progress bar for this purpose.
    Thanks in advance

    harish7447 wrote:
    Can you please explain how you fixed it?Use Javascript to display an initially hidden element which has an animated loading gif in it.
    If you want a realtime 0-100% progress bar, have a look to RichFaces. They have such a component.
    Also if possible put in your code snippet. I would appreciate it a lot. This is not a code factory or so. Start your own topic where in you elaborate the problem [the smart way|http://catb.org/esr/faqs/smart-questions.html].

Maybe you are looking for

  • Opening my appleworks file in word 2007

    I have a PC at work and used to have a mac at home (I will be getting a new mac in a few months). I have an appleworks file that I saved a while ago that I am trying to open on Word 2007 at work, but there isn't the converter like word 2003 had. Any

  • New Computer -- Need to upload my ipod music

    I just had to re-format my hardrive on my Windows' based computer and I want to upload the music on my ipod back to my new computer. I don't want to delete the 1,000 plus songs on my ipod. Can anyone help me with the process?

  • ITunes 11 on MacBook Air/Maverick OS becomes unresponsive after 30-45 minutes

    After upgrading my MacBook Air to Maverick OS, iTunes has become unstable, freezes up after 30-45 minutes, only way to regain control of laptop is forced shutdown.  Help, anyone...?

  • How to identify corrupted block in Particular tablespace?

    Hi, i am getting lot of block corruption error from particular tablesapce datafile. i couldn't able to use DBVerify utility .bcz datafiles not created using .dbf format. how to idetify corrupted blocks?

  • Problems with tabbed JSPs

    Hi , I have a JSP which is a tabbed one . I need to have common values in all the 5 tab pages of a single JSP . The problem im facing is , the common values entered in the first tab page only gets carried forward to the subsequent tab pages . In case