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 207639 - Make color management UI elements reusable
Summary: Make color management UI elements reusable
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Options (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2012-01-23 16:18 UTC by Theofanis Oikonomou
Modified: 2012-01-24 13:52 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
options.editor PATCH (3.12 KB, patch)
2012-01-23 16:18 UTC, Theofanis Oikonomou
Details | Diff
Old Terminal color management UI controls (2.93 KB, image/png)
2012-01-23 16:20 UTC, Theofanis Oikonomou
Details
New Terminal color management UI controls (7.14 KB, image/png)
2012-01-23 16:21 UTC, Theofanis Oikonomou
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Theofanis Oikonomou 2012-01-23 16:18:53 UTC
Created attachment 115162 [details]
options.editor PATCH

While working on bug 200878 I needed to reuse the color management UI elements (JComboBox) of the options.editor module from the terminal module. 

In particular I needed to use the ColorComboBox class which is public and part of the exposed to friends org.netbeans.modules.options.colors package. This is not possible because all the get/set methods as well as the constructor are private. The other alternative would be to copy the required classes to the desired package of the terminal module, which is actually done by some other modules.

I created a simple patch that makes all four methods of ColorComboBox public and adds the terminal module in the friend list of options.editor

The first image shows the current situation with some ugly UI control elements, while the second image shows the proposed UI. I believe that this makes the UI consistent and could be utilized by other modules that provide Color options.
Comment 1 Theofanis Oikonomou 2012-01-23 16:20:38 UTC
Created attachment 115163 [details]
Old Terminal color management UI controls
Comment 2 Theofanis Oikonomou 2012-01-23 16:21:29 UTC
Created attachment 115164 [details]
New Terminal color management UI controls
Comment 3 Jaroslav Tulach 2012-01-24 07:09:17 UTC
Y01 Terminal emulator does not have dependency on options.editor now. As terminal is editor independent, it does not make sense to make connection to editor APIs more tight. That would restrict re-use of the editor, while improving only options panel. Don't add dependency on more modules, use for example Y02 advice.

Y02 The patch does not include the intended usage of the API, but if it is about the control to select right color, then: You can resule UI controls while having loosely coupled dependency on the other module via PropertyPanel and custom property editors:
http://bits.netbeans.org/dev/javadoc/org-openide-explorer/org/openide/explorer/propertysheet/PropertyPanel.html
http://bits.netbeans.org/dev/javadoc/org-openide-explorer/org/openide/explorer/doc-files/propertyViewCustomization.html
Comment 4 Theofanis Oikonomou 2012-01-24 13:52:41 UTC
(In reply to comment #3)
> Y01 Terminal emulator does not have dependency on options.editor now. As
> terminal is editor independent, it does not make sense to make connection to
> editor APIs more tight. That would restrict re-use of the editor, while
> improving only options panel. Don't add dependency on more modules, use for
> example Y02 advice.
> 

Thanks for the comment, point taken. closing for now.