RSyntaxTextArea Themes

Questions on using RSyntaxTextArea should go here.

Moderator: robert

RSyntaxTextArea Themes

Postby codefreak » Sat Aug 04, 2012 2:12 pm

Hello members and admins,
i am an german developer who need some help.
Ok my problem is that i try to use the theme swichter in the RSyntaxTextArea and it doesn't work.

I loading the themes with this method:

java code:

InputStream in = getClass().getResourceAsStream("/dark.xml");
System.out.println(in);
try {
Theme theme = Theme.load(in);
theme.apply(ta);
} catch (IOException ioe) {
ioe.printStackTrace();
}


But it doesn't work :/

My eclipse log:
Code: Select all
org.xml.sax.SAXParseException: Element type "secondaryLanguages" must be declared.
   at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
   at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
   at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
   at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
   at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1929)
   at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:764)
   at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1363)
   at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2756)
   at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
   at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
   at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
   at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
   at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
   at org.fife.ui.rsyntaxtextarea.Theme$XmlHandler.load(Theme.java:427)
   at org.fife.ui.rsyntaxtextarea.Theme.load(Theme.java:205)
   at editor.gui$17.actionPerformed(gui.java:589)
   at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
   at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
   at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
   at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
   at javax.swing.AbstractButton.doClick(AbstractButton.java:389)
   at com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:95)
   at java.awt.MenuItem.processActionEvent(MenuItem.java:627)
   at java.awt.MenuItem.processEvent(MenuItem.java:586)
   at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:337)
   at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:325)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:687)
   at java.awt.EventQueue.access$000(EventQueue.java:85)
   at java.awt.EventQueue$1.run(EventQueue.java:643)
   at java.awt.EventQueue$1.run(EventQueue.java:641)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
   at java.awt.EventQueue$2.run(EventQueue.java:657)
   at java.awt.EventQueue$2.run(EventQueue.java:655)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:654)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
java.io.IOException: org.xml.sax.SAXParseException: Element type "secondaryLanguages" must be declared.
   at org.fife.ui.rsyntaxtextarea.Theme$XmlHandler.load(Theme.java:430)
   at org.fife.ui.rsyntaxtextarea.Theme.load(Theme.java:205)
   at editor.gui$17.actionPerformed(gui.java:589)
   at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
   at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
   at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
   at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
   at javax.swing.AbstractButton.doClick(AbstractButton.java:389)
   at com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:95)
   at java.awt.MenuItem.processActionEvent(MenuItem.java:627)
   at java.awt.MenuItem.processEvent(MenuItem.java:586)
   at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:337)
   at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:325)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:687)
   at java.awt.EventQueue.access$000(EventQueue.java:85)
   at java.awt.EventQueue$1.run(EventQueue.java:643)
   at java.awt.EventQueue$1.run(EventQueue.java:641)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
   at java.awt.EventQueue$2.run(EventQueue.java:657)
   at java.awt.EventQueue$2.run(EventQueue.java:655)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:654)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
codefreak
 

Re: RSyntaxTextArea Themes

Postby robert » Mon Aug 06, 2012 3:07 am

Are you using RSTA via the pre-built jars, or are you building the source yourself?

The "secondaryLanguages" element was added recently (not yet in a built-release) so you have to be using the source from SVN to be using themes with the secondaryLanguages definition.

If you're building your own jars, it's also important to make sure that theme.dtd is located in the root of your jar (or source folder if just running from Eclipse).
User avatar
robert
 
Posts: 774
Joined: Sat May 10, 2008 5:16 pm

Re: RSyntaxTextArea Themes

Postby Guest » Tue Aug 07, 2012 11:52 am

I try you solution with pack "theme.dtd" in the root of the jar.
Guest
 

Re: RSyntaxTextArea Themes

Postby codefreak » Tue Aug 07, 2012 12:07 pm

Yeah it's working you help me :)
BTW: I create a theme if it is good you can have a version.
codefreak
 


Return to Help

Who is online

Users browsing this forum: No registered users and 16 guests

cron