Search in sources :

Example 1 with SpecfilePreamble

use of org.eclipse.linuxtools.internal.rpm.ui.editor.parser.SpecfilePreamble in project linuxtools by eclipse.

the class SpecfileLabelProvider method getText.

@Override
public String getText(Object element) {
    // $NON-NLS-1$
    String str = "";
    if (element instanceof SpecfileSection) {
        SpecfileSection specfileSection = (SpecfileSection) element;
        str = specfileSection.toString();
    } else if (element instanceof Specfile) {
        str = ((Specfile) element).getName();
    } else if (element instanceof SpecfilePackageContainer) {
        str = Messages.SpecfileLabelProvider_0;
    } else if (element instanceof SpecfilePreamble) {
        str = Messages.SpecfileLabelProvider_1;
    } else if (element instanceof SpecfileElement) {
        SpecfileElement specfileElement = (SpecfileElement) element;
        str = specfileElement.getName();
    } else if (element instanceof String) {
        str = (String) element;
    } else if (element instanceof SpecfilePackage) {
        str = ((SpecfilePackage) element).getName();
    }
    return filterMacros(str.trim());
}
Also used : Specfile(org.eclipse.linuxtools.rpm.ui.editor.parser.Specfile) SpecfileSection(org.eclipse.linuxtools.rpm.ui.editor.parser.SpecfileSection) SpecfileElement(org.eclipse.linuxtools.rpm.ui.editor.parser.SpecfileElement) SpecfilePreamble(org.eclipse.linuxtools.internal.rpm.ui.editor.parser.SpecfilePreamble) SpecfilePackage(org.eclipse.linuxtools.rpm.ui.editor.parser.SpecfilePackage) SpecfilePackageContainer(org.eclipse.linuxtools.rpm.ui.editor.parser.SpecfilePackageContainer)

Aggregations

SpecfilePreamble (org.eclipse.linuxtools.internal.rpm.ui.editor.parser.SpecfilePreamble)1 Specfile (org.eclipse.linuxtools.rpm.ui.editor.parser.Specfile)1 SpecfileElement (org.eclipse.linuxtools.rpm.ui.editor.parser.SpecfileElement)1 SpecfilePackage (org.eclipse.linuxtools.rpm.ui.editor.parser.SpecfilePackage)1 SpecfilePackageContainer (org.eclipse.linuxtools.rpm.ui.editor.parser.SpecfilePackageContainer)1 SpecfileSection (org.eclipse.linuxtools.rpm.ui.editor.parser.SpecfileSection)1