@Override public Widget getIcon() { return tabIcon != null ? new SVGImage(tabIcon) : null; }
/** {@inheritDoc} */ @Override public Widget getIcon() { return new SVGImage(icon); }
/** * Returns {@link SVGImage} widget. * * @return {@link SVGImage} widget */ @Nullable public SVGImage getSVGImage() { if (svgResource == null) { return null; } return new SVGImage(svgResource); }
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);
private void setIcon(SVGResource resource) { iconPanel.clear(); SVGImage image = new SVGImage(resource); iconPanel.add(image); }
/** {@inheritDoc} */ @NotNull @Override public PartButton setIcon(@Nullable SVGResource iconResource) { this.tabIcon = iconResource; iconPanel.clear(); if (tabIcon != null) { iconPanel.add(new SVGImage(tabIcon)); } return this; }
private SVGImage getSvgImage(SymbolKind symbolKind) { SVGResource icon; switch (symbolKind) { case Interface: icon = javaResources.interfaceItem(); break; case Enum: icon = javaResources.enumItem(); break; default: icon = javaResources.javaFile(); } return new SVGImage(icon); } }
@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()); } }
@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()); } }
/** {@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; }
/** * 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); }
@Inject public ConsoleButtonImpl( ButtonResources resources, TooltipWidget tooltip, @NotNull @Assisted String prompt, @NotNull @Assisted SVGResource image) { this.resources = resources; this.tooltip = tooltip; this.tooltip.setDescription(prompt); resources.buttonCss().ensureInjected(); initWidget(UI_BINDER.createAndBindUi(this)); icon = new SVGImage(image); icon.getElement().setAttribute("class", resources.buttonCss().mainButtonIcon()); setCheckedStatus(false); addDomHandler(this, ClickEvent.getType()); addDomHandler(this, MouseOutEvent.getType()); addDomHandler(this, MouseOverEvent.getType()); }
/** * Adds the new radio button to the group. * * @param label radio button's label * @param title radio button's tooltip * @param icon radio button's icon * @param clickHandler click handler */ public void addButton( String label, String title, @Nullable SVGResource icon, ClickHandler clickHandler) { final RadioButton radioButton = new RadioButton(GROUP_NAME, label); radioButton.setTitle(title); radioButton.setStyleName(resources.getCSS().button()); radioButton.addClickHandler(clickHandler); final Element radioButtonElement = radioButton.getElement(); final Node labelNode = radioButtonElement.getLastChild(); if (icon != null) { labelNode.insertFirst(new SVGImage(icon).getElement()); } else { radioButtonElement.getStyle().setWidth(90, PX); as(labelNode).getStyle().setWidth(90, PX); } mainPanel.add(radioButton); buttons.add(radioButton); }
@Inject public AboutViewImpl( ProductInfoDataProvider productInfoDataProvider, AboutViewImplUiBinder uiBinder, AboutLocalizationConstant locale, HelpExtensionLocalizationConstant coreLocale, AboutResources aboutResources) { this.locale = locale; aboutResources.aboutCss().ensureInjected(); String title = locale.aboutControlTitle() + " " + productInfoDataProvider.getName(); this.setTitle(title); this.setWidget(uiBinder.createAndBindUi(this)); this.ensureDebugId("aboutView-window"); btnOk = addFooterButton(coreLocale.ok(), "help-about-ok", event -> delegate.onOkClicked(), true); final SVGResource logo = productInfoDataProvider.getLogo(); if (nonNull(logo)) { logoPanel.add(new SVGImage(logo)); } buildDetailsAnchor.ensureDebugId("build-details-anchor"); buildDetailsAnchor.addClickHandler(event -> delegate.onShowBuildDetailsClicked()); }
/** * 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; }
/** * 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; }
private SpanElement createCloseElement(final ProcessTreeNode node) { SpanElement closeButton = Elements.createSpanElement(resources.getCss().processesPanelCloseButtonForProcess()); ensureDebugId(closeButton, "close-terminal-node-button"); SVGImage icon = new SVGImage(partResources.closeIcon()); closeButton.appendChild((Node) icon.getElement()); Tooltip.create(closeButton, BOTTOM, MIDDLE, locale.viewCloseProcessOutputTooltip()); closeButton.addEventListener( Event.CLICK, event -> { if (stopProcessHandler != null) { stopProcessHandler.onCloseProcessOutputClick(node); } }, true); return closeButton; }
/** Adds button to maximize part stack. */ private void addMaximizeButton() { SVGImage maximize = new SVGImage(resources.maximizePart()); maximize.getElement().setAttribute("name", "workBenchIconMaximize"); ToolButton maximizeToolButton = new ToolButton(maximize); maximizeButton.add(maximizeToolButton); maximizeToolButton.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { delegate.onToggleMaximize(); } }); if (maximizeButton.getElement() instanceof elemental.dom.Element) { Tooltip.create( (elemental.dom.Element) maximizeButton.getElement(), PositionController.VerticalAlign.BOTTOM, PositionController.HorizontalAlign.MIDDLE, localizationConstant.maximizePartStackTitle()); } }
private SpanElement createCloseElement(final ProcessTreeNode node) { SpanElement closeButton = Elements.createSpanElement(resources.getCss().processesPanelCloseButtonForProcess()); ensureDebugId(closeButton, "close-command-node-button"); SVGImage icon = new SVGImage(partResources.closeIcon()); closeButton.appendChild((Node) icon.getElement()); Tooltip.create(closeButton, BOTTOM, MIDDLE, locale.viewCloseProcessOutputTooltip()); closeButton.addEventListener( Event.CLICK, event -> { if (stopProcessHandler != null) { stopProcessHandler.onCloseProcessOutputClick(node); } }, true); return closeButton; }
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()); }