Java Code Examples for com.google.gwt.safehtml.shared.SafeHtml

The following are top voted examples for showing how to use com.google.gwt.safehtml.shared.SafeHtml. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: sig-seguimiento-vehiculos   File: VertexStyleComboBox.java   Source Code and License 6 votes vote down vote up
public VertexStyleComboBox(String width) {
	super(new ListStore<VertexStyleDef>(
			((VertexStyleDefProperties)GWT.create(VertexStyleDefProperties.class)).key()),
			((VertexStyleDefProperties)GWT.create(VertexStyleDefProperties.class)).name(),
			new AbstractSafeHtmlRenderer<VertexStyleDef>() {
				final VertexStyleComboTemplates comboBoxTemplates = GWT
						.create(VertexStyleComboTemplates.class);

				public SafeHtml render(VertexStyleDef item) {
					return comboBoxTemplates.vertexStyle(item.getImage()
							.getSafeUri(), item.getName());
				}
			});
	
	setWidth(width);
	setTypeAhead(true);
	setEmptyText(UIMessages.INSTANCE.sbLayerComboEmptyText());
	setTriggerAction(TriggerAction.ALL);
	setForceSelection(true);
	setEditable(false);
	enableEvents();
	
	getStore().addAll(VertexStyles.getAll());
}
 
Example 2
Project: ontobrowser   File: ActionIconCellDecorator.java   Source Code and License 6 votes vote down vote up
private SafeHtml getImageHtml(ImageResource res, VerticalAlignmentConstant valign) {
	AbstractImagePrototype proto = AbstractImagePrototype.create(res);
	SafeHtml image = SafeHtmlUtils.fromTrustedString(proto.getHTML());

	// Create the wrapper based on the vertical alignment.
	SafeStylesBuilder cssStyles =
			new SafeStylesBuilder().appendTrustedString(direction + ":0px;");
	if (HasVerticalAlignment.ALIGN_TOP == valign) {
		return templates.imageWrapperTop(cssStyles.toSafeStyles(), image);
	} else if (HasVerticalAlignment.ALIGN_BOTTOM == valign) {
		return templates.imageWrapperBottom(cssStyles.toSafeStyles(), image);
	} else {
		int halfHeight = (int) Math.round(res.getHeight() / 2.0);
		cssStyles.appendTrustedString("margin-top:-" + halfHeight + "px;");
		return templates.imageWrapperMiddle(cssStyles.toSafeStyles(), image);
	}
}
 
Example 3
Project: appformer   File: DataSetEditorTest.java   Source Code and License 6 votes vote down vote up
@Test
public void testShowError() {
    final ClientRuntimeError error = mock(ClientRuntimeError.class);
    when(error.getCause()).thenReturn("errorCause");
    presenter.afterPreviewCommand = mock(Command.class);
    presenter.showError(error);
    verify(loadingBox, times(1)).hide();
    verify(view, times(1)).showErrorNotification(any(SafeHtml.class));
    verify(errorEvent, times(1)).fire(any(ErrorEvent.class));
    verify(presenter.afterPreviewCommand, times(1)).execute();
    verify(view, times(0)).addConfigurationTabItemClickHandler(any(Command.class));
    verify(view, times(0)).addPreviewTabItemClickHandler(any(Command.class));
    verify(view, times(0)).addAdvancedTabItemClickHandler(any(Command.class));
    verify(view, times(0)).showConfigurationTab();
    verify(view, times(0)).showPreviewTab();
    verify(view, times(0)).showAdvancedTab();
    verify(view, times(0)).openColumnsFilterPanel(anyString());
    verify(view, times(0)).closeColumnsFilterPanel(anyString());
    verify(view, times(0)).clearErrorNotification();
}
 
Example 4
Project: appformer   File: ValueBoxEditorTest.java   Source Code and License 6 votes vote down vote up
@Test
public void testShowErrors() throws Exception {
    EditorError e1 = mockEditorError(presenter, "m1");
    EditorError e2 = mockEditorError(presenter, "m2");
    List<EditorError> errors = new ArrayList<EditorError>(2);
    errors.add(e1);
    errors.add(e2);
    presenter.showErrors(errors);
    final ArgumentCaptor<SafeHtml> errorSafeHtmlCaptor =  ArgumentCaptor.forClass(SafeHtml.class);
    verify(view, times(1)).showError(errorSafeHtmlCaptor.capture());
    verify(view, times(0)).init(presenter);
    verify(view, times(0)).clearError();
    verify(view, times(0)).setValue(anyString());
    final SafeHtml value = errorSafeHtmlCaptor.getValue();
    Assert.assertEquals("m1\nm2", value.asString());
}
 
Example 5
Project: hftinymce-gwt   File: HFRichTextEditor.java   Source Code and License 6 votes vote down vote up
public SafeHtml getHTML() {
    SafeHtml result = null;
    if (libraryLoaded && initialized) {
        try {
            String contentHtml = getContentHtml(elementId); // TinyMCE takes care of the sanitization.
            if (contentHtml == null || contentHtml.trim().isEmpty()) {
                return SafeHtmlUtils.fromSafeConstant("");
            }
            // Remove the root block <p></p> that gets added automatically by TinyMCE
            if (contentHtml.startsWith("<p>") && contentHtml.endsWith("</p>")) {
                contentHtml = contentHtml.substring(3, contentHtml.length() - 4);
            }
            result = SafeHtmlUtils.fromTrustedString(contentHtml); 
        } catch (JavaScriptException e) {
            GWT.log("Unable to get the content from the TinyMCE editor.", e);
        }
    } else {
        String text = super.getText();
        if (text == null || text.trim().isEmpty()) {
            return SafeHtmlUtils.fromSafeConstant("");
        } else {
            return SafeHtmlUtils.fromString(text);
        }
    }
    return result;        
}
 
Example 6
Project: hftinymce-gwt   File: HFRichTextEditor.java   Source Code and License 6 votes vote down vote up
public void setHTML(SafeHtml html) {
    String text = html == null ? null: html.asString();
    if (libraryLoaded && (isInitialized() || isInitializing())) {
        if (isInitializing()) {
            pendingSetHtmlText = html;
            addPendingSetHtml();
            return;
        }
        try {
            setContent(elementId, text);
        } catch (JavaScriptException e) {
            // Don't do anything, just allow it to return.
            GWT.log("Unable to set the content on the TinyMCE editor.", e);
        }
        return;
    } else {
        super.setText(text);
    }
}
 
Example 7
Project: appformer   File: DataSetEditorTest.java   Source Code and License 6 votes vote down vote up
protected void assertViewNotUsed() {
    verify(view, times(0)).init(any(DataSetEditor.class));
    verify(view, times(0)).initWidgets(
            any(DataSetDefBasicAttributesEditor.View.class),
            any(IsWidget.class),
            any(DataSetDefColumnsFilterEditor.View.class),
            any(DataSetDefPreviewTable.View.class),
            any(DataSetDefCacheAttributesEditorView.class),
            any(DataSetDefCacheAttributesEditorView.class),
            any(DataSetDefRefreshAttributesEditor.View.class)
    );
    verify(view, times(0)).addConfigurationTabItemClickHandler(any(Command.class));
    verify(view, times(0)).addPreviewTabItemClickHandler(any(Command.class));
    verify(view, times(0)).addAdvancedTabItemClickHandler(any(Command.class));
    verify(view, times(0)).showConfigurationTab();
    verify(view, times(0)).showPreviewTab();
    verify(view, times(0)).showAdvancedTab();
    verify(view, times(0)).openColumnsFilterPanel(anyString());
    verify(view, times(0)).closeColumnsFilterPanel(anyString());
    verify(view, times(0)).showErrorNotification(any(SafeHtml.class));
    verify(view, times(0)).clearErrorNotification();
}
 
Example 8
Project: appformer   File: FileUploadEditorTest.java   Source Code and License 6 votes vote down vote up
@Test
public void testOnSubmitComplete() throws Exception {
    when(view.getFileName()).thenReturn("ff");
    presenter.onSubmitComplete("OK");
    assertEquals("ff", presenter.value);
    verify(view, times(0)).addHelpContent(anyString(), anyString(), any(Placement.class));
    verify(view, times(0)).init(presenter);
    verify(view, times(0)).setFileUploadName(anyString());
    verify(view, times(1)).setFileUploadVisible(true);
    verify(view, times(0)).setFileLabelText(anyString());
    verify(view, times(0)).setFileLabelVisible(anyBoolean());
    verify(view, times(1)).setLoadingImageVisible(false);
    verify(view, times(1)).getFileName();
    verify(view, times(0)).setFormAction(anyString());
    verify(view, times(0)).submit();
    verify(view, times(0)).showError(any(SafeHtml.class));
    verify(view, times(2)).clearError();
    verify( workbenchNotificationEvent, times( 1 ) ).fire(any(NotificationEvent.class));
    verify( valueChangeEvent, times( 1 ) ).fire(any(ValueChangeEvent.class));
}
 
Example 9
Project: hawkbit   File: ViewClientCriterion.java   Source Code and License 6 votes vote down vote up
/**
 * Styles a multi-row selection with the number of elements.
 *
 * @param drag
 *            the current drag event holding the context.
 */
void setMultiRowDragDecoration(VDragEvent drag) {
    Widget widget = drag.getTransferable().getDragSource().getWidget();

    if (widget instanceof VScrollTable) {
        VScrollTable table = (VScrollTable) widget;
        int rowCount = table.selectedRowKeys.size();

        Element dragCountElement = Document.get().getElementById(SP_DRAG_COUNT);
        if (rowCount > 1 && table.selectedRowKeys.contains(table.focusedRow.getKey())) {
            if (dragCountElement == null) {
                dragCountElement = Document.get().createStyleElement();
                dragCountElement.setId(SP_DRAG_COUNT);
                HeadElement head = HeadElement.as(Document.get().getElementsByTagName(HeadElement.TAG).getItem(0));
                head.appendChild(dragCountElement);
            }
            SafeHtml formattedCssStyle = getDraggableTemplate().multiSelectionStyle(determineActiveTheme(drag),
                    String.valueOf(rowCount));
            StyleElement dragCountStyleElement = StyleElement.as(dragCountElement);
            dragCountStyleElement.setInnerSafeHtml(formattedCssStyle);
        } else if (dragCountElement != null) {
            dragCountElement.removeFromParent();
        }
    }
}
 
Example 10
Project: appformer   File: ImageListEditorTest.java   Source Code and License 6 votes vote down vote up
public void testShowErrors() throws Exception {
    EditorError e1 = mockEditorError(presenter, "m1");
    EditorError e2 = mockEditorError(presenter, "m2");
    List<EditorError> errors = new ArrayList<EditorError>(2);
    errors.add(e1);
    errors.add(e2);
    
    presenter.showErrors(errors);
    final ArgumentCaptor<SafeHtml> errorSafeHtmlCaptor =  ArgumentCaptor.forClass(SafeHtml.class);
    verify(view, times(0)).clear();
    verify(view, times(0)).init(any(ImageListEditor.class));
    verify(view, times(0)).clearError();
    verify(view, times(0)).add(any(SafeUri.class), anyString(), anyString(), any(SafeHtml.class),
            any(SafeHtml.class), anyBoolean(), any(Command.class));
    verify(view, times(1)).showError(errorSafeHtmlCaptor.capture());
    final SafeHtml value = errorSafeHtmlCaptor.getValue();
    Assert.assertEquals("m1\nm2", value.asString());
}
 
Example 11
Project: appformer   File: ToggleSwitchEditorTest.java   Source Code and License 6 votes vote down vote up
@Test
public void testShowErrors() throws Exception {
    EditorError e1 = mockEditorError(presenter, "m1");
    EditorError e2 = mockEditorError(presenter, "m2");
    List<EditorError> errors = new ArrayList<EditorError>(2);
    errors.add(e1);
    errors.add(e2);
    presenter.showErrors(errors);
    final ArgumentCaptor<SafeHtml> errorSafeHtmlCaptor =  ArgumentCaptor.forClass(SafeHtml.class);
    verify(view, times(1)).showError(errorSafeHtmlCaptor.capture());
    verify(view, times(0)).init(presenter);
    verify(view, times(0)).clearError();
    verify(view, times(0)).setValue(anyBoolean());
    final SafeHtml value = errorSafeHtmlCaptor.getValue();
    Assert.assertEquals("m1\nm2", value.asString());
}
 
Example 12
Project: appformer   File: MapEditorTest.java   Source Code and License 6 votes vote down vote up
protected void assertSetViewValue(final int size) {
    verify(view, times(3)).removeColumn(0);
    verify(view, times(1)).clearError();
    verify(view, times(1)).addButtonColumn(anyInt(), anyString(), anyInt());
    verify(view, times(2)).addTextColumn(anyInt(), anyString(), anyBoolean(), anyInt());
    verify(view, times(1)).setEmptyText(anyString());
    verify(view, times(1)).setRowCount(size);
    final ArgumentCaptor<List> dataCaptor =  ArgumentCaptor.forClass(List.class);
    verify(view, times(1)).setData(dataCaptor.capture());
    final List dataValue = dataCaptor.getValue();
    assertNotNull(dataValue);
    assertEquals(size, dataValue.size());
    verify(view, times(0)).init(presenter);
    verify(view, times(0)).showError(any(SafeHtml.class));
    verify(view, times(0)).setAddText(anyString());
}
 
Example 13
Project: appformer   File: FileUploadEditorTest.java   Source Code and License 6 votes vote down vote up
@Test
public void testConfigure() throws Exception {
    FileUploadEditor.FileUploadEditorCallback callback = mock(FileUploadEditor.FileUploadEditorCallback.class);
    presenter.configure("f1", callback);
    assertEquals(view.asWidget(), presenter.asWidget());
    assertEquals(callback, presenter.callback);
    verify(view, times(0)).init(presenter);
    verify(view, times(0)).addHelpContent(anyString(), anyString(), any(Placement.class));
    verify(view, times(1)).setFileUploadName("f1");
    verify(view, times(0)).setFileUploadVisible(anyBoolean());
    verify(view, times(0)).setFileLabelText(anyString());
    verify(view, times(0)).setFileLabelVisible(anyBoolean());
    verify(view, times(0)).setLoadingImageVisible(false);
    verify(view, times(0)).getFileName();
    verify(view, times(0)).setFormAction(anyString());
    verify(view, times(0)).submit();
    verify(view, times(0)).showError(any(SafeHtml.class));
    verify(view, times(0)).clearError();
}
 
Example 14
Project: che   File: MenuButton.java   Source Code and License 6 votes vote down vote up
public MenuButton(SafeHtml content, ItemsProvider itemsProvider) {
  super();

  this.itemsProvider = itemsProvider;

  addStyleName(RESOURCES.css().menuButton());

  showMenuTimer =
      new Timer() {
        @Override
        public void run() {
          showMenu();
        }
      };

  final FocusWidget mainButton = new MainButton(content);
  final FocusWidget dropButton = new DropButton();

  add(mainButton);
  add(dropButton);

  attachMouseEventHandlers(mainButton);
  attachMouseEventHandlers(dropButton);
}
 
Example 15
Project: che   File: MenuButton.java   Source Code and License 6 votes vote down vote up
MainButton(SafeHtml content) {
  super(Document.get().createDivElement());

  getElement().setInnerSafeHtml(content);

  addStyleName(RESOURCES.css().button());
  addStyleName(RESOURCES.css().mainButton());

  addClickHandler(
      event -> {
        if (menu != null && menu.isShowing()) {
          return;
        }

        final Optional<MenuItem> defaultItem = itemsProvider.getDefaultItem();

        if (defaultItem.isPresent()) {
          getActionHandler()
              .ifPresent(actionHandler -> actionHandler.onAction(defaultItem.get()));
        } else {
          showMenu();
        }
      });
}
 
Example 16
Project: TreeGridGWT   File: ExpandableCell.java   Source Code and License 6 votes vote down vote up
private void createClosedArrowAndFolderSafeHtml(SafeHtmlBuilder sb,
		SafeStyles imgStyle) {
	SafeHtml rendered;
	if (currentRow.getChildren().size() != 0) {
		rendered = nodeImageTemplate.cell("ICON_ARROW__CLOSE", imgStyle,
				ICON_ARROW_CLOSE);
	} else {
		SafeStyles imageWidthStyle = SafeStylesUtils
				.fromTrustedString("float:left;width:16.0px;");
		rendered = nodeImageTemplate.cell("ICON_ARROW__CLOSE",
				imageWidthStyle, ICON_CLEAR);
	}
	sb.append(rendered);
	if (treeGrid.isSelectable()) {
		createCheckBoxImg(sb, imgStyle);
	}
	rendered = nodeImageTemplate.cell("ICON_FOLDER__CLOSE", imgStyle,
			ICON_FOLDER_CLOSE);
	sb.append(rendered);
}
 
Example 17
Project: riscoss-corporate   File: DomainList.java   Source Code and License 6 votes vote down vote up
public DomainList() {
	
	table = new CellTable<>(15, (Resources) GWT.create(TableResources.class));
	
	table.addColumn( new Column<String,SafeHtml>(new SafeHtmlCell() ) {
		@Override
		public SafeHtml getValue(String domain) {
			return new LinkHtml( domain, "javascript:selectDomain(\"" + domain + "\")" ); };
	}, "Domain");
	
	dataProvider = new ListDataProvider<String>();
	dataProvider.addDataDisplay( table );
	
	SimplePager pager = new SimplePager();
    pager.setDisplay( table );
    
    table.setWidth("100%");
	tablePanel.add( table );
	tablePanel.add( pager );
	tablePanel.setWidth("100%");
	
	
}
 
Example 18
Project: appformer   File: FileUploadEditorTest.java   Source Code and License 6 votes vote down vote up
@Test
public void testAddHelpContent() throws Exception {
    final String title = "title";
    final String content = "content";
    final Placement p = Placement.BOTTOM;
    presenter.addHelpContent(title, content, p);
    verify(view, times(1)).addHelpContent(title, content, p);
    verify(view, times(0)).init(presenter);
    verify(view, times(0)).setFileUploadName(anyString());
    verify(view, times(0)).setFileUploadVisible(anyBoolean());
    verify(view, times(0)).setFileLabelText(anyString());
    verify(view, times(0)).setFileLabelVisible(anyBoolean());
    verify(view, times(0)).setLoadingImageVisible(anyBoolean());
    verify(view, times(0)).getFileName();
    verify(view, times(0)).setFormAction(anyString());
    verify(view, times(0)).submit();
    verify(view, times(0)).showError(any(SafeHtml.class));
    verify(view, times(0)).clearError();
}
 
Example 19
Project: geowe-core   File: VertexStyleComboBox.java   Source Code and License 6 votes vote down vote up
public VertexStyleComboBox(String width) {
	super(new ListStore<VertexStyleDef>(
			((VertexStyleDefProperties)GWT.create(VertexStyleDefProperties.class)).key()),
			((VertexStyleDefProperties)GWT.create(VertexStyleDefProperties.class)).name(),
			new AbstractSafeHtmlRenderer<VertexStyleDef>() {
				final VertexStyleComboTemplates comboBoxTemplates = GWT
						.create(VertexStyleComboTemplates.class);

				public SafeHtml render(VertexStyleDef item) {
					return comboBoxTemplates.vertexStyle(item.getImage()
							.getSafeUri(), item.getName());
				}
			});
	
	setWidth(width);
	setTypeAhead(true);
	setEmptyText(UIMessages.INSTANCE.sbLayerComboEmptyText());
	setTriggerAction(TriggerAction.ALL);
	setForceSelection(true);
	setEditable(false);
	enableEvents();
	
	getStore().addAll(VertexStyles.getAll());
}
 
Example 20
Project: appformer   File: FileUploadEditorTest.java   Source Code and License 6 votes vote down vote up
@Test
public void testValueUnset() throws Exception {
    final String newValue = "newValue";
    when(view.getFileName()).thenReturn(null);
    presenter.setValue(newValue);
    assertEquals(newValue, presenter.getValue());
    verify(view, times(0)).addHelpContent(anyString(), anyString(), any(Placement.class));
    verify(view, times(0)).init(presenter);
    verify(view, times(0)).setFileUploadName(anyString());
    verify(view, times(0)).setFileUploadVisible(anyBoolean());
    verify(view, times(1)).setFileLabelText(newValue);
    verify(view, times(1)).setFileLabelVisible(true);
    verify(view, times(0)).setLoadingImageVisible(anyBoolean());
    verify(view, times(1)).getFileName();
    verify(view, times(0)).setFormAction(anyString());
    verify(view, times(0)).submit();
    verify(view, times(0)).showError(any(SafeHtml.class));
    verify(view, times(0)).clearError();
}
 
Example 21
Project: gwt-promptly   File: StyledBlock.java   Source Code and License 5 votes vote down vote up
SafeHtml toSafeHtml(boolean withFormatting) {

      // NOTE :: Embedded operations are LOST using this method .... 
      
      StringBuilder sb = new StringBuilder();
      
      for (StyledParagraphItem i : _items) {
         final String text = i.getText();
         final String style = i.getStyle();
         
         if (withFormatting && style != null) {
            sb.append("<span style=\"");
            sb.append(SafeHtmlUtils.htmlEscape(style));
            sb.append("\">");
            if (text != null && " ".equals(text)) {
               sb.append("&nbsp;");
            } else {
               sb.append(SafeHtmlUtils.htmlEscape(text));
            }
            sb.append("</span>");
         } else {
            sb.append(SafeHtmlUtils.htmlEscape(text));
         }
      }
      
      final SafeHtml safeHtml = SafeHtmlUtils.fromTrustedString(sb.toString());
      return safeHtml;
   }
 
Example 22
Project: essence   File: ClickableTextCellRuleID.java   Source Code and License 5 votes vote down vote up
@Override
protected void render(Context context, SafeHtml value, SafeHtmlBuilder sb) {
 if (!value.asString().equals("none")) {
	  sb.appendHtmlConstant("<div class=\""+style+"\">");
      sb.append(value);
      sb.appendHtmlConstant("</div>");
  }
 else
	 sb.append(value);
}
 
Example 23
Project: essence   File: VOOBDetailClickableCellText.java   Source Code and License 5 votes vote down vote up
@Override
protected void render(Context context, SafeHtml value, SafeHtmlBuilder sb) {
  // Make the details clickable for VOOB rule
  if (value != null && !value.asString().isEmpty()) {
	  sb.appendHtmlConstant("<div class=\""+style+"\">");
      sb.append(value);
      sb.appendHtmlConstant("</div>");
  }
}
 
Example 24
Project: essence   File: MyClickableCellTextDecision.java   Source Code and License 5 votes vote down vote up
@Override
protected void render(Context context, SafeHtml value, SafeHtmlBuilder sb) {
  if (value != null && !value.asString().equals("Select Action")) {
      sb.append(value);
  }
  // if the value is assign, then we need to make the cell clickable with underline
  // otherwise, not.
  if (value.asString().equals("Select Action")) {
	  sb.appendHtmlConstant("<div class=\""+style+"\">");
      sb.append(value);
      sb.appendHtmlConstant("</div>");
  }
}
 
Example 25
Project: essence   File: DecisionTypeButtonOrTextCell.java   Source Code and License 5 votes vote down vote up
@Override
public void render(Context arg0, Object arg1, SafeHtmlBuilder arg2) {
	// TODO Auto-generated method stub
       if (arg1 != null && arg1.equals(DecisionTypeDTO.MANUAL_ACTION.toString())) {
       	buttonCell.render(arg0, (SafeHtml)arg1, arg2);
       } else {
           textCell.render(arg0,(SafeHtml) arg1, arg2);
       }		
}
 
Example 26
Project: gwtmvp   File: TableRowAdapter.java   Source Code and License 5 votes vote down vote up
/**
 * Default implementation that populates the table cells with a return value of {@link #getCellContent(int, Object)}.
 * Override this method if you need to perform more complex operation on a table cell.
 * @param column The column index of the table cell (0-based)
 * @param elem The DOM element of the table cell
 * @param item The item for this row
 */
protected void setTableCell(int column, TableCellElement elem, T item) {
  Object content = getCellContent(column, item);
  if (content instanceof SafeHtml) {
    elem.setInnerSafeHtml((SafeHtml) content);
  } else {
    elem.setInnerText(content != null ? content.toString() : "");
  }
}
 
Example 27
Project: appformer   File: ValueBoxEditorTest.java   Source Code and License 5 votes vote down vote up
@Test
public void testClearErrors() throws Exception {
    List<EditorError> errors = new ArrayList<EditorError>();
    presenter.showErrors(errors);
    verify(view, times(1)).clearError();
    verify(view, times(0)).showError(any(SafeHtml.class));
    verify(view, times(0)).init(presenter);
    verify(view, times(0)).setValue(anyString());
}
 
Example 28
Project: wte4j   File: GenerateDocumentPanel.java   Source Code and License 5 votes vote down vote up
private Column<OrderDataDto, SafeHtml> createAddressColumn() {
	return new Column<OrderDataDto, SafeHtml>(new SafeHtmlCell()) {

		@Override
		public SafeHtml getValue(OrderDataDto orderData) {
			SafeHtmlBuilder builder = new SafeHtmlBuilder();
			builder.appendEscapedLines(orderData.getAddress());
			return builder.toSafeHtml();
		}
	};
}
 
Example 29
Project: appformer   File: ToggleSwitchEditorTest.java   Source Code and License 5 votes vote down vote up
@Test
public void testClearErrors() throws Exception {
    List<EditorError> errors = new ArrayList<EditorError>();
    presenter.showErrors(errors);
    verify(view, times(1)).clearError();
    verify(view, times(0)).showError(any(SafeHtml.class));
    verify(view, times(0)).init(presenter);
    verify(view, times(0)).setValue(anyBoolean());
}
 
Example 30
Project: blogwt   File: PrettyButtonCell.java   Source Code and License 5 votes vote down vote up
@Override
public void render (Context context, SafeHtml data, SafeHtmlBuilder sb) {
	if (data != null) {
		String buttonStyle = null, glyph = null;

		Button b = buttons.get(data.asString());

		if (b != null) {
			buttonStyle = b.style;
			glyph = b.glyph;
		} else {
			buttonStyle = "btn-default";
		}

		sb.appendHtmlConstant(
				"<button type=\"button\" class=\"btn btn-xs "
						+ (buttonStyle == null || buttonStyle.length() == 0
								? "" : buttonStyle)
						+ "\" tabindex=\"-1\">");

		if (glyph != null && glyph.length() > 0) {
			sb.appendHtmlConstant(
					"<span class=\"glyphicon " + glyph + "\"></span> ");
		}

		sb.append(data);
		sb.appendHtmlConstant("</button>");
	}
}
 
Example 31
Project: appformer   File: ValueBoxEditorTest.java   Source Code and License 5 votes vote down vote up
@Test
public void testValue() throws Exception {
    final String newValue = "newValue";  
    presenter.setValue(newValue);
    assertEquals(newValue, presenter.getValue());
    verify(view, times(1)).setValue(newValue);
    verify(view, times(0)).clearError();
    verify(view, times(0)).showError(any(SafeHtml.class));
    verify(view, times(0)).init(presenter);
}
 
Example 32
Project: appformer   File: ImageListEditorTest.java   Source Code and License 5 votes vote down vote up
public void testInit() throws Exception {
    presenter.init();
    verify(view, times(1)).init(presenter);
    verify(view, times(0)).clear();
    verify(view, times(0)).clearError();
    verify(view, times(0)).showError(any(SafeHtml.class));
    verify(view, times(0)).add(any(SafeUri.class), anyString(), anyString(), any(SafeHtml.class),
            any(SafeHtml.class), anyBoolean(), any(Command.class));
    
}
 
Example 33
Project: appformer   File: ValueBoxEditorTest.java   Source Code and License 5 votes vote down vote up
@Test
public void testAddHelpContent() throws Exception {
    final String title = "title";
    final String content = "content";
    final Placement p = Placement.BOTTOM;
    presenter.addHelpContent(title, content, p);
    verify(view, times(1)).addHelpContent(title, content, p);
    verify(view, times(0)).setValue(anyString());
    verify(view, times(0)).clearError();
    verify(view, times(0)).showError(any(SafeHtml.class));
    verify(view, times(0)).init(presenter);
}
 
Example 34
Project: appformer   File: MessageTableWidget.java   Source Code and License 5 votes vote down vote up
public SafeHtml createDivStart(String title,
                               String defaultValue,
                               String cssClasses) {
    if (title == null || "".equals(title)) {
        title = defaultValue;
    }

    final String css = cssClasses == null ? "" : "class=\"" + cssClasses + "\"";
    return SafeHtmlUtils.fromTrustedString("<div title=\"" + SafeHtmlUtils.htmlEscape(title.trim()) + "\" " + css + " >");
}
 
Example 35
Project: appformer   File: IconCell.java   Source Code and License 5 votes vote down vote up
@Override
protected void render(Context context,
                      SafeHtml data,
                      SafeHtmlBuilder sb) {
    Icon icon = GWT.create(Icon.class);
    if (tooltip != null) {
        icon.setTitle(tooltip);
    }
    icon.setSize(iconSize);
    icon.setType(iconType);
    sb.appendHtmlConstant(icon.getElement().getString());
}
 
Example 36
Project: appformer   File: ToggleSwitchEditorTest.java   Source Code and License 5 votes vote down vote up
@Test
public void testInit() throws Exception {
    presenter.init();
    verify(view, times(1)).init(presenter);
    verify(view, times(0)).clearError();
    verify(view, times(0)).showError(any(SafeHtml.class));
    verify(view, times(0)).setValue(anyBoolean());
}
 
Example 37
Project: appformer   File: DataSetEditorTest.java   Source Code and License 5 votes vote down vote up
@Test
public void testInit() {
    presenter.init();
    verify(view, times(1)).init(presenter);
    verify(view, times(1)).initWidgets(
            any(DataSetDefBasicAttributesEditor.View.class),
            any(IsWidget.class),
            any(DataSetDefColumnsFilterEditor.View.class),
            any(DataSetDefPreviewTable.View.class),
            any(DataSetDefCacheAttributesEditorView.class),
            any(DataSetDefCacheAttributesEditorView.class),
            any(DataSetDefRefreshAttributesEditor.View.class)
    );
    verify(view, times(1)).addConfigurationTabItemClickHandler(any(Command.class));
    verify(view, times(1)).addPreviewTabItemClickHandler(any(Command.class));
    verify(view, times(1)).addAdvancedTabItemClickHandler(any(Command.class));
    verify(columnsAndFilterEditor, times(1)).setMaxHeight(anyString());
    verify(backendCacheAttributesEditor, times(1)).setRange(anyDouble(), anyDouble());
    verify(clientCacheAttributesEditor, times(1)).setRange(anyDouble(), anyDouble());
    verify(view, times(0)).showConfigurationTab();
    verify(view, times(0)).showPreviewTab();
    verify(view, times(0)).showAdvancedTab();
    verify(view, times(0)).openColumnsFilterPanel(anyString());
    verify(view, times(0)).closeColumnsFilterPanel(anyString());
    verify(view, times(0)).showErrorNotification(any(SafeHtml.class));
    verify(view, times(0)).clearErrorNotification();
}
 
Example 38
Project: aggregate   File: UIEnabledActionColumn.java   Source Code and License 5 votes vote down vote up
public UIEnabledActionColumn(SafeHtml html, 
        UIVisiblePredicate<T> isVisiblePredicate,
        UIEnabledPredicate<T> isEnabledPredicate,
        UIEnabledActionCell.Delegate<T> action) {
    super(new UIEnabledActionCell<T>(html, 
                isVisiblePredicate, isEnabledPredicate,
                action));
}
 
Example 39
Project: appformer   File: ImageListEditorTest.java   Source Code and License 5 votes vote down vote up
protected static ImageListEditor<DataSetProviderType>.Entry mockEntry(DataSetProviderType type) {
    final String name = type.getName();
    final SafeUri uri = mock(SafeUri.class);
    final SafeHtml safeHtml = mock(SafeHtml.class);
    doReturn(name).when(safeHtml).asString();
    ImageListEditor<DataSetProviderType>.Entry entry = mock(ImageListEditor.Entry.class);
    doReturn(type).when(entry).getValue();
    doReturn(safeHtml).when(entry).getHeading();
    doReturn(safeHtml).when(entry).getText();
    doReturn(uri).when(entry).getUri();
    return entry;
}
 
Example 40
Project: appformer   File: DropDownEditorView.java   Source Code and License 5 votes vote down vote up
@Override
public DropDownEditorView showError(SafeHtml message) {
    errorTooltip.setTitle(message.asString());
    errorPanel.removeStyleName(style.errorPanel());
    errorPanel.addStyleName(style.errorPanelWithError());
    return this;
}
 
Example 41
Project: appformer   File: DataSetEditorTest.java   Source Code and License 5 votes vote down vote up
@Test
public void testOnFilterChangedEvent() {
    final FilterChangedEvent event = mock(FilterChangedEvent.class);
    final DataSetFilter filter = mock(DataSetFilter.class);
    when(event.getContext()).thenReturn(filterEditor);
    when(event.getFilter()).thenReturn(filter);
    presenter.dataSetDef = this.dataSetDef;
    mockPreviewTableCall();
    final Command afterPreviewCommand = mock(Command.class);
    presenter.afterPreviewCommand = afterPreviewCommand;
    presenter.onFilterChangedEvent(event);
    verify(dataSetDef, times(1)).setDataSetFilter(filter);
    verify(loadingBox, times(1)).show();
    verify(loadingBox, times(1)).hide();
    verify(view, times(1)).clearErrorNotification();
    verify(filterEditor, times(0)).init(any(DataSetMetadata.class));
    verify(afterPreviewCommand, times(1)).execute();
    verify(view, times(0)).init(any(DataSetEditor.class));
    verify(view, times(0)).initWidgets(
            any(DataSetDefBasicAttributesEditor.View.class),
            any(IsWidget.class),
            any(DataSetDefColumnsFilterEditor.View.class),
            any(DataSetDefPreviewTable.View.class),
            any(DataSetDefCacheAttributesEditorView.class),
            any(DataSetDefCacheAttributesEditorView.class),
            any(DataSetDefRefreshAttributesEditor.View.class)
    );
    verify(view, times(0)).addConfigurationTabItemClickHandler(any(Command.class));
    verify(view, times(0)).addPreviewTabItemClickHandler(any(Command.class));
    verify(view, times(0)).addAdvancedTabItemClickHandler(any(Command.class));
    verify(view, times(0)).showConfigurationTab();
    verify(view, times(0)).showPreviewTab();
    verify(view, times(0)).showAdvancedTab();
    verify(view, times(0)).openColumnsFilterPanel(anyString());
    verify(view, times(0)).closeColumnsFilterPanel(anyString());
    verify(view, times(0)).showErrorNotification(any(SafeHtml.class));
}
 
Example 42
Project: hawkbit   File: ViewClientCriterionTest.java   Source Code and License 5 votes vote down vote up
@Test
@Description("Check multi row drag decoration with a valid multi selection")
public void processMultiRowDragDecorationMultiSelection() {
    final ViewClientCriterion cut = new ViewClientCriterion();

    // prepare table
    final VScrollTable table = Mockito.spy(new VScrollTable());
    table.selectedRowKeys.add("one");
    table.selectedRowKeys.add("two");
    table.focusedRow = Mockito.mock(VScrollTable.VScrollTableBody.VScrollTableRow.class);
    when(table.focusedRow.getKey()).thenReturn("one");

    // prepare drag-event with table widget:
    final VDragEvent dragEvent = CriterionTestHelper.createMockedVDragEvent("thisId", table, "myTheme");
    dragEvent.getTransferable().getDragSource().getConnection().getUIConnector();

    // prepare document
    final Document document = Document.get();
    final StyleElement ele = Mockito.spy(StyleElement.class);
    when(ele.getTagName()).thenReturn(StyleElement.TAG);
    when(document.getElementById(ViewClientCriterion.SP_DRAG_COUNT)).thenReturn(ele);

    try {
        // act
        cut.setMultiRowDragDecoration(dragEvent);

        // assure that multi-row decoration for the table was processed
        verify(document).getElementById(ViewClientCriterion.SP_DRAG_COUNT);

        // assure that no multi selection was detected
        verify(ele).setInnerSafeHtml(any(SafeHtml.class));
    } finally {
        reset(Document.get());
    }
}
 
Example 43
Project: gwt-material   File: CodeHelper.java   Source Code and License 5 votes vote down vote up
public static SafeHtml parseCode(String code) {
    SafeHtmlBuilder builder = new SafeHtmlBuilder();
    String[] splitted = code.replaceAll("\\\\s", " ").split("\\\\n\\s?");
    String[] arr$ = splitted;
    int len$ = splitted.length;

    for (int i$ = 0; i$ < len$; ++i$) {
        String s = arr$[i$];
        builder.append(SafeHtmlUtils.fromTrustedString(SafeHtmlUtils.htmlEscapeAllowEntities(s)));
        builder.appendHtmlConstant("<br>");
    }

    return builder.toSafeHtml();
}
 
Example 44
Project: appformer   File: ToggleSwitchEditorTest.java   Source Code and License 5 votes vote down vote up
@Test
public void testOnValueChanged() throws Exception {
    final Boolean newValue = true;
    presenter.onValueChanged(newValue);
    assertEquals(newValue, presenter.getValue());
    verify(view, times(1)).clearError();
    verify(view, times(0)).setValue(newValue);
    verify(view, times(0)).showError(any(SafeHtml.class));
    verify(view, times(0)).init(presenter);
    verify( valueChangeEvent, times( 1 ) ).fire(any(ValueChangeEvent.class));
}
 
Example 45
Project: blogwt   File: HeaderPart.java   Source Code and License 5 votes vote down vote up
private Element addOpenable (Element parent, SafeHtml title, SafeUri href) {
	String key = href.asString().replaceFirst("#", "");
	final Element got;
	final Element element = (got = getOpenable(key)) == null
			? Document.get().createLIElement()
			: got;

	element.setClassName("dropdown");
	parent.appendChild(element);

	final Element a = Document.get().createAnchorElement();
	element.appendChild(a);
	Event.sinkEvents(a, Event.ONCLICK);
	Event.setEventListener(a, new EventListener() {

		@Override
		public void onBrowserEvent (Event event) {
			openableClick(a);
			event.stopPropagation();
		}
	});

	a.addClassName("dropdown-toggle");
	a.setInnerSafeHtml(title);
	Element ul = Document.get().createULElement();
	ul.addClassName("dropdown-menu");
	element.appendChild(ul);
	ensureOpenables().put(key, element);

	return element;
}
 
Example 46
Project: appformer   File: ImageListEditorTest.java   Source Code and License 5 votes vote down vote up
public void testClear() throws Exception {
    presenter.entries.addAll(expectedEntries);
    presenter.value = DataSetProviderType.BEAN;
    presenter.clear();
    assertTrue(presenter.entries.isEmpty());
    assertNull(presenter.value);
    verify(view, times(1)).clear();
    verify(view, times(0)).init(any(ImageListEditor.class));
    verify(view, times(0)).clearError();
    verify(view, times(0)).showError(any(SafeHtml.class));
    verify(view, times(0)).add(any(SafeUri.class), anyString(), anyString(), any(SafeHtml.class), 
            any(SafeHtml.class), anyBoolean(), any(Command.class));
}
 
Example 47
Project: mvp4g-examples   File: HeaderView.java   Source Code and License 5 votes vote down vote up
@XTemplate("<table width=\"100%\" height=\"100%\" class=\"{container}\">" +
           "  <tbody>" +
           "    <tr>" +
           "      <td height=\"50%\" class=\"leftColumn01\"></td>" +
           "    </tr>" +
           "  </tbody>" +
           "</table>")
SafeHtml getTemplate(String container);
 
Example 48
Project: che   File: SshKeyManagerPresenterTest.java   Source Code and License 5 votes vote down vote up
@Test
public void testOnDeleteClickedWhenDeleteKeyIsFailure() throws OperationException {
  when(sshPairDto.getService()).thenReturn(SshKeyManagerPresenter.VCS_SSH_SERVICE);
  when(sshPairDto.getName()).thenReturn(GITHUB_HOST);
  SafeHtml safeHtml = mock(SafeHtml.class);
  ConfirmDialog confirmDialog = mock(ConfirmDialog.class);
  when(constant.deleteSshKeyQuestion(anyString())).thenReturn(safeHtml);
  when(safeHtml.asString()).thenReturn("");
  when(dialogFactory.createConfirmDialog(
          nullable(String.class),
          nullable(String.class),
          nullable(ConfirmCallback.class),
          nullable(CancelCallback.class)))
      .thenReturn(confirmDialog);

  presenter.onDeleteClicked(sshPairDto);

  verify(dialogFactory)
      .createConfirmDialog(
          nullable(String.class),
          nullable(String.class),
          confirmCallbackCaptor.capture(),
          (CancelCallback) anyObject());
  ConfirmCallback confirmCallback = confirmCallbackCaptor.getValue();
  confirmCallback.accepted();

  verify(voidPromise).catchError(operationErrorCapture.capture());
  operationErrorCapture.getValue().apply(JsPromiseError.create(""));

  verify(confirmDialog).show();
  verify(service).deletePair(eq(SshKeyManagerPresenter.VCS_SSH_SERVICE), anyString());
  verify(notificationManager)
      .notify(anyString(), eq(StatusNotification.Status.FAIL), eq(FLOAT_MODE));
  verify(service, never()).getPairs(eq(SshKeyManagerPresenter.VCS_SSH_SERVICE));
}
 
Example 49
Project: che   File: ExecuteCommandButtonFactory.java   Source Code and License 5 votes vote down vote up
/** Returns {@link FontAwesome} icon for the given goal. */
private SafeHtml getIconForGoal(CommandGoal goal) {
  final SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();

  if (goal.equals(runGoal)) {
    safeHtmlBuilder.appendHtmlConstant(FontAwesome.PLAY);
  } else if (goal.equals(debugGoal)) {
    safeHtmlBuilder.appendHtmlConstant(FontAwesome.BUG);
  }

  return safeHtmlBuilder.toSafeHtml();
}
 
Example 50
Project: che   File: OpenCommandsPaletteButton.java   Source Code and License 5 votes vote down vote up
@Inject
OpenCommandsPaletteButton(
    Provider<CommandsPalettePresenter> commandsPalettePresenterProvider,
    PaletteMessages messages,
    Provider<ActionManager> actionManagerProvider,
    Provider<KeyBindingAgent> keyBindingAgentProvider,
    Provider<ShowCommandsPaletteAction> showCommandsPaletteActionProvider,
    @Assisted SafeHtml content) {
  super(content);

  this.actionManagerProvider = actionManagerProvider;
  this.keyBindingAgentProvider = keyBindingAgentProvider;

  addClickHandler(event -> commandsPalettePresenterProvider.get().showDialog());

  // We need to get action's shortcut but action may not be registered yet.
  // So postpone tooltip creation and wait 1 sec. while action will be registered.
  new Timer() {
    @Override
    public void run() {
      final DivElement divElement = Elements.createDivElement();
      divElement.setInnerText(messages.actionShowPaletteTitle());
      divElement.appendChild(getHotKey(showCommandsPaletteActionProvider.get()));

      Tooltip.create(
          (Element) OpenCommandsPaletteButton.this.getElement(), BOTTOM, MIDDLE, divElement);
    }
  }.schedule(1000);

  ensureDebugId("button-open_command_palette");
}
 
Example 51
Project: TreeGridGWT   File: ExpandableCell.java   Source Code and License 5 votes vote down vote up
private void createOpenArrowAndFolderSafeHtml(SafeHtmlBuilder sb,
		SafeStyles imgStyle) {
	SafeHtml rendered;
	if (currentRow.getChildren().size() != 0) {
		rendered = nodeImageTemplate.cell("ICON_ARROW__OPEN", imgStyle,
				ICON_ARROW_OPEN);
		sb.append(rendered);
	}
	if (treeGrid.isSelectable()) {
		createCheckBoxImg(sb, imgStyle);
	}
	rendered = nodeImageTemplate.cell("ICON_FOLDER__OPEN", imgStyle,
			ICON_FOLDER_OPEN);
	sb.append(rendered);
}
 
Example 52
Project: TreeGridGWT   File: ExpandableCell.java   Source Code and License 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
protected void render(com.google.gwt.cell.client.Cell.Context context,
		SafeHtml data, SafeHtmlBuilder sb) {
	currentRow = (T) treeGrid.getDataStore().getList()
			.get(context.getIndex());
	/*
	 * Always do a null check on the value. Cell widgets can pass null to
	 * cells if the underlying data contains a null, or if the data arrives
	 * out of order.
	 */
	if (data == null) {
		return;
	}

	// generate the image cell
	SafeStyles imgStyle = SafeStylesUtils
			.fromTrustedString("float:left;cursor:hand;cursor:pointer;");
	SafeStyles valueStyle = SafeStylesUtils
			.fromTrustedString("float:left;");
	SafeHtml rendered;
	if (currentRow.getChildren().size() > 0) {
		createClearIcon(sb, imgStyle, currentRow.getLevel());
		if (!currentRow.isExpand()) {
			createClosedArrowAndFolderSafeHtml(sb, imgStyle);
		} else {
			createOpenArrowAndFolderSafeHtml(sb, imgStyle);
		}
	} else {
		createClearIcon(sb, imgStyle, currentRow.getLevel() + 1);
		if (treeGrid.isSelectable()) {
			createCheckBoxImg(sb, imgStyle);
		}
		createLeafSafeHtml(sb, imgStyle);
	}
	// generate the value cell
	rendered = nodeImageTemplate.cellNode("EXPANDABLE_VALUE", valueStyle,
			SafeHtmlUtils.fromString(data.asString()));
	sb.append(rendered);
}
 
Example 53
Project: riscoss-corporate   File: RiskConfsModule.java   Source Code and License 5 votes vote down vote up
private void loadRiskConfsTable(JSONValue response) {
	tablePanel.clear();
	table = new CellTable<RCInfo>(15, (Resources) GWT.create(TableResources.class));
	
	table.addColumn( new Column<RCInfo,SafeHtml>(new SafeHtmlCell() ) {
		@Override
		public SafeHtml getValue(RCInfo object) {
			return new LinkHtml( object.name, "javascript:selectRC(\"" + object.name + "\")" ); };
	}, "Risk Configuration");
	table.setWidth("100%");
	dataProvider = new ListDataProvider<RCInfo>();
	dataProvider.addDataDisplay(table);

	GWT.log( response.toString() );
	if( response.isArray() != null ) {
		for( int i = 0; i < response.isArray().size(); i++ ) {
			JSONObject o = (JSONObject)response.isArray().get( i );
			dataProvider.getList().add( new RCInfo( 
					o.get( "name" ).isString().stringValue() ) );
		}
	}

	SimplePager pager = new SimplePager();
    pager.setDisplay( table );
	
	tablePanel.add( table );
	tablePanel.add( pager );
	tablePanel.setWidth("100%");
	
	spTable.setWidget(tablePanel);
	
}
 
Example 54
Project: appformer   File: TitledTextCell.java   Source Code and License 5 votes vote down vote up
@Override
public void render(Context context,
                   SafeHtml value,
                   SafeHtmlBuilder sb) {
    if (value != null) {
        sb.append(value);
    }
}
 
Example 55
Project: showcase   File: PhotoGallery.java   Source Code and License 5 votes vote down vote up
@Template("<div class=\"{4}\">"
+ "<a href=\"{0}\">"
+ "     <img src=\"{1}\"alt=\"{2}\"/>"
+ "</a>"
+ "<aside>"
+ "     <span>"
+ "         by <a href=\"{0}\">{3}</a>"
+ "     </span>"
+ "</aside>"
+ "</div>") SafeHtml input(SafeUri authorWebsite, SafeUri imageUrl, String imageText,
String authorName, String clazz);
 
Example 56
Project: blogwt   File: PostSummaryCell.java   Source Code and License 5 votes vote down vote up
@Override
public void render (Context context, Post value, SafeHtmlBuilder builder) {
	SafeUri link = PageTypeHelper.asHref(PageType.PostDetailPageType,
			PostHelper.getSlug(value));
	SafeHtml published = Templates.INSTANCE.notPublished(DateTimeHelper
			.ago(value.created));

	if (value.published != null) {
		published = Templates.INSTANCE.publishedDate(DateTimeHelper
				.ago(value.published));
	}

	String body = "Empty... :imp:";

	if (value.summary != null && value.summary.length() > 0) {
		body = value.summary;
	} else if (value.content != null && value.content.body != null
			&& value.content.body.length() > 0) {
		body = value.content.body;
	}

	SafeHtml author = SafeHtmlUtils.EMPTY_SAFE_HTML;

	if (PropertyController.get().booleanProperty(
			PropertyHelper.POST_SHOW_AUTHOR, false)) {
		author = Templates.INSTANCE
				.author(UriUtils.fromString(value.author.avatar + "?s="
						+ UserHelper.AVATAR_HEADER_SIZE + "&default=retro"),
						UserHelper.handle(value.author));
	}

	RENDERER.render(builder, link, SafeHtmlUtils
			.fromTrustedString(PostHelper.makeHeading2(value.title)),
			SafeHtmlUtils.fromTrustedString(PostHelper.makeMarkup(body)),
			author, published,
			value.listed.booleanValue() ? SafeHtmlUtils.EMPTY_SAFE_HTML
					: Templates.INSTANCE.notVisible());
}
 
Example 57
Project: sig-seguimiento-vehiculos   File: Welcome.java   Source Code and License 4 votes vote down vote up
@XTemplate(source = "welcomeTemplate.html")
public SafeHtml renderTemplate(UIWelcomeMessages uimessages);
 
Example 58
Project: sig-seguimiento-vehiculos   File: InfoProjectTool.java   Source Code and License 4 votes vote down vote up
@XTemplate(source = "ProjectInfoTemplate.html")
public SafeHtml renderTemplate(UIMessages uimessages, Project project,
		List<ProjectVectorLayer> vectors, int totalElements);
 
Example 59
Project: sig-seguimiento-vehiculos   File: HtmlReportLayerTool.java   Source Code and License 4 votes vote down vote up
@XTemplate(source = "LayerInfoTemplate.html")
public SafeHtml renderTemplate(UIMessages uimessages, VectorLayer data,
		List<List<String>> attrValues, List<String> attrNames);
 
Example 60
Project: sig-seguimiento-vehiculos   File: GeoprocessHelpDialog.java   Source Code and License 4 votes vote down vote up
@XTemplate(source = "GeoprocessHelpTemplate.html")
public SafeHtml renderTemplate(HelpMessages helpMessages, UIMessages uiMessages);