本文整理汇总了Java中org.eclipse.jdt.core.IType.getFullyQualifiedName方法的典型用法代码示例。如果您正苦于以下问题:Java IType.getFullyQualifiedName方法的具体用法?Java IType.getFullyQualifiedName怎么用?Java IType.getFullyQualifiedName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.IType
的用法示例。
在下文中一共展示了IType.getFullyQualifiedName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isGraphWalkerExecutionContextClass
import org.eclipse.jdt.core.IType; //导入方法依赖的package包/类
/**
* @param testInterface
* @return
* @throws JavaModelException
*/
public static boolean isGraphWalkerExecutionContextClass(ICompilationUnit unit) throws JavaModelException {
IType[] types = unit.getAllTypes();
if (types == null || types.length == 0) {
ResourceManager.logInfo(unit.getJavaProject().getProject().getName(),
"getAllTypes return null" + unit.getPath());
return false;
}
IType execContextType = unit.getJavaProject().findType(ExecutionContext.class.getName());
for (int i = 0; i < types.length; i++) {
IType type = types[i];
String typeNname = type.getFullyQualifiedName();
String compilationUnitName = JDTManager.getJavaFullyQualifiedName(unit);
if (typeNname.equals(compilationUnitName)) {
try {
ITypeHierarchy th = types[0].newTypeHierarchy(new NullProgressMonitor());
return th.contains(execContextType);
} catch (Exception e) {
ResourceManager.logException(e);
}
}
}
return false;
}
示例2: setMethod
import org.eclipse.jdt.core.IType; //导入方法依赖的package包/类
public void setMethod(IMethod method, InvocationAction a) {
String key = null;
try {
IType type = (IType) method.getParent();
key = type.getFullyQualifiedName() + "|" + method.getElementName() + method.getSignature();
} catch (JavaModelException e) {
e.printStackTrace();
}
if(key != null) {
StaticInvocationWidget2 inv = invWidgetsMap.get(key);
if(inv == null) {
inv = new StaticInvocationWidget2(this, null, method, a);
invWidgetsMap.put(key, inv);
}
inv.refreshItems();
layout.topControl = inv;
layout();
}
}
示例3: setMethod
import org.eclipse.jdt.core.IType; //导入方法依赖的package包/类
public void setMethod(IFile file, IMethod method, InvocationAction a) {
String key = null;
try {
IType type = (IType) method.getParent();
key = type.getFullyQualifiedName() + "|" + method.getElementName() + method.getSignature();
} catch (JavaModelException e) {
e.printStackTrace();
}
if(key != null) {
StaticInvocationWidget inv = invWidgetsMap.get(key);
if(inv == null) {
inv = new StaticInvocationWidget(this, file, method, a);
invWidgetsMap.put(key, inv);
}
inv.refreshItems(file);
layout.topControl = inv;
layout();
}
}
示例4: typeToClass
import org.eclipse.jdt.core.IType; //导入方法依赖的package包/类
/**
* transform the <code>IType</code> to <code>Class</code>
*
* @param type <code>IType</code>
* @return <code>Class</code>
* @throws ClassNotFoundException
* @throws MalformedURLException
*/
public static Class<?> typeToClass(IType type) throws CoreException,
ClassNotFoundException,MalformedURLException {
try {
if (null != type && (type.isClass() || type.isInterface())) {
String className = type.getFullyQualifiedName('$');
return loadClass(type.getJavaProject(), className);
}
} catch (JavaModelException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
return null;
}
示例5: getMethodKey
import org.eclipse.jdt.core.IType; //导入方法依赖的package包/类
private String getMethodKey(IMethod method) {
try {
IType type = (IType) method.getParent();
return type.getFullyQualifiedName() + "|" + method.getElementName() + method.getSignature();
} catch (JavaModelException e) {
e.printStackTrace();
return null;
}
}
示例6: initializeFrom
import org.eclipse.jdt.core.IType; //导入方法依赖的package包/类
@Override
public void initializeFrom(ILaunchConfiguration configuration) {
try {
String projectName = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
if (projectName==null || projectName.trim().length() == 0) {
additionalExecutionContexts=new IType[0];
mainExecutionContexts=new IType[0];
fMainTestExecutionComboViewer.setInput(null);
fAdditionalTestViewer.setInput(null);
};
fProjectText.setText(projectName);
removeBockedElementButton.setSelection(configuration.getAttribute(EXECUTION_TEST_REMOVE_BLOCKED_ELEMENT_CONFIGURATION, true));
displayDetailsButton.setSelection(new Boolean(configuration.getAttribute(EXECUTION_TEST_DISPLAY_CONFIGURATION, "true")).booleanValue());
String classes = configuration.getAttribute(CONFIG_TEST_CLASSES, "");
StringTokenizer st = new StringTokenizer (classes,";");
if (st.hasMoreTokens()) {
String mainContext = st.nextToken();
for (int i = 0; i < mainExecutionContexts.length; i++) {
IType executionContext = mainExecutionContexts[i];
if (executionContext.getFullyQualifiedName().equalsIgnoreCase(mainContext)) {
fMainTestExecutionComboViewer.setSelection(new StructuredSelection(executionContext));
break;
}
}
}
while (st.hasMoreTokens()) {
String clazz = st.nextToken();
TableItem[] items = this.fAdditionalTestViewer.getTable().getItems();
for (int i = 0; i < items.length; ++i) {
IType type = (IType) items[i].getData();
String name = type.getFullyQualifiedName();
if (name.equalsIgnoreCase(clazz)) {
items[i].setChecked(true);
}
}
}
} catch (CoreException e) {
ResourceManager.logException(e);
}
}