Costumizing Toolbar with ToolbarButton
Oxygen general issues.
-
- Posts: 19
- Joined: Mon Aug 15, 2011 10:57 am
Costumizing Toolbar with ToolbarButton
Hi.
I am trying to costumize my costum plugin toolbar and it works just fine with the common swing components, like JButton. But I have a problem using ToolbarButton - objects, so that the toolbar fit in the oxygen style.
The ToolbarInfo object provided by the customizeToolbar() function needs a JComponent[] list for it's setComponents() function. But the JComponent[] array won't accept objects of the type ToolbarButton. What am I missing?
Thanks and with kind regards,
Thomas.
I am trying to costumize my costum plugin toolbar and it works just fine with the common swing components, like JButton. But I have a problem using ToolbarButton - objects, so that the toolbar fit in the oxygen style.
The ToolbarInfo object provided by the customizeToolbar() function needs a JComponent[] list for it's setComponents() function. But the JComponent[] array won't accept objects of the type ToolbarButton. What am I missing?
Thanks and with kind regards,
Thomas.
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Costumizing Toolbar with ToolbarButton
Post by alex_jitianu »
Hello Thomas,
The ro.sync.exml.workspace.api.standalone.ui.ToolbarButton is actually an extension of JButton and indirectly a JComponent. So you should be able to add it inside that array of JComponent. We actually use it in one of our sample plugins (oxygen-sample-plugin-workspace-access):
Best regards,
Alex
The ro.sync.exml.workspace.api.standalone.ui.ToolbarButton is actually an extension of JButton and indirectly a JComponent. So you should be able to add it inside that array of JComponent. We actually use it in one of our sample plugins (oxygen-sample-plugin-workspace-access):
Code: Select all
if("SampleWorkspaceAccessToolbarID".equals(toolbarInfo.getToolbarID())) {
List<JComponent> comps = new ArrayList<JComponent>();
ToolbarButton checkInButton = new ToolbarButton(checkInAction, true);
checkInButton.setText("Check In");
comps.add(checkInButton);
toolbarInfo.setComponents(comps.toArray(new JComponent[0]));
}
Best regards,
Alex
-
- Posts: 19
- Joined: Mon Aug 15, 2011 10:57 am
Re: Costumizing Toolbar with ToolbarButton
Thank you for your quick reply.
Yes, that's what the API description tells and what I expected.
Nevertheless my eclipse SDK tells me that it's not possible to convert ToolbarButton to JComponent (Type mismatch). I also already tested the example code you mentioned with the same error.
Maybe it's just a eclipse issue, but when I let eclipse show me the type hierarchy of ToolbarButton it has only one ancestor, the "e" class, while Eclipse shows the expected Object-Component-Container-JComponent-AbstractButton-JButton-xf-ColorButton hierarchy for ColorButton and the other ro.sync.exml.workspace.api.standalone.ui.* classes. Only the ToolbarButtons seems to have this weird "e"-ToolbarButton hierarchy.
I am referencing the oxygen 16.1 x64 oxygen.jar library (but also tested the 15.2 x64 library), do not use the oxygen eclipse plugin and running eclipse in version SDK 4.2.2.
Kind regards,
Thomas.
Yes, that's what the API description tells and what I expected.
Nevertheless my eclipse SDK tells me that it's not possible to convert ToolbarButton to JComponent (Type mismatch). I also already tested the example code you mentioned with the same error.
Maybe it's just a eclipse issue, but when I let eclipse show me the type hierarchy of ToolbarButton it has only one ancestor, the "e" class, while Eclipse shows the expected Object-Component-Container-JComponent-AbstractButton-JButton-xf-ColorButton hierarchy for ColorButton and the other ro.sync.exml.workspace.api.standalone.ui.* classes. Only the ToolbarButtons seems to have this weird "e"-ToolbarButton hierarchy.
I am referencing the oxygen 16.1 x64 oxygen.jar library (but also tested the 15.2 x64 library), do not use the oxygen eclipse plugin and running eclipse in version SDK 4.2.2.
Kind regards,
Thomas.
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Costumizing Toolbar with ToolbarButton
Post by alex_jitianu »
Hello Thomas,
I think you are having a problem with ToolbarButton because it requires an additional jar file (jide-oss-3.5.6.jar). You can get all the required jar files from oxygen-sdk-16.1.2-all.zip. Alternatively, if you could have used the Maven based sample project as a starting point and all the required jar files would have been automatically downloaded.
Best regards,
Alex
I think you are having a problem with ToolbarButton because it requires an additional jar file (jide-oss-3.5.6.jar). You can get all the required jar files from oxygen-sdk-16.1.2-all.zip. Alternatively, if you could have used the Maven based sample project as a starting point and all the required jar files would have been automatically downloaded.
Best regards,
Alex
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service