String summary = Messages.getString("ProjectCreateWizard.ProjectContent.ContentSummary.NoContent.message");
FileMetadataExt fileMetadata = getProjectModel().getPackageManifestModel().getFileMetadatExt();
StyleRange[] ranges = null;
ProjectContentSummaryAssembler summaryAssembler = getProjectController().getProjectContentSummaryAssembler();
// set summary based on create option
if (projectProjectContentComposite.isAll()) { /* disabled */
projectProjectContentComposite.setLblIntroContentSummaryTxt(UIMessages
.getString("ProjectCreateWizard.ProjectContent.IntroContentSummary.label"));
projectProjectContentComposite.showContentSummary(true);
summaryContent = summaryAssembler.generateSummaryText(fileMetadata, null, true);
if (Utils.isNotEmpty(summaryContent)) {
Object[] stylizedText = UIUtils.getStylizedSummary(summaryContent);
summary = (String) stylizedText[0];
ranges = (StyleRange[]) stylizedText[1];
}
} else if (projectProjectContentComposite.isAllApex()) { /* all apex content */
projectProjectContentComposite.setLblIntroContentSummaryTxt(UIMessages
.getString("ProjectCreateWizard.ProjectContent.IntroContentSummary.label"));
projectProjectContentComposite.showContentSummary(true);
summaryContent = summaryAssembler.generateSummaryText(fileMetadata, getProjectModel().getForceProject().getEnabledComponentTypes(), true);
if (Utils.isNotEmpty(summaryContent)) {
Object[] stylizedText = UIUtils.getStylizedSummary(summaryContent);
summary = (String) stylizedText[0];
ranges = (StyleRange[]) stylizedText[1];
}
}
if (projectProjectContentComposite.isCustomComponents()) { /* custom content */
if (getProjectModel().getPackageManifestModel() != null
&& PackageManifestDocumentUtils.hasContent(getProjectModel().getPackageManifestModel()
.getManifestDocument())) {
projectProjectContentComposite.setLblIntroContentSummaryTxt(UIMessages
.getString("ProjectCreateWizard.ProjectContent.IntroContentSummary.label"));
projectProjectContentComposite.showContentSummary(true);
summaryContent = summaryAssembler.generateSummaryText(getProjectModel().getPackageManifestModel());
if (Utils.isNotEmpty(summaryContent)) {
Object[] stylizedText = UIUtils.getStylizedSummary(summaryContent);
summary = (String) stylizedText[0];
ranges = (StyleRange[]) stylizedText[1];
}