Search in sources :

Example 6 with IOutlineElement

use of org.eclipse.titan.designer.AST.IOutlineElement in project titan.EclipsePlug-ins by eclipse.

the class OutlineViewSorter method compare.

@Override
public int compare(final Viewer viewer, final Object e1, final Object e2) {
    if (sortByName) {
        return super.compare(viewer, e1, e2);
    }
    int cat1 = category(e1);
    int cat2 = category(e2);
    if (cat1 != cat2) {
        return cat1 - cat2;
    }
    if (!(e1 instanceof IOutlineElement) || !(e2 instanceof IOutlineElement)) {
        return 0;
    }
    IOutlineElement o1 = (IOutlineElement) e1;
    IOutlineElement o2 = (IOutlineElement) e2;
    return o1.getIdentifier().getLocation().getOffset() - o2.getIdentifier().getLocation().getOffset();
}
Also used : IOutlineElement(org.eclipse.titan.designer.AST.IOutlineElement)

Example 7 with IOutlineElement

use of org.eclipse.titan.designer.AST.IOutlineElement in project titan.EclipsePlug-ins by eclipse.

the class OutlineLabelProvider method getImage.

@Override
public Image getImage(final Object element) {
    String iconName = "titan.gif";
    if (element instanceof IOutlineElement) {
        IOutlineElement e = (IOutlineElement) element;
        iconName = e.getOutlineIcon();
    }
    return ImageCache.getImage(iconName);
}
Also used : IOutlineElement(org.eclipse.titan.designer.AST.IOutlineElement)

Aggregations

IOutlineElement (org.eclipse.titan.designer.AST.IOutlineElement)7 Identifier (org.eclipse.titan.designer.AST.Identifier)4 ISelection (org.eclipse.jface.viewers.ISelection)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 Location (org.eclipse.titan.designer.AST.Location)2