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 167803 - [67cat] Custom ant task toolbar shortcut was not imported
Summary: [67cat] Custom ant task toolbar shortcut was not imported
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-29 13:46 UTC by vanob
Modified: 2009-11-05 09:32 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vanob 2009-06-29 13:46:36 UTC
[ BUILD # : 200906142201 ]
[ JDK VERSION : 1.6.* ]

Hello

I had 6.5.1 and I've created a toolbar shortcut for one of my ant
tasks.
shortcut was added to the standard toolbar debug.

After I've imported the settings 6.7 did not show that shortcut on
the toolbar. I did it manually and it added the shortcut but there
appeared another one (exactly the same) (possibly from the 6.5.1
config).
Comment 1 Stanislav Aubrecht 2009-10-30 12:48:43 UTC
the problem is that the custom ant task in the toolbar points to <userdir>/config/Actions folder which isn't in import list.
so the import routine has to either ignore .shadow files when importing toolbar settings or import config/Actions folder
as well.
cc'ing jskrivanek to provide additional evaluation
Comment 2 Jiri Skrivanek 2009-11-03 12:03:32 UTC
Ant module owners should decide. I recommend to add config/Actions/Build folder to toolbars import.
Comment 3 Jesse Glick 2009-11-03 15:19:39 UTC
Can easily export config/Actions/Build/.*[.]xml, but that is not enough; would also need to export
config/(Menu|Toolbars|Shortcuts)/.*[.]shadow, i.e. the GUI presentations of those shortcuts. And doing that could
accidentally export other things unrelated to Ant shortcuts, especially keybindings, but perhaps also stuff in menus and
toolbars that I don't know about. Since there is no facility for programmatic hooks in the export list, I cannot filter
the entries to check that they are actually Ant shortcuts.
Comment 4 Stanislav Aubrecht 2009-11-03 15:22:04 UTC
wouldn't it better to filter out all .shadow files when importing toolbars? at least as a temporary solution
Comment 5 Jesse Glick 2009-11-03 19:12:20 UTC
core-main #d771899750fd

Beware that this only works if both the exporting _and_ importing IDEs contain this fix, i.e. will not be useful for
people importing 6.7 settings.
Comment 6 Jiri Skrivanek 2009-11-04 08:35:40 UTC
I don't like this solution. As you wrote it can accidentally import menu items unrelated to ant shortcuts. And we don't
have UI to correct possible misconfigurations in main menu layout. Better would be just adding
config/Actions/Build/.*[.]xml to Toolbars item in layer in core.windows. It satisfies ant shortcuts in toolbar are
exported if user selects Toolbars for export. Ant shortcuts in menu will never be exported and ant shortcuts in
config/Shortcuts will be exported with other keymaps.
Comment 7 Jesse Glick 2009-11-04 16:15:21 UTC
Exporting Ant shortcuts added to toolbars, but not to menus, seems like a clear bug to me. Also, adding
config/Actions/Build/.*[.]xml under "toolbars" means that Ant keyboard shortcuts will be exported only if "toolbars" are
exported, which is clearly wrong.

AFAIK the Ant module is the only code in the NB standard distribution which modifies Menu/ in the SFS. There could be
third-party modules which do so as well.

Again, could solve perfectly if there were some facility to programmatically produce (or filter) items for export. I
have never really understood the purpose of the export format being static.
Comment 8 Jiri Skrivanek 2009-11-04 16:23:42 UTC
OK, if you think, let it as it is now.

> Again, could solve perfectly if there were some facility to programmatically produce (or filter) items for export. I
have never really understood the purpose of the export format being static.

It is because we need to have just static list while doing initial import after new installation. o.n.upgrader does the
import when modules are not loaded and any filter would not be available.
Comment 9 Jesse Glick 2009-11-04 16:34:25 UTC
I don't really like the current solution either, but the proposed alternative seems worse to me. Not sure.

Regarding import - a mixture of static and dynamic would allow import to work only off static lists, while export could
be more dynamic. For example, keep current format but add an optional dynamic export filter which could eliminate some
items at runtime. There would still be a theoretical possibility of two entries from different modules overlapping in
the static list, the export filters resolving the ambiguity, and the user upon import checking only one of the entries
but having settings imported from the other entry...but I think this is unlikely to be a practical problem.
Comment 10 Quality Engineering 2009-11-04 22:28:45 UTC
Integrated into 'main-golden', will be available in build *200911041401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/d771899750fd
User: Jesse Glick <jglick@netbeans.org>
Log: #167803: option to export Ant shortcuts.
Comment 11 Jiri Skrivanek 2009-11-05 09:32:38 UTC
Yes, this could work for ad-hoc export to zip file and then import from this zip file. But still doesn't solve import
from existing userdir after new installation. It this case only the static list is always available. The only option is
to package runtime export/import filters to a separate jar. Similarly like the static etc/netbeans.import list is
generated during the build of whole IDE. Then this jar could be available for o.n.upgrader. I considered this option
when I was designing export/import feature. But I abandoned it because I didn't have use case for it. Static list was
enough for all known cases. Here are my early thoughts
http://wiki.netbeans.org/ExportImportOptions?version=4#section-ExportImportOptions-ImplementationDetails.