에 GWT 위젯을 첨부하는 방법 : I 콘텐츠 클래스와 중첩 된 DIV에 위젯을 삽입 할 필요가이 같은 마크 업을 사용하여 내 사용자 정의 위젯에 GWT 복합을 확장 위젯에 연결해야하는 방법 요소
<div class="left">
<div class="right">
<div class="content">{content}</div>
</div>
</div>
합니다.
public class VideoPanel extends Component {
public VideoPanel(final Widget content,
final VideoPanelAppearance appearance, final int width,
final int height) {
this.content = content;
this.appearance = appearance;
final SafeHtmlBuilder sb = new SafeHtmlBuilder();
appearance.render(sb,
SafeHtmlUtils.fromTrustedString(content.toString()));
final XElement element = XDOM.create(sb.toSafeHtml());
final XElement contentElement = appearance.getContentElement(element);
contentElement
.setSize(getContentWidth(width), getContentHeight(height));
setElement(element);
setPixelSize(width, height);
}
}
내가 문자열에 확실하지 않다 : 나는 내 사용자 정의 위젯의 생성자를 게시 아래
SafeHtmlUtils.fromTrustedString(content.toString())
내용은 비디오 플레이어 위젯입니다. 위 코드 결과는 HTML 페이지에 EMBED 태그가 표시되지 않습니다.