mising toolbar icon
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: mising toolbar icon
Hi Scott,
We just don't provide an icon for this specific action (because we never intended it to be added to a toolbar).
But you can create (or copy from some place) your own icon for it and set it to the action before creating a toolbar button from it:
Or create your own Swing action with your own properties which delegates to our action when actionPerformed is called on it.
Regards,
Radu
We just don't provide an icon for this specific action (because we never intended it to be added to a toolbar).
But you can create (or copy from some place) your own icon for it and set it to the action before creating a toolbar button from it:
Code: Select all
((javax.swing.AbstractAction)action).putValue(Action.SMALL_ICON, yourCustomIcon);
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 88
- Joined: Wed Feb 11, 2015 11:25 pm
- Location: San Francisco, California USA
- Contact:
Re: mising toolbar icon
Can someone please point we less sophisticated users to the information needed to "create (or copy from some place) your own icon for it and set it to the action"?
Thanks,
Riley
SFO
Thanks,
Riley
SFO
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: mising toolbar icon
Hi Riley,
Let's say that in your Java project you create in your "src" folder an "images" subfolder containing all custom images like for example an image called "OpenCustom.png".
The JAR library which will be created from your Java sources will contain inside this "images" subfolder with the images.
In your Java code you can create an ImageIcon from your image:
Once you have the ImageIcon you can use it on an action like:
Regards,
Radu
Let's say that in your Java project you create in your "src" folder an "images" subfolder containing all custom images like for example an image called "OpenCustom.png".
The JAR library which will be created from your Java sources will contain inside this "images" subfolder with the images.
In your Java code you can create an ImageIcon from your image:
Code: Select all
private ImageIcon createOpenIcon() {
ImageIcon icon = null;
InputStream is = AuthorComponentSample.class
.getResourceAsStream("/images/OpenCustom.png");
try {
icon = new ImageIcon(ImageIO.read(is));
} catch (IOException e) {
}
return icon;
}
Code: Select all
AbstractAction openAction = new AbstractAction("Open",
createOpenIcon()) {
public void actionPerformed(ActionEvent e) {
// Open the file
openFile();
}
};
actionsToolbar.add(new ToolbarButton(openAction, false));
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
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