/** * {@inheritDoc} */ @Override protected IView<SComponent> createImageView( IImageViewDescriptor viewDescriptor, IActionHandler actionHandler, @SuppressWarnings("unused") Locale locale) { SLabel imageLabel = createSLabel(false); SImageConnector connector = new SImageConnector(viewDescriptor .getModelDescriptor().getName(), imageLabel); connector.setExceptionHandler(actionHandler); SPanel viewComponent = createSPanel(new SBorderLayout()); IView<SComponent> view = constructView(viewComponent, viewDescriptor, connector); viewComponent.add(imageLabel, SBorderLayout.CENTER); if (viewDescriptor.isScrollable()) { imageLabel.setHorizontalAlignment(SConstants.LEFT); imageLabel.setVerticalAlignment(SConstants.TOP); SScrollPane scrollPane = createSScrollPane(); scrollPane.setViewportView(viewComponent); view.setPeer(scrollPane); } else { imageLabel.setHorizontalAlignment(SConstants.CENTER); imageLabel.setVerticalAlignment(SConstants.CENTER); } return view; }
private void initPanel() { imageLabel.setVerticalAlignment(SConstants.TOP_ALIGN); imageLabel.setStyle("SOptionPaneImage"); imageLabel.setToolTipText(null);
/** * {@inheritDoc} */ @Override protected IView<SComponent> createHtmlPropertyView( IPropertyViewDescriptor propertyViewDescriptor, IActionHandler actionHandler, Locale locale) { if (propertyViewDescriptor.isReadOnly()) { IHtmlPropertyDescriptor propertyDescriptor = (IHtmlPropertyDescriptor) propertyViewDescriptor .getModelDescriptor(); IValueConnector connector; SLabel viewComponent = createSLabel(true); viewComponent.setVerticalAlignment(SConstants.TOP); viewComponent.setHorizontalAlignment(SConstants.LEFT); connector = new SLabelConnector(propertyDescriptor.getName(), viewComponent); ((SLabelConnector) connector).setForceHtml(true); SScrollPane scrollPane = createSScrollPane(); scrollPane.setViewportView(viewComponent); connector.setExceptionHandler(actionHandler); IView<SComponent> view = constructView(scrollPane, propertyViewDescriptor, connector); return view; } return createTextPropertyView(propertyViewDescriptor, actionHandler, locale); }