Search in sources :

Example 1 with SVGResource

use of org.vectomatic.dom.svg.ui.SVGResource in project che by eclipse.

the class Presentation method setSVGResource.

/**
     * Sets icon SVG resource.
     *
     * @param svgResource icon SVG resource
     */
public void setSVGResource(SVGResource svgResource) {
    SVGResource oldSVGResource = svgResource;
    this.svgResource = svgResource;
    firePropertyChange(PROP_ICON, oldSVGResource, svgResource);
}
Also used : SVGResource(org.vectomatic.dom.svg.ui.SVGResource)

Example 2 with SVGResource

use of org.vectomatic.dom.svg.ui.SVGResource in project che by eclipse.

the class NotificationPopup method getIconBaseOnStatus.

/**
     * Return an icon based on {@link Status}.
     *
     * @return SVG image that represents icon status
     */
private SVGImage getIconBaseOnStatus() {
    final SVGResource icon;
    final String status;
    switch(notification.getStatus()) {
        case PROGRESS:
            icon = resources.progress();
            status = "progress";
            break;
        case SUCCESS:
            icon = resources.success();
            status = "success";
            break;
        case FAIL:
            icon = resources.fail();
            status = "fail";
            break;
        case WARNING:
            icon = resources.warning();
            status = "warning";
            break;
        default:
            throw new IllegalArgumentException("Can't determine notification icon");
    }
    SVGImage image = new SVGImage(icon);
    image.getElement().setAttribute("name", status);
    return image;
}
Also used : SVGResource(org.vectomatic.dom.svg.ui.SVGResource) SVGImage(org.vectomatic.dom.svg.ui.SVGImage)

Example 3 with SVGResource

use of org.vectomatic.dom.svg.ui.SVGResource in project che by eclipse.

the class MethodNode method updatePresentation.

@Override
public void updatePresentation(@NotNull NodePresentation presentation) {
    //TODO set proper icon
    presentation.setPresentableText(method.getLabel());
    int flags = method.getFlags();
    SVGResource icon;
    if (Flags.isPublic(flags)) {
        icon = resources.publicMethod();
    } else if (Flags.isPrivate(flags)) {
        icon = resources.privateMethod();
    } else if (Flags.isProtected(flags)) {
        icon = resources.protectedMethod();
    } else {
        icon = resources.publicMethod();
    }
    presentation.setPresentableIcon(icon);
}
Also used : SVGResource(org.vectomatic.dom.svg.ui.SVGResource)

Example 4 with SVGResource

use of org.vectomatic.dom.svg.ui.SVGResource in project che by eclipse.

the class TypeNode method updatePresentation.

@Override
public void updatePresentation(@NotNull NodePresentation presentation) {
    presentation.setPresentableText(type.getLabel());
    int flags = type.getFlags();
    SVGResource icon;
    if (Flags.isInterface(flags)) {
        icon = resources.interfaceItem();
    } else if (Flags.isEnum(flags)) {
        icon = resources.enumItem();
    } else if (Flags.isAnnotation(flags)) {
        icon = resources.annotationItem();
    } else {
        icon = resources.javaFile();
    }
    presentation.setPresentableIcon(icon);
}
Also used : SVGResource(org.vectomatic.dom.svg.ui.SVGResource)

Example 5 with SVGResource

use of org.vectomatic.dom.svg.ui.SVGResource in project che by eclipse.

the class MethodNode method updatePresentation.

/** {@inheritDoc} */
@Override
public void updatePresentation(@NotNull NodePresentation presentation) {
    StringBuilder presentableName = new StringBuilder(method.getLabel() + " : " + method.getReturnType());
    if (showingInheritedMembers) {
        String path = method.getRootPath();
        String className = method.isBinary() ? path.substring(path.lastIndexOf('.') + 1) : path.substring(path.lastIndexOf('/') + 1, path.indexOf('.'));
        presentableName.append(" -> ").append(className);
    }
    updatePresentationField(isFromSuper, presentation, presentableName.toString(), resources);
    SVGResource icon;
    int flag = method.getFlags();
    if (Flags.isPublic(flag)) {
        icon = resources.publicMethod();
    } else if (Flags.isPrivate(flag)) {
        icon = resources.privateMethod();
    } else if (Flags.isProtected(flag)) {
        icon = resources.protectedMethod();
    } else {
        icon = resources.publicMethod();
    }
    presentation.setPresentableIcon(icon);
}
Also used : SVGResource(org.vectomatic.dom.svg.ui.SVGResource)

Aggregations

SVGResource (org.vectomatic.dom.svg.ui.SVGResource)13 SVGImage (org.vectomatic.dom.svg.ui.SVGImage)4 Element (elemental.dom.Element)2 DivElement (elemental.html.DivElement)2 SpanElement (elemental.html.SpanElement)2 TreeNodeElement (org.eclipse.che.ide.ui.tree.TreeNodeElement)2 StatusNotification (org.eclipse.che.ide.api.notification.StatusNotification)1 Container (org.eclipse.che.ide.api.resources.Container)1 Marker (org.eclipse.che.ide.api.resources.marker.Marker)1 PresentableTextMarker (org.eclipse.che.ide.api.resources.marker.PresentableTextMarker)1 CutResourceMarker (org.eclipse.che.ide.api.resources.modification.CutResourceMarker)1 NodeIconProvider (org.eclipse.che.ide.project.node.icon.NodeIconProvider)1 Test (org.junit.Test)1