List of usage examples for org.eclipse.jdt.internal.core.search JavaSearchTypeNameMatch JavaSearchTypeNameMatch
public JavaSearchTypeNameMatch(IType type, int modifiers)
From source file:org.eclipse.contribution.weaving.jdt.tests.imagedescriptor.ImageDescriptorSelectorTests.java
License:Open Source License
public void testImageSelectDialog() throws Exception { FilteredTypesSelectionDialog dialog = new FilteredTypesSelectionDialog( new Shell(Display.getCurrent().getActiveShell()), false, null, null, 0, null); LabelProvider fTypeInfoLabelProvider = getLabelProvider(dialog); // here, we can't test the image directly because the extra decorators are added to it. // instead just test that the image selector was activated fTypeInfoLabelProvider.getImage(new JavaSearchTypeNameMatch((IType) cu.getChildren()[0], 0)); Assert.assertTrue("Image descriptor selector never activated", MockImageDescriptorSelector.isSet); }
From source file:org.eclipse.mylyn.internal.java.ui.TypeHistoryManager.java
License:Open Source License
/** * Path has to be compatible with ITypeNameRequestor *//*w ww . j a v a 2 s. c om*/ private void updateTypeHistory(IInteractionElement node, boolean add) { IJavaElement element = JavaCore.create(node.getHandleIdentifier()); if (element instanceof IType) { IType type = (IType) element; try { if (type.exists() && !type.isAnonymous() && !isAspectjType(type)) { JavaSearchTypeNameMatch typeNameMatch = new JavaSearchTypeNameMatch(type, type.getFlags()); if (add && !OpenTypeHistory.getInstance().contains(typeNameMatch)) { OpenTypeHistory.getInstance().accessed(typeNameMatch); } else { OpenTypeHistory.getInstance().remove(typeNameMatch); } } } catch (JavaModelException e) { StatusHandler.log(new Status(IStatus.ERROR, JavaUiBridgePlugin.ID_PLUGIN, "Failed to update history for a type", e)); //$NON-NLS-1$ } } }