use of org.vectomatic.dom.svg.ui.SVGImage in project che by eclipse.
the class ProcessTreeRenderer method createCloseElement.
private SpanElement createCloseElement(final ProcessTreeNode node) {
SpanElement closeButton = Elements.createSpanElement(resources.getCss().processesPanelCloseButtonForProcess());
SVGImage icon = new SVGImage(partStackUIResources.closeIcon());
closeButton.appendChild((Node) icon.getElement());
Tooltip.create(closeButton, BOTTOM, MIDDLE, locale.viewCloseProcessOutputTooltip());
closeButton.addEventListener(Event.CLICK, new EventListener() {
@Override
public void handleEvent(Event event) {
if (stopProcessHandler != null) {
stopProcessHandler.onCloseProcessOutputClick(node);
}
}
}, true);
return closeButton;
}
use of org.vectomatic.dom.svg.ui.SVGImage in project che by eclipse.
the class EditCommandsViewImpl method createCategoryHeaderForCommandType.
private SpanElement createCategoryHeaderForCommandType(final String commandTypeId) {
final SpanElement categoryHeaderElement = Document.get().createSpanElement();
categoryHeaderElement.setClassName(commandResources.getCss().categoryHeader());
final SpanElement iconElement = Document.get().createSpanElement();
categoryHeaderElement.appendChild(iconElement);
final SpanElement nameElement = Document.get().createSpanElement();
categoryHeaderElement.appendChild(nameElement);
final CommandType currentCommandType = getTypeById(commandTypeId);
nameElement.setInnerText(currentCommandType != null ? currentCommandType.getDisplayName() : commandTypeId);
final SpanElement buttonElement = Document.get().createSpanElement();
buttonElement.appendChild(commandResources.addCommandButton().getSvg().getElement());
categoryHeaderElement.appendChild(buttonElement);
Event.sinkEvents(buttonElement, Event.ONCLICK);
Event.setEventListener(buttonElement, new EventListener() {
@Override
public void onBrowserEvent(Event event) {
if (Event.ONCLICK == event.getTypeInt()) {
event.stopPropagation();
namePanel.setVisible(true);
previewUrlPanel.setVisible(true);
selectedType = commandTypeId;
delegate.onAddClicked();
resetFilter();
}
}
});
final Icon icon = iconRegistry.getIconIfExist(commandTypeId + ".commands.category.icon");
if (icon != null) {
final SVGImage iconSVG = icon.getSVGImage();
if (iconSVG != null) {
iconElement.appendChild(iconSVG.getElement());
return categoryHeaderElement;
}
}
return categoryHeaderElement;
}
use of org.vectomatic.dom.svg.ui.SVGImage in project che by eclipse.
the class CategoriesPageViewImpl method renderCategoryHeader.
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;
}
use of org.vectomatic.dom.svg.ui.SVGImage in project che by eclipse.
the class ActionPopupButton method renderImage.
/**
* Redraw the icon.
*/
private void renderImage() {
panel.clear();
if (presentation.getImageResource() != null) {
Image image = new Image(presentationFactory.getPresentation(action).getImageResource());
image.setStyleName(toolbarResources.toolbar().popupButtonIcon());
panel.add(image);
} else if (presentation.getSVGResource() != null) {
SVGImage image = new SVGImage(presentation.getSVGResource());
image.getElement().setAttribute("class", toolbarResources.toolbar().popupButtonIcon());
panel.add(image);
} else if (presentation.getHTMLResource() != null) {
FlowPanel icon = new FlowPanel();
icon.setStyleName(toolbarResources.toolbar().iconButtonIcon());
FlowPanel inner = new FlowPanel();
inner.setStyleName(toolbarResources.toolbar().popupButtonIconInner());
inner.getElement().setInnerHTML(presentation.getHTMLResource());
icon.add(inner);
panel.add(inner);
}
InlineLabel caret = new InlineLabel("");
caret.setStyleName(toolbarResources.toolbar().caret());
panel.add(caret);
}
use of org.vectomatic.dom.svg.ui.SVGImage in project che by eclipse.
the class PartButtonWidget method setIcon.
/** {@inheritDoc} */
@NotNull
@Override
public PartButton setIcon(@Nullable SVGResource iconResource) {
this.tabIcon = iconResource;
iconPanel.clear();
if (tabIcon != null) {
iconPanel.add(new SVGImage(tabIcon));
}
return this;
}
Aggregations