Skip to content

Commit

Permalink
Find the editor component based on the project version
Browse files Browse the repository at this point in the history
Instead of simply using the namespace (which is often the same for
various available version of a component!)
  • Loading branch information
victornoel committed Oct 4, 2016
1 parent cf1aa66 commit 081a3a9
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,20 @@ private void re_fillAdvancedDetailsContainer(FormToolkit toolkit, Composite adva
private void refreshDetails() {

this.componentContributions = null;
if( this.selectedEndpoint != null ) {
ComponentVersionDescription componentDesc = ExtensionManager.INSTANCE.findComponentDescription( this.selectedEndpoint );
if( this.selectedEndpoint != null ) {
Properties projectProperties = PetalsSPPropertiesManager.getProperties( getEditedFile().getProject());
String suTypeVersion = projectProperties.getProperty( PetalsSPPropertiesManager.COMPONENT_VERSION, "" );
String componentName = projectProperties.getProperty( PetalsSPPropertiesManager.COMPONENT_NAME, "" );

// first let's try with the project configuration
ComponentVersionDescription componentDesc = ExtensionManager.INSTANCE.findDescriptionByComponentNameAndVersion( componentName, suTypeVersion );

if (componentDesc == null) {
// if none is found (or if there is no project configuration file or no correct data in it)
// let's rely on the namespaces
componentDesc = ExtensionManager.INSTANCE.findComponentDescription( this.selectedEndpoint );
}

if( componentDesc != null ) {
EditorContributionSupport support = componentDesc.createNewExtensionSupport();
if( support != null )
Expand Down

0 comments on commit 081a3a9

Please sign in to comment.