Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue-99 Added ITernNatureCapability interface #100

Merged
merged 1 commit into from
Jul 7, 2014

Conversation

gamerson
Copy link
Contributor

@gamerson gamerson commented Jul 4, 2014

Fix for #99 However, I have not tested this with normal id only based extensions, so whoever reviews will need to double check that the DefaultTernNatureAdapter is working as expected.

@angelozerr angelozerr added this to the 0.4.0 milestone Jul 5, 2014
@angelozerr
Copy link
Owner

Many thank's @gamerson ! I tell me that ITernNatureCapability should perhaps add id in their signature

    package tern.eclipse.ide.core;

    import org.eclipse.core.resources.IProject;

    public interface ITernNatureCapability {

        boolean hasTernNature(IProject project, String natureId);
    }: 

What do you think about that @gamerson, @gamerson @vrubezhny ?

@gamerson
Copy link
Contributor Author

gamerson commented Jul 7, 2014

Sure we can modify the ITernNatureCapability but just so I'm understanding correctly are you thinking that we would pass into this interface the TernNature.ID?

@gamerson
Copy link
Contributor Author

gamerson commented Jul 7, 2014

The only reason that we would need to pass in the natureId is if the tern nature may be changing right? I've pushed a new commit that has this updated interface.

@angelozerr
Copy link
Owner

@gamerson sorry with my bad explanation.

My idea is to call ITernNatureCapability #hasTernNature(IProject project, String natureId) with the id of the extension point ternNatureAdapter/@id

Your DefaultTernNatureAdapter can become a singleton by removing nature id from the constructor.

Do you understand my idea?

@gamerson
Copy link
Contributor Author

gamerson commented Jul 7, 2014

Got it.

On Mon, Jul 7, 2014 at 10:10 AM, Angelo notifications@github.com wrote:

@gamerson https://github.com/gamerson sorry with my bad explanation.

My idea is to call ITernNatureCapability #hasTernNature(IProject project,
String natureId) with the id of the extension point ternNatureAdapter/@id
https://github.com/id

Your DefaultTernNatureAdapter can become a singleton by removing nature if
from the constructor.

Do you understand my idea?


Reply to this email directly or view it on GitHub
#100 (comment).

Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

@gamerson
Copy link
Contributor Author

gamerson commented Jul 7, 2014

But actually the way this works is the map only contains adapters, so if
we don't pass the original extension point id to the adapters we lose the
information. So we need to either switch back to the old way I had
before... or we can make the ternNatureAdapters map contain Map<Object,
List> and then for normal extensions we can just add a
String to the map and for complex extensions (those with capabilities) we
can add the object.

So you can decide which you want to do, for now I'll repush my original
code.

On Mon, Jul 7, 2014 at 10:10 AM, Greg Amerson gregory.amerson@liferay.com
wrote:

Got it.

On Mon, Jul 7, 2014 at 10:10 AM, Angelo notifications@github.com wrote:

@gamerson https://github.com/gamerson sorry with my bad explanation.

My idea is to call ITernNatureCapability #hasTernNature(IProject project,
String natureId) with the id of the extension point ternNatureAdapter/@id
https://github.com/id

Your DefaultTernNatureAdapter can become a singleton by removing nature
if from the constructor.

Do you understand my idea?


Reply to this email directly or view it on GitHub
#100 (comment).

Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

@gamerson
Copy link
Contributor Author

gamerson commented Jul 7, 2014

Ok I repushed my original code.

On Mon, Jul 7, 2014 at 10:15 AM, Greg Amerson gregory.amerson@liferay.com
wrote:

But actually the way this works is the map only contains adapters, so if
we don't pass the original extension point id to the adapters we lose the
information. So we need to either switch back to the old way I had
before... or we can make the ternNatureAdapters map contain Map<Object,
List> and then for normal extensions we can just add a
String to the map and for complex extensions (those with capabilities) we
can add the object.

So you can decide which you want to do, for now I'll repush my original
code.

On Mon, Jul 7, 2014 at 10:10 AM, Greg Amerson <gregory.amerson@liferay.com

wrote:

Got it.

On Mon, Jul 7, 2014 at 10:10 AM, Angelo notifications@github.com wrote:

@gamerson https://github.com/gamerson sorry with my bad explanation.

My idea is to call ITernNatureCapability #hasTernNature(IProject
project, String natureId) with the id of the extension point
ternNatureAdapter/@id https://github.com/id

Your DefaultTernNatureAdapter can become a singleton by removing nature
if from the constructor.

Do you understand my idea?


Reply to this email directly or view it on GitHub
#100 (comment)
.

Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

angelozerr added a commit that referenced this pull request Jul 7, 2014
Issue-99 Added ITernNatureCapability interface
@angelozerr angelozerr merged commit 33e41d1 into angelozerr:master Jul 7, 2014
@angelozerr
Copy link
Owner

@gamerson it was just an idea, I didn't see the problem that you have explained me. Sorry-(

Thank's for your work. @vrubezhny could you check if it works for you please.

@gamerson
Copy link
Contributor Author

gamerson commented Jul 7, 2014

Sounds good, no problems. Let me know if other adopters have trouble with
this change and I can try to fix those issues.

On Mon, Jul 7, 2014 at 11:12 AM, Angelo notifications@github.com wrote:

@gamerson https://github.com/gamerson it was just an idea, I didn't see
the problem that you have explained me. Sorry-(

Thank's for your work. @vrubezhny https://github.com/vrubezhny could
you check if it works for you please.


Reply to this email directly or view it on GitHub
#100 (comment).

Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants