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.
the current palette api mandates that an editor must insert a PaletteController instance into its Lookup if it wants to associate the palette with it. i want to extend the palette module API to include an option to associate palette content with document's mime type: palette providers will register their PaletteController instance in XML layer under "Editors/<mime type>" and when an editor window with this mime type is activated the palette module will show the appropriate palette content.
Created attachment 38982 [details] proposed implementation
if there are no objections, i'll integrate this tomorrow
There is a code that searches thru activated nodes of TopComponent and then gets DataObject and then FileObject, I'd like to change it to: for (FileObject fo : tc.getLookup().lookupAll(FileObject.class)) { // do what you want } imho, it should do the same and it is the preferred way to get FileObject from a TopComponent. Of course, change it only if it works for you.
merged to trunk: (tc.getLookup().lookupAll(FileObject.class) doesn't work for my unit tests) Checking in test/unit/src/org/netbeans/spi/palette/mf-layer.xml; /cvs/core/palette/test/unit/src/org/netbeans/spi/palette/mf-layer.xml,v <-- mf-layer.xml initial revision: 1.1 done Checking in test/unit/src/org/netbeans/spi/palette/AbstractPaletteTestHid.java; /cvs/core/palette/test/unit/src/org/netbeans/spi/palette/AbstractPaletteTestHid.java,v <-- AbstractPaletteTestHid.java new revision: 1.5; previous revision: 1.4 done RCS file: /cvs/core/palette/test/unit/src/org/netbeans/spi/palette/IDEInitializer.java,v done Checking in test/unit/src/org/netbeans/spi/palette/IDEInitializer.java; /cvs/core/palette/test/unit/src/org/netbeans/spi/palette/IDEInitializer.java,v <-- IDEInitializer.java initial revision: 1.1 done RCS file: /cvs/core/palette/test/unit/src/org/netbeans/spi/palette/MyLayerPaletteFactory.java,v done Checking in test/unit/src/org/netbeans/spi/palette/MyLayerPaletteFactory.java; /cvs/core/palette/test/unit/src/org/netbeans/spi/palette/MyLayerPaletteFactory.java,v <-- MyLayerPaletteFactory.java initial revision: 1.1 done RCS file: /cvs/core/palette/test/unit/src/org/netbeans/spi/palette/PaletteSwitchTest.java,v done Checking in test/unit/src/org/netbeans/spi/palette/PaletteSwitchTest.java; /cvs/core/palette/test/unit/src/org/netbeans/spi/palette/PaletteSwitchTest.java,v <-- PaletteSwitchTest.java initial revision: 1.1 done Checking in src/org/netbeans/spi/palette/PaletteSwitch.java; /cvs/core/palette/src/org/netbeans/spi/palette/PaletteSwitch.java,v <-- PaletteSwitch.java new revision: 1.2; previous revision: 1.1 done RCS file: /cvs/core/palette/src/org/netbeans/spi/palette/PaletteModule.java,v done Checking in src/org/netbeans/spi/palette/PaletteModule.java; /cvs/core/palette/src/org/netbeans/spi/palette/PaletteModule.java,v <-- PaletteModule.java initial revision: 1.1 done Checking in manifest.mf; /cvs/core/palette/manifest.mf,v <-- manifest.mf new revision: 1.12; previous revision: 1.11 done Checking in nbproject/project.xml; /cvs/core/palette/nbproject/project.xml,v <-- project.xml new revision: 1.9; previous revision: 1.8 done Checking in api/doc/changes/apichanges.xml; /cvs/core/palette/api/doc/changes/apichanges.xml,v <-- apichanges.xml new revision: 1.16; previous revision: 1.15 done