}
@Override
public void setVisible(boolean visible) {
if (visible) {
ProjectModel projectModel = getProjectController().getProjectModel();
ForceProject forceProject = getProjectService().getForceProject(getProject());
projectModel.setForceProject(forceProject);
projectModel.getPackageManifestModel().setProject(getProject());
// get package manifest file to tell pme where cache exists
IFile packageManifestFile =
ContainerDelegate.getInstance().getServiceLocator().getProjectService().getPackageManifestFactory().getPackageManifestFile(getProject());
projectModel.getPackageManifestModel().setPackageManifestFile(packageManifestFile);
// set cache, may not exists
Document packageManifestCache = Utils.loadDocument(Utils.getCacheUrl(getProject()));
if (packageManifestCache != null) {
projectModel.getPackageManifestModel().setManifestCache(packageManifestCache);
}
// load project manifest
Package packageManifest = null;
try {
packageManifest =
ContainerDelegate.getInstance().getFactoryLocator().getPackageManifestFactory().getPackageManifestFromFile(packageManifestFile);
projectModel.getPackageManifestModel().setPackageManifest(packageManifest);
Document packageManifestDoc =
ContainerDelegate.getInstance().getServiceLocator().getProjectService().getPackageManifestFactory().getPackageManifestDOMDocument(getProject());
projectModel.getPackageManifestModel().setManifestDocument(packageManifestDoc);
} catch (FileNotFoundException e) {
String errorMsg =
Messages.getString("ProjectProperties.ProjectContent.ContentSummary.JaxbException.message");
logger.error(errorMsg, e);
enableApplyButton(false);