use of com.liferay.ide.layouttpl.ui.LayoutTplUI in project liferay-ide by liferay.
the class NewLayoutTplWizard method getDefaultProvider.
@Override
protected IDataModelProvider getDefaultProvider() {
LayoutTplUI defaultUI = LayoutTplUI.getDefault();
TemplateStore templateStore = defaultUI.getTemplateStore();
ContextTypeRegistry contextTypeRegistry = defaultUI.getTemplateContextRegistry();
TemplateContextType contextType = contextTypeRegistry.getContextType(LayoutTplTemplateContextTypeIds.NEW);
return new NewLayoutTplDataModelProvider() {
@Override
public IDataModelOperation getDefaultOperation() {
return new AddLayoutTplOperation(getDataModel(), templateStore, contextType);
}
};
}
use of com.liferay.ide.layouttpl.ui.LayoutTplUI in project liferay-ide by liferay.
the class AddLayoutTplOperation method createThumbnailFile.
protected void createThumbnailFile(String thumbnailFileName) throws CoreException, IOException {
IFolder defaultDocroot = CoreUtil.getDefaultDocrootFolder(getTargetProject());
IFile thumbnailFile = defaultDocroot.getFile(thumbnailFileName);
LayoutTplUI defaultUI = LayoutTplUI.getDefault();
Bundle bundle = defaultUI.getBundle();
URL iconFileURL = bundle.getEntry("/icons/blank_columns.png");
CoreUtil.prepareFolder((IFolder) thumbnailFile.getParent());
if (FileUtil.exists(thumbnailFile)) {
thumbnailFile.setContents(iconFileURL.openStream(), IResource.FORCE, null);
} else {
thumbnailFile.create(iconFileURL.openStream(), true, null);
}
}
Aggregations