This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 190209 - Expose GoToMarkOccurrencesAction
Summary: Expose GoToMarkOccurrencesAction
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: CSL (API & infrastructure) (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Erno Mononen
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2010-09-07 13:47 UTC by Erno Mononen
Modified: 2010-10-01 08:30 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch for moving GoToMarkOccurrencesAction to csl.api (17.89 KB, patch)
2010-09-07 13:47 UTC, Erno Mononen
Details | Diff
CslActions (15.29 KB, patch)
2010-09-23 08:49 UTC, Erno Mononen
Details | Diff
HtmlKit migrated to use CslActions (2.48 KB, patch)
2010-09-23 08:50 UTC, Erno Mononen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erno Mononen 2010-09-07 13:47:41 UTC
Created attachment 101916 [details]
patch for moving GoToMarkOccurrencesAction to csl.api

GoToMarkOccurrencesAction is needed by HtmlKit for providing the csl shortcuts for navigating to next/prev occurrences. Attached is a patch that moves the action to the csl.api package. 

I'm not sure if this area has currently an owner, so if nobody takes this over I will integrate the patch myself on Friday.
Comment 1 Quality Engineering 2010-09-11 03:38:57 UTC
Integrated into 'main-golden', will be available in build *201009110000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/412f4907336a
User: Erno Mononen <emononen@netbeans.org>
Log: #190209 - Expose GoToMarkOccurrencesAction
Comment 2 Erno Mononen 2010-09-13 07:12:31 UTC
Please note the API_REVIEW_FAST keyword was added postmortem; I can revert the change if needed.
Comment 3 Jaroslav Tulach 2010-09-13 09:49:09 UTC
Y01 Missing @since tag
Y02 Missing description of the change in apichanges.xml

but most importantly:
Y03 Why the class needs to be in API at all? I don't understand why somebody would need to call an action class directly.
Comment 4 Erno Mononen 2010-09-13 11:09:47 UTC
Y01, Y02 - will fix these.

Y03 - HtmlKit needs to provide the action (in #createActions); similarly to e.g. o.n.m.csl.api.SelectCodeElementAction.
Comment 5 Jaroslav Tulach 2010-09-14 05:53:25 UTC
Re. Y03: If HtmlKit needs to provide the action, then just expose the instance so they can use it. The preferred method since 6.10 is to use 

@ActionID(...)
@ActionRegistration(...)
class TheActionClass {
}

and share the parameters for @ActionID with whoever wants to use them. Those people then use @ActionReference to use the action. They also use Utilities.actions2Popup to instantiate the popup menu.

Should the above not be possible for some unsolvable reason, expose just a factory method, not the whole class in the API. E.g. just a single public static Action createXYZAction(); which will return the class.
Comment 6 Erno Mononen 2010-09-14 09:48:40 UTC
Re - Y03: I think there is some value in following the existing conventions in csl.api - every action there is exposed the same way as GoToMarkOccurrencesAction. IMO it would make more sense to either change them all or stick to the existing way, even if the existing way is not ideal. Having different conventions in a large code base is unavoidable, but it seems undesirable to me that a single package would expose equivalent actions in different ways.
Comment 7 Jaroslav Tulach 2010-09-15 16:24:57 UTC
The "consistency defence" is good one. On the other hand, being always consistent with something which is buggy would prevent us to learn from past mistakes.

Preferably you could deprecate all the existing action classes, create one CSLActions with many factory methods and just add new one for the actionGoToMarkOccurences(). But I understand this is more work than you probably want to donate.
Comment 8 Erno Mononen 2010-09-16 07:25:10 UTC
I think I can find the time for creating CslActions, just not until next week. I'll attach a new patch here then.
Comment 9 Erno Mononen 2010-09-23 08:49:42 UTC
Created attachment 102128 [details]
CslActions

Attached is a patch for introducing CslActions, please review.
Comment 10 Erno Mononen 2010-09-23 08:50:41 UTC
Created attachment 102129 [details]
HtmlKit migrated to use CslActions
Comment 11 Jaroslav Tulach 2010-09-29 16:30:59 UTC
Y11: Summary in apichanges.xml is probably wrong.
Y12: deprecation="yes" would be more appropriate

Otherwise fine, looks good.
Comment 12 Erno Mononen 2010-09-30 11:15:49 UTC
Thanks for the review, I'll fix Y11 and Y12 before pushing the change tomorrow.
Comment 13 Erno Mononen 2010-10-01 08:30:00 UTC
web-main f26091baaec7