use of elemental.html.SpanElement in project che by eclipse.
the class AbstractPresentationNode method updatePresentationField.
/**
* Update presentation name for the node.
*
* @param isFromSuper
* <code>true</code> if a member is inherited
* @param presentation
* node presentation
* @param presentableName
* name
* @param resources
* project resources
*/
public void updatePresentationField(boolean isFromSuper, NodePresentation presentation, String presentableName, JavaResources resources) {
if (isFromSuper) {
SpanElement highlightElement = Elements.createSpanElement(resources.css().disableTextColor());
highlightElement.setInnerText(presentableName);
presentation.setUserElement((Element) highlightElement);
} else {
presentation.setPresentableText(presentableName);
}
}
use of elemental.html.SpanElement in project che by eclipse.
the class NoImplementationWidget method createTitleOfElement.
private SpanElement createTitleOfElement(Type type) {
String path = type.getRootPath();
SpanElement texElement = Elements.createSpanElement();
SpanElement highlightElement = Elements.createSpanElement(javaResources.css().disableTextColor());
highlightElement.setInnerText(" - (" + path + ')');
texElement.setInnerText(type.getElementName());
texElement.appendChild(highlightElement);
return texElement;
}
use of elemental.html.SpanElement in project che by eclipse.
the class QuickAssistWidget method createItem.
public Element createItem(final CompletionProposal proposal) {
final Element element = Elements.createLiElement(popupResources.popupStyle().item());
final Element icon = Elements.createDivElement(popupResources.popupStyle().icon());
if (proposal.getIcon() != null && proposal.getIcon().getSVGImage() != null) {
icon.appendChild((Node) proposal.getIcon().getSVGImage().getElement());
} else if (proposal.getIcon() != null && proposal.getIcon().getImage() != null) {
icon.appendChild((Node) proposal.getIcon().getImage().getElement());
}
element.appendChild(icon);
final SpanElement label = Elements.createSpanElement(popupResources.popupStyle().label());
label.setInnerHTML(proposal.getDisplayString());
element.appendChild(label);
final EventListener validateListener = new EventListener() {
@Override
public void handleEvent(final Event evt) {
proposal.getCompletion(new CompletionProposal.CompletionCallback() {
@Override
public void onCompletion(final Completion completion) {
HandlesUndoRedo undoRedo = null;
if (textEditor instanceof UndoableEditor) {
UndoableEditor undoableEditor = (UndoableEditor) QuickAssistWidget.this.textEditor;
undoRedo = undoableEditor.getUndoRedo();
}
try {
if (undoRedo != null) {
undoRedo.beginCompoundChange();
}
completion.apply(textEditor.getDocument());
final LinearRange selection = completion.getSelection(textEditor.getDocument());
if (selection != null) {
textEditor.getDocument().setSelectedRange(selection, true);
}
} catch (final Exception e) {
Log.error(getClass(), e);
} finally {
if (undoRedo != null) {
undoRedo.endCompoundChange();
}
}
}
});
hide();
}
};
element.addEventListener(Event.DBLCLICK, validateListener, false);
element.addEventListener(CUSTOM_EVT_TYPE_VALIDATE, validateListener, false);
return element;
}
use of elemental.html.SpanElement 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 elemental.html.SpanElement in project che by eclipse.
the class ProcessTreeRenderer method createStopProcessElement.
private SpanElement createStopProcessElement(final ProcessTreeNode node) {
SpanElement stopProcessButton = Elements.createSpanElement(resources.getCss().processesPanelStopButtonForProcess());
Tooltip.create(stopProcessButton, BOTTOM, MIDDLE, locale.viewStropProcessTooltip());
stopProcessButton.addEventListener(Event.CLICK, new EventListener() {
@Override
public void handleEvent(Event event) {
if (stopProcessHandler != null) {
stopProcessHandler.onStopProcessClick(node);
}
}
}, true);
return stopProcessButton;
}
Aggregations