software/test/performance/src/org/LexGrid/LexBIG/util/CodingSchemeSelectionMenu.java
/**
	 * Displays a list of available coding schemes.
	 * @return The ordered list of coding scheme summaries as displayed.
	 * @throws LBException If an error occurs displaying the list.
	 */
Displays a list of available coding schemes.
@return The ordered list of coding scheme summaries as displayed.
@throws LBException If an error occurs displaying the list.
Displays a list of available coding schemes . @return The ordered list of coding scheme summaries as displayed . @throws LBException If an error occurs displaying the list .
protected List<CodingSchemeSummary> displayCodingSchemes() throws LBException {
		List<CodingSchemeSummary> choices = new ArrayList<CodingSchemeSummary>();
		LexBIGService lbs = AppService.getLBSvc();
		CodingSchemeRenderingList schemes = lbs.getSupportedCodingSchemes();
		if (schemes.getCodingSchemeRenderingCount() == 0)
			Util.displayMessage("No coding schemes found.");
		else {
			Formatter f = new Formatter();
			String format = "%-5.5s|%-30.30s|%-25.25s|%-15.15s\n";
			Object[] hSep = new Object[] { Dash5, Dash30, Dash25, Dash15 };
			f.format(format, hSep);
			f.format(format, new Object[] { "#", "Local Name", "Version", "Tag" });
			f.format(format, hSep);
			CodingSchemeRendering[] csr = schemes.getCodingSchemeRendering();
			for (int i = 1; i <= csr.length; i++) {
				String nu = String.valueOf(i);
				CodingSchemeSummary css = csr[i-1].getCodingSchemeSummary();
				choices.add(css);
				String localName = css.getLocalName();
				if (localName != null && localName.length() > 30)
					localName = localName.substring(0, 28) + ">>";
				String version = css.getRepresentsVersion();
				if (version != null && version.length() > 25)
					version = version.substring(0, 23) + ">>";
				String[] tags = csr[i-1].getRenderingDetail().getVersionTags().getTag();
				String tag = tags.length > 0 ? tags[0] : "";
				if (tag != null && tag.length() > 15)
					tag = tag.substring(0, 13) + ">>";
				f.format(format, new Object[] { nu, localName, version, tag });
				for (int j = 1; j < tags.length; j++) {
					tag = tags[j];
					if (tag != null && tag.length() > 10)
						tag = tag.substring(0, 8) + ">>";
					f.format(format, "", "", "", tag);
				}
				f.format(format, hSep);
			}
			Util.displayMessage(f.out().toString());
			Util.displayMessage("");
			Util.displayMessage("NOTE: >> indicates column value exceeds the available width.");
		}
		return choices;
	}
protected List < CodingSchemeSummary > displayCodingSchemes ( ) throws LBException { List < CodingSchemeSummary > choices = new ArrayList < CodingSchemeSummary > ( ) ; LexBIGService lbs = AppService . getLBSvc ( ) ; CodingSchemeRenderingList schemes = lbs . getSupportedCodingSchemes ( ) ; if ( schemes . getCodingSchemeRenderingCount ( ) == 0 ) Util . displayMessage ( "No coding schemes found." ) ; else { Formatter f = new Formatter ( ) ; String format = "%-5.5s|%-30.30s|%-25.25s|%-15.15s\n" ; Object [ ] hSep = new Object [ ] { Dash5 , Dash30 , Dash25 , Dash15 } ; f . format ( format , hSep ) ; f . format ( format , new Object [ ] { "#" , "Local Name" , "Version" , "Tag" } ) ; f . format ( format , hSep ) ; CodingSchemeRendering [ ] csr = schemes . getCodingSchemeRendering ( ) ; for ( int i = 1 ; i <= csr . length ; i ++ ) { String nu = String . valueOf ( i ) ; CodingSchemeSummary css = csr [ i - 1 ] . getCodingSchemeSummary ( ) ; choices . add ( css ) ; String localName = css . getLocalName ( ) ; if ( localName != null && localName . length ( ) > 30 ) localName = localName . substring ( 0 , 28 ) + ">>" ; String version = css . getRepresentsVersion ( ) ; if ( version != null && version . length ( ) > 25 ) version = version . substring ( 0 , 23 ) + ">>" ; String [ ] tags = csr [ i - 1 ] . getRenderingDetail ( ) . getVersionTags ( ) . getTag ( ) ; String tag = tags . length > 0 ? tags [ 0 ] : "" ; if ( tag != null && tag . length ( ) > 15 ) tag = tag . substring ( 0 , 13 ) + ">>" ; f . format ( format , new Object [ ] { nu , localName , version , tag } ) ; for ( int j = 1 ; j < tags . length ; j ++ ) { tag = tags [ j ] ; if ( tag != null && tag . length ( ) > 10 ) tag = tag . substring ( 0 , 8 ) + ">>" ; f . format ( format , "" , "" , "" , tag ) ; } f . format ( format , hSep ) ; } Util . displayMessage ( f . out ( ) . toString ( ) ) ; Util . displayMessage ( "" ) ; Util . displayMessage ( "NOTE: >> indicates column value exceeds the available width." ) ; } return choices ; }
Displays a list of available coding schemes.
Displays a list of available coding schemes .
// Evaluate local name
 // Evaluate version
 // Evaluate tag(s)
 // Output the first line
 // Output additional tags
 // Output separator
