Source:
<code>protected Control createContents(Composite parent) { Label l = new Label(parent, SWT.NONE); Repository repo = (Repository) getElement() .getAdapter(Repository.class); if (repo == null) return l; if (repo instanceof FileRepository) { GC gc = new GC((FileRepository) repo); try { RepoStatistics stats = gc.getStatistics(); StringBuilder b=new StringBuilder(); <START> b.append(MessageFormat.format( <END> UIText.RepositoryStatistics_NrOfLoosePackedObjects, Long.valueOf(stats.numberOfLooseObjects), Long.valueOf(stats.numberOfPackedObjects))).append('\n'); b.append(MessageFormat.format( UIText.RepositoryStatistics_BytesUsedToPersistLoosePackedObjects, describeSize(stats.sizeOfLooseObjects), describeSize(stats.sizeOfPackedObjects))).append('\n'); b.append(MessageFormat.format( UIText.RepositoryStatistics_NrOfLoosePackedRefs, Long.valueOf(stats.numberOfLooseRefs), Long.valueOf(stats.numberOfPackedRefs))).append('\n'); b.append(MessageFormat.format( UIText.RepositoryStatistics_NrOfPackfiles, Long.valueOf(stats.numberOfPackFiles))); l.setText(b.toString()); } catch (IOException e) { l.setText(e.getMessage()); } } return l; }</code><technical_language>this pretty ugly is hard read, display this in a properly formatted 3 column table instead ? Description | Loose | Packed | ------------------------------------------------------------------------------- Number of objects 345 345k (345.123) Size of objects 34,5k 123M (123.541.123) Number of storage files 345 5</technical_language>

Target:
protected Control createContents(Composite parent) { Table table = new Table(parent, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION); String[] titles = { UIText.RepositoryStatistics_Description, UIText.RepositoryStatistics_LooseObjects, UIText.RepositoryStatistics_PackedObjects }; for (int i = 0; i < titles.length; i++) { TableColumn column = new TableColumn(table, SWT.NONE); column.setText(titles[i]); } Repository repo = (Repository) getElement() .getAdapter(Repository.class); if (repo == null) return table; if (repo instanceof FileRepository) { GC gc = new GC((FileRepository) repo); try { RepoStatistics stats = gc.getStatistics(); table.setLinesVisible(true); table.setHeaderVisible(true); GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); data.heightHint = 200; table.setLayoutData(data); TableItem item = new TableItem(table, SWT.NONE); item.setText(0, UIText.RepositoryStatistics_NrOfObjects); item.setText(1, bigIntFmt.format(stats.numberOfLooseObjects)); item.setText(2, bigIntFmt.format(stats.numberOfPackedObjects)); item = new TableItem(table, SWT.NONE); item.setText(0, UIText.RepositoryStatistics_SpaceNeededOnFilesystem); item.setText(1, describeSize(stats.sizeOfLooseObjects)); item.setText(2, describeSize(stats.sizeOfPackedObjects)); item = new TableItem(table, SWT.NONE); item.setText(0, UIText.RepositoryStatistics_NrOfRefs); item.setText(1, bigIntFmt.format(stats.numberOfLooseRefs) .toString()); item.setText(2, bigIntFmt.format(stats.numberOfPackedRefs) .toString()); item = new TableItem(table, SWT.NONE); item.setText(0, UIText.RepositoryStatistics_NrOfPackfiles); item.setText(2, bigIntFmt.format(stats.numberOfPackFiles) .toString()); for (int i = 0; i < titles.length; i++) { table.getColumn(i).pack(); } parent.pack(); } catch (IOException e) { } } return table; }