%--
* Copyright by Intland Software
*
* All rights reserved.
*
* This software is the confidential and proprietary information
* of Intland Software. ("Confidential Information"). You
* shall not disclose such Confidential Information and shall use
* it only in accordance with the terms of the license agreement
* you entered into with Intland.
*
* $Revision$ $Date$
--%>
<%@page import="com.intland.codebeamer.servlet.admin.project.ProgressMonitor"%>
<%@page import="com.intland.codebeamer.servlet.admin.project.ProgressMonitor.State"%>
<%@page import="com.intland.codebeamer.servlet.admin.project.ProjectSynchState"%>
<%@page import="com.intland.codebeamer.servlet.admin.project.ProgressMonitor.State"%>
<%@page import="java.text.NumberFormat"%>
<%--
Fragment prints out the progress when project SCM checkout or synchronization is running.
--%>
<%@ taglib uri="jstl-c" prefix="c" %>
<%@ taglib uri="uitaglib" prefix="ui" %>
<%@ taglib uri="taglib" prefix="tag" %>
<%!public String printProgress(ProgressMonitor progressMonitor, String processLabel, String counterText, String contextPath) {
if (progressMonitor == null) {
return "";
}
String txt = processLabel;
if (!State.WAITING.equals(progressMonitor.getState())) {
final NumberFormat nf = NumberFormat.getInstance();
txt += " " + String.format(counterText, nf.format(progressMonitor.getCounter()), nf.format(progressMonitor.getRuntime()));
}
String css = "";
if (State.FINISHED.equals(progressMonitor.getState())) {
txt += " finished.";
css = "finished";
}
if (State.RUNNING.equals(progressMonitor.getState())) {
css = "running";
txt += " is running...";
}
if (State.WAITING.equals(progressMonitor.getState())) {
css = "waiting";
txt += " is waiting.";
}
txt = String.format("%s", css, txt);
return txt;
}%>