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 19362 - Improve ResourcesAction
Summary: Improve ResourcesAction
Status: RESOLVED WONTFIX
Alias: None
Product: utilities
Classification: Unclassified
Component: URL (show other bugs)
Version: 3.x
Hardware: All All
: P4 blocker (vote)
Assignee: issues@utilities
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-11 17:50 UTC by Jesse Glick
Modified: 2005-05-14 22:18 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2002-01-11 17:50:35 UTC
I find ResourcesAction as written clumsy to configure and I am sure it
could be improved a bit: right now it is hardcoded to link for URL
links in the Resources/ system folder, which means there can only be
one such button at a time. Better style: have some class implementing
Presenter.Toolbar (not a SystemAction which is a singleton!) named
e.g. DropDownButton; then in the layer e.g.:

<folder name="Toolbars">
  <folder name="Data">
    <file name="ffj-resources.instance">
      <attr name="instanceCreate"
            methodvalue="org.netbeans.modules.url.DropDownButton.create"/>
      <attr name="folder" stringvalue="DropDownButton-data/ffj-resources"/>
    </file>
  </folder>
</folder>
<folder name="DropDownButton-data">
  <folder name="ffj-resources">
    <file name="something.url">http://..../</file>
    <!-- etc. -->
  </folder>
</folder>

where

public class DropDownButton implements Presenter.Toolbar {
    public static DropDownButton create(FileObject fo) {
        String folder = (String)fo.getAttribute("folder");
        // find in SystemFileSystem, configure from there...
        Node n = DataObject.find(fo).getNodeDelegate();
        // use n.getDisplayName() & n.getIcon() for presenters
    }
}

Not really much more work to code, and much more flexible.
Comment 1 Marek Grummich 2002-07-22 11:54:21 UTC
Set target milestone to TBD
Comment 2 Marek Grummich 2002-07-22 11:56:32 UTC
Set target milestone to TBD
Comment 3 Marian Petras 2005-05-13 16:24:30 UTC
The ResourcesAction has been removed in NB 4.1 - this enhancement is no more
applicable.

Marked as WONTFIX.