use of com.google.gwt.safehtml.shared.SafeUri in project kie-wb-common by kiegroup.
the class CaseManagementShapeDefFactory method newActivityShape.
@SuppressWarnings("unchecked")
private Shape newActivityShape(final Object instance, final ShapeDef shapeDef) {
final BPMNViewDefinition bpmnDefinition = (BPMNViewDefinition) instance;
final CaseManagementActivityShapeDef cmShapeDef = (CaseManagementActivityShapeDef) shapeDef;
final double width = cmShapeDef.getWidth(bpmnDefinition);
final double height = cmShapeDef.getHeight(bpmnDefinition);
final ActivityView view = cmShapeViewFactory.newActivityView(width, height);
final SafeUri iconUri = cmShapeDef.getIconUri(instance.getClass());
final PictureShapeView iconView = basicShapeViewFactory.pictureFromUri(iconUri, 15d, 15d);
return new ActivityShape(cmShapeDef, iconView, view);
}
use of com.google.gwt.safehtml.shared.SafeUri in project activityinfo by bedatadriven.
the class UnsupportedDialog method show.
public static void show() {
Template template = GWT.create(Template.class);
SafeUri downloadUri = UriUtils.fromSafeConstant("https://www.google.com/chrome/browser/desktop/?hl=" + LocaleInfo.getCurrentLocale().getLocaleName());
SafeHtml message = template.message(I18N.CONSTANTS.offlineNotSupported(), downloadUri, I18N.CONSTANTS.downloadGoogleChrome());
MessageBox.alert(I18N.CONSTANTS.offlineNotSupportedTitle(), message.asString(), null);
}
use of com.google.gwt.safehtml.shared.SafeUri in project kie-wb-common by kiegroup.
the class ShapeViewFactory method picture.
public PictureShapeView picture(final Object source, final double width, final double height) {
checkNotNull("source", source);
final SafeUri uri = pictureProvidersManager.getUri(source);
return new PictureShapeView(uri.asString(), width, height);
}
use of com.google.gwt.safehtml.shared.SafeUri in project kie-wb-common by kiegroup.
the class DiagramNavigatorItemImplTest method checkSizeIsSetBeforeUriWhenShowing.
@Test
public void checkSizeIsSetBeforeUriWhenShowing() {
final InOrder inOrder = inOrder(view, view);
final SafeUri uri = mock(SafeUri.class);
final DiagramRepresentation diagramRepresentation = mock(DiagramRepresentation.class);
when(diagramRepresentation.getDefinitionSetId()).thenReturn("defId");
when(shapeManager.getThumbnail(eq("defId"))).thenReturn(uri);
when(diagramRepresentation.getThumbImageData()).thenReturn(null);
diagramNavigatorItem.show(diagramRepresentation, 100, 200, () -> {
});
inOrder.verify(view).setItemPxSize(eq(100), eq(200));
inOrder.verify(view).setThumbUri(eq(uri));
}
use of com.google.gwt.safehtml.shared.SafeUri in project blogwt by billy1380.
the class HeaderPart method setupNavBarPages.
private void setupNavBarPages() {
String titleInNavBar = PropertyController.get().stringProperty(PropertyHelper.TITLE_IN_NAVBAR);
boolean removedHome = false;
if (titleInNavBar == null || titleInNavBar.contains(PropertyHelper.TITLE_VALUE)) {
elName.setInnerText(PropertyController.get().title());
} else if (titleInNavBar.equals(PropertyHelper.NONE_VALUE)) {
btnHome.removeFromParent();
removedHome = true;
} else {
elName.removeFromParent();
}
boolean foundBrandPage = false, addedBlog = false;
List<Page> pages;
SafeUri href;
Map<Long, Page> possibleParents = new HashMap<Long, Page>();
if ((pages = PageController.get().getHeaderPages()) != null) {
for (Page page : pages) {
if (page.priority != null && page.priority.floatValue() == 0.0f && !removedHome) {
btnHome.setHref(PageTypeHelper.slugToHref(page.slug));
foundBrandPage = true;
} else {
if (page.priority != null && page.priority.floatValue() > 2 && (foundBrandPage || removedHome) && !addedBlog) {
href = PageTypeHelper.asHref(PageType.PostsPageType);
addItem(elNavLeft, SafeHtmlUtils.fromSafeConstant("Blog"), href);
addedBlog = true;
}
Element el;
if (page.parent == null) {
href = PageTypeHelper.slugToHref(page.slug);
if (possibleParents.get(page.id) == null) {
addItem(elNavLeft, SafeHtmlUtils.fromString(page.title), href);
possibleParents.put(page.id, page);
} else {
possibleParents.put(page.id, page);
swapTitle(PageTypeHelper.slugToTargetHistoryToken("pageid_" + page.id), HeaderTemplates.INSTANCE.openableTitle(page.title), href);
}
} else {
Page parent;
if ((parent = possibleParents.get(page.parent.id)) != null) {
el = getOpenable(PageTypeHelper.slugToTargetHistoryToken(parent.slug));
if (el == null) {
el = getOpenable(PageTypeHelper.slugToTargetHistoryToken("pageid_" + parent.id));
}
if (el == null) {
el = getItem(PageTypeHelper.slugToTargetHistoryToken(parent.slug));
if (el != null) {
el = convertItemToOpenable(PageTypeHelper.slugToTargetHistoryToken(parent.slug), HeaderTemplates.INSTANCE.openableTitle(parent.title));
}
}
} else {
String dummySlug = "pageid_" + page.parent.id;
el = addOpenable(elNavLeft, HeaderTemplates.INSTANCE.openableTitle(dummySlug), PageTypeHelper.slugToHref(dummySlug));
possibleParents.put(page.parent.id, page.parent);
}
if (el != null) {
href = PageTypeHelper.slugToHref(page.slug);
addItem(el.getFirstChildElement().getNextSiblingElement(), SafeHtmlUtils.fromString(page.title), href);
}
}
}
}
}
if (foundBrandPage || removedHome) {
if (!addedBlog) {
href = PageTypeHelper.asHref(PageType.PostsPageType);
addItem(elNavLeft, SafeHtmlUtils.fromSafeConstant("Blog"), href);
}
} else {
btnHome.setHref(PageTypeHelper.asHref(PageType.PostsPageType));
}
ensureItems().put(PageType.AllPostsPageType.asTargetHistoryToken(), elPosts);
ensureItems().put(PageType.PagesPageType.asTargetHistoryToken(), elPages);
ensureItems().put(PageType.PropertiesPageType.asTargetHistoryToken(), elProperties);
ensureItems().put(PageType.UsersPageType.asTargetHistoryToken(), elUsers);
ensureItems().put(PageType.RolesPageType.asTargetHistoryToken(), elRoles);
ensureItems().put(PageType.PermissionsPageType.asTargetHistoryToken(), elPermissions);
ensureItems().put(PageType.ResourcesPageType.asTargetHistoryToken(), elResources);
ensureItems().put(PageType.MetaNotificationsPageType.asTargetHistoryToken(), elMetaNotifications);
elAdmin.removeFromParent();
elAccount.removeFromParent();
}
Aggregations