Issue 2005 import spy adapter#2151
Conversation
Test Results 126 files ±0 126 suites ±0 38m 16s ⏱️ + 5m 37s Results for commit db2393c. ± Comparison against base commit 5c5792d. This pull request removes 1 test.♻️ This comment has been updated with latest results. |
|
We would need a CQ here to import the code into PDE if approved by PL. |
|
iplab issue https://gitlab.eclipse.org/eclipsefdn/emo-team/iplab/-/issues/25593 is closed |
iloveeclipse
left a comment
There was a problem hiding this comment.
I did a short smoke test, no real code review but just some few basic checks.
In general looks useful, however I was missing some adapters and couldn't really figure out why.
For example, I've missed java.io.File adapter factory contributed here
https://github.com/iloveeclipse/anyedittools/blob/a8eaa4995f7724b871375d250e87dcdd2973c82b/AnyEditTools/plugin.xml#L626-L632
and here:
Also three filtering seem to work in a very strange way, even if table shows java.io.File, entering File in the filter sometimes shows some unrelated matches but not java.io.File, and sometimes it shows it.
Beside this, please rebase (not merge) your branch on top of latest master commit.
192d9ab to
5369f4e
Compare
|
@amelodev : please could you mark all comments on PR as resolved if they are already addressed by the latest change, and those that are unresolved give a comment why not? |
There was a problem hiding this comment.
Pull request overview
This PR imports the adapter spy plugin (org.eclipse.pde.spy.adapter) from an external source into the PDE spies collection. The adapter spy provides a view to display all available adapter factories in the Eclipse runtime, showing which source types can be adapted to which destination types. The plugin was originally developed by lacherp and has been renamed from org.eclipse.e4.tools.adapter.spy to fit the PDE naming convention.
Changes:
- Added new org.eclipse.pde.spy.adapter bundle with complete source code, icons, and metadata
- Includes model classes for adapter data representation, viewer components for tree display, and helper utilities for adapter introspection
- Integrated with the PDE spy framework using the org.eclipse.pde.spy.core.spyPart extension point
Reviewed changes
Copilot reviewed 24 out of 30 changed files in this pull request and generated 22 comments.
Show a summary per file
| File | Description |
|---|---|
| META-INF/MANIFEST.MF | Bundle manifest defining dependencies and execution environment (JavaSE-21) |
| plugin.xml | Extension point registration for the adapter spy part |
| plugin.properties | Localized bundle metadata and descriptions |
| build.properties | Build configuration specifying source and output directories |
| .project/.classpath/.settings/* | Eclipse project configuration files |
| src/org/eclipse/pde/spy/adapter/AdapterSpyPart.java | Main UI part creating the tree viewer and toolbar controls |
| src/org/eclipse/pde/spy/adapter/Messages.java | NLS message accessor class |
| src/org/eclipse/pde/spy/adapter/Messages.properties | Internationalized message strings |
| src/org/eclipse/pde/spy/adapter/model/* | Model classes (AdapterData, AdapterRepository, AdapterElementType) |
| src/org/eclipse/pde/spy/adapter/viewer/* | Viewer support classes (content providers, filters, comparators) |
| src/org/eclipse/pde/spy/adapter/tools/AdapterHelper.java | Helper utilities for adapter introspection |
| src/org/eclipse/pde/spy/adapter/hook/EclipseAdapterHook.java | Hook to intercept Eclipse adapter calls |
| icons/* | Image resources for the spy UI |
| about.html/notice.html | Legal documentation files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7a316c6 to
c39d5c7
Compare
c39d5c7 to
1445add
Compare
|
What needs to be done to get this PR merged? |
Beside free time & reviewers interested in this change:
Since I personally have no time for a comprehensive review, I will trigger Copilot review once again, it seem to do "randomized" reviews where some parts of the code are reviewed in subsequent runs, and some not... |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 30 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| AdapterData adapData = new AdapterData(AdapterElementType.DESTINATION_TYPE); | ||
| adapData.setParent(refAdapterData.get()); | ||
| adapData.setDestinationType(targetType); | ||
| destinationTypeToAdapterDataMap.put(targetType, adapData); | ||
| refClassName.set(""); |
| if (((AdapterData)ad.getParent()).getSourceType().equals(adchild.getDestinationType())) { | ||
| AdapterData adpd=new AdapterData(adchild); | ||
| ad.getChildrenList().add(adpd); | ||
| return; | ||
| } | ||
| ad.getChildrenList().add(adchild); |
| this.getChildrenList().forEach(child -> { | ||
| AdapterData newAdapterData = new AdapterData(child); | ||
| AdapterData soon = new AdapterData(this); | ||
| soon.setParent(child); |
| public Object getChildren(boolean sourceToDestination) { | ||
| if (!children.isEmpty()) { | ||
| Collections.sort(children); | ||
| if( sourceToDestination) { | ||
| Map<String, List<AdapterData>> childs = children.stream().collect(Collectors.groupingBy(AdapterData::getDestinationType)); | ||
| children.clear(); | ||
| childs.values().forEach(ls-> children.add(ls.get(0))); | ||
| return children.toArray(); | ||
| }else { | ||
| Map<String, List<AdapterData>> childs = children.stream().collect(Collectors.groupingBy(AdapterData::getSourceType)); | ||
| children.clear(); | ||
| childs.values().forEach(ls-> children.add(ls.get(0))); | ||
| return children.toArray(); | ||
| } |
| } | ||
| // reduce source Type | ||
| Collection<AdapterData> reduceresult = reduceType(adapaters); | ||
| refreshAdapterTree(NAMED_UPDATE_TREE_SOURCE_TO_DESTINATION, reduceresult); |
| Clipboard clipboard = new Clipboard(null); | ||
| try { | ||
| TextTransfer textTransfer = TextTransfer.getInstance(); | ||
| Transfer[] transfers = new Transfer[] { textTransfer }; | ||
| Object[] data = new Object[] { toCopy }; | ||
| clipboard.setContents(data, transfers); | ||
| } finally { | ||
| clipboard.dispose(); | ||
| } |
| org.eclipse.emf.ecore, | ||
| org.eclipse.jface, | ||
| org.eclipse.equinox.common, |
1445add to
db2393c
Compare

Fixes #2005
org.eclipse.pde.spy.adapter bundle added to the PDE spies collection.
This new spy provides a view of the available adapter factories.
There is one issue I have not been able to resolve yet — the Adapter Spy shortcut does not seem to work.
This problem also appears to affect other spies such as the Event Spy and the Context Spy.