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.
Summary: | Singleline editors support (was: Export code completion support) | ||
---|---|---|---|
Product: | editor | Reporter: | Egor Ushakov <gorrus> |
Component: | -- Other -- | Assignee: | issues@editor <issues> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dbalek, mentlicher, vv159170 |
Priority: | P2 | Keywords: | API |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 180100 | ||
Attachments: |
Introducing org.netbeans.spi.debugger.ui.Utilities class with desired methods.
Notes from inception review Patch supporting line/column based dialog bindings Patch adding single line editors factory |
Description
Egor Ushakov
2010-03-04 08:37:52 UTC
I agree that this is useful to have accessible through an API. Created attachment 94867 [details]
Introducing org.netbeans.spi.debugger.ui.Utilities class with desired methods.
Please review this simple API addition. Java debugger will use these methods as well. looks fine, exactly what we need, thanks! Y01 Private constructor for the Utilities class. Make it final. Y02 Why the setContext method is in debugger and not in more general place, For example editor module? Y01 O.K. Y02 Utilities.createScrollableLineEditor() is not debugger-specific either. Perhaps we could put API for creation of single-line editor (like this) and growable editor (like one in form module) somewhere under org.openide.awt ? So that it's accessible for everyone... Then the proposed Utilities.setContext() could go to DialogBinding for instance, like DialogBinding.bindComponentToFileLine(). It's a question what to do with Utilities.setupUI(), perhaps it should be somewhere in org.netbeans.editor.Utilities... Comments? Created attachment 95188 [details]
Notes from inception review
Inception review resulted in consensus about the need and place of various methods (see the attached text file). Most of the code will go to editor. Martin Entlicher promised to do the work. Víťa will provide commiter's guidance to Martin.
Moving to editor to implement TCRs: 1) A property on JTextComponent to disable visual limit indication. I suggest to introduce "TextLimitLineVisible" property, that would do: EditorUI eui = org.netbeans.editor.Utilities.getEditorUI(textComponent); eui.textLimitLineVisible = Boolean.TRUE.equals(textComponent.getClientProperty("TextLimitLineVisible")); 2) dialogBinding shall be able to work with line not only offset (and FileObject) Can be solved by: DialogBinding.bindComponentToFileLine(final FileObject fileObject, int line, int length, final JTextComponent component) or DialogBinding.bindComponentToFile(final FileObject fileObject, int line, int column, int length, final JTextComponent component) 3) We'll add putClientProperty support for 6.9 4) JComponent createOneLineEditor(JEditorPane) in editor API The implementation code could be taken from Utilities.createScrollableLineEditor(JEditorPane editoPane) attached here. Please adjust the component if necessary, not sure if this is the correct one. Created attachment 95951 [details]
Patch supporting line/column based dialog bindings
This is the API that allows dialog-bindings to be expressed in the form of a line/column pair rather than just a plain offset. In the list of requests this is described as #2.
Integrated into 'main-golden', will be available in build *201003290201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/f72324fbb0a5 User: Vita Stejskal <vstejskal@netbeans.org> Log: improving dialog binding mechanism to support line/column in addition to just an offset (related to #181523) Created attachment 96201 [details]
Patch adding single line editors factory
This patch add a new factory method for creating single line TextField-like controls and modifies debugger's WatchPanel to use this new factory method in combination with the new DialogBinding method (previsou patch).
Please review the API changes in the following two patches: http://netbeans.org/bugzilla/attachment.cgi?id=95951 http://netbeans.org/bugzilla/attachment.cgi?id=96201 Thanks Changes to DialogBinding seem to be OK. Minor typo in apichanges.xml: the first added method is named 'bindComponentToFile'. Thanks for the review. http://hg.netbeans.org/jet-main/rev/c24d2a221a50 http://hg.netbeans.org/jet-main/rev/ee13c2938de8 Integrated into 'main-golden', will be available in build *201004020200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/c24d2a221a50 User: Vita Stejskal <vstejskal@netbeans.org> Log: #181523: extending DialogBinding to support binding to a position specified as a line/column pair |