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);
}
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;
}
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);
}
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);
}
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);
}
Aggregations