Skip to main content



      Home
Home » Eclipse Projects » Mylyn » How should I extend a WikiText MarkupLanguage?
How should I extend a WikiText MarkupLanguage? [message #60491] Tue, 21 October 2008 12:57 Go to next message
Eclipse UserFriend
Greetings.

I'm trying to extend the MediaWikiLanguage to incorporate a few custom
tags of my own. I have sorted out that I need to add a
PatternBasedElement to the private static tokenSyntax field.

However, there is only one way to do this as I see it. In my subclass'
constructor, I add my new element to using the non-static
getReplacementTokenSyntax() method. In order to ensure that my element
isn't included multiple times to the static field (once for each time my
constructor is invoked), I have to first check that it isn't already
there. This seems a little excessive to me.

As a work around, I've changed the field from private to protected. I
figure that I'll change this to instead do the check and add approach.

I'd like for there to be an easier mechanism for extending this
MarkupLanguage subclass and, more generally, others. I realise that the
order in which these elements are added is significant which adds to the
challenge. I wonder if it might be a good idea to refactor the
initialization code out of the static block and into non-static methods
that can be overridden by subclasses. Ideally, the methods could factor
the elements into different groups (something like "specific elements"
and "more general elements").

Is there any particular reason why the tokenSyntax and
phraseModifierSyntax fields need to be static? Making them non-static
would permit greater flexibility with the instances (e.g. you could more
easily customize an instance).

Thoughts?

Thanks,

Wayne
Re: How should I extend a WikiText MarkupLanguage? [message #60516 is a reply to message #60491] Tue, 21 October 2008 15:55 Go to previous messageGo to next message
Eclipse UserFriend
Wayne,

> I'm trying to extend the MediaWikiLanguage to incorporate a few custom
> tags of my own.

I'm glad to hear that you're interested in extending WikiText. As you've
discovered MediaWikiLanguage is not designed for extensibility. We had
the same problem before with TextileLanguage, which was refactored to
better support extensibility as a result of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=237120

If you create an enhancement request at https://bugs.eclipse.org/bugs for
MediaWikiLanguage supporting extensibility I'll refactor its
initialization to make it possible to subclass.

Best regards,

David
Re: How should I extend a WikiText MarkupLanguage? [message #60840 is a reply to message #60516] Wed, 22 October 2008 09:23 Go to previous messageGo to next message
Eclipse UserFriend
Will do.

Thanks,

Wayne

David Green wrote:
> Wayne,
>
>> I'm trying to extend the MediaWikiLanguage to incorporate a few custom
>> tags of my own.
>
> I'm glad to hear that you're interested in extending WikiText. As
> you've discovered MediaWikiLanguage is not designed for extensibility.
> We had the same problem before with TextileLanguage, which was
> refactored to better support extensibility as a result of
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=237120
>
> If you create an enhancement request at https://bugs.eclipse.org/bugs
> for MediaWikiLanguage supporting extensibility I'll refactor its
> initialization to make it possible to subclass.
>
> Best regards,
>
> David
>
Re: How should I extend a WikiText MarkupLanguage? [message #60867 is a reply to message #60840] Mon, 27 October 2008 12:07 Go to previous messageGo to next message
Eclipse UserFriend
Wayne,

I was in there today and did the refactoring to make MediaWikiLanguage
extensible. See
org.eclipse.mylyn.wikitext.textile.core.BugzillaTextileLangu age for an
example of how to extend a language. Extending MediaWikiLanguage should
be very similar.

Regards,

David

Wayne Beaton wrote:
> Will do.
>
> Thanks,
>
> Wayne
>
> David Green wrote:
>> Wayne,
>>
>>> I'm trying to extend the MediaWikiLanguage to incorporate a few
>>> custom tags of my own.
>>
>> I'm glad to hear that you're interested in extending WikiText. As
>> you've discovered MediaWikiLanguage is not designed for
>> extensibility. We had the same problem before with TextileLanguage,
>> which was refactored to better support extensibility as a result of
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=237120
>>
>> If you create an enhancement request at https://bugs.eclipse.org/bugs
>> for MediaWikiLanguage supporting extensibility I'll refactor its
>> initialization to make it possible to subclass.
>>
>> Best regards,
>>
>> David
>>
Re: How should I extend a WikiText MarkupLanguage? [message #61163 is a reply to message #60867] Fri, 31 October 2008 13:29 Go to previous message
Eclipse UserFriend
That's done it.

Thanks,

Wayne

David Green wrote:
> Wayne,
>
> I was in there today and did the refactoring to make MediaWikiLanguage
> extensible. See
> org.eclipse.mylyn.wikitext.textile.core.BugzillaTextileLangu age for an
> example of how to extend a language. Extending MediaWikiLanguage should
> be very similar.
>
> Regards,
>
> David
>
> Wayne Beaton wrote:
>> Will do.
>>
>> Thanks,
>>
>> Wayne
>>
>> David Green wrote:
>>> Wayne,
>>>
>>>> I'm trying to extend the MediaWikiLanguage to incorporate a few
>>>> custom tags of my own.
>>>
>>> I'm glad to hear that you're interested in extending WikiText. As
>>> you've discovered MediaWikiLanguage is not designed for
>>> extensibility. We had the same problem before with TextileLanguage,
>>> which was refactored to better support extensibility as a result of
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=237120
>>>
>>> If you create an enhancement request at https://bugs.eclipse.org/bugs
>>> for MediaWikiLanguage supporting extensibility I'll refactor its
>>> initialization to make it possible to subclass.
>>>
>>> Best regards,
>>>
>>> David
>>>
Re: How should I extend a WikiText MarkupLanguage? [message #594450 is a reply to message #60491] Tue, 21 October 2008 15:55 Go to previous message
Eclipse UserFriend
Wayne,

> I'm trying to extend the MediaWikiLanguage to incorporate a few custom
> tags of my own.

I'm glad to hear that you're interested in extending WikiText. As you've
discovered MediaWikiLanguage is not designed for extensibility. We had
the same problem before with TextileLanguage, which was refactored to
better support extensibility as a result of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=237120

If you create an enhancement request at https://bugs.eclipse.org/bugs for
MediaWikiLanguage supporting extensibility I'll refactor its
initialization to make it possible to subclass.

Best regards,

David
Re: How should I extend a WikiText MarkupLanguage? [message #594470 is a reply to message #60516] Wed, 22 October 2008 09:23 Go to previous message
Eclipse UserFriend
Will do.

Thanks,

Wayne

David Green wrote:
> Wayne,
>
>> I'm trying to extend the MediaWikiLanguage to incorporate a few custom
>> tags of my own.
>
> I'm glad to hear that you're interested in extending WikiText. As
> you've discovered MediaWikiLanguage is not designed for extensibility.
> We had the same problem before with TextileLanguage, which was
> refactored to better support extensibility as a result of
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=237120
>
> If you create an enhancement request at https://bugs.eclipse.org/bugs
> for MediaWikiLanguage supporting extensibility I'll refactor its
> initialization to make it possible to subclass.
>
> Best regards,
>
> David
>
Re: How should I extend a WikiText MarkupLanguage? [message #594512 is a reply to message #60840] Mon, 27 October 2008 12:07 Go to previous message
Eclipse UserFriend
Wayne,

I was in there today and did the refactoring to make MediaWikiLanguage
extensible. See
org.eclipse.mylyn.wikitext.textile.core.BugzillaTextileLangu age for an
example of how to extend a language. Extending MediaWikiLanguage should
be very similar.

Regards,

David

Wayne Beaton wrote:
> Will do.
>
> Thanks,
>
> Wayne
>
> David Green wrote:
>> Wayne,
>>
>>> I'm trying to extend the MediaWikiLanguage to incorporate a few
>>> custom tags of my own.
>>
>> I'm glad to hear that you're interested in extending WikiText. As
>> you've discovered MediaWikiLanguage is not designed for
>> extensibility. We had the same problem before with TextileLanguage,
>> which was refactored to better support extensibility as a result of
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=237120
>>
>> If you create an enhancement request at https://bugs.eclipse.org/bugs
>> for MediaWikiLanguage supporting extensibility I'll refactor its
>> initialization to make it possible to subclass.
>>
>> Best regards,
>>
>> David
>>
Re: How should I extend a WikiText MarkupLanguage? [message #594599 is a reply to message #60867] Fri, 31 October 2008 13:29 Go to previous message
Eclipse UserFriend
That's done it.

Thanks,

Wayne

David Green wrote:
> Wayne,
>
> I was in there today and did the refactoring to make MediaWikiLanguage
> extensible. See
> org.eclipse.mylyn.wikitext.textile.core.BugzillaTextileLangu age for an
> example of how to extend a language. Extending MediaWikiLanguage should
> be very similar.
>
> Regards,
>
> David
>
> Wayne Beaton wrote:
>> Will do.
>>
>> Thanks,
>>
>> Wayne
>>
>> David Green wrote:
>>> Wayne,
>>>
>>>> I'm trying to extend the MediaWikiLanguage to incorporate a few
>>>> custom tags of my own.
>>>
>>> I'm glad to hear that you're interested in extending WikiText. As
>>> you've discovered MediaWikiLanguage is not designed for
>>> extensibility. We had the same problem before with TextileLanguage,
>>> which was refactored to better support extensibility as a result of
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=237120
>>>
>>> If you create an enhancement request at https://bugs.eclipse.org/bugs
>>> for MediaWikiLanguage supporting extensibility I'll refactor its
>>> initialization to make it possible to subclass.
>>>
>>> Best regards,
>>>
>>> David
>>>
Previous Topic:Mylyn 3.0.3 is now available
Next Topic:Is there a way to see the URL that the generic web connector uses
Goto Forum:
  


Current Time: Sun Jun 08 01:16:24 EDT 2025

Powered by FUDForum. Page generated in 0.22268 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top