/** * Return whether this is the first step in * the submission process (the first step is * currently considered the first that appears * in the progress bar) * * @return true if first step */ public boolean isFirstStep() { Set submissionPagesSet = submissionInfo.getProgressBarInfo().keySet(); String[] submissionPages = (String[]) submissionPagesSet.toArray(new String[submissionPagesSet.size()]); StepAndPage firstStepAndPage = new StepAndPage(submissionPages[0]); return firstStepAndPage.equals(stepAndPage); }
Iterator keyIterator = subInfo.getProgressBarInfo().keySet().iterator();
/** * Add a submission progress list to the current div for this step. * * @param div The division to add the list to. */ public void addSubmissionProgressList(Division div) throws WingException { //each entry in progress bar is placed under this "submit-progress" div List progress = div.addList("submit-progress",List.TYPE_PROGRESS); //get Map of progress bar information //key: entry # (i.e. step & page), //value: entry name key (i.e. display name) Map<String, String> progBarInfo = this.submissionInfo.getProgressBarInfo(); //add each entry to progress bar for (Map.Entry<String, String> progBarEntry : progBarInfo.entrySet()) { //Since we are using XML-UI, we need to prepend the heading key with "xmlui.Submission." String entryNameKey = "xmlui.Submission." + progBarEntry.getValue(); //the value of entryNum is current step & page //(e.g. 1.2 is page 2 of step 1) StepAndPage currentStepAndPage = new StepAndPage(progBarEntry.getKey()); //add a button to progress bar for this step & page addJumpButton(progress, message(entryNameKey), currentStepAndPage); } }
/** * Return whether this is the last step in * the submission process (the last step is * currently considered the one directly *before* * the Complete step in the progress bar) * * @return true if last step */ public boolean isLastStep() { boolean inWorkflow = this.submissionInfo.isInWorkflow(); Set submissionPagesSet = submissionInfo.getProgressBarInfo().keySet(); String[] submissionPages = (String[]) submissionPagesSet.toArray(new String[submissionPagesSet.size()]); StepAndPage lastStepAndPage; if(!inWorkflow) { // If not in Workflow, // Last step is considered the one *before* the Complete Step lastStepAndPage = new StepAndPage(submissionPages[submissionPages.length-2]); } else { lastStepAndPage = new StepAndPage(submissionPages[submissionPages.length-1]); } return lastStepAndPage.equals(stepAndPage); }
if (subInfo.getProgressBarInfo() == null) Iterator<String> stepIterator = subInfo.getProgressBarInfo().keySet() .iterator(); while (stepIterator.hasNext())
Set submissionPagesSet = submissionInfo.getProgressBarInfo().keySet(); String[] submissionPages = (String[]) submissionPagesSet.toArray(new String[submissionPagesSet.size()]);