diff options
Diffstat (limited to 'qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QGadget.java')
-rw-r--r-- | qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QGadget.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QGadget.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QGadget.java new file mode 100644 index 00000000000..c88d4f7e206 --- /dev/null +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QGadget.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2014 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package org.eclipse.cdt.internal.qt.core.index; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.eclipse.cdt.internal.qt.core.pdom.QtPDOMQEnum; +import org.eclipse.cdt.internal.qt.core.pdom.AbstractQtPDOMClass; +import org.eclipse.cdt.qt.core.index.IQEnum; +import org.eclipse.cdt.qt.core.index.IQGadget; +import org.eclipse.core.runtime.CoreException; + +public class QGadget implements IQGadget { + + private final String name; + private final List<IQEnum> enums; + + public QGadget(QtIndexImpl qtIndex, CDTIndex cdtIndex, AbstractQtPDOMClass pdomQGadget) throws CoreException { + this.name = pdomQGadget.getName(); + + this.enums = new ArrayList<IQEnum>(); + for(QtPDOMQEnum pdom : pdomQGadget.getChildren(QtPDOMQEnum.class)) + this.enums.add(new QEnum(pdom.getName(), pdom.isFlag(), pdom.getEnumerators())); + } + + @Override + public String getName() { + return name; + } + + @Override + public Collection<IQEnum> getEnums() { + return enums; + } +} |