@Override public Widget getIcon() { return tabIcon != null ? new SVGImage(tabIcon) : null; }
/** {@inheritDoc} */ @Override public void setCheckedStatus(boolean isChecked) { ButtonResources.Css buttonCss = resources.buttonCss(); if (isChecked) { icon.removeClassNameBaseVal(buttonCss.whiteColor()); icon.addClassNameBaseVal(buttonCss.activeConsoleButton()); } else { icon.removeClassNameBaseVal(buttonCss.activeConsoleButton()); icon.addClassNameBaseVal(buttonCss.whiteColor()); } image.getElement().appendChild(icon.getSvgElement().getElement()); }
@Override public final HandlerRegistration addDragOverHandler(DragOverHandler handler) { return addDomHandler(handler, DragOverEvent.getType()); } @Override
Transform2 t2 = new Transform2(at); // converts matrix syntax BufferedImage bImage = (BufferedImage) awtImage; SVGImage svgImage = new SVGImage(); svgImage.setTransform(t2); svgImage.readImageData(bImage, SVGImage.IMAGE_PNG);
@Inject GoalPopUpGroup( @Assisted String goalId, ActionManager actionManager, CommandGoalRegistry goalRegistry, IconRegistry iconRegistry) { super(actionManager); this.iconRegistry = iconRegistry; commandGoal = goalRegistry.getGoalForId(goalId); setPopup(true); // set icon final SVGResource commandTypeIcon = getCommandGoalIcon(); if (commandTypeIcon != null) { getTemplatePresentation().setImageElement(new SVGImage(commandTypeIcon).getElement()); } }
/** {@inheritDoc} */ @Override public SpanElement renderNodeContents(Reference data) { SpanElement root = Elements.createSpanElement(css.referenceRoot()); SVGImage icon; if (data.getFullName().equals(MergePresenter.LOCAL_BRANCHES_TITLE)) { icon = new SVGImage(gitResources.checkoutReference()); } else if (data.getFullName().equals(MergePresenter.REMOTE_BRANCHES_TITLE)) { icon = new SVGImage(gitResources.remote()); } else { icon = new SVGImage(gitResources.branches()); } SpanElement label = Elements.createSpanElement(css.referenceLabel()); String content = data.getDisplayName(); label.setTextContent(content); root.appendChild((Node) icon.getSvgElement().getElement()); root.appendChild(label); return root; }
@Override public Element createItem(final SymbolInformation itemModel) { final Element element = Elements.createLiElement(popupResources.popupStyle().item()); final Element iconElement = Elements.createDivElement(popupResources.popupStyle().icon()); SVGImage svgImage = getSvgImage(itemModel.getKind()); iconElement.appendChild((Node) svgImage.getElement()); element.appendChild(iconElement); element.appendChild(createTitleOfElement(itemModel)); final EventListener validateListener = evt -> { openImplementationPresenter.openOneImplementation(itemModel); hide(); }; element.addEventListener(Event.DBLCLICK, validateListener, false); element.addEventListener(CUSTOM_EVT_TYPE_VALIDATE, validateListener, false); return element; }
/** * Create close icon widget that contains an close notification icon. * * @return {@link SimplePanel} as close icon wrapper */ private SimplePanel createCloseWidget() { SimplePanel closeWrapper = new SimplePanel(); SVGImage closeImage = new SVGImage(resources.closeIcon()); closeImage.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { delegate.onClose(notification); } }); closeWrapper.add(closeImage); closeWrapper.setStyleName(resources.notificationCss().notificationCloseButtonWrapper()); closeImage.ensureDebugId(CLOSE_ICON_DBG_ID + notification.getId()); return closeWrapper; }
/** * Create close icon widget that contains an close notification icon. * * @return {@link SimplePanel} as close icon wrapper */ private SimplePanel createCloseWidget() { SimplePanel closeWrapper = new SimplePanel(); SVGImage closeImage = new SVGImage(resources.closeIcon()); closeImage.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { delegate.onClose(notification); } }); closeWrapper.add(closeImage); closeWrapper.setStyleName(resources.notificationCss().notificationPopupCloseButtonWrapper()); closeWrapper.ensureDebugId(CLOSE_ICON_DBG_ID + notification.getId()); return closeWrapper; }
private void initView() { WindowClientBundle.Style style = clientBundle.getStyle(); windowFrame = new VerticalPanel(); windowFrame.addStyleName(style.windowFrame()); windowFrameTitleBar = new HorizontalPanel(); windowFrameTitleBar.addStyleName(style.windowFrameTitleBar()); windowFrameHeaderTitle = new Label(); windowFrameHeaderTitle.addStyleName(style.windowFrameTitle()); windowFrameCloseButton = new SVGImage(clientBundle.closeIcon()); windowFrameCloseButton.addClassNameBaseVal(style.windowFrameCloseButton()); windowFrameBody = new FlowPanel(); windowFrameBody.addStyleName(style.windowFrameBody()); windowFrameButtonBar = new FlowPanel(); windowFrameButtonBar.addStyleName(style.windowFrameButtonBar()); windowFrameButtonBar.setVisible(false); windowFrameTitleBar.add(windowFrameHeaderTitle); windowFrameTitleBar.add(windowFrameCloseButton); windowFrame.add(windowFrameTitleBar); windowFrame.add(windowFrameBody); windowFrame.add(windowFrameButtonBar); initWidget(windowFrame); }
@Override public void setDebugId(String debugId) { ensureDebugId(debugId); windowFrameTitleBar.ensureDebugId(debugId + "-windowFrameTitleBar"); windowFrameHeaderTitle.ensureDebugId(debugId + "-windowFrameTitle"); windowFrameCloseButton.ensureDebugId(debugId + "-windowFrameCloseButton"); windowFrameBody.ensureDebugId(debugId + "-windowFrameBody"); windowFrameButtonBar.ensureDebugId(debugId + "-windowFrameButtonBar"); }
@Inject ExecuteCommandAction( @Assisted CommandImpl command, CommandUtils commandUtils, CommandExecutor commandExecutor, CommandManager commandManager) { super(command.getName()); this.command = command; this.commandExecutor = commandExecutor; this.commandManager = commandManager; final SVGResource commandIcon = commandUtils.getCommandTypeIcon(command.getType()); if (commandIcon != null) { getTemplatePresentation().setImageElement(new SVGImage(commandIcon).getElement()); } }
final SVGResource logo = productInfoDataProvider.getWaterMarkLogo(); if (nonNull(logo)) { this.logo.appendChild(new SVGImage(logo).getSvgElement().getElement());
private Element renderCategoryHeader(String category) { SpanElement categoryElement = Document.get().createSpanElement(); categoryElement.setClassName(resources.defaultCategoriesListCss().headerText()); SpanElement iconElement = Document.get().createSpanElement(); categoryElement.appendChild(iconElement); SpanElement textElement = Document.get().createSpanElement(); categoryElement.appendChild(textElement); textElement.setInnerText(category); Icon icon = iconRegistry.getIconIfExist(category + ".samples.category.icon"); if (icon != null) { final SVGImage iconSVG = icon.getSVGImage(); if (iconSVG != null) { iconElement.appendChild(iconSVG.getElement()); return categoryElement; } } return categoryElement; }
/** * Constructs a new action with the specified text, description and icon. * * @param text Serves as a tooltip when the presentation is a button and the name of the menu item * when the presentation is a menu item * @param description Describes current action, this description will appear on the status bar * when presentation has focus * @param svgResource Action's SVG icon * @param htmlResource HTML representation of icon */ public BaseAction(String text, String description, SVGResource svgResource, String htmlResource) { presentation.setText(text); presentation.setDescription(description); if (svgResource != null) { presentation.setImageElement(new SVGImage(svgResource).getElement()); } presentation.setHTMLResource(htmlResource); }
/** {@inheritDoc} */ @Override public Widget getIcon() { return new SVGImage(icon); }
public NodeWidget( String nodeName, ProjectClasspathResources resources, int nodeKind, SVGResource nodeIcon) { this.resources = resources; this.nodeName = nodeName; this.nodeKind = nodeKind; initWidget(UI_BINDER.createAndBindUi(this)); SVGImage icon = new SVGImage(nodeIcon.getSvg()); this.icon.getElement().appendChild(icon.getSvgElement().getElement()); this.removeButton.getElement().appendChild(resources.removeNode().getSvg().getElement()); name.setText(nodeName); removeButton.addDomHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { delegate.onRemoveButtonClicked(NodeWidget.this); } }, ClickEvent.getType()); addDomHandler(this, ClickEvent.getType()); }
final SVGImage iconSVG = icon.getSVGImage(); if (iconSVG != null) { iconElement.appendChild(iconSVG.getElement()); return categoryHeaderElement;
@Override public final HandlerRegistration addDragStartHandler(DragStartHandler handler) { return addDomHandler(handler, DragStartEvent.getType()); } @Override
SVGImage image = new SVGImage(icon); image.getElement().setAttribute("name", status); return image;